When updating SOG, a physics taint should not override a full update with a terse update

remove-scene-viewer
Dan Lake 2011-11-10 14:09:35 -08:00
parent d9b0d7e752
commit 18c625bda6
1 changed files with 15 additions and 10 deletions

View File

@ -1731,18 +1731,23 @@ namespace OpenSim.Region.Framework.Scenes
//if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0) //if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)
// return; // return;
bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); // If we somehow got here to updating the SOG and its root part is not scheduled for update,
// check to see if the physical position or rotation warrant an update.
if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) if (m_rootPart.UpdateFlag == UpdateRequired.NONE)
{ {
m_rootPart.UpdateFlag = UpdateRequired.TERSE; bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
lastPhysGroupPos = AbsolutePosition;
}
if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f))
{ {
m_rootPart.UpdateFlag = UpdateRequired.TERSE; m_rootPart.UpdateFlag = UpdateRequired.TERSE;
lastPhysGroupRot = GroupRotation; lastPhysGroupPos = AbsolutePosition;
}
if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f))
{
m_rootPart.UpdateFlag = UpdateRequired.TERSE;
lastPhysGroupRot = GroupRotation;
}
} }
SceneObjectPart[] parts = m_parts.GetArray(); SceneObjectPart[] parts = m_parts.GetArray();