diff options
author | Melanie | 2011-10-06 17:55:20 +0200 |
---|---|---|
committer | Melanie | 2011-10-06 17:55:20 +0200 |
commit | 300d357573a272ef0042ebbe0912ab88de958f65 (patch) | |
tree | 2c65b08074b6e7d84b2b5130fd7f9db04fa3ab3d /OpenSim/Region | |
parent | Change the asset connector to allow connection to different asset servers (diff) | |
download | opensim-SC-300d357573a272ef0042ebbe0912ab88de958f65.zip opensim-SC-300d357573a272ef0042ebbe0912ab88de958f65.tar.gz opensim-SC-300d357573a272ef0042ebbe0912ab88de958f65.tar.bz2 opensim-SC-300d357573a272ef0042ebbe0912ab88de958f65.tar.xz |
Fix physics proxy position when linking and rotating the root prim only
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6c47645..58f2586 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2397,6 +2397,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2397 | Quaternion oldRootRotation = linkPart.RotationOffset; | 2397 | Quaternion oldRootRotation = linkPart.RotationOffset; |
2398 | 2398 | ||
2399 | linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition; | 2399 | linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition; |
2400 | linkPart.ParentID = m_rootPart.LocalId; | ||
2400 | linkPart.GroupPosition = AbsolutePosition; | 2401 | linkPart.GroupPosition = AbsolutePosition; |
2401 | Vector3 axPos = linkPart.OffsetPosition; | 2402 | Vector3 axPos = linkPart.OffsetPosition; |
2402 | 2403 | ||
@@ -3431,14 +3432,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
3431 | if (prim.UUID != m_rootPart.UUID) | 3432 | if (prim.UUID != m_rootPart.UUID) |
3432 | { | 3433 | { |
3433 | prim.IgnoreUndoUpdate = true; | 3434 | prim.IgnoreUndoUpdate = true; |
3435 | |||
3436 | Quaternion NewRot = oldParentRot * prim.RotationOffset; | ||
3437 | NewRot = Quaternion.Inverse(axRot) * NewRot; | ||
3438 | prim.RotationOffset = NewRot; | ||
3439 | |||
3434 | Vector3 axPos = prim.OffsetPosition; | 3440 | Vector3 axPos = prim.OffsetPosition; |
3435 | 3441 | ||
3436 | axPos *= oldParentRot; | 3442 | axPos *= oldParentRot; |
3437 | axPos *= Quaternion.Inverse(axRot); | 3443 | axPos *= Quaternion.Inverse(axRot); |
3438 | prim.OffsetPosition = axPos; | 3444 | prim.OffsetPosition = axPos; |
3439 | 3445 | ||
3440 | prim.RotationOffset *= Quaternion.Inverse(prim.GetWorldRotation()) * (oldParentRot * prim.RotationOffset); | ||
3441 | |||
3442 | prim.IgnoreUndoUpdate = false; | 3446 | prim.IgnoreUndoUpdate = false; |
3443 | } | 3447 | } |
3444 | } | 3448 | } |