* Made Physics updates a teensy bit more responsive. A previous CPU optimization of mine slowed the speed of updates using the 'poll' method in certain circumstances.
parent
db264013d4
commit
bbb8b66908
|
@ -1447,9 +1447,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void UpdatePositionAndVelocity()
|
public void UpdatePositionAndVelocity()
|
||||||
{
|
{
|
||||||
// no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit!
|
// no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit!
|
||||||
PhysicsVector pv = new PhysicsVector(0, 0, 0);
|
PhysicsVector pv = new PhysicsVector(0, 0, 0);
|
||||||
|
bool lastZeroFlag = _zeroFlag;
|
||||||
if (Body != (IntPtr) 0)
|
if (Body != (IntPtr) 0)
|
||||||
{
|
{
|
||||||
d.Vector3 vec = d.BodyGetPosition(Body);
|
d.Vector3 vec = d.BodyGetPosition(Body);
|
||||||
|
@ -1546,6 +1547,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (lastZeroFlag != _zeroFlag)
|
||||||
|
base.RequestPhysicsterseUpdate();
|
||||||
|
|
||||||
m_lastVelocity = _velocity;
|
m_lastVelocity = _velocity;
|
||||||
|
|
||||||
_position = l_position;
|
_position = l_position;
|
||||||
|
|
Loading…
Reference in New Issue