aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authordahlia2009-09-07 17:12:17 -0700
committerdahlia2009-09-07 17:12:17 -0700
commit7a67b726d5be8b7eb7d04eabdb98dc4e3beb9d71 (patch)
treed51902a1fb958b235ea05cad381e38f70bd747e7 /OpenSim
parentOnly allow iar load/save if user is logged in to the region simulator (diff)
downloadopensim-SC-7a67b726d5be8b7eb7d04eabdb98dc4e3beb9d71.zip
opensim-SC-7a67b726d5be8b7eb7d04eabdb98dc4e3beb9d71.tar.gz
opensim-SC-7a67b726d5be8b7eb7d04eabdb98dc4e3beb9d71.tar.bz2
opensim-SC-7a67b726d5be8b7eb7d04eabdb98dc4e3beb9d71.tar.xz
random drive-by maths optimization in llRot2Euler() and llEuler2Rot()
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 16dd834..077315e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -497,9 +497,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
497 NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))), 497 NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))),
498 NormalizeAngle(Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s)))); 498 NormalizeAngle(Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s))));
499 else if (n > 0) 499 else if (n > 0)
500 return new LSL_Vector(0.0, Math.PI / 2, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); 500 return new LSL_Vector(0.0, Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)));
501 else 501 else
502 return new LSL_Vector(0.0, -Math.PI / 2, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); 502 return new LSL_Vector(0.0, -Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)));
503 } 503 }
504 504
505 /* From wiki: 505 /* From wiki:
@@ -553,12 +553,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
553 553
554 double x,y,z,s; 554 double x,y,z,s;
555 555
556 double c1 = Math.Cos(v.x/2.0); 556 double c1 = Math.Cos(v.x * 0.5);
557 double c2 = Math.Cos(v.y/2.0); 557 double c2 = Math.Cos(v.y * 0.5);
558 double c3 = Math.Cos(v.z/2.0); 558 double c3 = Math.Cos(v.z * 0.5);
559 double s1 = Math.Sin(v.x/2.0); 559 double s1 = Math.Sin(v.x * 0.5);
560 double s2 = Math.Sin(v.y/2.0); 560 double s2 = Math.Sin(v.y * 0.5);
561 double s3 = Math.Sin(v.z/2.0); 561 double s3 = Math.Sin(v.z * 0.5);
562 562
563 x = s1*c2*c3+c1*s2*s3; 563 x = s1*c2*c3+c1*s2*s3;
564 y = c1*s2*c3-s1*c2*s3; 564 y = c1*s2*c3-s1*c2*s3;