From 78814a1533cbb545d40582351237505fcfbd0efe Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 16 Feb 2015 19:42:36 -0800 Subject: Use a boolean flag to signal lookat is running instead of Quaternion.Identity so it can be a valid target orientation --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6e56f60..4a8be42 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -266,7 +266,7 @@ namespace OpenSim.Region.Framework.Scenes public Quaternion SpinOldOrientation = Quaternion.Identity; - protected int m_APIDIterations = 0; + protected bool m_APIDActive = false; protected Quaternion m_APIDTarget = Quaternion.Identity; protected float m_APIDDamp = 0; protected float m_APIDStrength = 0; @@ -642,6 +642,12 @@ namespace OpenSim.Region.Framework.Scenes } } + protected bool APIDActive + { + get { return m_APIDActive; } + set { m_APIDActive = value; } + } + protected Quaternion APIDTarget { get { return m_APIDTarget; } @@ -2621,7 +2627,7 @@ namespace OpenSim.Region.Framework.Scenes return; } - m_APIDIterations = 1 + (int)(Math.PI * APIDStrength); + APIDActive = true; } // Necessary to get the lookat deltas applied @@ -2635,7 +2641,7 @@ namespace OpenSim.Region.Framework.Scenes public void StopLookAt() { - APIDTarget = Quaternion.Identity; + APIDActive = false; } @@ -4884,7 +4890,7 @@ namespace OpenSim.Region.Framework.Scenes { try { - if (APIDTarget != Quaternion.Identity) + if (APIDActive) { PhysicsActor pa = ParentGroup.RootPart.PhysActor; if (pa == null || !pa.IsPhysical || APIDStrength < 0.04) -- cgit v1.1