You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following #25301, I decided to create an issue for this too.
I've been noticing it for a while, but never actually had a problem with it until now:
In shape_bullet.cpp, none of the shapes initialize their members. That means if you create a shape with a script using PhysicsServer directly, and add it to a body without calling set_data, the implementation is potentially creating a Bullet shape with garbage values.
In particular, the HeightmapShape ends up with absurd sizes and a null pointer, which should have made Bullet assert but didnt because of #25301.
Is this API really requiring the user to call set_data before adding the shape because it has no defaults? I would assume no because Godot physics does initialize them.
Should we give defaults to all shapes at server level? (for heightmaps, a 1x1 square since Bullet forbids 0 and due to the server's implementation, the shape is forced to create a Bullet collider).
The text was updated successfully, but these errors were encountered:
pouleyKetchoupp
changed the title
None of the shapes in PhysicsServer (Bullet) are initializing their members
[Bullet] None of the shapes in PhysicsServer (Bullet) are initializing their members
Jan 16, 2021
Godot 3.1 ab843b1
Following #25301, I decided to create an issue for this too.
I've been noticing it for a while, but never actually had a problem with it until now:
In
shape_bullet.cpp
, none of the shapes initialize their members. That means if you create a shape with a script usingPhysicsServer
directly, and add it to a body without callingset_data
, the implementation is potentially creating a Bullet shape with garbage values.In particular, the HeightmapShape ends up with absurd sizes and a null pointer, which should have made Bullet assert but didnt because of #25301.
Is this API really requiring the user to call
set_data
before adding the shape because it has no defaults? I would assume no because Godot physics does initialize them.Should we give defaults to all shapes at server level? (for heightmaps, a 1x1 square since Bullet forbids 0 and due to the server's implementation, the shape is forced to create a Bullet collider).
The text was updated successfully, but these errors were encountered: