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
348 stars 17 forks source link

Game engine hangs in scene with StaticBody2D with a WorldBoundaryShape2D #88

Closed TravisBarryDick closed 5 months ago

TravisBarryDick commented 5 months ago

Describe the bug When using the Rapier2D in a scene containing a StaticBody2D with a CollisionShape2D whose shape property is set to a WorldBoundaryShape2D, the game hangs upon loading the scene.

To Reproduce

  1. Create a new Godot project.
  2. Install Rapier2D from the AssetLib and make it the physics engine for the project.
  3. Add a StaticBody2D with a CollisionShape2D child whose shape is set to WorldBoundaryShape2D
  4. Launch the scene.

Expected behavior The game shouldn't hang / freeze.

Environment (please complete the following information):

Example project(zip) WorldBoundary2DHang.zip

Correlander commented 5 months ago

Can confirm same issue on Windows 10, Godot 4.2.2.stable, using the same engine (Rapier2D with SIMD). Game just hangs on boot splash. No errors at all.

Ughuuu commented 5 months ago

Thanks for the report, will investigate.

Ughuuu commented 5 months ago

Oh my, it's because of the fluid pipeline. It seems that the world boundary being so big, it generates some weird shape or something when coupling with fluids. I'll either temporarily disable world boundaries for fluids, or try to see why it happens.

Ughuuu commented 5 months ago

I'll open an issue on salva repo for now and disabling world space for fluids.

Ughuuu commented 5 months ago

Hm, looking at this, it might occur for bigger shapes too. Right now I register all shapes with fluid pipeline for all shapes using dynamic contact sampling. There should be a way for us to specify what objects should integrate with fluid pipeline and which not, but I also like the simplicity of now where it all just works. Hm.

TravisBarryDick commented 5 months ago

Thank you for the quick fix! I was wondering if it had to do with the volume of the body, cool to confirm. Out of curiosity, is there an easy way to install the main branch version into my godot project?

Ughuuu commented 5 months ago

Copy paste the addons folder into your project. Thats the only way, afaik.

Ughuuu commented 5 months ago

Eg. here is also described: https://github.com/appsinacup/godot-rapier-2d?tab=readme-ov-file#installation