The Joe Engine
Joe's engine programming playground
JoeEngine::JECamera Class Reference

The JECamera class. More...

#include <Camera.h>

Public Member Functions

 JECamera ()
 Default constructor. More...
 
 JECamera (glm::vec3 e, glm::vec3 r, float a, float n, float f)
 Constructor. More...
 
 ~JECamera ()=default
 Destructor (default). More...
 
void TranslateAlongLook (float amount)
 
void TranslateAlongRight (float amount)
 
void TranslateAlongUp (float amount)
 
void RotateAboutLook (float amount)
 
void RotateAboutRight (float amount)
 
void RotateAboutUp (float amount)
 
void SetAspect (float a)
 
void SetEye (glm::vec3 e)
 
const glm::mat4 & GetView () const
 Get view matrix. More...
 
const glm::mat4 & GetProj () const
 Get projection matrix. More...
 
const glm::mat4 & GetViewProj () const
 Get view-projection matrix. More...
 
const glm::mat4 & GetInvView () const
 Get inverse view matrix. More...
 
const glm::mat4 & GetInvProj () const
 Get inverse projection matrix. More...
 
glm::mat4 GetOrthoViewProj () const
 Get orthographic view-projection matrix. More...
 
float GetNearPlane () const
 Get near clip plane value. More...
 
float GetFarPlane () const
 Get far clip plane value. More...
 
bool Cull (const TransformComponent &transformComponent, const BoundingBoxData &boundingBox) const
 Frustum cull. More...
 

Detailed Description

The JECamera class.

This class manages all data necessary for a rendering camera. This class is used for both perspective rendering as well as orthographics projections, such as shadow maps. View/projection matrices are cached.

Constructor & Destructor Documentation

◆ JECamera() [1/2]

JoeEngine::JECamera::JECamera ( )
inline

Default constructor.

Invokes other constructor.

◆ JECamera() [2/2]

JoeEngine::JECamera::JECamera ( glm::vec3  e,
glm::vec3  r,
float  a,
float  n,
float  f 
)
inline

Constructor.

Initializes all member variables and computes view/projection matrices.

◆ ~JECamera()

JoeEngine::JECamera::~JECamera ( )
default

Destructor (default).

Member Function Documentation

◆ Cull()

bool JoeEngine::JECamera::Cull ( const TransformComponent transformComponent,
const BoundingBoxData boundingBox 
) const
inline

Frustum cull.

Given a bounding box and transformation, check whether it should be culled due to being outside of the view frustum.

Parameters
transformComponentthe world transformation of the bounding box.
boundingBoxthe bounding box data
Returns
true if the bounding box passed culling (was NOT culled), false otherwise.

◆ GetFarPlane()

float JoeEngine::JECamera::GetFarPlane ( ) const
inline

Get far clip plane value.

◆ GetInvProj()

const glm::mat4& JoeEngine::JECamera::GetInvProj ( ) const
inline

Get inverse projection matrix.

◆ GetInvView()

const glm::mat4& JoeEngine::JECamera::GetInvView ( ) const
inline

Get inverse view matrix.

◆ GetNearPlane()

float JoeEngine::JECamera::GetNearPlane ( ) const
inline

Get near clip plane value.

◆ GetOrthoViewProj()

glm::mat4 JoeEngine::JECamera::GetOrthoViewProj ( ) const
inline

Get orthographic view-projection matrix.

◆ GetProj()

const glm::mat4& JoeEngine::JECamera::GetProj ( ) const
inline

Get projection matrix.

◆ GetView()

const glm::mat4& JoeEngine::JECamera::GetView ( ) const
inline

Get view matrix.

◆ GetViewProj()

const glm::mat4& JoeEngine::JECamera::GetViewProj ( ) const
inline

Get view-projection matrix.

◆ RotateAboutLook()

void JoeEngine::JECamera::RotateAboutLook ( float  amount)
inline

Rotate camera about look vector.

Parameters
amounthow much to rotate by in radians.

◆ RotateAboutRight()

void JoeEngine::JECamera::RotateAboutRight ( float  amount)
inline

Rotate camera about right vector.

Parameters
amounthow much to rotate by in radians.

◆ RotateAboutUp()

void JoeEngine::JECamera::RotateAboutUp ( float  amount)
inline

Rotate camera about up vector.

Parameters
amounthow much to rotate by in radians.

◆ SetAspect()

void JoeEngine::JECamera::SetAspect ( float  a)
inline

Update camera aspect ratio.

Parameters
athe new aspect ratio.

◆ SetEye()

void JoeEngine::JECamera::SetEye ( glm::vec3  e)
inline

Update camera eye position.

Parameters
ethe new eye position.

◆ TranslateAlongLook()

void JoeEngine::JECamera::TranslateAlongLook ( float  amount)
inline

Translate camera along look vector.

Parameters
amounthow much to translate by.

◆ TranslateAlongRight()

void JoeEngine::JECamera::TranslateAlongRight ( float  amount)
inline

Translate camera along right vector.

Parameters
amounthow much to translate by.

◆ TranslateAlongUp()

void JoeEngine::JECamera::TranslateAlongUp ( float  amount)
inline

Translate camera along up vector.

Parameters
amounthow much to translate by.

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