コード例 #1
0
 /// <summary>
 /// Should the camera move up or down?</summary>
 /// <param name="modifierKeys">The camera control's ModifierKeys property</param>
 /// <param name="e">The camera control's event handler's MouseEventArgs</param>
 /// <returns>True if the user wants to move the camera up or down</returns>
 /// <remarks>This is used by the fly and walk camera controllers.</remarks>
 public override bool IsElevating(Keys modifierKeys, MouseEventArgs e)
 {
     return
         (e.Button == MouseButtons.Middle && (modifierKeys & Keys.Alt) == Keys.Alt) ||
         (e.Button == MouseButtons.Left &&
             (modifierKeys & (Keys.Alt | Keys.Control)) == (Keys.Alt | Keys.Control));
 }
コード例 #2
0
 /// <summary>
 /// Should the camera do a panning (strafing) motion?</summary>
 /// <param name="modifierKeys">The camera control's ModifierKeys property</param>
 /// <param name="e">The camera control's event handler's MouseEventArgs</param>
 /// <returns>True if the user wants to pan the camera</returns>
 public override bool IsPanning(Keys modifierKeys, MouseEventArgs e)
 {
     return
         e.Button == MouseButtons.Middle ||
         (e.Button == MouseButtons.Left &&
             (modifierKeys & (Keys.Alt | Keys.Control)) == (Keys.Alt | Keys.Control));
 }
コード例 #3
0
ファイル: ControlScheme.cs プロジェクト: BeRo1985/LevelEditor
 /// <summary>
 /// Does the user want to control the camera in some way?
 /// (As opposed to selecting something in the Design View, for example.)</summary>
 /// <param name="modifierKeys">The camera control's ModifierKeys property</param>
 /// <param name="e">The camera control's event handler's MouseEventArgs</param>
 /// <returns>True if the user wants to adjust the camera</returns>
 public virtual bool IsControllingCamera(Keys modifierKeys, MouseEventArgs e)
 {
     return
         IsRotating(modifierKeys, e) ||
         IsZooming(modifierKeys, e) ||
         IsPanning(modifierKeys, e) ||
         IsTurning(modifierKeys, e) ||
         IsElevating(modifierKeys, e);
 }
コード例 #4
0
 /// <summary>
 /// Should the camera move up or down?</summary>
 /// <param name="modifierKeys">The camera control's ModifierKeys property</param>
 /// <param name="e">The camera control's event handler's MouseEventArgs</param>
 /// <returns>True if the user wants to move the camera up or down</returns>
 /// <remarks>This is used by the fly and walk camera controllers.</remarks>
 public override bool IsElevating(Keys modifierKeys, MouseEventArgs e)
 {
     return e.Button == MouseButtons.Middle && (modifierKeys & Keys.Alt) == Keys.Alt;
 }
コード例 #5
0
 /// <summary>
 /// Should the camera zoom in some way?</summary>
 /// <param name="modifierKeys">The camera control's ModifierKeys property</param>
 /// <param name="e">The camera control's event handler's MouseEventArgs</param>
 /// <returns>True if the user wants to zoom the camera</returns>
 public override bool IsZooming(Keys modifierKeys, MouseEventArgs e)
 {
     return
         (e.Button == MouseButtons.Right && (modifierKeys & Keys.Alt) == Keys.Alt) ||
         e.Delta != 0; //mouse wheel moved?
 }
コード例 #6
0
 /// <summary>
 /// Should the camera do a panning (strafing) motion?</summary>
 /// <param name="modifierKeys">The camera control's ModifierKeys property</param>
 /// <param name="e">The camera control's event handler's MouseEventArgs</param>
 /// <returns>True if the user wants to pan the camera</returns>
 public override bool IsPanning(Keys modifierKeys, MouseEventArgs e)
 {
     return e.Button == MouseButtons.Middle;
 }
コード例 #7
0
 /// <summary>
 /// Should the camera rotate around the look-at point?</summary>
 /// <param name="modifierKeys">The camera control's ModifierKeys property</param>
 /// <param name="e">The camera control's event handler's MouseEventArgs</param>
 /// <returns>True if the user wants to rotate the camera</returns>
 public override bool IsRotating(Keys modifierKeys, MouseEventArgs e)
 {
     return (e.Button == MouseButtons.Left && (modifierKeys & Keys.Alt) == Keys.Alt);
 }
コード例 #8
0
ファイル: ControlScheme.cs プロジェクト: BeRo1985/LevelEditor
 /// <summary>
 /// Should the camera move up or down?</summary>
 /// <param name="modifierKeys">The camera control's ModifierKeys property</param>
 /// <param name="e">The camera control's event handler's MouseEventArgs</param>
 /// <returns>True if the user wants to move the camera up or down</returns>
 /// <remarks>This is used by the fly and walk camera controllers.</remarks>
 public abstract bool IsElevating(Keys modifierKeys, MouseEventArgs e);
コード例 #9
0
ファイル: ControlScheme.cs プロジェクト: BeRo1985/LevelEditor
 /// <summary>
 /// Should the camera turn around in-place? This means that the look-at direction
 /// changes, but the eye point remains stationary.</summary>
 /// <param name="modifierKeys">The camera control's ModifierKeys property</param>
 /// <param name="e">The camera control's event handler's MouseEventArgs</param>
 /// <returns>True if the user wants to turn the camera around in place</returns>
 /// <remarks>This is used by the fly and walk camera controllers.</remarks>
 public abstract bool IsTurning(Keys modifierKeys, MouseEventArgs e);