aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index b744ee4..e332f0f 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -191,13 +191,13 @@ namespace OpenSim.Region.ScriptEngine.Common
191 public double llVecMag(LSL_Types.Vector3 v) 191 public double llVecMag(LSL_Types.Vector3 v)
192 { 192 {
193 m_host.AddScriptLPS(1); 193 m_host.AddScriptLPS(1);
194 return (v.x * v.x + v.y * v.y + v.z * v.z); 194 return Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
195 } 195 }
196 196
197 public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v) 197 public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v)
198 { 198 {
199 m_host.AddScriptLPS(1); 199 m_host.AddScriptLPS(1);
200 double mag = v.x * v.x + v.y * v.y + v.z * v.z; 200 double mag = Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
201 LSL_Types.Vector3 nor = new LSL_Types.Vector3(); 201 LSL_Types.Vector3 nor = new LSL_Types.Vector3();
202 nor.x = v.x / mag; 202 nor.x = v.x / mag;
203 nor.y = v.y / mag; 203 nor.y = v.y / mag;