rhusics icon indicating copy to clipboard operation
rhusics copied to clipboard

next_frame_integration consumes force value even when dt = 0

Open trsoluti opened this issue 4 years ago • 0 comments

next_frame_integration, when creating the new velocity value, takes the forces (ForceAccumulator and gravity) and then multiplies them by the delta-time to get the resulting velocity.

Gravity is constant, so it is unaffected if the delta-time is 0.

However, next_frame_integration consumes the value in ForceAccumulator, so there's no force left once time starts up.

Instead, the system should treat delta-time==0 as a full stop, with no effect on any value.

This allows you to start an object moving from the beginning of the game, by applying force when setting up the object.

It also allows you to properly pause the physics by setting dt to 0.

trsoluti avatar Sep 01 '20 09:09 trsoluti