From 28e5abd9176aeba3b5004d07748ae88cccbcd57a Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 4 Jun 2012 21:05:56 +0200 Subject: Fix llAttachToAvatar and "Attach" viewer option to preserve saved attach positions. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ec0966b..ec44da0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3344,7 +3344,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; if (attachmentsModule != null) - attachmentsModule.AttachObject(presence, grp, (uint)attachment, false); + attachmentsModule.AttachObject(presence, grp, (uint)attachment, false, true); } } -- cgit v1.1 From 768447e41b358c7685ee85f36224d1bfdfd36fcf Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 5 Jun 2012 04:43:23 +0100 Subject: Stop llRezAtRoot() from applying velocity setting impulse in World.RezObject, doing it only in itself, so its applyed after resuming scripts etc. It was giving twice the requested velocity. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ec44da0..e825b74 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3079,7 +3079,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // need the magnitude later // float velmag = (float)Util.GetMagnitude(llvel); - SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, Rot2Quaternion(rot), llvel, param); + // rez with zero velocity so we can apply it here after resume scripts etc +// SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, Rot2Quaternion(rot), llvel, param); + SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, Rot2Quaternion(rot), Vector3.Zero, param); // If either of these are null, then there was an unknown error. if (new_group == null) @@ -3102,7 +3104,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (pa != null && pa.IsPhysical && llvel != Vector3.Zero) { - //Recoil. llApplyImpulse(new LSL_Vector(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0); } // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) -- cgit v1.1 From 372b76031bc6ae43d075a53574581d451e1200f3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 5 Jun 2012 05:52:25 +0100 Subject: revert last bad commit but fix recoil direction --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e825b74..d83b05d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3079,9 +3079,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // need the magnitude later // float velmag = (float)Util.GetMagnitude(llvel); - // rez with zero velocity so we can apply it here after resume scripts etc -// SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, Rot2Quaternion(rot), llvel, param); - SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, Rot2Quaternion(rot), Vector3.Zero, param); + SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, Rot2Quaternion(rot), llvel, param); // If either of these are null, then there was an unknown error. if (new_group == null) @@ -3104,7 +3102,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (pa != null && pa.IsPhysical && llvel != Vector3.Zero) { - llApplyImpulse(new LSL_Vector(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0); + // recoil + llvel *= -groupmass; + llApplyImpulse(new LSL_Vector(llvel.X, llvel.Y,llvel.Z), 0); } // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) return; -- cgit v1.1