Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bullet] None of the shapes in PhysicsServer (Bullet) are initializing their members #25304

Open
Tracked by #45022
Zylann opened this issue Jan 25, 2019 · 0 comments
Open
Tracked by #45022
Assignees
Milestone

Comments

@Zylann
Copy link
Contributor

Zylann commented Jan 25, 2019

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 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).

@akien-mga akien-mga added this to the 3.2 milestone Jan 25, 2019
@akien-mga akien-mga modified the milestones: 3.2, 4.0 Dec 13, 2019
@pouleyKetchoupp 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
@fabriceci fabriceci modified the milestones: 4.0, 3.x Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants