src/spatial/2d.js
function(drad) {
    var cos = Math.cos(drad);
    cos = -1e-10 < cos && cos < 1e-10 ? 0 : cos;
    return cos;
}
function(drad) {
    var cos = Math.cos(drad);
    cos = -1e-10 < cos && cos < 1e-10 ? 0 : cos;
    return cos;
}
function ( drad ) { var cos = Math . cos ( drad ) ; cos = - 1e-10 < cos && cos < 1e-10 ? 0 : cos ; return cos ; }
These versions of cos and sin ensure that rotations very close to 0 return 0. This avoids some problems where entities are not quite aligned with the grid.
These versions of cos and sin ensure that rotations very close to 0 return 0 . This avoids some problems where entities are not quite aligned with the grid .