B2G/gecko/browser/devtools/tilt/TiltMath.jsm
/**
   * Generates a frustum matrix with the given bounds.
   *
   * @param {Number} aLeft
   *                 scalar, left bound of the frustum
   * @param {Number} aRight
   *                 scalar, right bound of the frustum
   * @param {Number} aBottom
   *                 scalar, bottom bound of the frustum
   * @param {Number} aTop
   *                 scalar, top bound of the frustum
   * @param {Number} aNear
   *                 scalar, near bound of the frustum
   * @param {Number} aFar
   *                 scalar, far bound of the frustum
   * @param {Array} aDest
   *                optional, mat4 frustum matrix will be written into
   *                if not specified result is written to a new mat4
   *
   * @return {Array} the destination mat4 if specified, a new mat4 otherwise
   */
Generates a frustum matrix with the given bounds.

@return {Array} the destination mat4 if specified, a new mat4 otherwise
Generates a frustum matrix with the given bounds . @return { Array } the destination mat4 if specified a new mat4 otherwise
function M4_frustum(
    aLeft, aRight, aBottom, aTop, aNear, aFar, aDest)
  {
    if (!aDest) {
      aDest = new Float32Array(16);
    }
    let rl = (aRight - aLeft);
    let tb = (aTop - aBottom);
    let fn = (aFar - aNear);
    aDest[0] = (aNear * 2) / rl;
    aDest[1] = 0;
    aDest[2] = 0;
    aDest[3] = 0;
    aDest[4] = 0;
    aDest[5] = (aNear * 2) / tb;
    aDest[6] = 0;
    aDest[7] = 0;
    aDest[8] = (aRight + aLeft) / rl;
    aDest[9] = (aTop + aBottom) / tb;
    aDest[10] = -(aFar + aNear) / fn;
    aDest[11] = -1;
    aDest[12] = 0;
    aDest[13] = 0;
    aDest[14] = -(aFar * aNear * 2) / fn;
    aDest[15] = 0;
    return aDest;
  }
function M4_frustum ( aLeft , aRight , aBottom , aTop , aNear , aFar , aDest ) { if ( ! aDest ) { aDest = new Float32Array ( 16 ) ; } let rl = ( aRight - aLeft ) ; let tb = ( aTop - aBottom ) ; let fn = ( aFar - aNear ) ; aDest [ 0 ] = ( aNear * 2 ) / rl ; aDest [ 1 ] = 0 ; aDest [ 2 ] = 0 ; aDest [ 3 ] = 0 ; aDest [ 4 ] = 0 ; aDest [ 5 ] = ( aNear * 2 ) / tb ; aDest [ 6 ] = 0 ; aDest [ 7 ] = 0 ; aDest [ 8 ] = ( aRight + aLeft ) / rl ; aDest [ 9 ] = ( aTop + aBottom ) / tb ; aDest [ 10 ] = - ( aFar + aNear ) / fn ; aDest [ 11 ] = - 1 ; aDest [ 12 ] = 0 ; aDest [ 13 ] = 0 ; aDest [ 14 ] = - ( aFar * aNear * 2 ) / fn ; aDest [ 15 ] = 0 ; return aDest ; }
Generates a frustum matrix with the given bounds.
Generates a frustum matrix with the given bounds .