B2G/gecko/browser/devtools/tilt/TiltMath.jsm
/**
   * Create a ray between two points using the current model view & projection
   * matrices. This is useful when creating a ray destined for 3D picking.
   *
   * @param {Array} aP0
   *                the [x, y, z] coordinates of the first point
   * @param {Array} aP1
   *                the [x, y, z] coordinates of the second point
   * @param {Array} aViewport
   *                the viewport [x, y, width, height] coordinates
   * @param {Array} aMvMatrix
   *                the model view matrix
   * @param {Array} aProjMatrix
   *                the projection matrix
   *
   * @return {Object} a ray object containing the direction vector between
   * the two unprojected points, the position and the lookAt
   */
Create a ray between two points using the current model view & projection
matrices. This is useful when creating a ray destined for 3D picking.



@return {Object} a ray object containing the direction vector between
the two unprojected points, the position and the lookAt
Create a ray between two points using the current model view & projection matrices . This is useful when creating a ray destined for 3D picking . @return { Object } a ray object containing the direction vector between the two unprojected points the position and the lookAt
function V3_createRay(aP0, aP1, aViewport, aMvMatrix, aProjMatrix)
  {
    vec3.unproject(aP0, aViewport, aMvMatrix, aProjMatrix, aP0);
    vec3.unproject(aP1, aViewport, aMvMatrix, aProjMatrix, aP1);
    return {
      origin: aP0,
      direction: vec3.normalize(vec3.subtract(aP1, aP0))
    };
  }
function V3_createRay ( aP0 , aP1 , aViewport , aMvMatrix , aProjMatrix ) { vec3 . unproject ( aP0 , aViewport , aMvMatrix , aProjMatrix , aP0 ) ; vec3 . unproject ( aP1 , aViewport , aMvMatrix , aProjMatrix , aP1 ) ; return { origin : aP0 , direction : vec3 . normalize ( vec3 . subtract ( aP1 , aP0 ) ) } ; }
Create a ray between two points using the current model view & projection
 matrices.
Create a ray between two points using the current model view & projection matrices .
// unproject the two points