From 5d7751da891360c665622562f06a15e02fea4922 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 18 Aug 2012 01:17:01 +0100 Subject: refactoring for Vector3 operator & constructor tweaks --- OpenSim/Region/ScriptEngine/Shared/Helpers.cs | 28 +++++++++------------------ 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Helpers.cs') diff --git a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs index 0108f44..5a58f73 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs @@ -160,11 +160,11 @@ namespace OpenSim.Region.ScriptEngine.Shared else { // Set the values from the touch data provided by the client - touchST = new LSL_Types.Vector3(value.STCoord.X, value.STCoord.Y, value.STCoord.Z); - touchUV = new LSL_Types.Vector3(value.UVCoord.X, value.UVCoord.Y, value.UVCoord.Z); - touchNormal = new LSL_Types.Vector3(value.Normal.X, value.Normal.Y, value.Normal.Z); - touchBinormal = new LSL_Types.Vector3(value.Binormal.X, value.Binormal.Y, value.Binormal.Z); - touchPos = new LSL_Types.Vector3(value.Position.X, value.Position.Y, value.Position.Z); + touchST = new LSL_Types.Vector3(value.STCoord); + touchUV = new LSL_Types.Vector3(value.UVCoord); + touchNormal = new LSL_Types.Vector3(value.Normal); + touchBinormal = new LSL_Types.Vector3(value.Binormal); + touchPos = new LSL_Types.Vector3(value.Position); touchFace = value.FaceIndex; } } @@ -181,19 +181,13 @@ namespace OpenSim.Region.ScriptEngine.Shared Name = presence.Firstname + " " + presence.Lastname; Owner = Key; - Position = new LSL_Types.Vector3( - presence.AbsolutePosition.X, - presence.AbsolutePosition.Y, - presence.AbsolutePosition.Z); + Position = new LSL_Types.Vector3(presence.AbsolutePosition); Rotation = new LSL_Types.Quaternion( presence.Rotation.X, presence.Rotation.Y, presence.Rotation.Z, presence.Rotation.W); - Velocity = new LSL_Types.Vector3( - presence.Velocity.X, - presence.Velocity.Y, - presence.Velocity.Z); + Velocity = new LSL_Types.Vector3(presence.Velocity); if (presence.PresenceType != PresenceType.Npc) { @@ -241,16 +235,12 @@ namespace OpenSim.Region.ScriptEngine.Shared } } - Position = new LSL_Types.Vector3(part.AbsolutePosition.X, - part.AbsolutePosition.Y, - part.AbsolutePosition.Z); + Position = new LSL_Types.Vector3(part.AbsolutePosition); Quaternion wr = part.ParentGroup.GroupRotation; Rotation = new LSL_Types.Quaternion(wr.X, wr.Y, wr.Z, wr.W); - Velocity = new LSL_Types.Vector3(part.Velocity.X, - part.Velocity.Y, - part.Velocity.Z); + Velocity = new LSL_Types.Vector3(part.Velocity); } } -- cgit v1.1