diff options
author | Melanie | 2013-08-25 06:26:56 +0200 |
---|---|---|
committer | Melanie | 2013-08-25 06:26:56 +0200 |
commit | f7378829c3da999fcd200a5d0e6189a563cbda39 (patch) | |
tree | ceb762fd98516750dd5d4e9a00315c04a8de1a3f | |
parent | * This fixes the border crossing offsets by storing the final keyframe locati... (diff) | |
download | opensim-SC_OLD-f7378829c3da999fcd200a5d0e6189a563cbda39.zip opensim-SC_OLD-f7378829c3da999fcd200a5d0e6189a563cbda39.tar.gz opensim-SC_OLD-f7378829c3da999fcd200a5d0e6189a563cbda39.tar.bz2 opensim-SC_OLD-f7378829c3da999fcd200a5d0e6189a563cbda39.tar.xz |
Fix the root cause of keyframe motion region crossing offset - UpdateSceneObject
was being called twice on each crossing.
-rw-r--r-- | OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 6 |
2 files changed, 5 insertions, 23 deletions
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index d9df95c..276b61f 100644 --- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs +++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | |||
@@ -478,7 +478,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
478 | k.Position = pos; | 478 | k.Position = pos; |
479 | // k.Velocity = Vector3.Zero; | 479 | // k.Velocity = Vector3.Zero; |
480 | } | 480 | } |
481 | k.AngularVelocity = (Vector3)k.Position; | ||
482 | 481 | ||
483 | k.StartRotation = rot; | 482 | k.StartRotation = rot; |
484 | if (k.Rotation.HasValue) | 483 | if (k.Rotation.HasValue) |
@@ -619,7 +618,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
619 | m_group.RootPart.Velocity = Vector3.Zero; | 618 | m_group.RootPart.Velocity = Vector3.Zero; |
620 | m_group.RootPart.AngularVelocity = Vector3.Zero; | 619 | m_group.RootPart.AngularVelocity = Vector3.Zero; |
621 | 620 | ||
622 | m_nextPosition = NormalizeVector(m_currentFrame.AngularVelocity); | 621 | m_nextPosition = (Vector3)m_currentFrame.Position; |
623 | m_group.AbsolutePosition = m_nextPosition; | 622 | m_group.AbsolutePosition = m_nextPosition; |
624 | 623 | ||
625 | // we are sending imediate updates, no doing force a extra terseUpdate | 624 | // we are sending imediate updates, no doing force a extra terseUpdate |
@@ -707,26 +706,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
707 | m_group.SendGroupRootTerseUpdate(); | 706 | m_group.SendGroupRootTerseUpdate(); |
708 | } | 707 | } |
709 | } | 708 | } |
710 | private Vector3 NormalizeVector(Vector3? pPosition) | ||
711 | { | ||
712 | if (pPosition == null) | ||
713 | return Vector3.Zero; | ||
714 | |||
715 | Vector3 tmp = (Vector3) pPosition; | ||
716 | |||
717 | while (tmp.X > Constants.RegionSize) | ||
718 | tmp.X -= Constants.RegionSize; | ||
719 | while (tmp.X < 0) | ||
720 | tmp.X += Constants.RegionSize; | ||
721 | while (tmp.Y > Constants.RegionSize) | ||
722 | tmp.Y -= Constants.RegionSize; | ||
723 | while (tmp.Y < 0) | ||
724 | tmp.Y += Constants.RegionSize; | ||
725 | 709 | ||
726 | return tmp; | ||
727 | |||
728 | |||
729 | } | ||
730 | public Byte[] Serialize() | 710 | public Byte[] Serialize() |
731 | { | 711 | { |
732 | StopTimer(); | 712 | StopTimer(); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2b58795..b189599 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2802,8 +2802,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2802 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); | 2802 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); |
2803 | newObject.ResumeScripts(); | 2803 | newObject.ResumeScripts(); |
2804 | 2804 | ||
2805 | if (newObject.RootPart.KeyframeMotion != null) | 2805 | // AddSceneObject already does this and doing it again messes |
2806 | newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject); | 2806 | // up region crossings, so don't. |
2807 | //if (newObject.RootPart.KeyframeMotion != null) | ||
2808 | // newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject); | ||
2807 | } | 2809 | } |
2808 | 2810 | ||
2809 | // Do this as late as possible so that listeners have full access to the incoming object | 2811 | // Do this as late as possible so that listeners have full access to the incoming object |