aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
diff options
context:
space:
mode:
authorJeff Ames2008-03-11 22:15:28 +0000
committerJeff Ames2008-03-11 22:15:28 +0000
commit6da664edbead5d0a39a830b9ce8688e064e6fc8f (patch)
tree5cb5b7d8ee373b9af32940d7f8116013848eda08 /OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
parentUpdate svn properties. (diff)
downloadopensim-SC-6da664edbead5d0a39a830b9ce8688e064e6fc8f.zip
opensim-SC-6da664edbead5d0a39a830b9ce8688e064e6fc8f.tar.gz
opensim-SC-6da664edbead5d0a39a830b9ce8688e064e6fc8f.tar.bz2
opensim-SC-6da664edbead5d0a39a830b9ce8688e064e6fc8f.tar.xz
Refactor out some duplicate code.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs')
-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 e332f0f..e64fb36 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 Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z); 194 return LSL_Types.Vector3.Mag(v);
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 = Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z); 200 double mag = LSL_Types.Vector3.Mag(v);
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;