|
@@ -220,13 +220,15 @@ namespace bbiwarg.Utility
|
|
|
}
|
|
|
public static float distancePointPlane(Vector<T> point, Vector<T> planeA, Vector<T> planeB, Vector<T> planeC)
|
|
|
{
|
|
|
-
|
|
|
+ //TODO - Diese funktion funktioniert nur mit T = float,
|
|
|
+ //die normalisierte Normale einer Ebene macht nur mit floats sinn (werte zwischen 0 und 1)
|
|
|
if (point.length() != 3 || planeA.length() != 3 || planeB.length() != 3 || planeC.length() != 3)
|
|
|
throw new ArgumentException("The vectors' length should be 3");
|
|
|
|
|
|
Vector<T> ab = planeB - planeA;
|
|
|
Vector<T> ac = planeC - planeA;
|
|
|
Vector<T> normal = crossProduct(ab, ac).normalize();
|
|
|
+
|
|
|
|
|
|
Vector<T> temp = point - planeA;
|
|
|
temp = pointwiseMultiply(temp, normal);
|