aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE/src/core/script/math/vec4.js
diff options
context:
space:
mode:
authorKris Kowal2012-07-06 11:52:06 -0700
committerKris Kowal2012-07-06 15:01:48 -0700
commit648ee61ae84216d0236e0dbc211addc13b2cfa3a (patch)
tree8f0f55557bd0c47a84e49c1977c950645d284607 /js/helper-classes/RDGE/src/core/script/math/vec4.js
parentaedd14b18695d031f695d27dfbd94df5614495bb (diff)
downloadninja-648ee61ae84216d0236e0dbc211addc13b2cfa3a.tar.gz
Expand tabs
Diffstat (limited to 'js/helper-classes/RDGE/src/core/script/math/vec4.js')
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/math/vec4.js46
1 files changed, 23 insertions, 23 deletions
diff --git a/js/helper-classes/RDGE/src/core/script/math/vec4.js b/js/helper-classes/RDGE/src/core/script/math/vec4.js
index 53759d6e..3c2d96e7 100755
--- a/js/helper-classes/RDGE/src/core/script/math/vec4.js
+++ b/js/helper-classes/RDGE/src/core/script/math/vec4.js
@@ -34,9 +34,9 @@ POSSIBILITY OF SUCH DAMAGE.
34* containing at least 4 numeric components can represent a 4D vector. 34* containing at least 4 numeric components can represent a 4D vector.
35* 35*
36* For example, all of these are valid RDGE.vec4 declarations: 36* For example, all of these are valid RDGE.vec4 declarations:
37* var a = [0, 0, 0, 1]; 37* var a = [0, 0, 0, 1];
38* var b = RDGE.RDGE.vec4.identity(); 38* var b = RDGE.RDGE.vec4.identity();
39* var c = RDGE.RDGE.vec4.zero(); 39* var c = RDGE.RDGE.vec4.zero();
40* 40*
41*/ 41*/
42var RDGE = RDGE || {}; 42var RDGE = RDGE || {};
@@ -139,9 +139,9 @@ RDGE.vec4.random = function (min, max) {
139*/ 139*/
140RDGE.vec4.add = function (a, b) { 140RDGE.vec4.add = function (a, b) {
141 return [a[0] + b[0], 141 return [a[0] + b[0],
142 a[1] + b[1], 142 a[1] + b[1],
143 a[2] + b[2], 143 a[2] + b[2],
144 a[3] + b[3]]; 144 a[3] + b[3]];
145}; 145};
146 146
147/** 147/**
@@ -149,9 +149,9 @@ RDGE.vec4.add = function (a, b) {
149*/ 149*/
150RDGE.vec4.sub = function (a, b) { 150RDGE.vec4.sub = function (a, b) {
151 return [a[0] - b[0], 151 return [a[0] - b[0],
152 a[1] - b[1], 152 a[1] - b[1],
153 a[2] - b[2], 153 a[2] - b[2],
154 a[3] - b[3]]; 154 a[3] - b[3]];
155}; 155};
156 156
157/** 157/**
@@ -159,9 +159,9 @@ RDGE.vec4.sub = function (a, b) {
159*/ 159*/
160RDGE.vec4.mul = function (a, b) { 160RDGE.vec4.mul = function (a, b) {
161 return [a[0] * b[0], 161 return [a[0] * b[0],
162 a[1] * b[1], 162 a[1] * b[1],
163 a[2] * b[2], 163 a[2] * b[2],
164 a[3] * b[3]]; 164 a[3] * b[3]];
165}; 165};
166 166
167/** 167/**
@@ -217,9 +217,9 @@ RDGE.vec4.normalize = function (v) {
217*/ 217*/
218RDGE.vec4.lengthSq = function (v) { 218RDGE.vec4.lengthSq = function (v) {
219 return v[0] * v[0] + 219 return v[0] * v[0] +
220 v[1] * v[1] + 220 v[1] * v[1] +
221 v[2] * v[2] + 221 v[2] * v[2] +
222 v[3] * v[3]; 222 v[3] * v[3];
223}; 223};
224 224
225/** 225/**
@@ -227,9 +227,9 @@ RDGE.vec4.lengthSq = function (v) {
227*/ 227*/
228RDGE.vec4.length = function (v) { 228RDGE.vec4.length = function (v) {
229 return Math.sqrt(v[0] * v[0] + 229 return Math.sqrt(v[0] * v[0] +
230 v[1] * v[1] + 230 v[1] * v[1] +
231 v[2] * v[2] + 231 v[2] * v[2] +
232 v[3] * v[3]); 232 v[3] * v[3]);
233}; 233};
234 234
235/** 235/**
@@ -275,9 +275,9 @@ RDGE.vec4.equal = function (a, b, t) {
275*/ 275*/
276RDGE.vec4.lerp = function (a, b, t) { 276RDGE.vec4.lerp = function (a, b, t) {
277 return [ 277 return [
278 a[0] + (b[0] - a[0]) * t, 278 a[0] + (b[0] - a[0]) * t,
279 a[1] + (b[1] - a[1]) * t, 279 a[1] + (b[1] - a[1]) * t,
280 a[2] + (b[2] - a[2]) * t, 280 a[2] + (b[2] - a[2]) * t,
281 a[3] + (b[3] - a[3]) * t 281 a[3] + (b[3] - a[3]) * t
282 ]; 282 ];
283}; 283};