Problem with LinearVelocity and no movement
Posted: Tue Apr 29, 2014 10:25 am
Ok, after that bug was fixed yesterday I was able to do most of what I wanted. I am converting pos and rot now and the "aircraft" camera is moving at the right speeds most of the time and almost into the right direction (I still have an unexplained difference of like 1 degree versus the correct movement - I am still thinking about why that happens, but its probably the LatLonAlt to Meter conversion process).
But now that I have fixed most coordinate system problems I still have a problem with LinearVelocity and objects that stop moving slowly despite having LinarVelocity.
This is from the debugger:
obj.PhysicsEntity.LinearVelocity {2.107735, -0.01689263, -1.474374} BEPUutilities.Vector3
and this is never changing:
obj.PhysicsEntity.Position {-4013779, 49.87001, -5923159} BEPUutilities.Vector3
It does not always happen, I have seen objects move slow, but this object now is not moving for reasons I do not understand yet. Is it something like a rounding problem? The speed is too slow? Or what could be the problem?
I have also looked at the BufferedStates, but nothing is moving there either.
I am not doing much in my code with BEPU, so I have not really changed any defaults. This is like my complete BEPU code:
Am I doing something wrong? I have converted LatLonAlt to meters, do I need to scale it differently?
Thx for all the help!
But now that I have fixed most coordinate system problems I still have a problem with LinearVelocity and objects that stop moving slowly despite having LinarVelocity.
This is from the debugger:
obj.PhysicsEntity.LinearVelocity {2.107735, -0.01689263, -1.474374} BEPUutilities.Vector3
and this is never changing:
obj.PhysicsEntity.Position {-4013779, 49.87001, -5923159} BEPUutilities.Vector3
It does not always happen, I have seen objects move slow, but this object now is not moving for reasons I do not understand yet. Is it something like a rounding problem? The speed is too slow? Or what could be the problem?
I have also looked at the BufferedStates, but nothing is moving there either.
I am not doing much in my code with BEPU, so I have not really changed any defaults. This is like my complete BEPU code:
Code: Select all
public Space PhysicsSpace = new Space();
Data.PhysicsSpace.BufferedStates.Enabled = true;
Data.PhysicsSpace.TimeStepSettings.MaximumTimeStepsPerFrame = 10;
Data.PhysicsSpace.TimeStepSettings.TimeStepDuration = ((float)CALCULATE_POSITIONS_TIME_INTERVAL_MS) / 1000 / 10;
Data.PhysicsSpace.Update((float)(ms / 1000));
obj.PhysicsEntity = new BEPUphysics.Entities.Prefabs.Box(new BEPUutilities.Vector3(), 14, 6, 16);
obj.PhysicsEntity.Mass = 0.000001f;
PhysicsSpace.Add(obj.PhysicsEntity);
Thx for all the help!