llVecNorm() now returns a zero-length vector when one is supplied as input. Addresses Mantis #4752
parent
d06b75fe3b
commit
5f932605dc
|
@ -450,13 +450,8 @@ 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);
|
||||||
double mag = LSL_Vector.Mag(v);
|
return LSL_Vector.Norm(v);
|
||||||
LSL_Vector nor = new LSL_Vector();
|
|
||||||
nor.x = v.x / mag;
|
|
||||||
nor.y = v.y / mag;
|
|
||||||
nor.z = v.z / mag;
|
|
||||||
return nor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Float llVecDist(LSL_Vector a, LSL_Vector b)
|
public LSL_Float llVecDist(LSL_Vector a, LSL_Vector b)
|
||||||
|
|
Loading…
Reference in New Issue