godot icon indicating copy to clipboard operation
godot copied to clipboard

Rigidbody3D jittering instead of settling on the ground, under certain conditions

Open yannprada opened this issue 3 years ago • 1 comments

Godot version

Godot_v4.0-beta1_win64

System information

windows 10, Vulkan API 1.2.0 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1050 Ti

Issue description

https://user-images.githubusercontent.com/6585372/191086126-a8dc46dd-d0c0-4e51-9c94-99e38b3d2aa6.mp4

A camera follows a rigidbody3D with a cube as collider. The collider scale is (5,5,5) On ready, launch the cube, using cube.apply_central_impulse(Vector3(1, 0, -1) * 10)

The cube then gets launched towards the floor (staticbody with a cube as collider). As soon as it reachs the floor, the cube then proceeds to jitter without stopping.

It doesn't happen if:

  • the initial impulse if smaller (lower the scalar to 8 or less)
  • the scale of the rigidbody's collider is lowered
  • the inertia property is altered to something other than Vertor3.ZERO

Steps to reproduce

  • 3d scene
    • camera (make this follow and look at cube, for your sake)
    • rigidbody3d (cube.apply_central_impulse(Vector3(1, 0, -1) * 10))
      • collider (scale to 5,5,5)
        • cube
    • staticbody3d (floor)
      • collider
        • cube

Minimal reproduction project

test.zip

yannprada avatar Sep 19 '22 18:09 yannprada

Interesting note about the inertia. For starters we could look at what goes differently in servers/physics_3d/godot_body_3d.cpp when that property is set.

rburing avatar Sep 19 '22 21:09 rburing

didn't look at the code, but found a comment in it mentioning collider scale and inertia: link

yannprada avatar Sep 19 '22 22:09 yannprada