From a534257b0e0861bb7656389675044fa905a11bf4 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 25 Apr 2008 21:41:55 +0000 Subject: * Fixes prim crossing. See bug 1050. * Causes the internal handling of attachments to put the prim group conceptually at the position of the avatar instead of 0,0,0 --- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 2357c2f..6a12fb9 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -103,6 +103,7 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] public bool m_IsAttachment = false; [XmlIgnore] public uint m_attachmentPoint = (byte)0; [XmlIgnore] public LLUUID m_attachedAvatar = LLUUID.Zero; + [XmlIgnore] public LLVector3 m_attachedPos = LLVector3.Zero; public Int32 CreationDate; public uint ParentID = 0; @@ -276,6 +277,15 @@ namespace OpenSim.Region.Environment.Scenes m_groupPosition.Y = PhysActor.Position.Y; m_groupPosition.Z = PhysActor.Position.Z; } + if (m_IsAttachment) + { + ScenePresence sp = m_parentGroup.Scene.GetScenePresence(m_attachedAvatar); + if (sp != null) + { + return sp.AbsolutePosition; + } + } + return m_groupPosition; } set @@ -340,7 +350,11 @@ namespace OpenSim.Region.Environment.Scenes public LLVector3 AbsolutePosition { - get { return m_offsetPosition + m_groupPosition; } + get { + if (m_IsAttachment) + return GroupPosition; + + return m_offsetPosition + m_groupPosition; } } protected LLQuaternion m_rotationOffset; -- cgit v1.1