Off the bat, I'll admit that I'm using jME source from a year ago, but please hear me out.
I'm currently experiencing a bug whereby my ships jitter if I fly them more than about 18000 units from the origin of my game world. The ships are standard nodes with geometry attached and a dynamic physics object. The jittering is very mild but noticeable whenever there is some angular velocity imparted to the ship.
So my question is this. I'm considering upgrading to version 1.0rc1 and I'm curious if any of you old timers are familiar with such a bug at some point in jME's past and if using the latest version has a good likelihood of fixing this issue? I thought it was perhaps a math issue, so I've already updated to the latest math classes, but the problem still exists.
Many thanks
You of course also have the dilemna that in upgrading, which may take a while to convert - it may be alot faster or you may uncover a bug…
I havent upgraded yet either - think im still stuck in April… but i wiill soon
Ok. I have things working on the latest code base and the problem still exists. Any thoughts?
This could be a physics problem, jittering in jME would mean jittering in OpenGL and that is unlikely to happen
I'm not familiar with any specific issues… but perhaps as has been said you are running into some float rounding issue with "larger" values somewhere? Maybe some kind of position * velocity or such calc…? 18k units is not all that big, but maybe in the context of some calculation it's generating larger floats.
I use doubles in my physics implementation now. I started out with floats and got weird behaviours at a distance of only 200 units from origo. Did some tests and found out that some velocity values where indeed too small to be added to 200f and make a difference.
One option for me was to have relative positions for every physics object, kinda like a scenegraph. The other was to use doubles.
I chose doubles since:
- they are faster to make computations with if cache misses are few
- the runtime conversion from double to float is expensive, but the amount of conversions needed for displaying the objects are far, far fewer than the number of physics calculations
- last but certainly not least, I'm lazy. Eclipse replaced those floats with doubles for me and a few resulting bugs were easily squashed.
Interesting. So excuse the basic question. But where did you change the floats to doubles exactly? Is it just a global replace in com.jmex.physics.impl.ode or something?