Hi,
I'm currently working on porting a physics project to a machine without any native floating point support. I'm using ODE (in single floating point mode) and find it works very well on a PC but is very slow when using an emulated floating point system.
I was going to reimplement ODE using a fixed point maths class but would like to know if anyone had any information on this before I go ahead. Ideally I would use a 16:16 system but I'm unsure whether this would be too limited for the scale of numbers being used.
If anyone could give their opinion on the following questions I would be really grateful:
1) Has anyone used fixed-point maths for physics before?
2) Do physics systems require support for NaN/Infinity etc...?
3) What would be a reasonable size to use for the fixed-point (e.g. 32:32, 16:16, 48:16)
Thanks!
Tone
Using fixed point maths in a physics engine
-
- Posts: 2
- Joined: Mon Mar 19, 2007 4:35 pm
-
- Posts: 40
- Joined: Fri Jul 22, 2005 8:00 pm
- Location: Santa Monica
-
- Posts: 197
- Joined: Sat Aug 19, 2006 11:52 pm
This is something I'd be very interested to hear about. One tip you might find handy is given near the end of this presentation: http://jet.ro/files/The_neglected_art_o ... 060913.pdf
basically: use a number class which internally implements both floatingpoint and fixedpoint at the same time, so that you can easily detect when problems arise with your fixedpoint code.
dog: did you need 128bit values for intermediate calculations? or did you only really use 16:32?
basically: use a number class which internally implements both floatingpoint and fixedpoint at the same time, so that you can easily detect when problems arise with your fixedpoint code.
dog: did you need 128bit values for intermediate calculations? or did you only really use 16:32?
-
- Posts: 40
- Joined: Fri Jul 22, 2005 8:00 pm
- Location: Santa Monica
Yeah. Intermediate 128-bit calculations. The first game that used it had 16:32, but I changed it to 32:32 for a space-sim, which apparently needed it. My first physics sim used 8:8 (but that was on a C-64).
I'll have to be honest and say that when I did this stuff floating point units were not usually available.
I'll have to be honest and say that when I did this stuff floating point units were not usually available.
-
- Posts: 2
- Joined: Mon Mar 19, 2007 4:35 pm