Small performance tweaks to code called by the heartbeat loop

This commit is contained in:
John Hurliman
2009-10-28 23:10:16 -07:00
parent 1c9696a9d2
commit 59eb378d16
4 changed files with 53 additions and 117 deletions

View File

@@ -1857,28 +1857,15 @@ namespace OpenSim.Region.Framework.Scenes
{
bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
//if (IsAttachment)
//{
//foreach (SceneObjectPart part in m_parts.Values)
//{
//part.SendScheduledUpdates();
//}
//return;
//}
if (UsePhysics && Util.DistanceLessThan(lastPhysGroupPos, AbsolutePosition, 0.02))
if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f))
{
m_rootPart.UpdateFlag = 1;
lastPhysGroupPos = AbsolutePosition;
}
if (UsePhysics && ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1)
|| (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1)
|| (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1)
|| (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1)))
if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f))
{
m_rootPart.UpdateFlag = 1;
lastPhysGroupRot = GroupRotation;
}