diff options
author | Robert Adams | 2013-08-21 16:02:42 -0700 |
---|---|---|
committer | Robert Adams | 2013-09-11 09:12:07 -0700 |
commit | e0b457d3c3daabc065aa66376bc17472d4b43e8f (patch) | |
tree | a58e01c77746803707c5b80ca5b42d6db74cf0c0 | |
parent | BulletSim: pass both root and child BSPhysObjects to Extension function. Upda... (diff) | |
download | opensim-SC_OLD-e0b457d3c3daabc065aa66376bc17472d4b43e8f.zip opensim-SC_OLD-e0b457d3c3daabc065aa66376bc17472d4b43e8f.tar.gz opensim-SC_OLD-e0b457d3c3daabc065aa66376bc17472d4b43e8f.tar.bz2 opensim-SC_OLD-e0b457d3c3daabc065aa66376bc17472d4b43e8f.tar.xz |
BulletSim: add position and rotation update for child prim physics update events. Normally, physics engines do not return updates for child prims so, under normal operation, this code should never execute. Will only be used when using flexible linkset linkages.
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 20 |
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 | ||