Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray3D::cCameraParams Class Reference

#include <cCamera.h>

Inheritance diagram for Gray3D::cCameraParams:
Gray3D::cCameraParamsBase

Public Member Functions

 cCameraParams ()
 
 DECLARE_HEAP_ALIGNED_ALLOC (cCameraParams)
 
const cMatrix4x4fget_ProjMatrix () const
 
const cMatrix4x4fget_ViewMatrix () const
 
const cMatrix4x4fget_InvViewMatrix () const
 
const cMatrix4x4fget_View0Matrix () const
 
const cMatrix4x4fget_InvView0Matrix () const
 
const cMatrix4x4fget_ViewProjMatrix () const
 
bool ClampProjectPos (cVector2f &posScreen) const
 
bool GetProjectPos (cVector2f &posScreen, const cVector3f &posTop) const
 
GINTERSECT_TYPE CheckBSphere (const cSpheref &sphere) const
 
GINTERSECT_TYPE CheckBSphere (const cVector3f &vCenter, float fRadius) const
 
GINTERSECT_TYPE CheckBSphereTrans (const cVector3f &vCenter, float fRadius) const
 
void UpdateMatrix ()
 Update all camera params. More...
 
- Public Member Functions inherited from Gray3D::cCameraParamsBase
 cCameraParamsBase ()
 
const cVector3fget_Eye () const noexcept
 
const cVector3fget_Ang () const noexcept
 

Public Attributes

cRectI m_ProjRect
 Cache projection dimension. More...
 
cVector3f m_vAxisCam [AXIS_Trans]
 Derived params. must be recalculated when the camera moves. More...
 
- Public Attributes inherited from Gray3D::cCameraParamsBase
cVector3f m_vEye
 Location point POV eye of the camera. RADIANf_t. More...
 
cVector3f m_vAng
 Euler Angle of the first person camera ray from the m_vEye. (RADIANf_t) Pitch, Bank, Heading. More...
 
METERSf_t m_fFar
 Far plane distance from eye. More...
 
METERSf_t m_fNear
 Near plane distance from eye. More...
 

Static Public Attributes

static const cVector3f k_vLocalSide = cVector3f(1, 0, 0)
 AXIS_X for calculation of m_vAxisCam. More...
 
static const cVector3f k_vLocalUp = cVector3f(0, 1, 0)
 AXIS_Y. More...
 
static const cVector3f k_vLocalAhead = cVector3f(0, 0, 1)
 AXIS_Z. More...
 

Protected Member Functions

void UpdateDerived ()
 

Protected Attributes

cMatrix4x4f m_mProj
 Projection based on m_ProjRect. More...
 
cMatrix4x4f m_mView
 Field of view. More...
 
cMatrix4x4f m_mInvView
 Invert m_mView. More...
 
cMatrix4x4f m_mView0
 m_mView with put_Translation(0,0,0) More...
 
cMatrix4x4f m_mInvView0
 Invert m_mView0. More...
 
cMatrix4x4f m_mViewProj
 Resultant m_mView * m_mProj. More...
 
cHexahedron m_FrustumWindow
 Recalculate when window changes size. i.e m_mProj changes. More...
 

Detailed Description

cCameraParamsBase + derived params. Allow basic position and calculations to be copied to another camera. All camera have these params.

Constructor & Destructor Documentation

◆ cCameraParams()

Gray3D::cCameraParams::cCameraParams ( )

Member Function Documentation

◆ CheckBSphere() [1/2]

GINTERSECT_TYPE Gray3D::cCameraParams::CheckBSphere ( const cSpheref sphere) const
inline

Is Sphere in frustum?

◆ CheckBSphere() [2/2]

GINTERSECT_TYPE Gray3D::cCameraParams::CheckBSphere ( const cVector3f vCenter,
float  fRadius 
) const
inline

Is Sphere in frustum?

◆ CheckBSphereTrans()

