public void markBoxArea(Context ctx, float[] bmin, float[] bmax, AreaModification areaMod, CompactHeightfield chf) {
        ctx.startTimer("MARK_BOX_AREA");

        int minx = (int) ((bmin[0] - chf.bmin[0]) / chf.cs);
        int miny = (int) ((bmin[1] - chf.bmin[1]) / chf.ch);
        int minz = (int) ((bmin[2] - chf.bmin[2]) / chf.cs);
        int maxx = (int) ((bmax[0] - chf.bmin[0]) / chf.cs);
        int maxy = (int) ((bmax[1] - chf.bmin[1]) / chf.ch);
        int maxz = (int) ((bmax[2] - chf.bmin[2]) / chf.cs);

        if (maxx < 0)
            return;
        if (minx >= chf.width)
            return;
        if (maxz < 0)
            return;
        if (minz >= chf.height)
            return;

        if (minx < 0)
            minx = 0;
        if (maxx >= chf.width)
            maxx = chf.width - 1;
        if (minz < 0)
            minz = 0;
        if (maxz >= chf.height)
            maxz = chf.height - 1;

        for (int z = minz; z <= maxz; ++z) {
            for (int x = minx; x <= maxx; ++x) {
                CompactCell c = chf.cells[x + z * chf.width];
                for (int i = c.index, ni = c.index + c.count; i < ni; ++i) {
                    CompactSpan s = chf.spans[i];
                    if (s.y >= miny && s.y <= maxy) {
                        if (chf.areas[i] != RC_NULL_AREA)
                            chf.areas[i] = areaMod.apply(chf.areas[i]);
                    }
                }
            }
        }

        ctx.stopTimer("MARK_BOX_AREA");

    }
public void markBoxArea ( Context ctx , float [ ] bmin , float [ ] bmax , AreaModification areaMod , CompactHeightfield chf ) { ctx . startTimer ( "MARK_BOX_AREA" ) ; int minx = ( int ) ( ( bmin [ 0 ] - chf . bmin [ 0 ] ) / chf . cs ) ; int miny = ( int ) ( ( bmin [ 1 ] - chf . bmin [ 1 ] ) / chf . ch ) ; int minz = ( int ) ( ( bmin [ 2 ] - chf . bmin [ 2 ] ) / chf . cs ) ; int maxx = ( int ) ( ( bmax [ 0 ] - chf . bmin [ 0 ] ) / chf . cs ) ; int maxy = ( int ) ( ( bmax [ 1 ] - chf . bmin [ 1 ] ) / chf . ch ) ; int maxz = ( int ) ( ( bmax [ 2 ] - chf . bmin [ 2 ] ) / chf . cs ) ; if ( maxx < 0 ) return ; if ( minx >= chf . width ) return ; if ( maxz < 0 ) return ; if ( minz >= chf . height ) return ; if ( minx < 0 ) minx = 0 ; if ( maxx >= chf . width ) maxx = chf . width - 1 ; if ( minz < 0 ) minz = 0 ; if ( maxz >= chf . height ) maxz = chf . height - 1 ; for ( int z = minz ; z <= maxz ; ++ z ) { for ( int x = minx ; x <= maxx ; ++ x ) { CompactCell c = chf . cells [ x + z * chf . width ] ; for ( int i = c . index , ni = c . index + c . count ; i < ni ; ++ i ) { CompactSpan s = chf . spans [ i ] ; if ( s . y >= miny && s . y <= maxy ) { if ( chf . areas [ i ] != RC_NULL_AREA ) chf . areas [ i ] = areaMod . apply ( chf . areas [ i ] ) ; } } } } ctx . stopTimer ( "MARK_BOX_AREA" ) ; }
/ @see rcCompactHeightfield, rcMedianFilterWalkableArea