Browse Source

Update vector2 to add divide and multiply.

fixes #4477
author: @WestLangley
gero3 11 years ago
parent
commit
9ef56d921f
1 changed files with 18 additions and 0 deletions
  1. 18 0
      src/math/Vector2.js

+ 18 - 0
src/math/Vector2.js

@@ -133,6 +133,15 @@ THREE.Vector2.prototype = {
 		return this;
 		return this;
 
 
 	},
 	},
+	
+	multiply: function ( v ) {
+
+		this.x *= v.x;
+		this.y *= v.y;
+
+		return this;
+
+	},
 
 
 	multiplyScalar: function ( s ) {
 	multiplyScalar: function ( s ) {
 
 
@@ -143,6 +152,15 @@ THREE.Vector2.prototype = {
 
 
 	},
 	},
 
 
+	divide: function ( v ) {
+
+		this.x /= v.x;
+		this.y /= v.y;
+
+		return this;
+
+	},
+
 	divideScalar: function ( scalar ) {
 	divideScalar: function ( scalar ) {
 
 
 		if ( scalar !== 0 ) {
 		if ( scalar !== 0 ) {