Git Product home page Git Product logo

Comments (4)

TravisBarryDick avatar TravisBarryDick commented on July 19, 2024 1

I also just noticed that updating the shape as follows has the intended behavior:

func _ready():
    var new_shape = CircleShape2D.new()
    new_shape.radius = 100
    $CollisionShape2D.set_shape(new_shape)

from godot-rapier-2d.

Ughuuu avatar Ughuuu commented on July 19, 2024

Interesting. Will investigate, thanks for the bug report.

from godot-rapier-2d.

Ughuuu avatar Ughuuu commented on July 19, 2024

It seems when a shape is changed, the shape is destroyed and recreated(probably this can be optimized, this seems to be just code ported from godot physics). But the collider is only destroyed, and the shape itself with all properties isn't destroyed. That's why this happens.
I'm trying to also destroy the shape when it needs updating, see if there are any lose ends. If not i'll try to update the shape instead of deleting it.

from godot-rapier-2d.

Ughuuu avatar Ughuuu commented on July 19, 2024

Ran the tests, there isn't any issue after the change. Seems to fix this. Only issue I could think of with this approach is if there are any dangling references of the shape handle, but the only place the shape handle reference is kept is on the shape itself, so there wouldn't be any problem.
Will take a note of this bugfix for the rust rewrite also and make sure to re-implement it there as well.

from godot-rapier-2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.