From b05cb3b2bfd6f3912fb33a790b7c2d1ed898d539 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 9 Sep 2013 14:47:49 -0700 Subject: Change collision logic in SceneObjectPart so land_collision will happen. The previous logic would generate land_collision_start and land_collision_end but would not generate the land_collision itself. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index c9ff4f3..2e11162 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2464,12 +2464,9 @@ namespace OpenSim.Region.Framework.Scenes SendCollisionEvent(scriptEvents.collision_end , endedColliders , ParentGroup.Scene.EventManager.TriggerScriptCollidingEnd); if (startedColliders.Contains(0)) - { - if (m_lastColliders.Contains(0)) - SendLandCollisionEvent(scriptEvents.land_collision, ParentGroup.Scene.EventManager.TriggerScriptLandColliding); - else - SendLandCollisionEvent(scriptEvents.land_collision_start, ParentGroup.Scene.EventManager.TriggerScriptLandCollidingStart); - } + SendLandCollisionEvent(scriptEvents.land_collision_start, ParentGroup.Scene.EventManager.TriggerScriptLandCollidingStart); + if (m_lastColliders.Contains(0)) + SendLandCollisionEvent(scriptEvents.land_collision, ParentGroup.Scene.EventManager.TriggerScriptLandColliding); if (endedColliders.Contains(0)) SendLandCollisionEvent(scriptEvents.land_collision_end, ParentGroup.Scene.EventManager.TriggerScriptLandCollidingEnd); } -- cgit v1.1 From e0b457d3c3daabc065aa66376bc17472d4b43e8f Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 21 Aug 2013 16:02:42 -0700 Subject: 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. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs') 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 //ParentGroup.RootPart.m_groupPosition = newpos; } + if (pa != null && ParentID != 0 && ParentGroup != null) + { + // RA: Special case where a child object is requesting property updates. + // This happens when linksets are modified to use flexible links rather than + // the default links. + // The simulator code presumes that child parts are only modified by scripts + // so the logic for changing position/rotation/etc does not take into + // account the physical object actually moving. + // This code updates the offset position and rotation of the child and then + // lets the update code push the update to the viewer. + // Since physics engines do not normally generate this event for linkset children, + // this code will not be active unless you have a specially configured + // physics engine. + Quaternion invRootRotation = Quaternion.Normalize(Quaternion.Inverse(ParentGroup.RootPart.RotationOffset)); + m_offsetPosition = pa.Position - m_groupPosition; + RotationOffset = pa.Orientation * invRootRotation; + m_log.DebugFormat("{0} PhysicsRequestingTerseUpdate child: pos={1}, rot={2}, offPos={3}, offRot={4}", + "[SCENE OBJECT PART]", pa.Position, pa.Orientation, m_offsetPosition, RotationOffset); + } + ScheduleTerseUpdate(); } -- cgit v1.1 From 3dbf4a1002216e2d14c20353a5993ea63413d03d Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 22 Aug 2013 09:05:26 -0700 Subject: BulletSim: remove chatty debug message from previous commit. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b30c024..b3e6b67 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2504,7 +2504,7 @@ namespace OpenSim.Region.Framework.Scenes if (pa != null && ParentID != 0 && ParentGroup != null) { - // RA: Special case where a child object is requesting property updates. + // Special case where a child object is requesting property updates. // This happens when linksets are modified to use flexible links rather than // the default links. // The simulator code presumes that child parts are only modified by scripts @@ -2518,8 +2518,8 @@ namespace OpenSim.Region.Framework.Scenes Quaternion invRootRotation = Quaternion.Normalize(Quaternion.Inverse(ParentGroup.RootPart.RotationOffset)); m_offsetPosition = pa.Position - m_groupPosition; RotationOffset = pa.Orientation * invRootRotation; - m_log.DebugFormat("{0} PhysicsRequestingTerseUpdate child: pos={1}, rot={2}, offPos={3}, offRot={4}", - "[SCENE OBJECT PART]", pa.Position, pa.Orientation, m_offsetPosition, RotationOffset); + // m_log.DebugFormat("{0} PhysicsRequestingTerseUpdate child: pos={1}, rot={2}, offPos={3}, offRot={4}", + // "[SCENE OBJECT PART]", pa.Position, pa.Orientation, m_offsetPosition, RotationOffset); } ScheduleTerseUpdate(); -- cgit v1.1