diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index a626be8..7162226 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -428,9 +428,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
428 | try | 428 | try |
429 | { | 429 | { |
430 | Vector3 diff = toRegionPos - fromRegionPos; | 430 | Vector3 diff = toRegionPos - fromRegionPos; |
431 | LSL_Types.Vector3 obj_dir = new LSL_Types.Vector3(diff.X, diff.Y, diff.Z); | 431 | double dot = LSL_Types.Vector3.Dot(forward_dir, diff); |
432 | double dot = LSL_Types.Vector3.Dot(forward_dir, obj_dir); | 432 | double mag_obj = LSL_Types.Vector3.Mag(diff); |
433 | double mag_obj = LSL_Types.Vector3.Mag(obj_dir); | ||
434 | ang_obj = Math.Acos(dot / (mag_fwd * mag_obj)); | 433 | ang_obj = Math.Acos(dot / (mag_fwd * mag_obj)); |
435 | } | 434 | } |
436 | catch | 435 | catch |
@@ -560,8 +559,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
560 | double ang_obj = 0; | 559 | double ang_obj = 0; |
561 | try | 560 | try |
562 | { | 561 | { |
563 | Vector3 diff = toRegionPos - fromRegionPos; | 562 | LSL_Types.Vector3 obj_dir = new LSL_Types.Vector3( |
564 | LSL_Types.Vector3 obj_dir = new LSL_Types.Vector3(diff.X, diff.Y, diff.Z); | 563 | toRegionPos - fromRegionPos); |
565 | double dot = LSL_Types.Vector3.Dot(forward_dir, obj_dir); | 564 | double dot = LSL_Types.Vector3.Dot(forward_dir, obj_dir); |
566 | double mag_obj = LSL_Types.Vector3.Mag(obj_dir); | 565 | double mag_obj = LSL_Types.Vector3.Mag(obj_dir); |
567 | ang_obj = Math.Acos(dot / (mag_fwd * mag_obj)); | 566 | ang_obj = Math.Acos(dot / (mag_fwd * mag_obj)); |