浏览代码

-updated distancePointPlane

Anton Rohr 11 年之前
父节点
当前提交
8259b58200
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      bbiwarg/Utility/Vector.cs

+ 3 - 1
bbiwarg/Utility/Vector.cs

@@ -220,13 +220,15 @@ namespace bbiwarg.Utility
         }
         }
         public static float distancePointPlane(Vector<T> point, Vector<T> planeA, Vector<T> planeB, Vector<T> planeC)
         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)
             if (point.length() != 3 || planeA.length() != 3 || planeB.length() != 3 || planeC.length() != 3)
                 throw new ArgumentException("The vectors' length should be 3");
                 throw new ArgumentException("The vectors' length should be 3");
 
 
             Vector<T> ab = planeB - planeA;
             Vector<T> ab = planeB - planeA;
             Vector<T> ac = planeC - planeA;
             Vector<T> ac = planeC - planeA;
             Vector<T> normal = crossProduct(ab, ac).normalize();
             Vector<T> normal = crossProduct(ab, ac).normalize();
+            
 
 
             Vector<T> temp = point - planeA;
             Vector<T> temp = point - planeA;
             temp = pointwiseMultiply(temp, normal);
             temp = pointwiseMultiply(temp, normal);