rem: global.mat = (function() { function str(m, l) { var str = '\n', l = (!l)? Math.floor(Math.sqrt(m.length+1)+0.05) : l, x,y, number_width = 1, width; for(x=l*l; x--;) { width = String(m[x]).length; if(width > number_width) number_width = width; }  for(y=-1; ++y < l; ) { for(x=-1; ++x < l; ) { width = String(m[(x*l) + y]).length; str += m[(x*l) + y] + Array(number_width-width+2).join(' '); 
add: this.NEngine = (function() {  var math, Obj, renderer, geometry;    math = (function() {      function projection(out,va,vb) { vec4.scale(out, vb, vec4.dot(va,vb)/vec4.length(va)); }   function repair(vx, vy, vz, vw) { var length, projection = new vec4.create();   projection(projection, vx, vy); vec4.sub(vx,vx, projection); projection(projection, vx, vz); vec4.sub(vx,vx, projection); projection(projection, vx, vw); vec4.sub(vx,vx, projection);  vec4.normalize(vx, vx);  projection(projection, vy, vz); vec4.sub(vy,vy, projection); projection(projection, vy, vw); vec4.sub(vy,vy, projection);  vec4.normalize(vy,vy);  projection(projection, vz, vw); vec4.sub(vz,vz, projection);  vec4.normalize(vz,vz); vec4.normalize(vw,vw); }  return { projection: projection, repair: repair }; })();  Obj = (function(){  function Obj(p, rx, ry, rz, rw) {   this.p = (p)?p:new vec4.create();  this.rx = new vec4.create(); this.ry = new vec4.create(); this.rz = new vec4.create(); this.rw = new vec4.create(); this.rx[0] = 1.0; this.ry[1] = 1.0; this.rz[2] = 1.0; this.rw[3] = 1.0;    this.dp = new vec4.create();  /*  more complex than i need right now my friend ... this.drx = new vec4(); this.dry = new vec4(); this.drz = new vec4(); this.drw = new vec4(); */  this.drx = 0.0; this.dry = 0.0; this.drz = 0.0; this.drw = 0.0  this.geom = null; };  return Obj; })();   geometry = (function() {  function grid3(x,y,z, options) { if(!options) options = {}; if(!options.size_z) options.size_z = (!options.size)?100.0:options.size; if(!options.size_y) options.size_y = (!options.size)?100.0:options.size; if(!options.size_x) options.size_x = (!options.size)?100.0:options.size;  var position = new GLMAT_ARRAY_TYPE(z*y*x*4), indices, step_x = 4, step_y = x*step_x, step_z = y*step_y, step_length_z = options.size_z/(z-1), step_length_y = options.size_y/(y-1), step_length_x = options.size_x/(x-1), i_z, i_y, i_x, i_dir;    for(i_z = z; i_z--;) for(i_y = y; i_y--;) for(i_x = x; i_x--;) { i_dir = i_w*step_w + i_z*step_z + i_y*step_y + i_x*step_x;  position[ i_dir ] =  i_x*step_length_x; position[i_dir+1] =  i_y*step_length_y; position[i_dir+2] =  i_z*step_length_z; position[i_dir+3] =  i_w*step_length_w; }   if(!options.linestrip) { indices = new GLMAT_ARRAY_TYPE(2*( z*y*(x-1) + z*(y-1)*x + (z-1)*y*x ));        function createLinesOnAxis(offset, axis_a_step, axis_b_step, axis_c_step) { var i_dir2;  var step_x = 2, step_y = y*step_x, step_z = z*step_y;  for(i_z = z; i_z--;) for(i_y = y; i_y--;) for(i_x = x-1; i_x--;) {  i_dir = offset + i_z*step_z + i_y*step_y + i_x*step_x; i_dir2 =  i_z*axis_a_step + i_y*axis_b_step + i_x*axis_c_step;  indices[i_dir] = i_dir2; indices[i_dir+1] = i_dir2 + axis_c_step; } }      createLinesOnAxis(0, step_z, step_y, step_x); createLinesOnAxis( 2*z*y*(x-1), step_z, step_x, step_y);  createLinesOnAxis( 2*z(y*(x-1) + (y-1)*x), step_y, step_x, step_z); 
context:   global.mat = (function() {    function str(m, l) {      var str = '\n',        l = (!l)? Math.floor(Math.sqrt(m.length+1)+0.05) : l,        x,y,        number_width = 1,        width;      for(x=l*l; x--;) {        width = String(m[x]).length;        if(width > number_width)          number_width = width;      }      for(y=-1; ++y < l; ) {        for(x=-1; ++x < l; ) {          width = String(m[(x*l) + y]).length;          str += m[(x*l) + y] + Array(number_width-width+2).join(' ');        }        str += '\n';      }      return str;    }    return {      str: str    };  })();
meta: 5665	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5665/0f8ba5d109269d49d72be1d776721a5a867dd729/NEngine.js/clean/lib/NEngine.js