Axiom.Samples.SdkCameraManager.injectMouseMove C# (CSharp) Method

injectMouseMove() public method

public injectMouseMove ( SharpInputSystem evt ) : void
evt SharpInputSystem
return void
		public virtual void injectMouseMove( SIS.MouseEventArgs evt )
		{
			if ( mStyle == CameraStyle.Orbit )
			{
				Real dist = ( mCamera.Position - mTarget.DerivedPosition ).Length;

				if ( mOrbiting )   // yaw around the target, and pitch locally
				{
					mCamera.Position = mTarget.DerivedPosition;

					mCamera.Yaw( (Real)( new Degree( (Real)( -evt.State.X.Relative * 0.25f ) ) ) );
					mCamera.Pitch( (Real)( new Degree( (Real)( -evt.State.Y.Relative * 0.25f ) ) ) );

					mCamera.MoveRelative( new Vector3( 0, 0, dist ) );

					// don't let the camera go over the top or around the bottom of the target
				}
				else if ( mZooming )  // move the camera toward or away from the target
				{
					// the further the camera is, the faster it moves
					mCamera.MoveRelative( new Vector3( 0, 0, evt.State.Y.Relative * 0.004f * dist ) );
				}
				else if ( evt.State.Z.Relative != 0 )  // move the camera toward or away from the target
				{
					// the further the camera is, the faster it moves
					mCamera.MoveRelative( new Vector3( 0, 0, -evt.State.Z.Relative * 0.0008f * dist ) );
				}
			}
			else if ( mStyle == CameraStyle.FreeLook )
			{
				mCamera.Yaw( (Real)( new Degree( (Real)( -evt.State.X.Relative * 0.15f ) ) ) );
				mCamera.Pitch( (Real)( new Degree( (Real)( -evt.State.Y.Relative * 0.15f ) ) ) );
			}
		}