diff options
author | Robert Adams | 2013-08-21 16:02:42 -0700 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-09-20 21:03:21 +0100 |
commit | d3efb6a7f7b0205379da37f40bf233d70fb12c45 (patch) | |
tree | 209e5399105e1d5f50068a369f9146926c14c56c /OpenSim/Region | |
parent | BulletSim: pass both root and child BSPhysObjects to Extension function. Upda... (diff) | |
download | opensim-SC_OLD-d3efb6a7f7b0205379da37f40bf233d70fb12c45.zip opensim-SC_OLD-d3efb6a7f7b0205379da37f40bf233d70fb12c45.tar.gz opensim-SC_OLD-d3efb6a7f7b0205379da37f40bf233d70fb12c45.tar.bz2 opensim-SC_OLD-d3efb6a7f7b0205379da37f40bf233d70fb12c45.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.
Diffstat (limited to 'OpenSim/Region')
-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 | ||