diff --git a/src/math/Vector2.js b/src/math/Vector2.js index 7d1f1fa0891f00c264414319791a2bc7a197e6a7..fdb7fa092bdd512118e98715a28e40e710bd8851 100644 --- a/src/math/Vector2.js +++ b/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; diff --git a/src/math/Vector3.js b/src/math/Vector3.js index cc6d08cad41c88b6d1add4e0d8c71c1ad2a4290c..c4272ad2f9db45f3283f55c4c86d5c54de9a0abe 100644 --- a/src/math/Vector3.js +++ b/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; diff --git a/src/math/Vector4.js b/src/math/Vector4.js index bb9cca1322e99c521a51d0d889c5af66a5d5436a..81319d605f04ebea684a7597fcbd502224b7c971 100644 --- a/src/math/Vector4.js +++ b/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;