GINTERSECT_TYPE Gray3D::cCameraParams::CheckBSphereTrans ( const cVector3f vCenter,
float  fRadius 
) const
inline

Takes sphere vCenter in m_mView WORLD coordinates

◆ ClampProjectPos()

bool Gray3D::cCameraParams::ClampProjectPos ( cVector2f posScreen) const

Clamp the x,y value to the screen rectangle. ClampPtInRect()

Returns
true = off screen.

◆ DECLARE_HEAP_ALIGNED_ALLOC()

Gray3D::cCameraParams::DECLARE_HEAP_ALIGNED_ALLOC ( cCameraParams  )

◆ get_InvView0Matrix()

const cMatrix4x4f& Gray3D::cCameraParams::get_InvView0Matrix ( ) const
inline

◆ get_InvViewMatrix()

const cMatrix4x4f& Gray3D::cCameraParams::get_InvViewMatrix ( ) const
inline

◆ get_ProjMatrix()

const cMatrix4x4f& Gray3D::cCameraParams::get_ProjMatrix ( ) const
inline

◆ get_View0Matrix()

const cMatrix4x4f& Gray3D::cCameraParams::get_View0Matrix ( ) const
inline

◆ get_ViewMatrix()

const cMatrix4x4f& Gray3D::cCameraParams::get_ViewMatrix ( ) const
inline

◆ get_ViewProjMatrix()

const cMatrix4x4f& Gray3D::cCameraParams::get_ViewProjMatrix ( ) const
inline

◆ GetProjectPos()

bool Gray3D::cCameraParams::GetProjectPos ( cVector2f posScreen,
const cVector3f posTop 
) const

Get the 3d position in the cameras projection 2d coordinates.

◆ UpdateDerived()

void Gray3D::cCameraParams::UpdateDerived ( )
protected

update stuff derived from m_mInvView0, m_mView and m_mProj

◆ UpdateMatrix()

void Gray3D::cCameraParams::UpdateMatrix ( )

Update all camera params.

Given cCameraParamsBase m_vEye and m_vAng. Update my matrixes.

Note
m_mProj not set here.

Member Data Documentation

◆ k_vLocalAhead

const cVector3f Gray3D::cCameraParams::k_vLocalAhead = cVector3f(0, 0, 1)
static

AXIS_Z.

◆ k_vLocalSide

const cVector3f Gray3D::cCameraParams::k_vLocalSide = cVector3f(1, 0, 0)
static

AXIS_X for calculation of m_vAxisCam.

◆ k_vLocalUp

const cVector3f Gray3D::cCameraParams::k_vLocalUp = cVector3f(0, 1, 0)
static

AXIS_Y.

◆ m_FrustumWindow

cHexahedron Gray3D::cCameraParams::m_FrustumWindow
protected

Recalculate when window changes size. i.e m_mProj changes.

◆ m_mInvView

cMatrix4x4f Gray3D::cCameraParams::m_mInvView
protected

Invert m_mView.

◆ m_mInvView0

cMatrix4x4f Gray3D::cCameraParams::m_mInvView0
protected

Invert m_mView0.

◆ m_mProj

cMatrix4x4f Gray3D::cCameraParams::m_mProj
protected

Projection based on m_ProjRect.

◆ m_mView

cMatrix4x4f Gray3D::cCameraParams::m_mView
protected

Field of view.

◆ m_mView0

cMatrix4x4f Gray3D::cCameraParams::m_mView0
protected

m_mView with put_Translation(0,0,0)

◆ m_mViewProj

cMatrix4x4f Gray3D::cCameraParams::m_mViewProj
protected

Resultant m_mView * m_mProj.

◆ m_ProjRect

cRectI Gray3D::cCameraParams::m_ProjRect

Cache projection dimension.

In pixels of the camera view output.

◆ m_vAxisCam

cVector3f Gray3D::cCameraParams::m_vAxisCam[AXIS_Trans]

Derived params. must be recalculated when the camera moves.

X, Y, Z transformed axis (Camera local)


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