Pyrogenesis trunk
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
CCamera Class Reference

#include <Camera.h>

Collaboration diagram for CCamera:
Collaboration graph
[legend]

Public Types

enum class  ProjectionType { CUSTOM , ORTHO , PERSPECTIVE }
 
using Quad = std::array< CVector3D, 4 >
 

Public Member Functions

 CCamera ()
 
 ~CCamera ()
 
CMatrix3DGetProjection ()
 
const CMatrix3DGetProjection () const
 
CMatrix3D GetViewProjection () const
 
void SetProjection (const CMatrix3D &matrix)
 
void SetProjectionFromCamera (const CCamera &camera)
 
void SetOrthoProjection (float nearp, float farp, float scale)
 
void SetPerspectiveProjection (float nearp, float farp, float fov)
 
ProjectionType GetProjectionType () const
 
CMatrix3DGetOrientation ()
 
const CMatrix3DGetOrientation () const
 
void UpdateFrustum (const CBoundingBoxAligned &scissor=CBoundingBoxAligned(CVector3D(-1.0f, -1.0f, -1.0f), CVector3D(1.0f, 1.0f, 1.0f)))
 
void ClipFrustum (const CPlane &clipPlane)
 
const CFrustumGetFrustum () const
 
void SetViewPort (const SViewPort &viewport)
 
const SViewPortGetViewPort () const
 
float GetAspectRatio () const
 
float GetNearPlane () const
 
float GetFarPlane () const
 
float GetFOV () const
 
float GetOrthoScale () const
 
void GetViewQuad (float dist, Quad &quad) const
 
void BuildCameraRay (int px, int py, CVector3D &origin, CVector3D &dir) const
 
void GetScreenCoordinates (const CVector3D &world, float &x, float &y) const
 
CVector3D GetWorldCoordinates (int px, int py, bool aboveWater=false) const
 
CVector3D GetWorldCoordinates (int px, int py, float h) const
 
CVector3D GetFocus () const
 
CBoundingBoxAligned GetBoundsInViewPort (const CBoundingBoxAligned &boundigBox) const
 
void LookAt (const CVector3D &camera, const CVector3D &focus, const CVector3D &up)
 
void LookAlong (const CVector3D &camera, CVector3D orientation, CVector3D up)
 

Public Attributes

CMatrix3D m_Orientation
 
float m_FOV
 
float m_OrthoScale
 

Private Attributes

CMatrix3D m_ProjMat
 
ProjectionType m_ProjType = ProjectionType::CUSTOM
 
float m_NearPlane = 0.0f
 
float m_FarPlane = 0.0f
 
union {
   float   m_FOV
 
   float   m_OrthoScale
 
}; 
 
SViewPort m_ViewPort
 
CFrustum m_ViewFrustum
 

Member Typedef Documentation

◆ Quad

using CCamera::Quad = std::array<CVector3D, 4>

Member Enumeration Documentation

◆ ProjectionType

enum class CCamera::ProjectionType
strong
Enumerator
CUSTOM 
ORTHO 
PERSPECTIVE 

Constructor & Destructor Documentation

◆ CCamera()

CCamera::CCamera ( )

◆ ~CCamera()

CCamera::~CCamera ( )
default

Member Function Documentation

◆ BuildCameraRay()

void CCamera::BuildCameraRay ( int  px,
int  py,
CVector3D origin,
CVector3D dir 
) const

◆ ClipFrustum()

void CCamera::ClipFrustum ( const CPlane clipPlane)

◆ GetAspectRatio()

float CCamera::GetAspectRatio ( ) const

◆ GetBoundsInViewPort()

CBoundingBoxAligned CCamera::GetBoundsInViewPort ( const CBoundingBoxAligned boundigBox) const

◆ GetFarPlane()

float CCamera::GetFarPlane ( ) const
inline

◆ GetFocus()

CVector3D CCamera::GetFocus ( ) const

◆ GetFOV()

float CCamera::GetFOV ( ) const
inline

◆ GetFrustum()

const CFrustum & CCamera::GetFrustum ( ) const
inline

◆ GetNearPlane()

float CCamera::GetNearPlane ( ) const
inline

◆ GetOrientation() [1/2]

CMatrix3D & CCamera::GetOrientation ( )
inline

◆ GetOrientation() [2/2]

const CMatrix3D & CCamera::GetOrientation ( ) const
inline

◆ GetOrthoScale()

float CCamera::GetOrthoScale ( ) const
inline

◆ GetProjection() [1/2]

CMatrix3D & CCamera::GetProjection ( )
inline

◆ GetProjection() [2/2]

const CMatrix3D & CCamera::GetProjection ( ) const
inline

◆ GetProjectionType()

ProjectionType CCamera::GetProjectionType ( ) const
inline

◆ GetScreenCoordinates()

void CCamera::GetScreenCoordinates ( const CVector3D world,
float &  x,
float &  y 
) const

◆ GetViewPort()

const SViewPort & CCamera::GetViewPort ( ) const
inline

◆ GetViewProjection()

CMatrix3D CCamera::GetViewProjection ( ) const
inline

◆ GetViewQuad()

void CCamera::GetViewQuad ( float  dist,
Quad quad 
) const

◆ GetWorldCoordinates() [1/2]

CVector3D CCamera::GetWorldCoordinates ( int  px,
int  py,
bool  aboveWater = false 
) const

◆ GetWorldCoordinates() [2/2]

CVector3D CCamera::GetWorldCoordinates ( int  px,
int  py,
float  h 
) const

◆ LookAlong()

void CCamera::LookAlong ( const CVector3D camera,
CVector3D  orientation,
CVector3D  up 
)

◆ LookAt()

void CCamera::LookAt ( const CVector3D camera,
const CVector3D focus,
const CVector3D up 
)

◆ SetOrthoProjection()

void CCamera::SetOrthoProjection ( float  nearp,
float  farp,
float  scale 
)

◆ SetPerspectiveProjection()

void CCamera::SetPerspectiveProjection ( float  nearp,
float  farp,
float  fov 
)

◆ SetProjection()

void CCamera::SetProjection ( const CMatrix3D matrix)

◆ SetProjectionFromCamera()

void CCamera::SetProjectionFromCamera ( const CCamera camera)

◆ SetViewPort()

void CCamera::SetViewPort ( const SViewPort viewport)

◆ UpdateFrustum()

void CCamera::UpdateFrustum ( const CBoundingBoxAligned scissor = CBoundingBoxAligned(CVector3D(-1.0f, -1.0f, -1.0f), CVector3D(1.0f, 1.0f, 1.0f)))

Member Data Documentation

◆ 

union { ... } CCamera::@1

◆ m_FarPlane

float CCamera::m_FarPlane = 0.0f
private

◆ m_FOV

float CCamera::m_FOV

◆ m_NearPlane

float CCamera::m_NearPlane = 0.0f
private

◆ m_Orientation

CMatrix3D CCamera::m_Orientation

◆ m_OrthoScale

float CCamera::m_OrthoScale

◆ m_ProjMat

CMatrix3D CCamera::m_ProjMat
private

◆ m_ProjType

ProjectionType CCamera::m_ProjType = ProjectionType::CUSTOM
private

◆ m_ViewFrustum

CFrustum CCamera::m_ViewFrustum
private

◆ m_ViewPort

SViewPort CCamera::m_ViewPort
private

The documentation for this class was generated from the following files: