src/main/java/de/hfu/in/machinelearning/crawling_robot_2d_sim/models/ShapeRenderer.java
public static final void render(Graphics2D g, Slice slice, double scale, Color color) {
		double radius = slice.getSliceRadius();
		double theta2 = slice.getTheta() * 0.5;
		
		// get the local rotation and translation
		double rotation = slice.getRotation();
		Vector2 circleCenter = slice.getCircleCenter();
		
		// save the old transform
		AffineTransform oTransform = g.getTransform();
		// translate and rotate
		g.translate(circleCenter.x * scale, circleCenter.y * scale);
		g.rotate(rotation);
		
		// to draw the arc, java2d wants the top left x,y
		// as if you were drawing a circle
		Arc2D a = new Arc2D.Double(-radius * scale, 
				-radius * scale,
				2.0 * radius * scale, 
				2.0 * radius * scale,
				-Math.toDegrees(theta2),
				Math.toDegrees(2.0 * theta2),
				Arc2D.PIE);
		
		// fill the shape
		g.setColor(color);
		g.fill(a);
		// draw the outline
		g.setColor(getOutlineColor(color));
		g.draw(a);
		
		// re-instate the old transform
		g.setTransform(oTransform);
	}
/**
	 * Renders the given {@link Slice} to the given graphics context using the given scale and color.
	 * @param g the graphics context
	 * @param slice the slice to render
	 * @param scale the scale to render the shape (pixels per dyn4j unit (typically meter))
	 * @param color the color
	 */
Renders the given  Slice to the given graphics context using the given scale and color.
@param g the graphics context
@param slice the slice to render
@param scale the scale to render the shape (pixels per dyn4j unit (typically meter))
@param color the color
Renders the given Slice to the given graphics context using the given scale and color . @param g the graphics context @param slice the slice to render @param scale the scale to render the shape ( pixels per dyn4j unit ( typically meter )) @param color the color
public static final void render(Graphics2D g, Slice slice, double scale, Color color) {
		double radius = slice.getSliceRadius();
		double theta2 = slice.getTheta() * 0.5;
		double rotation = slice.getRotation();
		Vector2 circleCenter = slice.getCircleCenter();
		AffineTransform oTransform = g.getTransform();
		g.translate(circleCenter.x * scale, circleCenter.y * scale);
		g.rotate(rotation);
		Arc2D a = new Arc2D.Double(-radius * scale, 
				-radius * scale,
				2.0 * radius * scale, 
				2.0 * radius * scale,
				-Math.toDegrees(theta2),
				Math.toDegrees(2.0 * theta2),
				Arc2D.PIE);
		g.setColor(color);
		g.fill(a);
		g.setColor(getOutlineColor(color));
		g.draw(a);
		g.setTransform(oTransform);
	}
public static final void render ( Graphics2D g , Slice slice , double scale , Color color ) { double radius = slice . getSliceRadius ( ) ; double theta2 = slice . getTheta ( ) * 0.5 ; double rotation = slice . getRotation ( ) ; Vector2 circleCenter = slice . getCircleCenter ( ) ; AffineTransform oTransform = g . getTransform ( ) ; g . translate ( circleCenter . x * scale , circleCenter . y * scale ) ; g . rotate ( rotation ) ; Arc2D a = new Arc2D . Double ( - radius * scale , - radius * scale , 2.0 * radius * scale , 2.0 * radius * scale , - Math . toDegrees ( theta2 ) , Math . toDegrees ( 2.0 * theta2 ) , Arc2D . PIE ) ; g . setColor ( color ) ; g . fill ( a ) ; g . setColor ( getOutlineColor ( color ) ) ; g . draw ( a ) ; g . setTransform ( oTransform ) ; }
Renders the given {@link Slice} to the given graphics context using the given scale and color.
Renders the given { @link Slice } to the given graphics context using the given scale and color .
// get the local rotation and translation // save the old transform // translate and rotate // to draw the arc, java2d wants the top left x,y // as if you were drawing a circle // fill the shape // draw the outline // re-instate the old transform