From a5f2803c79b8d3a25124bef5f68afd57b5feba96 Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Thu, 26 Nov 2009 01:34:46 -0500 Subject: [PATCH] * Re-enable the AbsolutePosition = AbsolutePosition in the LSL_Api in the SetRot method if the object is not active physical. This is important for scripted rotating doors. without AbsolutePosition = AbsolutePosition, the door won't rotate. It's also important that we do not use AbsolutePosition = AbsolutePosition if the object is active physical because that would cause a complete rebuild of the object which would break vehicles. This is the best of both worlds right now. Doors as child prim should work again so long as you don't check the Physical box. * Thanks talentraspel * Thanks NixNerd * Thanks KittoFlora * Thanks lockd --- .../Shared/Api/Implementation/LSL_Api.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9c627758b0..fbbbfdc727 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1987,6 +1987,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type // part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; + + // So, after thinking about this for a bit, the issue with the part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition line + // is it isn't compatible with vehicles because it causes the vehicle body to have to be broken down and rebuilt + // It's perfectly okay when the object is not an active physical body though. + // So, part.ParentGroup.ResetChildPrimPhysicsPositions(); does the thing that Kitto is warning against + // but only if the object is not physial and active. This is important for rotating doors. + // without the absoluteposition = absoluteposition happening, the doors do not move in the physics + // scene + if (part.PhysActor != null && !part.PhysActor.IsPhysical) + { + part.ParentGroup.ResetChildPrimPhysicsPositions(); + } } ///