2
0
Эх сурвалжийг харах

Vector*: Added setScalar.

Mr.doob 9 жил өмнө
parent
commit
af6a817751

+ 9 - 0
src/math/Vector2.js

@@ -33,6 +33,15 @@ THREE.Vector2.prototype = {
 
 	},
 
+	setScalar: function ( scalar ) {
+
+		this.x = scalar;
+		this.y = scalar;
+
+		return this;
+
+	},
+
 	setX: function ( x ) {
 
 		this.x = x;

+ 10 - 0
src/math/Vector3.js

@@ -29,6 +29,16 @@ THREE.Vector3.prototype = {
 
 	},
 
+	setScalar: function ( scalar ) {
+
+		this.x = scalar;
+		this.y = scalar;
+		this.z = scalar;
+
+		return this;
+
+	},
+
 	setX: function ( x ) {
 
 		this.x = x;

+ 11 - 0
src/math/Vector4.js

@@ -30,6 +30,17 @@ THREE.Vector4.prototype = {
 
 	},
 
+	setScalar: function ( scalar ) {
+
+		this.x = scalar;
+		this.y = scalar;
+		this.z = scalar;
+		this.w = scalar;
+
+		return this;
+
+	},
+
 	setX: function ( x ) {
 
 		this.x = x;