diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 |
2 files changed, 24 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index c0057ee..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) |
@@ -638,7 +639,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
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; | ||
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; | ||
729 | 745 | ||
746 | return tmp; | ||
747 | |||
748 | |||
749 | } | ||
730 | public Byte[] Serialize() | 750 | public Byte[] Serialize() |
731 | { | 751 | { |
732 | StopTimer(); | 752 | StopTimer(); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6deb870..997a1be 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1667,7 +1667,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1667 | ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar); | 1667 | ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar); |
1668 | if (avatar == null) | 1668 | if (avatar == null) |
1669 | return; | 1669 | return; |
1670 | 1670 | m_rootPart.Shape.LastAttachPoint = m_rootPart.Shape.State; | |
1671 | m_rootPart.AttachedPos = m_rootPart.OffsetPosition; | ||
1671 | avatar.RemoveAttachment(this); | 1672 | avatar.RemoveAttachment(this); |
1672 | 1673 | ||
1673 | Vector3 detachedpos = new Vector3(127f,127f,127f); | 1674 | Vector3 detachedpos = new Vector3(127f,127f,127f); |
@@ -2107,6 +2108,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2107 | 2108 | ||
2108 | if (RootPart.Shape.PCode == 9 && RootPart.Shape.State != 0) | 2109 | if (RootPart.Shape.PCode == 9 && RootPart.Shape.State != 0) |
2109 | { | 2110 | { |
2111 | RootPart.Shape.LastAttachPoint = RootPart.Shape.State; | ||
2110 | RootPart.Shape.State = 0; | 2112 | RootPart.Shape.State = 0; |
2111 | ScheduleGroupForFullUpdate(); | 2113 | ScheduleGroupForFullUpdate(); |
2112 | } | 2114 | } |