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 Typedefs Index

template <typename THandle>
usingValue_type = helios::math::vec4f
template <typename THandle>
usingHandle_type = THandle

Public Constructors Index

template <typename THandle>
PerspectiveCameraComponent (const float fovY, const float aspectRatio, const float zNear=0.1f, const float zFar=1000.0f)

Public Member Functions Index

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

Sets the perspective projection parameters. More...

template <typename THandle>
voidsetValue (const Value_type &value) noexcept

Sets the value of the perspective camera component as a vec4f. 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...

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...

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 Typedefs

Handle_type

template <typename THandle>
using helios::engine::scene::components::PerspectiveCameraComponent< THandle >::Handle_type = THandle

Definition at line 57 of file PerspectiveCameraComponent.ixx.

57 using Handle_type = THandle;

Value_type

template <typename THandle>
using helios::engine::scene::components::PerspectiveCameraComponent< THandle >::Value_type = helios::math::vec4f

Definition at line 55 of file PerspectiveCameraComponent.ixx.

55 using Value_type = helios::math::vec4f;

Public Constructors

PerspectiveCameraComponent()

Public Member Functions

aspectRatio()

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

fovY()

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

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 125 of file PerspectiveCameraComponent.ixx.

125 void setAspectRatio(const float aspectRatio) noexcept {
126 aspectRatio_ = aspectRatio;
127 }

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 116 of file PerspectiveCameraComponent.ixx.

116 void setFovY(const float fovY) noexcept {
117 fovY_ = fovY;
118 }

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

setPerspective()

template <typename THandle>
void helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setPerspective (const float fovY, const float aspectRatio, const float zNear, const 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 71 of file PerspectiveCameraComponent.ixx.

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

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.

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

setValue()

template <typename THandle>
void helios::engine::scene::components::PerspectiveCameraComponent< THandle >::setValue (const Value_type & value)
inline noexcept

Sets the value of the perspective camera component as a vec4f.

Parameters
value
See Also

setPerspective

Definition at line 87 of file PerspectiveCameraComponent.ixx.

87 void setValue(const Value_type& value) noexcept {
88 setPerspective(value[0], value[1], value[2], value[3]);
89 }

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

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 106 of file PerspectiveCameraComponent.ixx.

106 void setZFar(const float zFar) noexcept {
107 assert(zFar > 0 && zFar > zNear_ && "zFar must be positive and greater than zNear");
108 zFar_ = zFar;
109 }

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 96 of file PerspectiveCameraComponent.ixx.

96 void setZNear(const float zNear) noexcept {
97 assert(zNear > 0 && "zNear must be positive");
98 zNear_ = zNear;
99 }

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

zNear()

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

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);

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.