CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::CameraComponent::Accessor Struct Reference

A class that describes access to a CameraComponent. More...

#include <CeresEngine/Scene/Camera.hpp>

Inheritance diagram for CeresEngine::CameraComponent::Accessor:
CeresEngine::Component< T >::Accessor

Public Member Functions

double getFieldOfView () const noexcept
 The camera field of view.
 
void setFieldOfView (double fieldOfView) noexcept
 The camera field of view.
 
double getNearPlane () const noexcept
 The distance where objects near from the camera start clipping.
 
void setNearPlane (double nearPlane) noexcept
 The distance where objects near from the camera start clipping.
 
double getFarPlane () const noexcept
 The distance where objects far from the camera start clipping.
 
void setFarPlane (double farPlane) noexcept
 The distance where objects far from the camera start clipping.
 
double getAspectRatio () const noexcept
 
void setAspectRatio (double aspectRatio) noexcept
 
const GPUImagePtrgetRenderImage () const
 The render target that the camera should render to.
 
void setRenderImage (GPUImagePtr renderImage)
 The render target that the camera should render to.
 
const RendererCameraSettingsgetRendererSettings () const
 A set of settings that should be used by renderer when rendering this camera.
 
void setRendererSettings (const RendererCameraSettings &rendererSettings)
 A set of settings that should be used by renderer when rendering this camera.
 
