Browse Source

Added vector3.cross

David Catuhe 6 năm trước cách đây
mục cha
commit
2cd32a0293
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 10 0
      src/Maths/math.vector.ts

+ 10 - 0
src/Maths/math.vector.ts

@@ -1161,6 +1161,16 @@ export class Vector3 {
     }
 
     /**
+     * Returns a new Vector3 as the cross product of the current vector and the "other" one
+     * The cross product is then orthogonal to both current and "other"
+     * @param other defines the right operand
+     * @returns the cross product
+     */
+    public cross(other: Vector3) {
+        return Vector3.Cross(this, other);
+    }
+
+    /**
      * Normalize the current Vector3 with the given input length.
      * Please note that this is an in place operation.
      * @param len the length of the vector