examples/game/lib/view.js
function angleDiff(angle1, angle2){
        var deltaAngle = angle1-angle2;
        while (deltaAngle < -Math.PI) deltaAngle += (2*Math.PI);
        while (deltaAngle > Math.PI) deltaAngle -= (2*Math.PI);
        return Math.abs(deltaAngle);
    }
function angleDiff(angle1, angle2){
        var deltaAngle = angle1-angle2;
        while (deltaAngle < -Math.PI) deltaAngle += (2*Math.PI);
        while (deltaAngle > Math.PI) deltaAngle -= (2*Math.PI);
        return Math.abs(deltaAngle);
    }
function angleDiff ( angle1 , angle2 ) { var deltaAngle = angle1 - angle2 ; while ( deltaAngle < - Math . PI ) deltaAngle += ( 2 * Math . PI ) ; while ( deltaAngle > Math . PI ) deltaAngle -= ( 2 * Math . PI ) ; return Math . abs ( deltaAngle ) ; }
Calculates the delta between two angles
Calculates the delta between two angles