Browse Source

add cross method to Vector2

zhaoy 7 years ago
parent
commit
ceef48eedc
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/math/Vector2.js

+ 6 - 0
src/math/Vector2.js

@@ -353,6 +353,12 @@ Object.assign( Vector2.prototype, {
 
 	},
 
+	cross: function ( v ) {
+
+		return this.x * v.y - this.y * v.x;
+
+	},
+
 	lengthSq: function () {
 
 		return this.x * this.x + this.y * this.y;