mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
Fix physics proxy position when linking and rotating the root prim only
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user