ace/Source/ACE.Server/Physics/Common/Vector.cs
gmriggs 7d720df1fa
backporting support functions from 1991 (#2537)
* backporting support functions from 1991

* adding MoveToComplete shell function
2019-12-15 09:54:16 -05:00

25 lines
615 B
C#

using System;
using System.Numerics;
namespace ACE.Server.Physics.Common
{
public static class Vec
{
public static bool NormalizeCheckSmall(ref Vector3 v)
{
var dist = v.Length();
if (dist < PhysicsGlobals.EPSILON)
return true;
v *= 1.0f / dist;
return false;
}
public static bool IsZero(Vector3 v)
{
return Math.Abs(v.X) < PhysicsGlobals.EPSILON &&
Math.Abs(v.Y) < PhysicsGlobals.EPSILON &&
Math.Abs(v.Z) < PhysicsGlobals.EPSILON;
}
}
}