Game Development Reference
In-Depth Information
time passed since the change in the angle exceeds waiting time specified by turnTimeout .
If this is true, we begin to rotate the camera.
As we have learned before, we need three pieces of information to rotate the camera: a ro-
tation axis, a rotation direction (clockwise or counter-clockwise), and a rotation speed. The
rotation axis is the vertical axis located at the same position of the car, since we are going
to rotate the camera around the car object. The speed of the rotation is already defined by
turnSpeed , so what is left now is determining the rotation direction. This direction depends
on whether the car has turned left or right. When the car turns right, we rotate the camera
clockwise, and when the car turns left, we rotate the camera counter-clockwise.
Search WWH ::




Custom Search