16 lines
315 B
C#
16 lines
315 B
C#
using CSNetwork.GPDataType;
|
|
using UnityEngine;
|
|
|
|
public class A3DFuncs
|
|
{
|
|
// Returns vector with same direction and unit length
|
|
public static A3DVECTOR3 a3d_Normalize(A3DVECTOR3 v)
|
|
{
|
|
float mag = v.Magnitude();
|
|
if (mag< 1e-12 && mag> -1e-12)
|
|
return new A3DVECTOR3(0.0f);
|
|
else
|
|
return v / mag;
|
|
}
|
|
}
|