When moving the root prim of an attachment: a) Change the attach position; b) Move the other prims in the reverse direction to compensate
parent
88f01a4130
commit
da47bcae3e
|
@ -3043,13 +3043,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
Vector3 oldPos;
|
Vector3 oldPos;
|
||||||
|
|
||||||
// FIXME: This improves the situation where editing just the root prim of an attached object would send
|
|
||||||
// all the other parts to oblivion after detach/reattach. However, a problem remains since the root prim
|
|
||||||
// still ends up in the wrong position on reattach.
|
|
||||||
if (IsAttachment)
|
if (IsAttachment)
|
||||||
oldPos = RootPart.OffsetPosition;
|
oldPos = m_rootPart.AttachedPos + m_rootPart.OffsetPosition; // OffsetPosition should always be 0 in an attachments's root prim
|
||||||
else
|
else
|
||||||
oldPos = AbsolutePosition + RootPart.OffsetPosition;
|
oldPos = AbsolutePosition + m_rootPart.OffsetPosition;
|
||||||
|
|
||||||
Vector3 diff = oldPos - newPos;
|
Vector3 diff = oldPos - newPos;
|
||||||
Quaternion partRotation = m_rootPart.RotationOffset;
|
Quaternion partRotation = m_rootPart.RotationOffset;
|
||||||
|
@ -3064,6 +3061,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
AbsolutePosition = newPos;
|
AbsolutePosition = newPos;
|
||||||
|
|
||||||
|
if (IsAttachment)
|
||||||
|
m_rootPart.AttachedPos = newPos;
|
||||||
|
|
||||||
HasGroupChanged = true;
|
HasGroupChanged = true;
|
||||||
ScheduleGroupForTerseUpdate();
|
ScheduleGroupForTerseUpdate();
|
||||||
|
|
Loading…
Reference in New Issue