PhysicsNode and gravity

I’ve been playing around with large and small values with respect to size, distances and gravity in jme3. If a PhysicsNode is positioned at a relatively large distance from the origin of the root node (say y = 25000 units), also setSleepingThreshold(0f,0f), and the PhysicsNode is allowed to ‘fall’ while monitoring its position and linear velocities (I just print them to the console), the following behavior is displayed:

The location vector of the PhysicsNode does not change (the PhysicsNode does not ‘move’ graphically either) until a certain threshold value of velocity has been reached. The velocity changes/increases but position does not change. After the ‘threshold’ value has been reached to PhysicsNode begins to move/accelerate with the attained velocity/gravity vector. This velocity value appears to be proportional to the distance from the origin. This is most visible at small values of gravity (< 1 unit / sec^2 ) . Also, if applyContinousForce is utilized (with gravity(o,o,o), the above behavior does not manifest; accelerations and velocities appear to integrate properly. I realize at a numeric distance (25000 units) the floating point accuracy is only about 1/2000 of a unit. I’m just not familiar enough (at all) with the JBullet engine to know how this would factor into the given displayed behavior.


Look at the code to find out. As you say its probably float inaccuracies. Also, the default size of the physicsspace is not even big enough that it would include the location you indicate, did you expand the size?

Yes I increased the physicspace maxsize to Vector3f.UNIT_XYZ.mult(30000f).