From dd7f9ed7bf3a6776ccdb1efe06a820f51ef6af1e Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 25 Oct 2010 00:33:34 +0200 Subject: [PATCH 1/2] Implement llGetLinkNumberOfSides(), needed for 1-script sculptie foot shoe scripts. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 9 +++++++++ .../Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | 1 + .../Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1b11f2cdc7..2527757ba0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -10777,6 +10777,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return GetLinkPrimitiveParams(obj, rules); } + + public LSL_Integer llGetLinkNumberOfSides(LSL_Integer link) + { + List parts = GetLinkParts(link); + if (parts.Count < 1) + return 0; + + return GetNumberOfSides(parts[0]); + } } public class NotecardCache diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 561e3b3213..bae7d4b78b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs @@ -398,6 +398,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_Vector llWind(LSL_Vector offset); LSL_String llXorBase64Strings(string str1, string str2); LSL_String llXorBase64StringsCorrect(string str1, string str2); + LSL_Integer llGetLinkNumberOfSides(LSL_Integer link); void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); LSL_List GetLinkPrimitiveParamsEx(LSL_Key prim, LSL_List rules); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index f14967e237..7c26824197 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -1849,5 +1849,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_LSL_Functions.llClearPrimMedia(face); } + + public LSL_Integer llGetLinkNumberOfSides(LSL_Integer link) + { + return m_LSL_Functions.llGetLinkNumberOfSides(link); + } } } From cf78f3fae311be4aa4c0ab37d2a7c8b6679fb22d Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 25 Oct 2010 00:53:38 +0200 Subject: [PATCH 2/2] Comment repeated add and remove of avatars from the physical scene. It's no longer needed. --- .../Region/Framework/Scenes/ScenePresence.cs | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 618f4258eb..7bf0a999d9 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2865,22 +2865,28 @@ namespace OpenSim.Region.Framework.Scenes { lock (m_syncRoot) { - if (m_physicsActor != null) - { - if (!IsChildAgent) - { - // This may seem like it's redundant, remove the avatar from the physics scene - // just to add it back again, but it saves us from having to update - // 3 variables 10 times a second. - bool flyingTemp = m_physicsActor.Flying; - RemoveFromPhysicalScene(); - //m_scene.PhysicsScene.RemoveAvatar(m_physicsActor); - - //PhysicsActor = null; - - AddToPhysicalScene(flyingTemp); - } - } +// MT: Commented this because it's no longer needed. +// It used to be that the avatar height was calculated from the visual +// params, so any call to this method could change the physical actor's +// height. Now the height is supplied in the agent circuit data and never +// changes here. So, we can leave physics alone. +// +// if (m_physicsActor != null) +// { +// if (!IsChildAgent) +// { +// // This may seem like it's redundant, remove the avatar from the physics scene +// // just to add it back again, but it saves us from having to update +// // 3 variables 10 times a second. +// bool flyingTemp = m_physicsActor.Flying; +// RemoveFromPhysicalScene(); +// //m_scene.PhysicsScene.RemoveAvatar(m_physicsActor); +// +// //PhysicsActor = null; +// +// AddToPhysicalScene(flyingTemp); +// } +// } #region Bake Cache Check