Kaynağa Gözat

Merge pull request #9324 from Popov72/fix-isfrontfacingto-doc

Clarify Plane.isFrontFacingTo doc
David Catuhe 4 yıl önce
ebeveyn
işleme
3eaf64eb6c
1 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. 5 2
      src/Maths/math.plane.ts

+ 5 - 2
src/Maths/math.plane.ts

@@ -139,10 +139,13 @@ export class Plane {
     }
 
     /**
-     * Checks if the plane is facing a given direction
+     * Checks if the plane is facing a given direction (meaning if the plane's normal is pointing in the opposite direction of the given vector).
+     * Note that for this function to work as expected you should make sure that:
+     *   - direction and the plane normal are normalized
+     *   - epsilon is a number just bigger than -1, something like -0.99 for eg
      * @param direction the direction to check if the plane is facing
      * @param epsilon value the dot product is compared against (returns true if dot <= epsilon)
-     * @returns True is the vector "direction"  is the same side than the plane normal.
+     * @returns True if the plane is facing the given direction
      */
     public isFrontFacingTo(direction: DeepImmutable<Vector3>, epsilon: number): boolean {
         var dot = Vector3.Dot(this.normal, direction);