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;
|
||||
|
||||
// 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)
|
||||
oldPos = RootPart.OffsetPosition;
|
||||
oldPos = m_rootPart.AttachedPos + m_rootPart.OffsetPosition; // OffsetPosition should always be 0 in an attachments's root prim
|
||||
else
|
||||
oldPos = AbsolutePosition + RootPart.OffsetPosition;
|
||||
oldPos = AbsolutePosition + m_rootPart.OffsetPosition;
|
||||
|
||||
Vector3 diff = oldPos - newPos;
|
||||
Quaternion partRotation = m_rootPart.RotationOffset;
|
||||
|
@ -3065,6 +3062,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
AbsolutePosition = newPos;
|
||||
|
||||
if (IsAttachment)
|
||||
m_rootPart.AttachedPos = newPos;
|
||||
|
||||
HasGroupChanged = true;
|
||||
ScheduleGroupForTerseUpdate();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue