Browse Source

VectorX.set()

Mr.doob 15 years ago
parent
commit
3b334a3f40
3 changed files with 21 additions and 0 deletions
  1. 6 0
      src/core/Vector2.js
  2. 7 0
      src/core/Vector3.js
  3. 8 0
      src/core/Vector4.js

+ 6 - 0
src/core/Vector2.js

@@ -7,6 +7,12 @@ THREE.Vector2 = function (x, y) {
 	this.x = x || 0;
 	this.y = y || 0;
 	
+	this.set = function (x, y) {
+	
+		this.x = x;
+		this.y = y;
+	}	
+	
 	this.copy = function (v) {
 	
 		this.x = v.x;

+ 7 - 0
src/core/Vector3.js

@@ -9,6 +9,13 @@ THREE.Vector3 = function (x, y, z) {
 	this.y = y || 0;
 	this.z = z || 0;
 
+	this.set = function (x, y, z) {
+	
+		this.x = x;
+		this.y = y;
+		this.z = z;
+	}
+
 	this.copy = function (v) {
 	
 		this.x = v.x;

+ 8 - 0
src/core/Vector4.js

@@ -9,6 +9,14 @@ THREE.Vector4 = function (x, y, z, w) {
 	this.z = z || 0;
 	this.w = w || 1;
 
+	this.set = function (x, y, z, w) {
+	
+		this.x = x;
+		this.y = y;
+		this.z = z;
+		this.w = w;
+	}
+
 	this.copy = function (v) {
 	
 		this.x = v.x;