From 2bb5e985740b7c6aa75cd31aa057d39d56f024b6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 3 Apr 2017 17:19:28 +0100 Subject: add EXPERIMENTAL osObjectTeleport(LSL_Key objectUUID, LSL_Vector targetPos, LSL_Rotation rotation, LSL_Integer stop) --- .../Shared/Api/Implementation/OSSL_Api.cs | 46 ++++++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 2 + .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 4 ++ 3 files changed, 52 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 6c094ee..ddf5078 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -4418,6 +4418,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_List osGetInertiaData() { + m_host.AddScriptLPS(1); + LSL_List result = new LSL_List(); float TotalMass; Vector3 CenterOfMass; @@ -4463,6 +4465,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetInertia(LSL_Float mass, LSL_Vector centerOfMass, LSL_Vector principalInertiaScaled, LSL_Rotation lslrot) { + m_host.AddScriptLPS(1); SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) return; @@ -4499,6 +4502,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public void osSetInertiaAsBox(LSL_Float mass, LSL_Vector boxSize, LSL_Vector centerOfMass, LSL_Rotation lslrot) { + m_host.AddScriptLPS(1); + SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) return; @@ -4538,6 +4543,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, LSL_Vector centerOfMass) { + m_host.AddScriptLPS(1); SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) return; @@ -4575,6 +4581,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, LSL_Vector centerOfMass, LSL_Rotation lslrot) { + m_host.AddScriptLPS(1); SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) return; @@ -4611,11 +4618,50 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public void osClearInertia() { + m_host.AddScriptLPS(1); SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) return; sog.SetInertiaData(-1, Vector3.Zero, Vector3.Zero, Vector4.Zero ); } + + /// + /// teleports a object (full linkset) + /// + /// the id of the linkset to teleport + /// target position + /// a rotation to apply + /// if TRUE (!=0) stop at destination + /// + /// only does teleport local to region + /// object owner must have rights to run scripts on target location + /// object owner must have rights to enter ojects on target location + /// target location parcel must have enought free prims capacity for the linkset prims + /// all avatars siting on the object must have access to target location + /// has a cool down time. retries before expire reset it + /// fail conditions are silent ignored + /// + public void osObjectTeleport(LSL_Key objectUUID, LSL_Vector targetPos, LSL_Rotation rotation, LSL_Integer stop) + { + CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent"); + m_host.AddScriptLPS(1); + + UUID objUUID; + if (!UUID.TryParse(objectUUID, out objUUID)) + { + OSSLShoutError("osObjectTeleport() invalid object Key"); + return; + } + + SceneObjectGroup sog = World.GetSceneObjectGroup(objUUID); + if(sog== null || sog.IsDeleted) + return; + + UUID myid = m_host.ParentGroup.UUID; + + sog.ObjectTeleport(myid, targetPos, rotation, stop != 0); + // a delay here may break vehicles + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index f76ff7f..4722fed 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -495,5 +495,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void osSetInertiaAsBox(LSL_Float mass, vector boxSize, vector centerOfMass, rotation rot); void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, vector centerOfMass); void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, vector centerOfMass,rotation lslrot); + + void osObjectTeleport(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer stop); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 09337e5..37e7a17 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -1140,5 +1140,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_OSSL_Functions.osClearInertia(); } + public void osObjectTeleport(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer stop) + { + m_OSSL_Functions.osObjectTeleport(objectUUID, targetPos, targetrotation, stop); + } } } -- cgit v1.1