diff options
Diffstat (limited to 'OpenSim/Region')
5 files changed, 33 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 81a7278..051e959 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -685,6 +685,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
685 | if (changed && m_scene.AvatarFactory != null) | 685 | if (changed && m_scene.AvatarFactory != null) |
686 | m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID); | 686 | m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID); |
687 | 687 | ||
688 | so.RootPart.Shape.LastAttachPoint = (byte)so.AttachmentPoint; | ||
689 | |||
688 | sp.RemoveAttachment(so); | 690 | sp.RemoveAttachment(so); |
689 | so.FromItemID = UUID.Zero; | 691 | so.FromItemID = UUID.Zero; |
690 | 692 | ||
@@ -699,7 +701,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
699 | so.ClearPartAttachmentData(); | 701 | so.ClearPartAttachmentData(); |
700 | rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive,false); | 702 | rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive,false); |
701 | so.HasGroupChanged = true; | 703 | so.HasGroupChanged = true; |
702 | so.RootPart.Shape.LastAttachPoint = (byte)so.AttachmentPoint; | ||
703 | rootPart.Rezzed = DateTime.Now; | 704 | rootPart.Rezzed = DateTime.Now; |
704 | rootPart.RemFlag(PrimFlags.TemporaryOnRez); | 705 | rootPart.RemFlag(PrimFlags.TemporaryOnRez); |
705 | so.AttachToBackup(); | 706 | so.AttachToBackup(); |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 3feeb13..ac4203f 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -390,9 +390,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
390 | 390 | ||
391 | // Trees could be attached and it's been done, but it makes | 391 | // Trees could be attached and it's been done, but it makes |
392 | // no sense. State must be preserved because it's the tree type | 392 | // no sense. State must be preserved because it's the tree type |
393 | if (objectGroup.RootPart.Shape.PCode != (byte)PCode.Tree && | 393 | if (objectGroup.RootPart.Shape.PCode != (byte) PCode.Tree && |
394 | objectGroup.RootPart.Shape.PCode != (byte)PCode.NewTree) | 394 | objectGroup.RootPart.Shape.PCode != (byte) PCode.NewTree) |
395 | { | ||
395 | objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint; | 396 | objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint; |
397 | if (objectGroup.RootPart.AttachPoint > 0) | ||
398 | objectGroup.RootPart.Shape.LastAttachPoint = objectGroup.RootPart.AttachPoint; | ||
399 | } | ||
396 | 400 | ||
397 | objectGroup.AbsolutePosition = inventoryStoredPosition; | 401 | objectGroup.AbsolutePosition = inventoryStoredPosition; |
398 | objectGroup.RootPart.RotationOffset = inventoryStoredRotation; | 402 | objectGroup.RootPart.RotationOffset = inventoryStoredRotation; |
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 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 2427cbe..275b608 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -1241,4 +1241,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
1241 | return null; | 1241 | return null; |
1242 | } | 1242 | } |
1243 | } | 1243 | } |
1244 | } \ No newline at end of file | 1244 | } |