src/main/java/de/hfu/in/machinelearning/crawling_robot_2d_sim/models/FloorHandler.java
public void updateFor(double currentPosition) {
		double limitX = tiles[2].getWorldCenter().x;
		if (Double.compare(currentPosition, limitX) > 0) {
			// move the leftmost tile by 3x width to the right
			tiles[0].translate(TILE_WIDTH * 3.0, 0.0);
			BasicBody tmp = tiles[0];
			tiles[0] = tiles[1];
			tiles[1] = tiles[2];
			tiles[2] = tmp;
		} else {
			limitX = tiles[0].getWorldCenter().x;
			if (Double.compare(currentPosition, limitX) < 0) {
				// move the rightmost tile by 3x width to the left
				tiles[2].translate(-TILE_WIDTH * 3.0, 0.0);
				BasicBody tmp = tiles[2];
				tiles[2] = tiles[1];
				tiles[1] = tiles[0];
				tiles[0] = tmp;
			}
		}
	}
/**
	 * Updates the floor tile bodies according to the current (vehicle-) position.
	 * If the position is greater than the center of the right most tile, the left
	 * most tile will be shifted to the right. If the position is smaller than the
	 * center of the left most tile, the right most tile will be shifted to the
	 * left. This creates an seemingly infinite floor in both directions.
	 * 
	 * @param currentPosition
	 */
Updates the floor tile bodies according to the current (vehicle-) position.
If the position is greater than the center of the right most tile, the left
most tile will be shifted to the right. If the position is smaller than the
center of the left most tile, the right most tile will be shifted to the
left. This creates an seemingly infinite floor in both directions.

@param currentPosition
Updates the floor tile bodies according to the current ( vehicle - ) position . If the position is greater than the center of the right most tile the left most tile will be shifted to the right . If the position is smaller than the center of the left most tile the right most tile will be shifted to the left . This creates an seemingly infinite floor in both directions . @param currentPosition
public void updateFor(double currentPosition) {
		double limitX = tiles[2].getWorldCenter().x;
		if (Double.compare(currentPosition, limitX) > 0) {
			tiles[0].translate(TILE_WIDTH * 3.0, 0.0);
			BasicBody tmp = tiles[0];
			tiles[0] = tiles[1];
			tiles[1] = tiles[2];
			tiles[2] = tmp;
		} else {
			limitX = tiles[0].getWorldCenter().x;
			if (Double.compare(currentPosition, limitX) < 0) {
				tiles[2].translate(-TILE_WIDTH * 3.0, 0.0);
				BasicBody tmp = tiles[2];
				tiles[2] = tiles[1];
				tiles[1] = tiles[0];
				tiles[0] = tmp;
			}
		}
	}
public void updateFor ( double currentPosition ) { double limitX = tiles [ 2 ] . getWorldCenter ( ) . x ; if ( Double . compare ( currentPosition , limitX ) > 0 ) { tiles [ 0 ] . translate ( TILE_WIDTH * 3.0 , 0.0 ) ; BasicBody tmp = tiles [ 0 ] ; tiles [ 0 ] = tiles [ 1 ] ; tiles [ 1 ] = tiles [ 2 ] ; tiles [ 2 ] = tmp ; } else { limitX = tiles [ 0 ] . getWorldCenter ( ) . x ; if ( Double . compare ( currentPosition , limitX ) < 0 ) { tiles [ 2 ] . translate ( - TILE_WIDTH * 3.0 , 0.0 ) ; BasicBody tmp = tiles [ 2 ] ; tiles [ 2 ] = tiles [ 1 ] ; tiles [ 1 ] = tiles [ 0 ] ; tiles [ 0 ] = tmp ; } } }
Updates the floor tile bodies according to the current (vehicle-) position.
Updates the floor tile bodies according to the current ( vehicle - ) position .
// move the leftmost tile by 3x width to the right // move the rightmost tile by 3x width to the left