protected int findIntersection ( SquareNode target , SquareNode node ) { lineCenters . a = target . center ; lineCenters . b = node . center ; for ( int i = 0 ; i < 4 ; i ++ ) { int j = ( i + 1 ) % 4 ; lineSide . a = target . square . get ( i ) ; lineSide . b = target . square . get ( j ) ; if ( Intersection2D_F64 . intersection ( lineCenters , lineSide , dummy ) != null ) { return i ; } } return - 1 ; }
Finds the side which intersects the line segment from the center of target to center of node