You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behaviour: When RigidBody2D's bounce is set to 1, it keeps gaining more speed every time it bounces off a StaticBody2D, when angular and linear damp are set to 0.
Expected behaviour: RigidBody2D should conserve momentum and bounce back with same speed.
Steps to reproduce
Run the main scene in below minimal reproduction to observe that RigidBody2D keeps gaining more speed with each bounce.
Calinou
changed the title
RigidBody2D gains momentum with each collision when bounce = 1
RigidBody gains momentum with each collision when bounce = 1 (both 2D and 3D, Bullet and GodotPhysics)
Sep 11, 2021
Biased velocity which is used to separate bodies in order to resolve interpenetration could contribute to gain in momentum. I'm currently developing my own physics engine and get the same results when restitution (bounce) is set to 1.0.
Increasing Engine.iterations_per_second to values like 300 helps to minimize this gain in momentum, and decreasing it to 30 makes it even more dramatic. So I guess this is also an error accumulated from integrating velocity/acceleration over large or small delta time (the smaller, the less error).
I'm really not sure if there's an efficient way to resolve this, but according to other engines/implementations, it seems to be a common limitation. Perhaps a better integration scheme could be incorporated, but that would be at the cost of performance.
CCD could also help this perhaps, but it's not working: #9071.
Body keeps gaining momentum with each bounce when linear and angular damp is set to 0. If you set both damps to 0.1 (which is default) then,
GodotPhysics: RigidBody bounces back to the same height
Perhaps this is one of the reasons why damp is set to 0.1 by default, to cover up those issues.
Godot version
3.3.3.stable
System information
Windows 10
Issue description
Current behaviour: When
RigidBody2D
's bounce is set to 1, it keeps gaining more speed every time it bounces off aStaticBody2D
, when angular and linear damp are set to 0.Expected behaviour:
RigidBody2D
should conserve momentum and bounce back with same speed.Steps to reproduce
Run the main scene in below minimal reproduction to observe that
RigidBody2D
keeps gaining more speed with each bounce.Minimal reproduction project
RigidBody2DTest.zip
The text was updated successfully, but these errors were encountered: