diff options
author | SignpostMarv | 2012-08-18 01:17:01 +0100 |
---|---|---|
committer | Melanie | 2012-08-18 13:21:55 +0100 |
commit | 5d7751da891360c665622562f06a15e02fea4922 (patch) | |
tree | 7c0439407e246f298c8258a4b4c4e37c27fd92eb /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC-5d7751da891360c665622562f06a15e02fea4922.zip opensim-SC-5d7751da891360c665622562f06a15e02fea4922.tar.gz opensim-SC-5d7751da891360c665622562f06a15e02fea4922.tar.bz2 opensim-SC-5d7751da891360c665622562f06a15e02fea4922.tar.xz |
refactoring for Vector3 operator & constructor tweaks
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins')
-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)); |