From 3b334a3f401bce0fb3af8c3a6971ff7ac89d3b2f Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Sun, 16 May 2010 17:30:46 +0100 Subject: [PATCH] VectorX.set() --- src/core/Vector2.js | 6 ++++++ src/core/Vector3.js | 7 +++++++ src/core/Vector4.js | 8 ++++++++ 3 files changed, 21 insertions(+) diff --git a/src/core/Vector2.js b/src/core/Vector2.js index 4c22b8f7c8..980af93837 100755 --- a/src/core/Vector2.js +++ b/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; diff --git a/src/core/Vector3.js b/src/core/Vector3.js index eb4972b8d1..18154ed4f3 100755 --- a/src/core/Vector3.js +++ b/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; diff --git a/src/core/Vector4.js b/src/core/Vector4.js index 2c4f5fd37b..a1a52dd3cd 100644 --- a/src/core/Vector4.js +++ b/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; -- GitLab