From e9153e1d1aae50024d8cd05fe14a9bce34343a0e Mon Sep 17 00:00:00 2001 From: teravus Date: Thu, 15 Nov 2012 10:05:16 -0500 Subject: Revert "Merge master into teravuswork", it should have been avination, not master. This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64. --- .../Shared/Api/Implementation/Plugins/SensorRepeat.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 4dd795d..678f9d5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -352,7 +352,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins q = avatar.Rotation; } - LSL_Types.Quaternion r = new LSL_Types.Quaternion(q); + LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); @@ -429,8 +429,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins try { Vector3 diff = toRegionPos - fromRegionPos; - double dot = LSL_Types.Vector3.Dot(forward_dir, diff); - double mag_obj = LSL_Types.Vector3.Mag(diff); + LSL_Types.Vector3 obj_dir = new LSL_Types.Vector3(diff.X, diff.Y, diff.Z); + double dot = LSL_Types.Vector3.Dot(forward_dir, obj_dir); + double mag_obj = LSL_Types.Vector3.Mag(obj_dir); ang_obj = Math.Acos(dot / (mag_fwd * mag_obj)); } catch @@ -482,7 +483,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins q = avatar.Rotation; } - LSL_Types.Quaternion r = new LSL_Types.Quaternion(q); + LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); bool attached = (SensePoint.ParentGroup.AttachmentPoint != 0); @@ -563,8 +564,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins double ang_obj = 0; try { - LSL_Types.Vector3 obj_dir = new LSL_Types.Vector3( - toRegionPos - fromRegionPos); + Vector3 diff = toRegionPos - fromRegionPos; + LSL_Types.Vector3 obj_dir = new LSL_Types.Vector3(diff.X, diff.Y, diff.Z); double dot = LSL_Types.Vector3.Dot(forward_dir, obj_dir); double mag_obj = LSL_Types.Vector3.Mag(obj_dir); ang_obj = Math.Acos(dot / (mag_fwd * mag_obj)); -- cgit v1.1