diff options
Diffstat (limited to 'js/helper-classes/RDGE/src/core/script/math')
5 files changed, 32 insertions, 32 deletions
diff --git a/js/helper-classes/RDGE/src/core/script/math/mat4.js b/js/helper-classes/RDGE/src/core/script/math/mat4.js index e2907272..d5cd7039 100755 --- a/js/helper-classes/RDGE/src/core/script/math/mat4.js +++ b/js/helper-classes/RDGE/src/core/script/math/mat4.js | |||
@@ -29,8 +29,8 @@ POSSIBILITY OF SUCH DAMAGE. | |||
29 | </copyright> */ | 29 | </copyright> */ |
30 | 30 | ||
31 | /** | 31 | /** |
32 | * This library contains functions for operating on 4x4 matrices. Any JS array | 32 | * This library contains functions for operating on 4x4 matrices. Any JS array |
33 | * containing at least 16 numeric components can represent a 4x4 matrix. | 33 | * containing at least 16 numeric components can represent a 4x4 matrix. |
34 | * | 34 | * |
35 | * For example, all of these are valid matrix construction methods: | 35 | * For example, all of these are valid matrix construction methods: |
36 | * ... | 36 | * ... |
@@ -39,15 +39,15 @@ POSSIBILITY OF SUCH DAMAGE. | |||
39 | * var c = mat4.lookAt( [0, 0, 0], [1, 0, 0], [ 0, 1, 0 ] ); | 39 | * var c = mat4.lookAt( [0, 0, 0], [1, 0, 0], [ 0, 1, 0 ] ); |
40 | * var d = mat4.basis( [1, 0, 0], [0, 1, 0], [ 0, 0, 1 ] ); | 40 | * var d = mat4.basis( [1, 0, 0], [0, 1, 0], [ 0, 0, 1 ] ); |
41 | * | 41 | * |
42 | * This library is implemented assuming components are arranged | 42 | * This library is implemented assuming components are arranged |
43 | * contiguously in memory as such: | 43 | * contiguously in memory as such: |
44 | * M = [ x0, x1, x2, x3, | 44 | * M = [ x0, x1, x2, x3, |
45 | * y0, y1, y2, y3, | 45 | * y0, y1, y2, y3, |
46 | * z0, z1, z2, z3, | 46 | * z0, z1, z2, z3, |
47 | * w0, w1, w2, w3 ]; | 47 | * w0, w1, w2, w3 ]; |
48 | * The translation components of a transformation matrix would be stored in | 48 | * The translation components of a transformation matrix would be stored in |
49 | * w0, w1, w2, or at indices 12, 13, and 14 of the array, as is consistent | 49 | * w0, w1, w2, or at indices 12, 13, and 14 of the array, as is consistent |
50 | * with OpenGL. | 50 | * with OpenGL. |
51 | */ | 51 | */ |
52 | // RDGE namespaces | 52 | // RDGE namespaces |
53 | var RDGE = RDGE || {}; | 53 | var RDGE = RDGE || {}; |
@@ -81,7 +81,7 @@ RDGE.mat4.toCSSString = function (m, conversionConstant) { | |||
81 | 81 | ||
82 | /** | 82 | /** |
83 | * RDGE.mat4.verify | 83 | * RDGE.mat4.verify |
84 | * This function is provided for debugging purposes only. It is not recommended | 84 | * This function is provided for debugging purposes only. It is not recommended |
85 | * to be used in performance critical areas of the code. | 85 | * to be used in performance critical areas of the code. |
86 | */ | 86 | */ |
87 | RDGE.mat4.verify = function (m) { | 87 | RDGE.mat4.verify = function (m) { |
@@ -231,10 +231,10 @@ RDGE.mat4.angleAxis = function (angle, axis) { | |||
231 | RDGE.mat4.lookAt = function (eye, at, up) { | 231 | RDGE.mat4.lookAt = function (eye, at, up) { |
232 | /* | 232 | /* |
233 | var w_axis = new RDGE.vec3(posVec.x, posVec.y, posVec.z); | 233 | var w_axis = new RDGE.vec3(posVec.x, posVec.y, posVec.z); |
234 | 234 | ||
235 | var z_axis = subVec3(targetVec, w_axis); | 235 | var z_axis = subVec3(targetVec, w_axis); |
236 | z_axis.normalize(); | 236 | z_axis.normalize(); |
237 | 237 | ||
238 | var x_axis = crossVec3(upVec, z_axis); | 238 | var x_axis = crossVec3(upVec, z_axis); |
239 | x_axis.normalize(); | 239 | x_axis.normalize(); |
240 | 240 | ||
@@ -522,7 +522,7 @@ RDGE.mat4._adjoint = function (m) { | |||
522 | */ | 522 | */ |
523 | RDGE.mat4.inverse = function (m) { | 523 | RDGE.mat4.inverse = function (m) { |
524 | // Calculate the 4x4 determinant | 524 | // Calculate the 4x4 determinant |
525 | // If the determinant is zero, | 525 | // If the determinant is zero, |
526 | // then the inverse matrix is not unique. | 526 | // then the inverse matrix is not unique. |
527 | var det = RDGE.mat4._det4x4(m); | 527 | var det = RDGE.mat4._det4x4(m); |
528 | 528 | ||
@@ -580,7 +580,7 @@ RDGE.mat4.transformPoint = function (m, v) { | |||
580 | m[1] * x + m[5] * y + m[9] * z + m[13] * w, | 580 | m[1] * x + m[5] * y + m[9] * z + m[13] * w, |
581 | m[2] * x + m[6] * y + m[10] * z + m[14] * w, | 581 | m[2] * x + m[6] * y + m[10] * z + m[14] * w, |
582 | m[3] * x + m[7] * y + m[11] * z + m[15] * w]; | 582 | m[3] * x + m[7] * y + m[11] * z + m[15] * w]; |
583 | // 12 adds, 16 multiplies, 16 lookups. | 583 | // 12 adds, 16 multiplies, 16 lookups. |
584 | }; | 584 | }; |
585 | 585 | ||
586 | /** | 586 | /** |
@@ -589,7 +589,7 @@ RDGE.mat4.transformPoint = function (m, v) { | |||
589 | RDGE.mat4.transformVector = function (m, v) { | 589 | RDGE.mat4.transformVector = function (m, v) { |
590 | m = RDGE.mat4.inverse(m); | 590 | m = RDGE.mat4.inverse(m); |
591 | var x = v[0], y = v[1], z = v[2], w = v.length >= 4 ? v[3] : 0.0; | 591 | var x = v[0], y = v[1], z = v[2], w = v.length >= 4 ? v[3] : 0.0; |
592 | // 12 adds, 16 multiplies, 16 lookups. | 592 | // 12 adds, 16 multiplies, 16 lookups. |
593 | // transpose multiply | 593 | // transpose multiply |
594 | return [m[0] * x + m[1] * y + m[2] * z + m[3] * w, | 594 | return [m[0] * x + m[1] * y + m[2] * z + m[3] * w, |
595 | m[4] * x + m[5] * y + m[6] * z + m[7] * w, | 595 | m[4] * x + m[5] * y + m[6] * z + m[7] * w, |
diff --git a/js/helper-classes/RDGE/src/core/script/math/quat.js b/js/helper-classes/RDGE/src/core/script/math/quat.js index d243a7ba..d3a3db5c 100755 --- a/js/helper-classes/RDGE/src/core/script/math/quat.js +++ b/js/helper-classes/RDGE/src/core/script/math/quat.js | |||
@@ -33,9 +33,9 @@ POSSIBILITY OF SUCH DAMAGE. | |||
33 | * RDGE.quat = {} | 33 | * RDGE.quat = {} |
34 | * This library contains utility functions for operating on quaternions. | 34 | * This library contains utility functions for operating on quaternions. |
35 | * -- | 35 | * -- |
36 | * TODO: | 36 | * TODO: |
37 | * -need to add more helper functions for generating quaternions from | 37 | * -need to add more helper functions for generating quaternions from |
38 | * other representations (i.e. - eulers, angle-axis). | 38 | * other representations (i.e. - eulers, angle-axis). |
39 | */ | 39 | */ |
40 | var RDGE = RDGE || {}; | 40 | var RDGE = RDGE || {}; |
41 | RDGE.quat = {}; | 41 | RDGE.quat = {}; |
diff --git a/js/helper-classes/RDGE/src/core/script/math/vec2.js b/js/helper-classes/RDGE/src/core/script/math/vec2.js index a003130d..e5c7df06 100755 --- a/js/helper-classes/RDGE/src/core/script/math/vec2.js +++ b/js/helper-classes/RDGE/src/core/script/math/vec2.js | |||
@@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. | |||
31 | 31 | ||
32 | /** | 32 | /** |
33 | * RDGE.vec2 = {} | 33 | * RDGE.vec2 = {} |
34 | * This library contains functions for operating on 2D vectors. | 34 | * This library contains functions for operating on 2D vectors. |
35 | * A 2D vector can be any array containing at least 2 numeric components. | 35 | * A 2D vector can be any array containing at least 2 numeric components. |
36 | * All of the following are valid methods for declaring a RDGE.vec2: | 36 | * All of the following are valid methods for declaring a RDGE.vec2: |
37 | * var a = [0, 1]; | 37 | * var a = [0, 1]; |
38 | * var b = RDGE.vec2.zero(); | 38 | * var b = RDGE.vec2.zero(); |
@@ -50,7 +50,7 @@ RDGE.vec2.string = function (v) { | |||
50 | 50 | ||
51 | /** | 51 | /** |
52 | * RDGE.vec2.verify | 52 | * RDGE.vec2.verify |
53 | * This function is provided for debugging purposes only. It is not recommended | 53 | * This function is provided for debugging purposes only. It is not recommended |
54 | * to be used in performance critical areas of the code. | 54 | * to be used in performance critical areas of the code. |
55 | */ | 55 | */ |
56 | RDGE.vec2.verify = function (v) { | 56 | RDGE.vec2.verify = function (v) { |
diff --git a/js/helper-classes/RDGE/src/core/script/math/vec3.js b/js/helper-classes/RDGE/src/core/script/math/vec3.js index 72662513..86d17e04 100755 --- a/js/helper-classes/RDGE/src/core/script/math/vec3.js +++ b/js/helper-classes/RDGE/src/core/script/math/vec3.js | |||
@@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. | |||
31 | 31 | ||
32 | /** | 32 | /** |
33 | * RDGE.vec3 = {} | 33 | * RDGE.vec3 = {} |
34 | * This library contains functions for operating on 3D vectors. Any JS array | 34 | * This library contains functions for operating on 3D vectors. Any JS array |
35 | * containing at least 3 numeric components can represent a 3D vector. | 35 | * containing at least 3 numeric components can represent a 3D vector. |
36 | * | 36 | * |
37 | * For example, all of these are valid RDGE.vec3 declarations: | 37 | * For example, all of these are valid RDGE.vec3 declarations: |
38 | * var a = [0, 0, 1]; | 38 | * var a = [0, 0, 1]; |
@@ -52,7 +52,7 @@ RDGE.vec3.string = function (v) { | |||
52 | 52 | ||
53 | /** | 53 | /** |
54 | * RDGE.vec3.verify | 54 | * RDGE.vec3.verify |
55 | * This function is provided for debugging purposes only. It is not recommended | 55 | * This function is provided for debugging purposes only. It is not recommended |
56 | * to be used in performance critical areas of the code. | 56 | * to be used in performance critical areas of the code. |
57 | */ | 57 | */ |
58 | RDGE.vec3.verify = function (v) { | 58 | RDGE.vec3.verify = function (v) { |
@@ -94,7 +94,7 @@ RDGE.vec3.translation = function (m) { | |||
94 | }; | 94 | }; |
95 | 95 | ||
96 | /** | 96 | /** |
97 | * RDGE.vec3.basisX = function( m ) | 97 | * RDGE.vec3.basisX = function( m ) |
98 | * description : returns a vector containing the translation vector of m. | 98 | * description : returns a vector containing the translation vector of m. |
99 | */ | 99 | */ |
100 | RDGE.vec3.basisX = function (m) { | 100 | RDGE.vec3.basisX = function (m) { |
@@ -102,7 +102,7 @@ RDGE.vec3.basisX = function (m) { | |||
102 | }; | 102 | }; |
103 | 103 | ||
104 | /** | 104 | /** |
105 | * RDGE.vec3.basisY = function( m ) | 105 | * RDGE.vec3.basisY = function( m ) |
106 | * description : returns a vector containing the translation vector of m. | 106 | * description : returns a vector containing the translation vector of m. |
107 | */ | 107 | */ |
108 | RDGE.vec3.basisY = function (m) { | 108 | RDGE.vec3.basisY = function (m) { |
@@ -110,7 +110,7 @@ RDGE.vec3.basisY = function (m) { | |||
110 | }; | 110 | }; |
111 | 111 | ||
112 | /** | 112 | /** |
113 | * RDGE.vec3.basisZ = function( m ) | 113 | * RDGE.vec3.basisZ = function( m ) |
114 | * description : returns a vector containing the translation vector of m. | 114 | * description : returns a vector containing the translation vector of m. |
115 | */ | 115 | */ |
116 | RDGE.vec3.basisZ = function (m) { | 116 | RDGE.vec3.basisZ = function (m) { |
@@ -155,14 +155,14 @@ RDGE.vec3.random = function (min, max) { | |||
155 | }; | 155 | }; |
156 | 156 | ||
157 | /** | 157 | /** |
158 | * RDGE.vec3.xy | 158 | * RDGE.vec3.xy |
159 | */ | 159 | */ |
160 | RDGE.vec3.xy = function (v) { | 160 |