appsinacup / godot-rapier-physics

Godot Rapier Physics – A 2D and 3D drop-in replacement for the Godot engine that adds stability and fluids.
https://godot.rapier.rs
MIT License
313 stars 16 forks source link

One Way Collision shapes cause instability when multiple objects are stacked. #162

Closed DragonEngineer closed 1 week ago

DragonEngineer commented 1 month ago

Describe the bug

If you have 2 or rigidbodies (godot icons thing) stacking on top of another, the bottom most rigidbody will clip into the staticbody (magenta thing) image

To Reproduce

Steps to reproduce the behavior:

  1. Put many "Box" object on top of the "Belt" object
  2. Run the game

Expected behavior The bottom most rigidbody should rest right on top of the magenta block, not partially sunk into the magenta block

Environment:

Files Factory Boxes.zip

Ughuuu commented 1 month ago

Seems that if you disable one_way_collision on the shape, everything works. Possibly the problem is in the modify_contacts of the one_way_collision logic.

Ughuuu commented 2 weeks ago

One way collision will get fixed soon by open PR, next thing to look into at this issue is move_and_slide call getting call, that might cause some instability too.

Ughuuu commented 1 week ago

Fixed in 0.8.1. It was indeed caused by one way direction that has been reworked to be more stable.

https://github.com/user-attachments/assets/b45617c5-776c-4c1c-8927-230378b6e295

I do acknowledge that it does pass a bit into the object. Probably that can be another issue.