From 060350832ae0be015182a3516a718dfdf030b56c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 5 Nov 2016 16:50:41 +0000 Subject: add suport for PRIM_SIT_TARGET on get(link)PrimitveParameters and fix typos --- .../Shared/Api/Implementation/LSL_Api.cs | 27 ++++++++++++++++------ .../Shared/Api/Runtime/LSL_Constants.cs | 9 ++++---- 2 files changed, 24 insertions(+), 12 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ced81ad..91b49cd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -662,15 +662,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api List ret = new List(); if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) return ret; - ret.Add(part); switch (linkType) { case ScriptBaseClass.LINK_SET: return new List(part.ParentGroup.Parts); - case ScriptBaseClass.LINK_ROOT: - ret = new List(); + case ScriptBaseClass.LINK_ROOT: ret.Add(part.ParentGroup.RootPart); return ret; @@ -690,16 +688,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return ret; case ScriptBaseClass.LINK_THIS: + ret.Add(part); return ret; default: if (linkType < 0) - return new List(); + return ret; SceneObjectPart target = part.ParentGroup.GetLinkNumPart(linkType); if (target == null) - return new List(); - ret = new List(); + return ret; ret.Add(target); return ret; } @@ -11182,7 +11180,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api res.Add(new LSL_Float(spin)); res.Add(new LSL_Float(gain)); break; - + + case (int)ScriptBaseClass.PRIM_SIT_TARGET: + if(part.IsSitTargetSet) + { + res.Add(new LSL_Integer(1)); + res.Add(new LSL_Vector(part.SitTargetPosition)); + res.Add(new LSL_Rotation(part.SitTargetOrientation)); + } + else + { + res.Add(new LSL_Integer(0)); + res.Add(new LSL_Vector(Vector3.Zero)); + res.Add(new LSL_Rotation(Quaternion.Identity)); + } + break; + case (int)ScriptBaseClass.PRIM_LINK_TARGET: // TODO: Should be issuing a runtime script warning in this case. diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 1a3de1e..bc4d20c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -339,7 +339,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase // LINK flags public const int LINK_SET = -1; - public const int LINK_TRUEROOT = 0; // possible this should had been ROOT all the time public const int LINK_ROOT = 1; public const int LINK_ALL_OTHERS = -2; public const int LINK_ALL_CHILDREN = -3; @@ -418,7 +417,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int PRIM_DESC = 28; public const int PRIM_ROT_LOCAL = 29; public const int PRIM_PHYSICS_SHAPE_TYPE = 30; - public const int PRIM_PHYSICS_MATERIAL = 31; // aparently not SL + public const int PRIM_PHYSICS_MATERIAL = 31; // apparently not on SL wiki public const int PRIM_OMEGA = 32; public const int PRIM_POS_LOCAL = 33; public const int PRIM_LINK_TARGET = 34; @@ -426,9 +425,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int PRIM_SPECULAR = 36; public const int PRIM_NORMAL = 37; public const int PRIM_ALPHA_MODE = 38; - public const int PRIM_ALLOW_UNSIT = 39; // experiences related. Unsuport - public const int PRIM_SCRIPTED_SIT_ONLY = 40; // experiences related. Unsuport - public const int PRIM_SIT_TARGET = 40; + public const int PRIM_ALLOW_UNSIT = 39; // experiences related. unsupported + public const int PRIM_SCRIPTED_SIT_ONLY = 40; // experiences related. unsupported + public const int PRIM_SIT_TARGET = 41; // parameters -- cgit v1.1