-
Notifications
You must be signed in to change notification settings - Fork 44
Crash in 3d when the collision shape has no depth #255
Comments
I don't reproduce it yet. Can you please provide more information? The exact commit at which you tried. What is your OS, rust version, and rendering backend? Can you share the full call stack? Don't hesitate to provide any additional information you can think of. |
I made the ball collide with the ground and it crashes |
I see here that you are using the 3d version. But that example is a 2d example that creates collision shapes without any depth:
And rapier (not heron) crashes when the collision shape has a volume To solve your problem you can either:
|
I leave this issue open for discussion about how we could improve the situation. On top of my head I think we could:
|
That also happens in 3D where there should be a volume already. For the record, this crashes too:
|
This is only the ball, you also need to give a depth to the ground. |
you are right. Changing flag to |
In my example I spawn a dynamic body like so:
and all the rest is static, like so:
|
Collision is logged but ball disappears from screen (without actually colliding). |
Due to the fast angular velocity, the body gets moved along the z-axis. I am not sure of the exact reason, but that is probably due to f32 imprecision in rapier's matrix multiplications. Nevertheless, it does not crash. And if you remove the angular velocity or increase the depth of the ground it interacts correctly. Though it will always look strange, because these are 2d sprites allowed to move and rotate along the z-axis And anyway, the |
you are right. The demo is meant to be a 2d. |
Can you please provide more information? At least a full reproducer, and the full stack trace you get? |
Absolutely. If you just Let me know if there's something missing as this is a repo to reproduce the error only |
We should have a note encouraging to check Rapiers common mistakes article, or a friendlier way to hint to what's wrong. this had the answer to start with. A 3d object with 0 in one dimension has 0 mass/volume. |
Running this demo (no changes made) https://github.com/jcornaz/heron/blob/main/examples/demo.rs
I get this
The text was updated successfully, but these errors were encountered: