These 2 files want to be committed.
parent
5f932605dc
commit
9316e0b867
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue