Reactor.RCamera.RotateFlight C# (CSharp) Method

RotateFlight() public method

Rotates the camera for flight behavior.
public RotateFlight ( float headingDegrees, float pitchDegrees, float rollDegrees ) : void
headingDegrees float Y axis rotation angle.
pitchDegrees float X axis rotation angle.
rollDegrees float Z axis rotation angle.
return void
        public void RotateFlight(float headingDegrees, float pitchDegrees, float rollDegrees)
        {
            accumPitchDegrees += pitchDegrees;

            if (accumPitchDegrees > 360.0f)
                accumPitchDegrees -= 360.0f;

            if (accumPitchDegrees < -360.0f)
                accumPitchDegrees += 360.0f;

            Heading = headingDegrees;
            Pitch = pitchDegrees;
            Roll = rollDegrees;
            float heading = MathHelper.ToRadians(headingDegrees);
            float pitch = MathHelper.ToRadians(pitchDegrees);
            float roll = MathHelper.ToRadians(rollDegrees);

            Quaternion rotation = Quaternion.CreateFromYawPitchRoll(heading, pitch, roll);
            Quaternion.Concatenate(ref orientation, ref rotation, out orientation);
            UpdateViewMatrix();
        }