mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
Refactor out some duplicate code.
This commit is contained in:
@@ -191,13 +191,13 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public double llVecMag(LSL_Types.Vector3 v)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
return Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
|
||||
return LSL_Types.Vector3.Mag(v);
|
||||
}
|
||||
|
||||
public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
double mag = Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
|
||||
double mag = LSL_Types.Vector3.Mag(v);
|
||||
LSL_Types.Vector3 nor = new LSL_Types.Vector3();
|
||||
nor.x = v.x / mag;
|
||||
nor.y = v.y / mag;
|
||||
|
||||
Reference in New Issue
Block a user