diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index d773ee7..d9df95c 100644 --- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs +++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | |||
@@ -478,6 +478,7 @@ 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; | ||
481 | 482 | ||
482 | k.StartRotation = rot; | 483 | k.StartRotation = rot; |
483 | if (k.Rotation.HasValue) | 484 | if (k.Rotation.HasValue) |
@@ -612,13 +613,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
612 | 613 | ||
613 | // Do the frame processing | 614 | // Do the frame processing |
614 | double steps = (double)m_currentFrame.TimeMS / tickDuration; | 615 | double steps = (double)m_currentFrame.TimeMS / tickDuration; |
615 | 616 | ||
616 | if (steps <= 0.0) | 617 | if (steps <= 0.0) |
617 | { | 618 | { |
618 | m_group.RootPart.Velocity = Vector3.Zero; | 619 | m_group.RootPart.Velocity = Vector3.Zero; |
619 | m_group.RootPart.AngularVelocity = Vector3.Zero; | 620 | m_group.RootPart.AngularVelocity = Vector3.Zero; |
620 | 621 | ||
621 | m_nextPosition = (Vector3)m_currentFrame.Position; | 622 | m_nextPosition = NormalizeVector(m_currentFrame.AngularVelocity); |
622 | m_group.AbsolutePosition = m_nextPosition; | 623 | m_group.AbsolutePosition = m_nextPosition; |
623 | 624 | ||
624 | // we are sending imediate updates, no doing force a extra terseUpdate | 625 | // we are sending imediate updates, no doing force a extra terseUpdate |
@@ -706,7 +707,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
706 | m_group.SendGroupRootTerseUpdate(); | 707 | m_group.SendGroupRootTerseUpdate(); |
707 | } | 708 | } |
708 | } | 709 | } |
710 | private Vector3 NormalizeVector(Vector3? pPosition) | ||
711 | { | ||
712 | if (pPosition == null) | ||
713 | return Vector3.Zero; | ||
714 | |||
715 | Vector3 tmp = (Vector3) pPosition; | ||
709 | 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 | |||
726 | return tmp; | ||
727 | |||
728 | |||
729 | } | ||
710 | public Byte[] Serialize() | 730 | public Byte[] Serialize() |
711 | { | 731 | { |
712 | StopTimer(); | 732 | StopTimer(); |