void Camera::rotate(float headingDegrees, float pitchDegrees, float rollDegrees) { // Rotates the camera based on its current behavior. // Note that not all behaviors support rolling. // // This Camera class follows the left-hand rotation rule. // Angles are measured clockwise when looking along the rotation // axis toward the origin. Since the Z axis is pointing into the // screen we need to negate rolls. rollDegrees = -rollDegrees; switch (m_behavior) { default: break; case CAMERA_BEHAVIOR_FIRST_PERSON: rotateFirstPerson(headingDegrees, pitchDegrees); break; case CAMERA_BEHAVIOR_FLIGHT: rotateFlight(headingDegrees, pitchDegrees, rollDegrees); break; } updateViewMatrix(true); }
void Camera::rotate(float headingDegrees, float pitchDegrees, float rollDegrees) { // Rotates the camera based on its current behavior. // Note that not all behaviors support rolling. pitchDegrees = -pitchDegrees; headingDegrees = -headingDegrees; rollDegrees = -rollDegrees; switch (m_behavior) { default: break; case CAMERA_BEHAVIOR_FIRST_PERSON: case CAMERA_BEHAVIOR_SPECTATOR: rotateFirstPerson(headingDegrees, pitchDegrees); break; case CAMERA_BEHAVIOR_FLIGHT: rotateFlight(headingDegrees, pitchDegrees, rollDegrees); break; case CAMERA_BEHAVIOR_ORBIT: rotateOrbit(headingDegrees, pitchDegrees, rollDegrees); break; } updateViewMatrix(); }