Closed ElderJoy closed 8 months ago
The accuracy of the free-fall calculation will depend on the integration scheme. Rapier, like most physics engines, uses simplectic Euler which is a first-order integration scheme, so it won’t capture exactly the effect of gravity on position (which is quadratically dependent on the timestep). I suspect the omnicalculator is relying on a more accurate (or analytic) scheme.
I'm learning rapier engine and run first example from rust guide: https://rapier.rs/docs/user_guides/rust/getting_started, but without ground and with 0 start height to check how it is calculates free fall height. Results are different than I expected. Next log illustrates each step of calculation of 1/60 second each:
According to free-fall calculator (https://www.omnicalculator.com/physics/free-fall) for 9.81 gravity they should be as next:
There is difference with expected calculations:
For some reason rapier adding (with "-" sign) 0.0013625 m. for each step. It is exactly the distance, that body should fall for the first 1/60 sec. Why is that? Am I doing something wrong? Code, that I'm using: