From 78fa544f0d12d1c946f0b81200167f79aa83f9fc Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 27 Aug 2016 19:25:47 +0100 Subject: experimental function. Results still too volatile to be usefull --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 19 +++++++++++++++++++ .../Shared/Api/Implementation/OSSL_Api.cs | 12 ++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 3 +-- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index cdf97b6..bf78c3f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -5408,5 +5408,24 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter Acceleration = Vector3.Zero; APIDActive = false; } + + // handle osVolumeDetect + public void ScriptSetVolumeDetect(bool makeVolumeDetect) + { + if(_parentID == 0) + { + // if root prim do it via SOG + ParentGroup.ScriptSetVolumeDetect(makeVolumeDetect); + return; + } + + bool wasUsingPhysics = ((Flags & PrimFlags.Physics) != 0); + bool wasTemporary = ((Flags & PrimFlags.TemporaryOnRez) != 0); + bool wasPhantom = ((Flags & PrimFlags.Phantom) != 0); + + if(PhysActor != null) + PhysActor.Building = true; + UpdatePrimFlags(wasUsingPhysics,wasTemporary,wasPhantom,makeVolumeDetect,false); + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 32405d7..6168fe0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -4279,5 +4279,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else m_host.CollisionSoundType = -1; } + + // still not very usefull, detector is lost on rez, restarts, etc + public void osVolumeDetect(int detect) + { + m_host.AddScriptLPS(1); + + if (m_host.ParentGroup == null || m_host.ParentGroup.IsDeleted || m_host.ParentGroup.IsAttachment) + return; + + m_host.ScriptSetVolumeDetect(detect != 0); + } + } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 8851e5f..5ce859e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -477,5 +477,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_String osRequestURL(LSL_List options); LSL_String osRequestSecureURL(LSL_List options); void osCollisionSound(string impact_sound, double impact_volume); + void osVolumeDetect(int detect); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 164c5cb..c5cb88e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -1094,11 +1094,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { m_OSSL_Functions.osCollisionSound(impact_sound, impact_volume); } -/* + public void osVolumeDetect(int detect) { m_OSSL_Functions.osVolumeDetect(detect); } -*/ } } -- cgit v1.1