diff --git a/KeepersCompound.Lightmapper/MathUtils.cs b/KeepersCompound.Lightmapper/MathUtils.cs new file mode 100644 index 0000000..853167b --- /dev/null +++ b/KeepersCompound.Lightmapper/MathUtils.cs @@ -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(); + } +} \ No newline at end of file