remove redundant lastPhysGroupPos and lastPhysGroupRot checks

in SOG Update(). rootpart does more complet checks
avinationmerge
UbitUmarov 2013-01-11 16:02:14 +00:00
parent 1f9dbdf8b8
commit 819f4b338d
1 changed files with 3 additions and 16 deletions

View File

@ -307,9 +307,6 @@ namespace OpenSim.Region.Framework.Scenes
get { return RootPart.VolumeDetectActive; } get { return RootPart.VolumeDetectActive; }
} }
private Vector3 lastPhysGroupPos;
private Quaternion lastPhysGroupRot;
private bool m_isBackedUp; private bool m_isBackedUp;
public bool IsBackedUp public bool IsBackedUp
@ -2525,6 +2522,7 @@ namespace OpenSim.Region.Framework.Scenes
#endregion #endregion
public override void Update() public override void Update()
{ {
// Check that the group was not deleted before the scheduled update // Check that the group was not deleted before the scheduled update
@ -2543,19 +2541,8 @@ namespace OpenSim.Region.Framework.Scenes
// check to see if the physical position or rotation warrant an update. // check to see if the physical position or rotation warrant an update.
if (m_rootPart.UpdateFlag == UpdateRequired.NONE) if (m_rootPart.UpdateFlag == UpdateRequired.NONE)
{ {
bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); // rootpart SendScheduledUpdates will check if a update is needed
if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f))
{
m_rootPart.UpdateFlag = UpdateRequired.TERSE; m_rootPart.UpdateFlag = UpdateRequired.TERSE;
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();