Fix physics proxy position when linking and rotating the root prim only
parent
363a99593d
commit
300d357573
|
@ -2397,6 +2397,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
Quaternion oldRootRotation = linkPart.RotationOffset;
|
||||
|
||||
linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition;
|
||||
linkPart.ParentID = m_rootPart.LocalId;
|
||||
linkPart.GroupPosition = AbsolutePosition;
|
||||
Vector3 axPos = linkPart.OffsetPosition;
|
||||
|
||||
|
@ -3431,14 +3432,17 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (prim.UUID != m_rootPart.UUID)
|
||||
{
|
||||
prim.IgnoreUndoUpdate = true;
|
||||
|
||||
Quaternion NewRot = oldParentRot * prim.RotationOffset;
|
||||
NewRot = Quaternion.Inverse(axRot) * NewRot;
|
||||
prim.RotationOffset = NewRot;
|
||||
|
||||
Vector3 axPos = prim.OffsetPosition;
|
||||
|
||||
axPos *= oldParentRot;
|
||||
axPos *= Quaternion.Inverse(axRot);
|
||||
prim.OffsetPosition = axPos;
|
||||
|
||||
prim.RotationOffset *= Quaternion.Inverse(prim.GetWorldRotation()) * (oldParentRot * prim.RotationOffset);
|
||||
|
||||
prim.IgnoreUndoUpdate = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue