Skip to main content

PerspectiveCameraComponent Class Template

Component that stores perspective camera projection parameters. More...

Declaration

template <typename THandle> class helios::engine::scene::components::PerspectiveCameraComponent<THandle> { ... }

Public Member Functions Index

template <typename THandle>
voidsetPerspective (float fovY, float aspectRatio, float zNear, float zFar) noexcept

Sets the perspective projection parameters. More...

template <typename THandle>
voidsetZNear (const float zNear) noexcept

Sets the near clipping plane distance. More...

template <typename THandle>
voidsetZFar (const float zFar) noexcept

Sets the far clipping plane distance. More...

template <typename THandle>
voidsetFovY (const float fovY) noexcept

Sets the vertical field of view. More...

template <typename THandle>
voidsetAspectRatio (const float aspectRatio) noexcept

Sets the aspect ratio used by the camera. More...

template <typename THandle>
floatfovY () const noexcept

Gets the current vertical field of view. More...

template <typename THandle>
floataspectRatio () const noexcept

Gets the current aspect ratio. More...

template <typename THandle>
floatzNear () const noexcept

Gets the current near clipping plane distance. More...

template <typename THandle>
floatzFar () const noexcept

Gets the current far clipping plane distance. More...

template <typename THandle>
boolisDirty () const noexcept

Returns whether the component requires projection recomputation. More...

template <typename THandle>
voidclearDirty () noexcept

Clears the dirty flag after dependent systems consumed updates. More...

Private Member Attributes Index

template <typename THandle>
floataspectRatio_ = 1.0f

The aspect ratio of the camera (width/height). More...

template <typename THandle>
floatzNear_ = 0.1f

The near clipping plane distance. More...

template <typename THandle>
floatzFar_ = 1000.0f

The far clipping plane distance. More...

template <typename THandle>
floatfovY_ = radians(90)

The vertical field of view in radians. More...

template <typename THandle>
boolisDirty_ = true

Dirty flag used to signal projection updates. More...

Description

Component that stores perspective camera projection parameters.

Template Parameters
THandle

Owning entity handle type.

Definition at line 23 of file PerspectiveCameraComponent.ixx.

Public Member Functions

aspectRatio()

template <typename THandle>
float helios::engine::scene::components::PerspectiveCameraComponent< THandle >::aspectRatio ()
inline noexcept

Gets the current aspect ratio.

Returns

The aspect ratio (width/height).

Definition at line 135 of file PerspectiveCameraComponent.ixx.

136 return aspectRatio_;
137 }

Referenced by helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setAspectRatio and helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setPerspective.

clearDirty()

template <typename THandle>
void helios::engine::scene::components::PerspectiveCameraComponent< THandle >::clearDirty ()
inline noexcept

Clears the dirty flag after dependent systems consumed updates.

Definition at line 169 of file PerspectiveCameraComponent.ixx.

170 isDirty_ = false;
171 }

fovY()

template <typename THandle>
float helios::engine::scene::components::PerspectiveCameraComponent< THandle >::fovY ()
inline noexcept

Gets the current vertical field of view.

Returns

The vertical field of view in radians.

Definition at line 126 of file PerspectiveCameraComponent.ixx.

127 return fovY_;
128 }

Referenced by helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setFovY and helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setPerspective.

isDirty()

template <typename THandle>
bool helios::engine::scene::components::PerspectiveCameraComponent< THandle >::isDirty ()
inline noexcept

Returns whether the component requires projection recomputation.

Returns

true when values were changed and not yet consumed.

Definition at line 162 of file PerspectiveCameraComponent.ixx.

163 return isDirty_;
164 }

setAspectRatio()

template <typename THandle>
void helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setAspectRatio (const float aspectRatio)
inline noexcept

Sets the aspect ratio used by the camera.

Parameters
aspectRatio

The new aspect ratio (width/height).

Definition at line 116 of file PerspectiveCameraComponent.ixx.

116 void setAspectRatio(const float aspectRatio) noexcept {
117 aspectRatio_ = aspectRatio;
118 }

Reference helios::engine::scene::components::PerspectiveCameraComponent< THandle >::aspectRatio.

setFovY()

template <typename THandle>
void helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setFovY (const float fovY)
inline noexcept

Sets the vertical field of view.

Parameters
fovY

The new vertical field of view in radians.

Definition at line 106 of file PerspectiveCameraComponent.ixx.

106 void setFovY(const float fovY) noexcept {
107 fovY_ = fovY;
108 isDirty_ = true;
109 }

Reference helios::engine::scene::components::PerspectiveCameraComponent< THandle >::fovY.

setPerspective()

