question: protected boolean raycast ( Vector2 start , double length , double invDx , double invDy , AABB aabb ) { double tx1 = ( aabb . getMinX ( ) - start . x ) * invDx ; double tx2 = ( aabb . getMaxX ( ) - start . x ) * invDx ; double tmin = Math . min ( tx1 , tx2 ) ; double tmax = Math . max ( tx1 , tx2 ) ; double ty1 = ( aabb . getMinY ( ) - start . y ) * invDy ; double ty2 = ( aabb . getMaxY ( ) - start . y ) * invDy ; tmin = Math . max ( tmin , Math . min ( ty1 , ty2 ) ) ; tmax = Math . min ( tmax , Math . max ( ty1 , ty2 ) ) ; if ( tmax < 0 ) return false ; if ( tmin > length ) return false ; return tmax >= tmin ; }
target:  Returns true if the ray and AABB intersect. <p> This method is ideally called for a number of AABBs where the invDx and invDy can be computed once.