protected final void checkPoints ( ) { if ( pointsDirty ) { createPoints ( ) ; findCenter ( ) ; calculateRadius ( ) ; if ( points . length > 0 ) { maxX = points [ 0 ] ; maxY = points [ 1 ] ; minX = points [ 0 ] ; minY = points [ 1 ] ; for ( int i = 0 ; i < points . length / 2 ; i ++ ) { maxX = Math . max ( points [ i * 2 ] , maxX ) ; maxY = Math . max ( points [ ( i * 2 ) + 1 ] , maxY ) ; minX = Math . min ( points [ i * 2 ] , minX ) ; minY = Math . min ( points [ ( i * 2 ) + 1 ] , minY ) ; } } pointsDirty = false ; trianglesDirty = true ; } }
Check the dirty flag and create points as necessary .