Fixed-point physics engines?

Started by
2 comments, last by serg3d 16 years ago
Are there any in development? The potential guarantee of determinism across different platforms would be a huge advantage, and I'd guess a fixed-point engine would be faster than a floating-point one.
Advertisement
IMHO the fixed-point operations would be slower on today's computers because floats are now really fast. Or there will be almost no difference. It is not worth the trouble with overflows and underflows.
It could be useful on platforms when you don't have support for floats.

There is a patch for Box2D (it's in the SVN currently) which adds support for fixed-point numbers (more about the patch here: http://www.box2d.org/forum/viewtopic.php?f=3&t=517&st=0&sk=t&sd=a&start=10). I ported Box2D to Symbian and made some tests on my N70. When using fixed-point number one frame took cca 15ms and when using floats one frame took cca 25ms, so there is a difference, but on PC the difference was negligible. Also, compiling with fixed-point numbers the code size almost doubled.
^ Thanks for the example, it's the first I've heard of so far.

Guess I would've expected a bigger speed difference between fixed and floating point physics, but really the point of using fixed-point on PC would be determinism regardless.
In my experience overflow are not so bad if approached with care. Underflow - precision loss is a lot bigger problem, mostly in collision detection. Point-like object can squeeze itself trough the boundary if it's not checked all the time for inside/outside area condition. Probably some other methods, not common vector algebra needed for efficient code. Like digital geometry http://en.wikipedia.org/wiki/Digital_geometry

This topic is closed to new replies.

Advertisement