C# Class Nuaj.Cirrus.Utility.CameraManipulator

This is a little camera manipulator helper that you can bind to a control Use left button to rotate, middle to pan and right/wheel to zoom Use Shift to switch to "Unreal Editor first person mode"
Mostra file Open project: Patapom/GodComplex

Protected Properties

Property Type Description
m_ButtonDownCameraTargetDistance float
m_ButtonDownMousePosition float2
m_ButtonDownNormalizedTargetDistance float
m_ButtonDownTargetObjectMatrix SharpMath.float4x4
m_ButtonDownTransform SharpMath.float4x4
m_ButtonsDown MouseButtons
m_Camera Camera
m_CameraTargetDistance float
m_CameraTransform SharpMath.float4x4
m_Control System.Windows.Forms.Control
m_InvButtonDownTargetObjectMatrix SharpMath.float4x4
m_ManipulationPanSpeed float
m_ManipulationRotationSpeed float
m_ManipulationZoomAcceleration float
m_ManipulationZoomSpeed float
m_NormalizedTargetDistance float
m_bLastManipulationWasFirstPerson bool
m_bPushingTarget bool
m_bRotationEnabled bool

Public Methods

Method Description
Attach ( Control _Control, Camera _Camera ) : void
CameraManipulator ( ) : System
Detach ( Control _Control ) : void
InitializeCamera ( float3 _position, float3 _target, float3 _up ) : void

Protected Methods

Method Description
ComputeNormalizedScreenPosition ( int _X, int _Y, float _fCameraAspectRatio ) : float2
Control_MouseDown ( object sender, MouseEventArgs e ) : void
Control_MouseMove ( object sender, MouseEventArgs e ) : void
Control_MouseUp ( object sender, MouseEventArgs e ) : void
Control_MouseWheel ( object sender, MouseEventArgs e ) : void
DeNormalizeTargetDistance ( float _fNormalizedTargetDistance ) : float
GetDenormalizationFactor ( ) : float
GetEuler ( float4x4 _Matrix ) : float3

/// Converts an angle+axis into a plain rotation matrix ///

Extracts Euler angles from a rotation matrix

NormalizeTargetDistance ( float _fDeNormalizedTargetDistance ) : float

Method Details

Attach() public method

public Attach ( Control _Control, Camera _Camera ) : void
_Control System.Windows.Forms.Control
_Camera Camera
return void

CameraManipulator() public method

public CameraManipulator ( ) : System
return System

ComputeNormalizedScreenPosition() protected method

protected ComputeNormalizedScreenPosition ( int _X, int _Y, float _fCameraAspectRatio ) : float2
_X int
_Y int
_fCameraAspectRatio float
return float2

Control_MouseDown() protected method

protected Control_MouseDown ( object sender, MouseEventArgs e ) : void
sender object
e System.Windows.Forms.MouseEventArgs
return void

Control_MouseMove() protected method

protected Control_MouseMove ( object sender, MouseEventArgs e ) : void
sender object
e System.Windows.Forms.MouseEventArgs
return void

Control_MouseUp() protected method

protected Control_MouseUp ( object sender, MouseEventArgs e ) : void
sender object
e System.Windows.Forms.MouseEventArgs
return void

Control_MouseWheel() protected method

protected Control_MouseWheel ( object sender, MouseEventArgs e ) : void
sender object
e System.Windows.Forms.MouseEventArgs
return void

DeNormalizeTargetDistance() protected method

protected DeNormalizeTargetDistance ( float _fNormalizedTargetDistance ) : float
_fNormalizedTargetDistance float
return float

Detach() public method

public Detach ( Control _Control ) : void
_Control System.Windows.Forms.Control
return void

GetDenormalizationFactor() protected method

protected GetDenormalizationFactor ( ) : float
return float

GetEuler() protected method

/// Converts an angle+axis into a plain rotation matrix /// Extracts Euler angles from a rotation matrix
protected GetEuler ( float4x4 _Matrix ) : float3
_Matrix SharpMath.float4x4
return SharpMath.float3

InitializeCamera() public method

public InitializeCamera ( float3 _position, float3 _target, float3 _up ) : void
_position SharpMath.float3
_target SharpMath.float3
_up SharpMath.float3
return void

NormalizeTargetDistance() protected method

protected NormalizeTargetDistance ( float _fDeNormalizedTargetDistance ) : float
_fDeNormalizedTargetDistance float
return float

Property Details

m_ButtonDownCameraTargetDistance protected_oe property

protected float m_ButtonDownCameraTargetDistance
return float

m_ButtonDownMousePosition protected_oe property

protected float2 m_ButtonDownMousePosition
return float2

m_ButtonDownNormalizedTargetDistance protected_oe property

protected float m_ButtonDownNormalizedTargetDistance
return float

m_ButtonDownTargetObjectMatrix protected_oe property

protected float4x4,SharpMath m_ButtonDownTargetObjectMatrix
return SharpMath.float4x4

m_ButtonDownTransform protected_oe property

protected float4x4,SharpMath m_ButtonDownTransform
return SharpMath.float4x4

m_ButtonsDown protected_oe property

protected MouseButtons m_ButtonsDown
return MouseButtons

m_Camera protected_oe property

protected Camera,Nuaj.Cirrus.Utility m_Camera
return Camera

m_CameraTargetDistance protected_oe property

protected float m_CameraTargetDistance
return float

m_CameraTransform protected_oe property

protected float4x4,SharpMath m_CameraTransform
return SharpMath.float4x4

m_Control protected_oe property

protected Control,System.Windows.Forms m_Control
return System.Windows.Forms.Control

m_InvButtonDownTargetObjectMatrix protected_oe property

protected float4x4,SharpMath m_InvButtonDownTargetObjectMatrix
return SharpMath.float4x4

m_ManipulationPanSpeed protected_oe property

protected float m_ManipulationPanSpeed
return float

m_ManipulationRotationSpeed protected_oe property

protected float m_ManipulationRotationSpeed
return float

m_ManipulationZoomAcceleration protected_oe property

protected float m_ManipulationZoomAcceleration
return float

m_ManipulationZoomSpeed protected_oe property

protected float m_ManipulationZoomSpeed
return float

m_NormalizedTargetDistance protected_oe property

protected float m_NormalizedTargetDistance
return float

m_bLastManipulationWasFirstPerson protected_oe property

protected bool m_bLastManipulationWasFirstPerson
return bool

m_bPushingTarget protected_oe property

protected bool m_bPushingTarget
return bool

m_bRotationEnabled protected_oe property

protected bool m_bRotationEnabled
return bool