aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 2e11162..b30c024 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2502,6 +2502,26 @@ namespace OpenSim.Region.Framework.Scenes
2502 //ParentGroup.RootPart.m_groupPosition = newpos; 2502 //ParentGroup.RootPart.m_groupPosition = newpos;
2503 } 2503 }
2504 2504
2505 if (pa != null && ParentID != 0 && ParentGroup != null)
2506 {
2507 // RA: Special case where a child object is requesting property updates.
2508 // This happens when linksets are modified to use flexible links rather than
2509 // the default links.
2510 // The simulator code presumes that child parts are only modified by scripts
2511 // so the logic for changing position/rotation/etc does not take into
2512 // account the physical object actually moving.
2513 // This code updates the offset position and rotation of the child and then
2514 // lets the update code push the update to the viewer.
2515 // Since physics engines do not normally generate this event for linkset children,
2516 // this code will not be active unless you have a specially configured
2517 // physics engine.
2518 Quaternion invRootRotation = Quaternion.Normalize(Quaternion.Inverse(ParentGroup.RootPart.RotationOffset));
2519 m_offsetPosition = pa.Position - m_groupPosition;
2520 RotationOffset = pa.Orientation * invRootRotation;
2521 m_log.DebugFormat("{0} PhysicsRequestingTerseUpdate child: pos={1}, rot={2}, offPos={3}, offRot={4}",
2522 "[SCENE OBJECT PART]", pa.Position, pa.Orientation, m_offsetPosition, RotationOffset);
2523 }
2524
2505 ScheduleTerseUpdate(); 2525 ScheduleTerseUpdate();
2506 } 2526 }
2507 2527