aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/KeyframeMotion.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/KeyframeMotion.cs24
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
index 29652aa..4d153da 100644
--- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
+++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
@@ -498,6 +498,7 @@ namespace OpenSim.Region.Framework.Scenes
498 k.Position = pos; 498 k.Position = pos;
499// k.Velocity = Vector3.Zero; 499// k.Velocity = Vector3.Zero;
500 } 500 }
501 k.AngularVelocity = (Vector3)k.Position;
501 502
502 k.StartRotation = rot; 503 k.StartRotation = rot;
503 if (k.Rotation.HasValue) 504 if (k.Rotation.HasValue)
@@ -632,13 +633,13 @@ namespace OpenSim.Region.Framework.Scenes
632 633
633 // Do the frame processing 634 // Do the frame processing
634 double steps = (double)m_currentFrame.TimeMS / tickDuration; 635 double steps = (double)m_currentFrame.TimeMS / tickDuration;
635 636
636 if (steps <= 0.0) 637 if (steps <= 0.0)
637 { 638 {
638 m_group.RootPart.Velocity = Vector3.Zero; 639 m_group.RootPart.Velocity = Vector3.Zero;
639 m_group.RootPart.AngularVelocity = Vector3.Zero; 640 m_group.RootPart.AngularVelocity = Vector3.Zero;
640 641
641 m_nextPosition = (Vector3)m_currentFrame.Position; 642 m_nextPosition = NormalizeVector(m_currentFrame.AngularVelocity);
642 m_group.AbsolutePosition = m_nextPosition; 643 m_group.AbsolutePosition = m_nextPosition;
643 644
644 // we are sending imediate updates, no doing force a extra terseUpdate 645 // we are sending imediate updates, no doing force a extra terseUpdate
@@ -726,7 +727,26 @@ namespace OpenSim.Region.Framework.Scenes
726 m_group.SendGroupRootTerseUpdate(); 727 m_group.SendGroupRootTerseUpdate();
727 } 728 }
728 } 729 }
730 private Vector3 NormalizeVector(Vector3? pPosition)
731 {
732 if (pPosition == null)
733 return Vector3.Zero;
734
735 Vector3 tmp = (Vector3) pPosition;
729 736
737 while (tmp.X > Constants.RegionSize)
738 tmp.X -= Constants.RegionSize;
739 while (tmp.X < 0)
740 tmp.X += Constants.RegionSize;
741 while (tmp.Y > Constants.RegionSize)
742 tmp.Y -= Constants.RegionSize;
743 while (tmp.Y < 0)
744 tmp.Y += Constants.RegionSize;
745
746 return tmp;
747
748
749 }
730 public Byte[] Serialize() 750 public Byte[] Serialize()
731 { 751 {
732 StopTimer(); 752 StopTimer();