diff options
author | dahlia | 2015-02-16 19:42:36 -0800 |
---|---|---|
committer | dahlia | 2015-02-16 19:42:36 -0800 |
commit | 78814a1533cbb545d40582351237505fcfbd0efe (patch) | |
tree | 26671ac422a5c32e694f73cd9e3c9f7bc50cbe46 | |
parent | Filter NaN and Infinity values at SOP AngularVelocity setter (diff) | |
download | opensim-SC-78814a1533cbb545d40582351237505fcfbd0efe.zip opensim-SC-78814a1533cbb545d40582351237505fcfbd0efe.tar.gz opensim-SC-78814a1533cbb545d40582351237505fcfbd0efe.tar.bz2 opensim-SC-78814a1533cbb545d40582351237505fcfbd0efe.tar.xz |
Use a boolean flag to signal lookat is running instead of Quaternion.Identity so it can be a valid target orientation
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 14 |
1 files changed, 10 insertions, 4 deletions
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 | |||
266 | 266 | ||
267 | public Quaternion SpinOldOrientation = Quaternion.Identity; | 267 | public Quaternion SpinOldOrientation = Quaternion.Identity; |
268 | 268 | ||
269 | protected int m_APIDIterations = 0; | 269 | protected bool m_APIDActive = false; |
270 | protected Quaternion m_APIDTarget = Quaternion.Identity; | 270 | protected Quaternion m_APIDTarget = Quaternion.Identity; |
271 | protected float m_APIDDamp = 0; | 271 | protected float m_APIDDamp = 0; |
272 | protected float m_APIDStrength = 0; | 272 | protected float m_APIDStrength = 0; |
@@ -642,6 +642,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
642 | } | 642 | } |
643 | } | 643 | } |
644 | 644 | ||
645 | protected bool APIDActive | ||
646 | { | ||
647 | get { return m_APIDActive; } | ||
648 | set { m_APIDActive = value; } | ||
649 | } | ||
650 | |||
645 | protected Quaternion APIDTarget | 651 | protected Quaternion APIDTarget |
646 | { | 652 | { |
647 | get { return m_APIDTarget; } | 653 | get { return m_APIDTarget; } |
@@ -2621,7 +2627,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2621 | return; | 2627 | return; |
2622 | } | 2628 | } |
2623 | 2629 | ||
2624 | m_APIDIterations = 1 + (int)(Math.PI * APIDStrength); | 2630 | APIDActive = true; |
2625 | } | 2631 | } |
2626 | 2632 | ||
2627 | // Necessary to get the lookat deltas applied | 2633 | // Necessary to get the lookat deltas applied |
@@ -2635,7 +2641,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2635 | 2641 | ||
2636 | public void StopLookAt() | 2642 | public void StopLookAt() |
2637 | { | 2643 | { |
2638 | APIDTarget = Quaternion.Identity; | 2644 | APIDActive = false; |
2639 | } | 2645 | } |
2640 | 2646 | ||
2641 | 2647 | ||
@@ -4884,7 +4890,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4884 | { | 4890 | { |
4885 | try | 4891 | try |
4886 | { | 4892 | { |
4887 | if (APIDTarget != Quaternion.Identity) | 4893 | if (APIDActive) |
4888 | { | 4894 | { |
4889 | PhysicsActor pa = ParentGroup.RootPart.PhysActor; | 4895 | PhysicsActor pa = ParentGroup.RootPart.PhysActor; |
4890 | if (pa == null || !pa.IsPhysical || APIDStrength < 0.04) | 4896 | if (pa == null || !pa.IsPhysical || APIDStrength < 0.04) |