aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/vec-utils.js
diff options
context:
space:
mode:
authorJohn Mayhew2012-04-02 16:28:39 -0700
committerJohn Mayhew2012-04-02 16:28:39 -0700
commitb4155fb4c33675a8a7cd37473513718043fdf0ba (patch)
tree3d8c802473f2395d53d599ec9d8b70b60a4db50c /js/helper-classes/3D/vec-utils.js
parent5ba9aeac94c86049423fd5d4b37b277263939c13 (diff)
parentc6de22bf42be90b403491b5f87b1818d9020310c (diff)
downloadninja-b4155fb4c33675a8a7cd37473513718043fdf0ba.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts: js/helper-classes/RDGE/rdge-compiled.js js/helper-classes/RDGE/runtime/GLRuntime.js js/helper-classes/RDGE/src/core/script/MeshManager.js js/helper-classes/RDGE/src/core/script/engine.js js/helper-classes/RDGE/src/core/script/fx/ssao.js js/helper-classes/RDGE/src/core/script/init_state.js js/helper-classes/RDGE/src/core/script/run_state.js js/helper-classes/RDGE/src/core/script/scenegraphNodes.js js/helper-classes/RDGE/src/core/script/utilities.js js/helper-classes/RDGE/src/tools/compile-rdge-core.bat js/helper-classes/RDGE/src/tools/compile-rdge-core.sh js/helper-classes/RDGE/src/tools/rdge-compiled.js js/lib/drawing/world.js js/lib/rdge/materials/bump-metal-material.js js/lib/rdge/materials/deform-material.js js/lib/rdge/materials/flat-material.js js/lib/rdge/materials/fly-material.js js/lib/rdge/materials/julia-material.js js/lib/rdge/materials/keleidoscope-material.js js/lib/rdge/materials/linear-gradient-material.js js/lib/rdge/materials/mandel-material.js js/lib/rdge/materials/plasma-material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/radial-blur-material.js js/lib/rdge/materials/radial-gradient-material.js js/lib/rdge/materials/relief-tunnel-material.js js/lib/rdge/materials/square-tunnel-material.js js/lib/rdge/materials/star-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/tunnel-material.js js/lib/rdge/materials/twist-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/uber-material.js js/lib/rdge/materials/water-material.js js/lib/rdge/materials/z-invert-material.js js/preloader/Preloader.js
Diffstat (limited to 'js/helper-classes/3D/vec-utils.js')
-rwxr-xr-xjs/helper-classes/3D/vec-utils.js71
1 files changed, 70 insertions, 1 deletions
diff --git a/js/helper-classes/3D/vec-utils.js b/js/helper-classes/3D/vec-utils.js
index 3db95ab7..4eacd856 100755
--- a/js/helper-classes/3D/vec-utils.js
+++ b/js/helper-classes/3D/vec-utils.js
@@ -191,5 +191,74 @@ var VecUtils = exports.VecUtils = Object.create(Object.prototype,
191 191
192 return vec; 192 return vec;
193 } 193 }
194 } 194 },
195
196 matI :
197 {
198 value: function(dimen)
199 {
200 var mat = [];
201 for (var i=0; i<dimen*dimen; i++) mat.push(0);
202
203 var index = 0;
204 for (var i=0; i<dimen; i++)
205 {
206 mat[index] = 1.0;
207 index += dimen + 1;
208 }
209
210 return mat;
211 }
212 },
213
214 matTranslation:
215 {
216 value: function (vec)
217 {
218 var mat = Matrix.I(4);
219 glmat4.translate(mat, vec);
220 return mat;
221 }
222 },
223
224 matRotationX:
225 {
226 value: function( angle )
227 {
228 var mat = Matrix.I(4);
229 glmat4.rotateX(mat, angle);
230 return mat;
231 }
232 },
233
234 matRotationY:
235 {
236 value: function( angle )
237 {
238 var mat = Matrix.I(4);
239 glmat4.rotateY(mat, angle);
240 return mat;
241 }
242 },
243
244 matRotationZ:
245 {
246 value: function( angle )
247 {
248 var mat = Matrix.I(4);
249 glmat4.rotateZ(mat, angle);
250 return mat;
251 }
252 },
253
254 matRotation:
255 {
256 value: function(angle, axis)
257 {
258 var mat = Matrix.I(4);
259 glmat4.rotate(mat, angle, axis);
260 return mat;
261 }
262 }
263
195}); \ No newline at end of file 264}); \ No newline at end of file