Add math utility class

This commit is contained in:
Jarrod Doyle 2024-09-24 08:11:35 +01:00
parent 10a8a31520
commit ead1943820
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
using System.Numerics;
namespace KeepersCompound.Lightmapper;
public static class MathUtils
{
public static float DistanceFromPlane(Plane plane, Vector3 point)
{
return Math.Abs(Vector3.Dot(plane.Normal, point) + plane.D) / plane.Normal.Length();
}
}