From 18c625bda669509fc9aae330703fe09ff7a6c72e Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Thu, 10 Nov 2011 14:09:35 -0800 Subject: When updating SOG, a physics taint should not override a full update with a terse update --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 339cf0f..f6bfc9b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1731,18 +1731,23 @@ namespace OpenSim.Region.Framework.Scenes //if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0) // return; - bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); - - if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) + // 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 (m_rootPart.UpdateFlag == UpdateRequired.NONE) { - m_rootPart.UpdateFlag = UpdateRequired.TERSE; - lastPhysGroupPos = AbsolutePosition; - } + bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); - if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) - { - m_rootPart.UpdateFlag = UpdateRequired.TERSE; - lastPhysGroupRot = GroupRotation; + if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) + { + 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(); -- cgit v1.1 From f5abae5ac67caefdc305cfa8551dfa749bf8b5c7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 10 Nov 2011 22:34:54 +0100 Subject: Implement nudging support for strafing motion --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fc5141f..e662492 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1509,7 +1509,8 @@ namespace OpenSim.Region.Framework.Scenes if ((MovementFlag & (byte)(uint)DCF) == 0) { - if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) + if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE || + DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT_NUDGE) { MovementFlag |= (byte)nudgehack; } @@ -1522,7 +1523,8 @@ namespace OpenSim.Region.Framework.Scenes else { if ((MovementFlag & (byte)(uint)DCF) != 0 || - ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) + ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE || + DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT_NUDGE) && ((MovementFlag & (byte)nudgehack) == nudgehack)) ) // This or is for Nudge forward { -- cgit v1.1