@Override
	public void controlObject(GObject target, Context context) {
		// If the mouse isn't in the screen, we'll exit now.
		if (!context.isMouseInScreen()) {
			return;
		}

		// Store mouse position.
		final Point m = context.getMouseRelative();

		// Define values.
		final Point2D p = target.getAnchorPoint();
		final double x = p.getX();
		final double y = p.getY();

		// Are the mouse position and object coincident?
		if (m.x == x && m.y == y) {
			// Don't want to divide by zero. Plus, nothing to do, really.
			return;
		}

		// Calculate the transform.
		Point2D transform = new Point2D.Double(m.x - x, m.y - y);

		// Add this transform to the list.
		previousTransforms.add(transform);

		// If we're too long...
		if (previousTransforms.size() > getMovingAverageCount()) {
			// ... take off the front.
			previousTransforms.remove(0);
		}

		// Define starting average points.
		double newDx = 0, newDy = 0;

		// Calculate the average transform...
		for (Point2D point : previousTransforms) {
			// Increment totals.
			newDx += point.getX();
			newDy += point.getY();
		}

		// Then rotate.
		target.setRotation(Math.toDegrees(Math.atan2(newDy, newDx))
				+ angleShift);
	}