examples/3d/js/map.js
function(sin, cos, step, shiftX, shiftY, dist, offset) {
    var dx = (cos < 0) ? shiftX : 0;
    var dy = (sin < 0) ? shiftY : 0;

    step.type = this.check(step.x - dx, step.y - dy);
    step.height = (step.type) > 0 ? 1 : 0;
    step.dist = dist + Math.sqrt(step.len2);

    if (shiftX) {
      step.shading = (cos < 0) ? 2 : 0;
    } else {
      step.shading = (sin < 0) ? 2 : 1;
    }

    step.offset = offset - Math.floor(offset);

    return step;
  }
function(sin, cos, step, shiftX, shiftY, dist, offset) {
    var dx = (cos < 0) ? shiftX : 0;
    var dy = (sin < 0) ? shiftY : 0;

    step.type = this.check(step.x - dx, step.y - dy);
    step.height = (step.type) > 0 ? 1 : 0;
    step.dist = dist + Math.sqrt(step.len2);

    if (shiftX) {
      step.shading = (cos < 0) ? 2 : 0;
    } else {
      step.shading = (sin < 0) ? 2 : 1;
    }

    step.offset = offset - Math.floor(offset);

    return step;
  }
function ( sin , cos , step , shiftX , shiftY , dist , offset ) { var dx = ( cos < 0 ) ? shiftX : 0 ; var dy = ( sin < 0 ) ? shiftY : 0 ; step . type = this . check ( step . x - dx , step . y - dy ) ; step . height = ( step . type ) > 0 ? 1 : 0 ; step . dist = dist + Math . sqrt ( step . len2 ) ; if ( shiftX ) { step . shading = ( cos < 0 ) ? 2 : 0 ; } else { step . shading = ( sin < 0 ) ? 2 : 1 ; } step . offset = offset - Math . floor ( offset ) ; return step ; }
Inspect the next position to determine distance, height, shading, etc.
@param  {Number} sin    Sine of the cast angle.
@param  {Number} cos    Cosine of the cast angle.
@param  {Object} step   x, y and length of the step.
@param  {Number} shiftX X shifted by 1 or 0.
@param  {Number} shiftY Y shifted by 1 or 0.
@param  {Number} dist   Distnace from origin.
@param  {Number} offset Step offset.
Inspect the next position to determine distance height shading etc .