private void UpdateCameraGoal( Real deltaYaw, Real deltaPitch, Real deltaZoom )
{
cameraPivot.Yaw( deltaYaw, TransformSpace.World );
// bound the pitch
if ( !( pivotPitch + deltaPitch > 25 && deltaPitch > 0 ) &&
!( pivotPitch + deltaPitch < -60 && deltaPitch < 0 ) )
{
cameraPivot.Pitch( deltaPitch, TransformSpace.Local );
pivotPitch += deltaPitch;
}
Real dist = cameraGoal.DerivedPosition.Distance( cameraPivot.DerivedPosition );
Real distChange = deltaZoom * dist;
// bound the zoom
if ( !( dist + distChange < 8 && distChange < 0 ) &&
!( dist + distChange > 25 && distChange > 0 ) )
{
cameraGoal.Translate( new Vector3( 0, 0, distChange ), TransformSpace.Local );
}
}