These 2 files want to be committed.

0.7-release
Diva Canto 2010-07-08 16:07:37 -07:00
parent 5f932605dc
commit 9316e0b867
2 changed files with 10 additions and 10 deletions

View File

@ -450,7 +450,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Vector llVecNorm(LSL_Vector v) public LSL_Vector llVecNorm(LSL_Vector v)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
return LSL_Vector.Norm(v); return LSL_Vector.Norm(v);
} }

View File

@ -259,15 +259,15 @@ namespace OpenSim.Region.ScriptEngine.Shared
return Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z); return Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
} }
public static Vector3 Norm(Vector3 vector) public static Vector3 Norm(Vector3 vector)
{ {
double mag = Mag(vector); double mag = Mag(vector);
if (mag > 0.0) if (mag > 0.0)
{ {
double invMag = 1.0 / mag; double invMag = 1.0 / mag;
return vector * invMag; return vector * invMag;
} }
return new Vector3(0, 0, 0); return new Vector3(0, 0, 0);
} }
#endregion #endregion