Thread history

Fragment of a discussion from User talk:Cbrowne
Viewing a history listing
Jump to navigation Jump to search
Time User Activity Comment
No results

I think rather just go with this:

	public void turnGunTo(double newHeading) {
		double oldHeading = getGunHeadingRadians(); 
		// use of normalRelativeAngle means we don't have to decide left or right
		setTurnGunLeft(Utils.normalRelativeAngle(newHeading-oldHeading));
	}

You can even move the getGunHeadingRadians() into the brackets if you want, and get rid of oldHeading, although that might be going a bit far =). Utils.normalRelativeAngle() will automatically clean up the full circle/double circle/no circle thing for you.

It might be setTurnGunRight though... you'll have to check.

Skilgannon18:01, 11 October 2011