template <typename THandle>
void helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setPerspective (float fovY, float aspectRatio, float zNear, float zFar)
inline noexcept

Sets the perspective projection parameters.

Parameters
fovY

The vertical field of view in radians.

aspectRatio

The aspect ratio (width/height).

zNear

The near clipping plane distance.

zFar

The far clipping plane distance.

Definition at line 68 of file PerspectiveCameraComponent.ixx.

68 void setPerspective(float fovY, float aspectRatio, float zNear, float zFar) noexcept {
69 assert(zNear > 0 && "zNear must be positive");
70 assert(zFar > 0 && zFar > zNear && "zFar must be positive and greater than zNear");
71 fovY_ = fovY;
72 aspectRatio_ = aspectRatio;
73 zNear_ = zNear;
74 zFar_ = zFar;
75 isDirty_ = true;
76 }

References helios::engine::scene::components::PerspectiveCameraComponent< THandle >::aspectRatio, helios::engine::scene::components::PerspectiveCameraComponent< THandle >::fovY, helios::engine::scene::registerComponents, helios::engine::scene::components::PerspectiveCameraComponent< THandle >::zFar and helios::engine::scene::components::PerspectiveCameraComponent< THandle >::zNear.

setZFar()

template <typename THandle>
void helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setZFar (const float zFar)
inline noexcept

Sets the far clipping plane distance.

Parameters
zFar

The new far clipping plane distance.

Definition at line 95 of file PerspectiveCameraComponent.ixx.

95 void setZFar(const float zFar) noexcept {
96 assert(zFar > 0 && "zFar must be positive and greater than zNear");
97 zFar_ = zFar;
98 isDirty_ = true;
99 }

References helios::engine::scene::registerComponents and helios::engine::scene::components::PerspectiveCameraComponent< THandle >::zFar.

setZNear()

template <typename THandle>
void helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setZNear (const float zNear)
inline noexcept

Sets the near clipping plane distance.

Parameters
zNear

The new near clipping plane distance.

Definition at line 83 of file PerspectiveCameraComponent.ixx.

83 void setZNear(const float zNear) noexcept {
84 assert(zNear > 0 && "zNear must be positive");
85 zNear_ = zNear;
86
87 isDirty_ = true;
88 }

References helios::engine::scene::registerComponents and helios::engine::scene::components::PerspectiveCameraComponent< THandle >::zNear.

zFar()

template <typename THandle>
float helios::engine::scene::components::PerspectiveCameraComponent< THandle >::zFar ()
inline noexcept

Gets the current far clipping plane distance.

Returns

The far clipping plane distance.

Definition at line 153 of file PerspectiveCameraComponent.ixx.

154 return zFar_;
155 }

Referenced by helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setPerspective and helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setZFar.

zNear()

template <typename THandle>
float helios::engine::scene::components::PerspectiveCameraComponent< THandle >::zNear ()
inline noexcept

Gets the current near clipping plane distance.

Returns

The near clipping plane distance.

Definition at line 144 of file PerspectiveCameraComponent.ixx.

145 return zNear_;
146 }

Referenced by helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setPerspective and helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setZNear.

Private Member Attributes

aspectRatio_

template <typename THandle>
float helios::engine::scene::components::PerspectiveCameraComponent< THandle >::aspectRatio_ = 1.0f

The aspect ratio of the camera (width/height).

Defaults to 1.0.

Definition at line 30 of file PerspectiveCameraComponent.ixx.

30 float aspectRatio_ = 1.0f;

fovY_

template <typename THandle>
float helios::engine::scene::components::PerspectiveCameraComponent< THandle >::fovY_ = radians(90)

The vertical field of view in radians.

Defaults to 90 degrees (converted to radians).

Definition at line 51 of file PerspectiveCameraComponent.ixx.

51 float fovY_ = radians(90);

isDirty_

template <typename THandle>
bool helios::engine::scene::components::PerspectiveCameraComponent< THandle >::isDirty_ = true

Dirty flag used to signal projection updates.

Definition at line 56 of file PerspectiveCameraComponent.ixx.

56 bool isDirty_ = true;

zFar_

template <typename THandle>
float helios::engine::scene::components::PerspectiveCameraComponent< THandle >::zFar_ = 1000.0f

The far clipping plane distance.

Defaults to 1000.0.

Definition at line 44 of file PerspectiveCameraComponent.ixx.

44 float zFar_ = 1000.0f;

zNear_

template <typename THandle>
float helios::engine::scene::components::PerspectiveCameraComponent< THandle >::zNear_ = 0.1f

The near clipping plane distance.

Defaults to 0.1.

Definition at line 37 of file PerspectiveCameraComponent.ixx.

37 float zNear_ = 0.1f;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.