mirror of
https://github.com/ACEmulator/ACE
synced 2026-08-17 12:26:06 -04:00
25 lines
615 B
C#
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;
|
|
}
|
|
}
|
|
}
|