C# Class SharpDX.WPF.Cameras.BaseCamera

Simple base camera class that moves and rotates. The base class records mouse and keyboard input for use by a derived class, and keeps common state.
Datei anzeigen Open project: MercurialForge/VSViewer

Public Properties

Property Type Description
ViewPosition System.Vector3

Protected Properties

Property Type Description
m_downKeys bool>.Dictionary
m_mouseDownPos System.Vector2
m_viewRotQuat Quaternion

Public Methods

Method Description
BaseCamera ( ) : System
FrameMove ( System.TimeSpan elapsed ) : void
HandleKeyDown ( UIElement ui, System.Windows.Input.KeyEventArgs e ) : void
HandleKeyUp ( UIElement ui, System.Windows.Input.KeyEventArgs e ) : void
HandleMouseDown ( UIElement ui, System.Windows.Input.MouseButtonEventArgs e ) : void
HandleMouseMove ( UIElement ui, System.Windows.Input.MouseEventArgs e ) : void
HandleMouseUp ( UIElement ui, System.Windows.Input.MouseButtonEventArgs e ) : void
HandleMouseWheel ( UIElement ui, System.Windows.Input.MouseWheelEventArgs e ) : void
Reset ( ) : void
Roll ( float angle ) : void

TODO: accept a real angle as a value

SetProjParams ( float fFOV, float fAspect, float fNearPlane, float fFarPlane ) : void
SetScalers ( float sRotation, float sMove ) : void
SetViewParams ( System.Vector3 eye, System.Vector3 lookAt ) : void
SetViewParams ( System.Vector3 eye, System.Vector3 lookAt, System.Vector3 vUp ) : void

Protected Methods

Method Description
GetMouseAngle ( System.Vector2 dp, UIElement ui ) : float
GetVector ( UIElement ui, System.Windows.Input.MouseEventArgs e ) : System.Vector2
KeyMove ( System.Vector3 dp ) : void
KeyRoll ( float angle ) : void
KeyRotateHorizontal ( float angle ) : void
MouseRotation ( Quaternion dMouse ) : void
UpdateView ( ) : void

Private Methods

Method Description
GetRollSpeed ( Key k ) : float
GetSpeed ( Key k ) : System.Vector3
OnInitInteractive ( ) : void
UpdateProj ( ) : void

Method Details

BaseCamera() public method

public BaseCamera ( ) : System
return System

FrameMove() public method

public FrameMove ( System.TimeSpan elapsed ) : void
elapsed System.TimeSpan
return void

GetMouseAngle() protected method

protected GetMouseAngle ( System.Vector2 dp, UIElement ui ) : float
dp System.Vector2
ui System.Windows.UIElement
return float

GetVector() protected static method

protected static GetVector ( UIElement ui, System.Windows.Input.MouseEventArgs e ) : System.Vector2
ui System.Windows.UIElement
e System.Windows.Input.MouseEventArgs
return System.Vector2

HandleKeyDown() public method

public HandleKeyDown ( UIElement ui, System.Windows.Input.KeyEventArgs e ) : void
ui System.Windows.UIElement
e System.Windows.Input.KeyEventArgs
return void

HandleKeyUp() public method

public HandleKeyUp ( UIElement ui, System.Windows.Input.KeyEventArgs e ) : void
ui System.Windows.UIElement
e System.Windows.Input.KeyEventArgs
return void

HandleMouseDown() public method

public HandleMouseDown ( UIElement ui, System.Windows.Input.MouseButtonEventArgs e ) : void
ui System.Windows.UIElement
e System.Windows.Input.MouseButtonEventArgs
return void

HandleMouseMove() public method

public HandleMouseMove ( UIElement ui, System.Windows.Input.MouseEventArgs e ) : void
ui System.Windows.UIElement
e System.Windows.Input.MouseEventArgs
return void

HandleMouseUp() public method

public HandleMouseUp ( UIElement ui, System.Windows.Input.MouseButtonEventArgs e ) : void
ui System.Windows.UIElement
e System.Windows.Input.MouseButtonEventArgs
return void

HandleMouseWheel() public method

public HandleMouseWheel ( UIElement ui, System.Windows.Input.MouseWheelEventArgs e ) : void
ui System.Windows.UIElement
e System.Windows.Input.MouseWheelEventArgs
return void

KeyMove() protected method

protected KeyMove ( System.Vector3 dp ) : void
dp System.Vector3
return void

KeyRoll() protected method

protected KeyRoll ( float angle ) : void
angle float
return void

KeyRotateHorizontal() protected method

protected KeyRotateHorizontal ( float angle ) : void
angle float
return void

MouseRotation() protected method

protected MouseRotation ( Quaternion dMouse ) : void
dMouse Quaternion
return void

Reset() public method

public Reset ( ) : void
return void

Roll() public method

TODO: accept a real angle as a value
public Roll ( float angle ) : void
angle float
return void

SetProjParams() public method

public SetProjParams ( float fFOV, float fAspect, float fNearPlane, float fFarPlane ) : void
fFOV float
fAspect float
fNearPlane float
fFarPlane float
return void

SetScalers() public method

public SetScalers ( float sRotation, float sMove ) : void
sRotation float
sMove float
return void

SetViewParams() public method

public SetViewParams ( System.Vector3 eye, System.Vector3 lookAt ) : void
eye System.Vector3
lookAt System.Vector3
return void

SetViewParams() public method

public SetViewParams ( System.Vector3 eye, System.Vector3 lookAt, System.Vector3 vUp ) : void
eye System.Vector3
lookAt System.Vector3
vUp System.Vector3
return void

UpdateView() protected method

protected UpdateView ( ) : void
return void

Property Details

ViewPosition public_oe property

public Vector3,System ViewPosition
return System.Vector3

m_downKeys protected_oe property

protected Dictionary m_downKeys
return bool>.Dictionary

m_mouseDownPos protected_oe property

protected Vector2,System m_mouseDownPos
return System.Vector2

m_viewRotQuat protected_oe property

protected Quaternion m_viewRotQuat
return Quaternion