Nebula
Loading...
Searching...
No Matches
Graphics::CameraSettings Class Reference

#include <camerasettings.h>

Public Member Functions

 CameraSettings ()
 default constructor
 
void SetupPerspectiveFov (float fov, float aspect, float zNear, float zFar)
 setup a perspective view volume
 
void SetupOrthogonal (float w, float h, float zNear, float zFar)
 setup an orthogonal projection transform
 
const Math::mat4GetProjTransform () const
 get projection matrix
 
const Math::mat4GetInvProjTransform () const
 get the inverse projection matrix
 
const Math::vec2GetFocalLength () const
 get focal length (computed from fov and aspect ratio)
 
bool IsPerspective () const
 return true if this is a perspective projection
 
bool IsOrthogonal () const
 return true if this is an orthogonal transform
 
float GetZNear () const
 get near plane distance
 
float GetZFar () const
 get far plane distance
 
float GetFov () const
 get field-of-view (only if perspective)
 
float GetAspect () const
 get aspect ration (only if perspective)
 
float GetNearWidth () const
 get width of near plane
 
float GetNearHeight () const
 get height of near plane
 
float GetFarWidth () const
 get width of far plane
 
float GetFarHeight () const
 get height of far plane
 

Private Attributes

Math::mat4 projMatrix
 
Math::mat4 invProjMatrix
 
bool isPersp
 
float zNear
 
float zFar
 
float fov
 
float aspect
 
float nearWidth
 
float nearHeight
 
float farWidth
 
float farHeight
 
Math::vec2 focalLength
 

Constructor & Destructor Documentation

◆ CameraSettings()

Graphics::CameraSettings::CameraSettings ( )

default constructor

Member Function Documentation

◆ GetAspect()

float Graphics::CameraSettings::GetAspect ( ) const
inline

get aspect ration (only if perspective)

◆ GetFarHeight()

float Graphics::CameraSettings::GetFarHeight ( ) const
inline

get height of far plane

◆ GetFarWidth()

float Graphics::CameraSettings::GetFarWidth ( ) const
inline

get width of far plane

◆ GetFocalLength()

const Math::vec2 & Graphics::CameraSettings::GetFocalLength ( ) const
inline

get focal length (computed from fov and aspect ratio)

◆ GetFov()

float Graphics::CameraSettings::GetFov ( ) const
inline

get field-of-view (only if perspective)

◆ GetInvProjTransform()

const Math::mat4 & Graphics::CameraSettings::GetInvProjTransform ( ) const
inline

get the inverse projection matrix

◆ GetNearHeight()

float Graphics::CameraSettings::GetNearHeight ( ) const
inline

get height of near plane

◆ GetNearWidth()

float Graphics::CameraSettings::GetNearWidth ( ) const
inline

get width of near plane

◆ GetProjTransform()

const Math::mat4 & Graphics::CameraSettings::GetProjTransform ( ) const
inline

get projection matrix

◆ GetZFar()

float Graphics::CameraSettings::GetZFar ( ) const
inline

get far plane distance

◆ GetZNear()

float Graphics::CameraSettings::GetZNear ( ) const
inline

get near plane distance

◆ IsOrthogonal()

bool Graphics::CameraSettings::IsOrthogonal ( ) const
inline

return true if this is an orthogonal transform

◆ IsPerspective()

bool Graphics::CameraSettings::IsPerspective ( ) const
inline

return true if this is a perspective projection

◆ SetupOrthogonal()

void Graphics::CameraSettings::SetupOrthogonal ( float w,
float h,
float zNear_,
float zFar_ )

setup an orthogonal projection transform

Setup camera as orthogonal projection.

This method can be called before or after setting up the object. When the object is alive, an update message will be sent to the render-thread.

◆ SetupPerspectiveFov()

void Graphics::CameraSettings::SetupPerspectiveFov ( float fov_,
float aspect_,
float zNear_,
float zFar_ )

setup a perspective view volume

Setup camera as perspective projection.

This method can be called before or after setting up the object. When the object is alive, an update message will be sent to the render-thread.

Member Data Documentation

◆ aspect

float Graphics::CameraSettings::aspect
private

◆ farHeight

float Graphics::CameraSettings::farHeight
private

◆ farWidth

float Graphics::CameraSettings::farWidth
private

◆ focalLength

Math::vec2 Graphics::CameraSettings::focalLength
private

◆ fov

float Graphics::CameraSettings::fov
private

◆ invProjMatrix

Math::mat4 Graphics::CameraSettings::invProjMatrix
private

◆ isPersp

bool Graphics::CameraSettings::isPersp
private

◆ nearHeight

float Graphics::CameraSettings::nearHeight
private

◆ nearWidth

float Graphics::CameraSettings::nearWidth
private

◆ projMatrix

Math::mat4 Graphics::CameraSettings::projMatrix
private

◆ zFar

float Graphics::CameraSettings::zFar
private

◆ zNear

float Graphics::CameraSettings::zNear
private

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