aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authoralondria2008-02-03 16:42:43 +0000
committeralondria2008-02-03 16:42:43 +0000
commitbc3d0217af85e61f26b9dd68d60093b766e9d71d (patch)
tree3d07b8a1388991f87f44228732a568103d2d9435 /OpenSim/Region/ScriptEngine
parentTemporarily disabled shared threads because of a bug. Script were only workin... (diff)
downloadopensim-SC-bc3d0217af85e61f26b9dd68d60093b766e9d71d.zip
opensim-SC-bc3d0217af85e61f26b9dd68d60093b766e9d71d.tar.gz
opensim-SC-bc3d0217af85e61f26b9dd68d60093b766e9d71d.tar.bz2
opensim-SC-bc3d0217af85e61f26b9dd68d60093b766e9d71d.tar.xz
Added llRot2Fwd, llRot2Left, and llRot2Up as well as explicit vector->string casting.
(Thanks to dalien on informing me how easy the math was for these).
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_Types.cs5
2 files changed, 8 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 9d228fa..3d5f106 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -245,17 +245,17 @@ namespace OpenSim.Region.ScriptEngine.Common
245 245
246 public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r) 246 public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r)
247 { 247 {
248 return new LSL_Types.Vector3(); 248 return (new LSL_Types.Vector3(1,0,0) * r);
249 } 249 }
250 250
251 public LSL_Types.Vector3 llRot2Left(LSL_Types.Quaternion r) 251 public LSL_Types.Vector3 llRot2Left(LSL_Types.Quaternion r)
252 { 252 {
253 return new LSL_Types.Vector3(); 253 return (new LSL_Types.Vector3(0, 1, 0) * r);
254 } 254 }
255 255
256 public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) 256 public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r)
257 { 257 {
258 return new LSL_Types.Vector3(); 258 return (new LSL_Types.Vector3(0, 0, 1) * r);
259 } 259 }
260 public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b) 260 public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b)
261 { 261 {
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
index bbdd4ee..fc0e282 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
@@ -80,6 +80,11 @@ namespace OpenSim.Region.ScriptEngine.Common
80 return "<" + x.ToString() + ", " + y.ToString() + ", " + z.ToString() + ">"; 80 return "<" + x.ToString() + ", " + y.ToString() + ", " + z.ToString() + ">";
81 } 81 }
82 82
83 public static explicit operator string(Vector3 vec)
84 {
85 return "<" + vec.x.ToString() + ", " + vec.y.ToString() + ", " + vec.z.ToString() + ">";
86 }
87
83 public static bool operator ==(Vector3 lhs, Vector3 rhs) 88 public static bool operator ==(Vector3 lhs, Vector3 rhs)
84 { 89 {
85 return (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z); 90 return (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z);