From fb84ff96a9ac7df564fb8f8242e0ff0d2638b438 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 18 Aug 2012 15:04:07 +0100 Subject: implicit operators mean one does not need to instantiate new objects manually --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 ++--- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs | 7 +++---- 2 files changed, 5 insertions(+), 7 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 4d542d50..87298e3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2231,8 +2231,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llRotTarget(LSL_Rotation rot, double error) { m_host.AddScriptLPS(1); - return m_host.ParentGroup.registerRotTargetWaypoint( - new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), (float)error); + return m_host.ParentGroup.registerRotTargetWaypoint(rot, (float)error); } public void llRotTargetRemove(int number) @@ -10531,7 +10530,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else rot = obj.GetWorldRotation(); - LSL_Rotation objrot = new LSL_Rotation(rot.X, rot.Y, rot.Z, rot.W); + LSL_Rotation objrot = new LSL_Rotation(rot); ret.Add(objrot); } break; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs index 929948b..84cf6ca 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs @@ -333,8 +333,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (type == typeof(OpenMetaverse.Quaternion)) { - LSL_Rotation rot = (LSL_Rotation)lslparm; - return new OpenMetaverse.Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s); + return (OpenMetaverse.Quaternion)((LSL_Rotation)lslparm); } } @@ -366,8 +365,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api result[i] = new UUID((LSL_Key)plist[i]); else if (plist[i] is LSL_Rotation) { - LSL_Rotation rot = (LSL_Rotation)plist[i]; - result[i] = new OpenMetaverse.Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s); + result[i] = (OpenMetaverse.Quaternion)( + (LSL_Rotation)plist[i]); } else if (plist[i] is LSL_Vector) { -- cgit v1.1