From 12049e1120559a36ea5fd0453a36210808d04363 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 16 Jul 2012 11:03:12 +0200 Subject: Allow setting linked avatar positions from within a prim not the one sat on --- .../Shared/Api/Implementation/LSL_Api.cs | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5bade25..595dd8a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2470,8 +2470,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Rotation llGetLocalRot() { + return GetPartLocalRot(m_host); + } + + private LSL_Rotation GetPartLocalRot(SceneObjectPart part) + { m_host.AddScriptLPS(1); - Quaternion rot = m_host.RotationOffset; + Quaternion rot = part.RotationOffset; return new LSL_Rotation(rot.X, rot.Y, rot.Z, rot.W); } @@ -8029,10 +8034,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSL_Rotation localRot = ScriptBaseClass.ZERO_ROTATION; LSL_Vector localPos = ScriptBaseClass.ZERO_VECTOR; - if (llGetLinkNumber() > 1) + if (part.LinkNum > 1) { - localRot = llGetLocalRot(); - localPos = llGetLocalPos(); + localRot = GetPartLocalRot(part); + localPos = GetPartLocalPos(part); } v -= localPos; @@ -8054,17 +8059,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (remain < 1) return; + LSL_Rotation r; + r = rules.GetQuaternionItem(idx++); + + SceneObjectPart part = World.GetSceneObjectPart(av.ParentID); + if (part == null) + break; + LSL_Rotation localRot = ScriptBaseClass.ZERO_ROTATION; LSL_Vector localPos = ScriptBaseClass.ZERO_VECTOR; - if (llGetLinkNumber() > 1) - { - localRot = llGetLocalRot(); - localPos = llGetLocalPos(); - } + if (part.LinkNum > 1) + localRot = GetPartLocalRot(part); - LSL_Rotation r; - r = rules.GetQuaternionItem(idx++); r = r * llGetRootRotation() / localRot; av.Rotation = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); av.SendAvatarDataToAllAgents(); -- cgit v1.1 From 0d3661fb5f9f8f2cfc29d516d744ce87826ec6be Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 17 Jul 2012 00:27:01 +0100 Subject: UbitOde: remove useless water collider from active code. --- OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index 139c4e8..a554897 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs @@ -203,9 +203,9 @@ namespace OpenSim.Region.Physics.OdePlugin private float waterlevel = 0f; private int framecount = 0; - private IntPtr WaterGeom = IntPtr.Zero; - private IntPtr WaterHeightmapData = IntPtr.Zero; - private GCHandle WaterMapHandler = new GCHandle(); +// private IntPtr WaterGeom = IntPtr.Zero; +// private IntPtr WaterHeightmapData = IntPtr.Zero; +// private GCHandle WaterMapHandler = new GCHandle(); public float avPIDD = 2200f; // make it visible public float avPIDP = 900f; // make it visible @@ -2491,9 +2491,9 @@ namespace OpenSim.Region.Physics.OdePlugin public override void SetWaterLevel(float baseheight) { waterlevel = baseheight; - randomizeWater(waterlevel); +// randomizeWater(waterlevel); } - +/* public void randomizeWater(float baseheight) { const uint heightmapWidth = Constants.RegionSize + 2; @@ -2574,7 +2574,7 @@ namespace OpenSim.Region.Physics.OdePlugin } } } - +*/ public override void Dispose() { lock (OdeLock) @@ -2624,7 +2624,7 @@ namespace OpenSim.Region.Physics.OdePlugin TerrainHeightFieldHeightsHandlers.Clear(); TerrainHeightFieldHeights.Clear(); - +/* if (WaterGeom != IntPtr.Zero) { d.GeomDestroy(WaterGeom); @@ -2636,7 +2636,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (WaterMapHandler.IsAllocated) WaterMapHandler.Free(); } - +*/ if (ContactgeomsArray != IntPtr.Zero) Marshal.FreeHGlobal(ContactgeomsArray); if (GlobalContactsArray != IntPtr.Zero) -- cgit v1.1