4 ms·
The ball motion formula is less than ideal. Can be much more precise, for very small extra performance cost: https://en.wikipedia.org/wiki/Leapfrog_integration#
by Const-me 7y ago
The ball motion formula is less than ideal. Can be much more precise, for very small extra performance cost: https://en.wikipedia.org/wiki/Leapfrog_integration#Algorithm https://en.wikipedia.org/wiki/Leapfrog_integration#Algorithm
- meheleventyone 7y agoSemi-implicit Euler as shown in the ball example is pretty common and usually good enough. Leapfrog has other issues with the decoupling of velocity and acceleration. For example adding in the effects of drag or anything else where the acceleration is dependent on velocity.
- Const-me 7y ago> and usually good enough Usually, but for the OP's bouncing balls conservation of energy would be nice. Another thing, "good enough" is a moving target, both games and the hardware running them improve over time.