C# Class Nuaj.Cirrus.Utility.Camera

The Camera class doesn't wrap any DirectX component per-se but helps a lot to handle basic displacement and projections NOTES : _ The projection float4x4 is Left Handed _ The Local2World float4x4 is left handed (all other matrices in Nuaj are right handed !) A typical camera float4x4 looks like this : Y (Up) ^ | Z (At) | / | / | / |/ o---------> X (Right)
ファイルを表示 Open project: Patapom/GodComplex Class Usage Examples

Protected Properties

Property Type Description
m_AspectRatio float
m_CachedCameraData float4
m_Camera2Proj SharpMath.float4x4
m_Camera2World SharpMath.float4x4
m_Far float
m_Near float
m_OrthoHeight float
m_PerspFOV float
m_Proj2Camera SharpMath.float4x4
m_Proj2World SharpMath.float4x4
m_World2Camera SharpMath.float4x4
m_World2Proj SharpMath.float4x4
m_bActive bool
m_bIsPerspective bool

Private Properties

Property Type Description

Public Methods

Method Description
BuildCameraRay ( float _X, float _Y, float3 &_Position, float3 &_Direction ) : void

/// Builds a camera ray in WORLD space ///

Builds a camera ray in CAMERA space

Camera ( ) : System

Creates a default camera

CreatePerspectiveCamera ( float _FOV, float _AspectRatio, float _Near, float _Far ) : void

Creates a perspective projection float4x4 for the camera

LookAt ( float3 _Eye, float3 _Target, float3 _Up ) : void

Makes the camera look at the specified target from the specified eye position

ProjectPoint ( float3 _Position ) : float2

Projects a 3D point in 2D

ProjectVector ( float3 _Vector ) : float2

Projects a 3D vector in 2D

Protected Methods

Method Description
RebuildProjection ( ) : void

/// Creates an orthogonal projection float4x4 for the camera ///

Rebuilds the camera projection data after a change

Method Details

BuildCameraRay() public method

/// Builds a camera ray in WORLD space /// Builds a camera ray in CAMERA space
public BuildCameraRay ( float _X, float _Y, float3 &_Position, float3 &_Direction ) : void
_X float The normalized X coordinate in [0,1] (0 is left screen border and 1 is right screen border)
_Y float The normalized Y coordinate in [0,1] (0 is top screen border and 1 is bottom screen border)
_Position SharpMath.float3
_Direction SharpMath.float3
return void

Camera() public method

Creates a default camera
public Camera ( ) : System
return System

CreatePerspectiveCamera() public method

Creates a perspective projection float4x4 for the camera
public CreatePerspectiveCamera ( float _FOV, float _AspectRatio, float _Near, float _Far ) : void
_FOV float
_AspectRatio float
_Near float
_Far float
return void

LookAt() public method

Makes the camera look at the specified target from the specified eye position
public LookAt ( float3 _Eye, float3 _Target, float3 _Up ) : void
_Eye SharpMath.float3
_Target SharpMath.float3
_Up SharpMath.float3
return void

ProjectPoint() public method

Projects a 3D point in 2D
public ProjectPoint ( float3 _Position ) : float2
_Position SharpMath.float3
return float2

ProjectVector() public method

Projects a 3D vector in 2D
public ProjectVector ( float3 _Vector ) : float2
_Vector SharpMath.float3
return float2

RebuildProjection() protected method

/// Creates an orthogonal projection float4x4 for the camera /// Rebuilds the camera projection data after a change
protected RebuildProjection ( ) : void
return void

Property Details

m_AspectRatio protected_oe property

protected float m_AspectRatio
return float

m_CachedCameraData protected_oe property

protected float4 m_CachedCameraData
return float4

m_Camera2Proj protected_oe property

protected float4x4,SharpMath m_Camera2Proj
return SharpMath.float4x4

m_Camera2World protected_oe property

protected float4x4,SharpMath m_Camera2World
return SharpMath.float4x4

m_Far protected_oe property

protected float m_Far
return float

m_Near protected_oe property

protected float m_Near
return float

m_OrthoHeight protected_oe property

protected float m_OrthoHeight
return float

m_PerspFOV protected_oe property

protected float m_PerspFOV
return float

m_Proj2Camera protected_oe property

protected float4x4,SharpMath m_Proj2Camera
return SharpMath.float4x4

m_Proj2World protected_oe property

protected float4x4,SharpMath m_Proj2World
return SharpMath.float4x4

m_World2Camera protected_oe property

protected float4x4,SharpMath m_World2Camera
return SharpMath.float4x4

m_World2Proj protected_oe property

protected float4x4,SharpMath m_World2Proj
return SharpMath.float4x4

m_bActive protected_oe property

protected bool m_bActive
return bool

m_bIsPerspective protected_oe property

protected bool m_bIsPerspective
return bool