template<CInvocable< RendererCameraSettings & > Func>
decltype(autoupdateRendererSettings (Func &&func) noexcept
 A set of settings that should be used by renderer when rendering this camera.
 
void changeViewportAspectRatio (double width, double height) noexcept
 Updates the viewport aspect ratio.
 
Matrix4 getProjection () const noexcept
 
Transform getView () const noexcept
 
Vector3 unproject (Vector3 screenSpaceVector) const noexcept
 Transforms a screen-space coordinates vector screenSpaceVector into world coordinates vector.
 
Vector3 project (Vector3 worldSpaceVector) const noexcept
 Transforms a world-space coordinates vector worldSpaceVector into screen-space coordinates vector.
 
Ray toRay (const Point2 &point) const noexcept
 
bool visible (Vector3 worldSpaceVector) const noexcept
 Checks a world-space coordinates vector is visible from the camera.
 
bool visible (const AABox &boundingBox) const noexcept
 Checks if the bounding box is visible from the camera.
 
- Public Member Functions inherited from CeresEngine::Component< T >::Accessor
 Accessor (const Entity &entity)
 

Static Public Member Functions

template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 

Additional Inherited Members

- Public Attributes inherited from CeresEngine::Component< T >::Accessor
const Entityentity
 
- Protected Types inherited from CeresEngine::Component< T >::Accessor
using C = TC
 
- Protected Member Functions inherited from CeresEngine::Component< T >::Accessor
template<typename T >
auto mutate (T C::*ptr)
 Accesses an element from an existing Component.
 
template<typename MutatorFunc , typename T >
requires (CInvocable<MutatorFunc, T&>)
decltype(automutate (MutatorFunc &&func, T C::*ptr)
 Accesses an element from an existing Component.
 
template<typename T1 , typename T2 , typename... Ts>
Tuple< ComponentFieldMutator< T1, C >, ComponentFieldMutator< T2, C >, ComponentFieldMutator< Ts, C >... > mutate (T1 C::*ptr1, T2 C::*ptr2, Ts C::*... ptrs)
 TODO Write docs.
 
template<typename MutatorFunc , typename T1 , typename T2 , typename... Ts>
Tuple< ComponentFieldMutator< T1, C >, ComponentFieldMutator< T2, C >, ComponentFieldMutator< Ts, C >... > mutate (MutatorFunc &&func, T1 C::*ptr1, T2 C::*ptr2, Ts C::*... ptr)
 
template<typename T >
auto get (T C::*ptr)
 Accesses an element from an existing Component.
 
template<typename T1 , typename T2 , typename... Ts>
Tuple< ComponentFieldMutator< T1, C >, ComponentFieldMutator< T2, C >, ComponentFieldMutator< Ts, C >... > get (T1 C::*ptr1, T2 C::*ptr2, Ts C::*... ptrs)
 Accesses an element from an existing Component.
 
template<typename T >
const Tread (const T C::*ptr) const
 Accesses an element from an existing Component.
 
template<typename T1 , typename T2 , typename... Ts>
Tuple< const T1 &, const T2 &, const Ts &... > read (const T1 C::*ptr1, const T2 C::*ptr2, const Ts C::*... ptrs) const
 TODO Write docs.
 
template<typename T >
const Tget (const T C::*ptr) const
 Accesses an element from an existing Component.
 
template<typename T1 , typename T2 , typename... Ts>
Tuple< const T1 &, const T2 &, const Ts &... > get (const T1 C::*ptr1, const T2 C::*ptr2, const Ts C::*... ptrs) const
 Accesses an element from an existing Component.
 

Detailed Description

A class that describes access to a CameraComponent.

Member Function Documentation

◆ changeViewportAspectRatio()

void CeresEngine::CameraComponent::Accessor::changeViewportAspectRatio ( double  width,
double  height 
)
noexcept

Updates the viewport aspect ratio.

Parameters
widthThe viewport width
heightThe viewport height

◆ getAspectRatio()

double CeresEngine::CameraComponent::Accessor::getAspectRatio ( ) const
noexcept
Returns
The screen aspect ration

◆ getFarPlane()

double CeresEngine::CameraComponent::Accessor::getFarPlane ( ) const
noexcept

The distance where objects far from the camera start clipping.

Returns
The distance where objects far from the camera start clipping

◆ getFieldOfView()

double CeresEngine::CameraComponent::Accessor::getFieldOfView ( ) const
noexcept

The camera field of view.

◆ getNearPlane()

double CeresEngine::CameraComponent::Accessor::getNearPlane ( ) const
noexcept

The distance where objects near from the camera start clipping.

Returns
The distance where objects near the camera start clipping

◆ getProjection()

Matrix4 CeresEngine::CameraComponent::Accessor::getProjection ( ) const
noexcept
Returns
The camera projection transformation matrix

◆ getRendererSettings()

const RendererCameraSettings & CeresEngine::CameraComponent::Accessor::getRendererSettings ( ) const

A set of settings that should be used by renderer when rendering this camera.

◆ getRenderImage()

const GPUImagePtr & CeresEngine::CameraComponent::Accessor::getRenderImage ( ) const

The render target that the camera should render to.

◆ getView()

Transform CeresEngine::CameraComponent::Accessor::getView ( ) const
noexcept
Returns
The camera view transformation matrix

◆ project()

Vector3 CeresEngine::CameraComponent::Accessor::project ( Vector3  worldSpaceVector) const
noexcept

Transforms a world-space coordinates vector worldSpaceVector into screen-space coordinates vector.

Parameters
worldSpaceVectorThe world-space vector to be
Returns
The transformed (in screen-space coordinates) vector

◆ reflect()

template<typename Processor >
static constexpr void CeresEngine::CameraComponent::Accessor::reflect ( Processor &&  RTTI)
inlinestaticconstexpr

Executes the given processor for every field of the struct.

Parameters
RTTIThe processor to be ran for every field.

◆ setAspectRatio()

void CeresEngine::CameraComponent::Accessor::setAspectRatio ( double  aspectRatio)
noexcept
Parameters
aspectRatioThe screen aspect ration

◆ setFarPlane()

void CeresEngine::CameraComponent::Accessor::setFarPlane ( double  farPlane)
noexcept

The distance where objects far from the camera start clipping.

Parameters
farPlaneThe distance where objects far from the camera start clipping

◆ setFieldOfView()

void CeresEngine::CameraComponent::Accessor::setFieldOfView ( double  fieldOfView)
noexcept

The camera field of view.

Parameters
fieldOfViewThe camera's new field of view angle

◆ setNearPlane()

void CeresEngine::CameraComponent::Accessor::setNearPlane ( double  nearPlane)
noexcept

The distance where objects near from the camera start clipping.

Parameters
nearPlaneThe distance where objects near the camera start clipping

◆ setRendererSettings()

void CeresEngine::CameraComponent::Accessor::setRendererSettings ( const RendererCameraSettings rendererSettings)

A set of settings that should be used by renderer when rendering this camera.

◆ setRenderImage()

void CeresEngine::CameraComponent::Accessor::setRenderImage ( GPUImagePtr  renderImage)

The render target that the camera should render to.

◆ toRay()

Ray CeresEngine::CameraComponent::Accessor::toRay ( const Point2 &  point) const
noexcept

◆ unproject()

Vector3 CeresEngine::CameraComponent::Accessor::unproject ( Vector3  screenSpaceVector) const
noexcept

Transforms a screen-space coordinates vector screenSpaceVector into world coordinates vector.

Parameters
screenSpaceVectorThe screen-space vector to be transformed
Returns
The transformed (in world-space coordinates) vector

◆ updateRendererSettings()

template<CInvocable< RendererCameraSettings & > Func>
decltype(auto) CeresEngine::CameraComponent::Accessor::updateRendererSettings ( Func &&  func)
inlinenoexcept

A set of settings that should be used by renderer when rendering this camera.

◆ visible() [1/2]

bool CeresEngine::CameraComponent::Accessor::visible ( const AABox &  boundingBox) const
noexcept

Checks if the bounding box is visible from the camera.

Parameters
boundingBox
Returns

◆ visible() [2/2]

bool CeresEngine::CameraComponent::Accessor::visible ( Vector3  worldSpaceVector) const
noexcept

Checks a world-space coordinates vector is visible from the camera.

Parameters
worldSpaceVectorThe world-space vector to be checked for visibility
Returns
true if the point is visible from the camera perspective, false otherwise.

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