Skip to main content

PerspectiveCameraUpdateSystem Class Template

Updates camera transforms for active perspective cameras. More...

Declaration

template <typename TMemberHandle> class helios::engine::scene::systems::PerspectiveCameraUpdateSystem<TMemberHandle> { ... }

Public Member Typedefs Index

template <typename TMemberHandle>
usingEngineRoleTag = SystemRole

Role tag used for runtime registration as a system. More...

Public Member Functions Index

template <typename TMemberHandle>
voidupdate (UpdateContext &updateContext) noexcept

Executes the camera update pass for all active camera entities. More...

Description

Updates camera transforms for active perspective cameras.

Recomputes LookAt and Perspective matrices only when the respective target components are marked as dirty.

Template Parameters
TMemberHandle

Camera entity handle type.

Definition at line 35 of file PerspectiveCameraUpdateSystem.ixx.

Public Member Typedefs

EngineRoleTag

template <typename TMemberHandle>
using helios::engine::scene::systems::PerspectiveCameraUpdateSystem< TMemberHandle >::EngineRoleTag = SystemRole

Role tag used for runtime registration as a system.

Definition at line 42 of file PerspectiveCameraUpdateSystem.ixx.

Public Member Functions

update()

template <typename TMemberHandle>
void helios::engine::scene::systems::PerspectiveCameraUpdateSystem< TMemberHandle >::update (UpdateContext & updateContext)
inline noexcept

Executes the camera update pass for all active camera entities.

Parameters
updateContext

Frame-local update context with ECS access.

Definition at line 49 of file PerspectiveCameraUpdateSystem.ixx.

50
51
52 for (auto [entity, p3c, u3c, tp3c, pcc, pmc, vmc, active] : updateContext.view<
61 >().whereEnabled()) {
62
63 if (p3c->isDirty() || tp3c->isDirty() || u3c->isDirty()) {
64 vmc->setValue(helios::math::lookAt(
65 p3c->value(),
66 tp3c->value(),
67 u3c->value()
68 ));
69 }
70
71
72 if (pcc->isDirty()) {
73 pmc->setValue(helios::math::perspective(
74 pcc->fovY(),
75 pcc->aspectRatio(),
76 pcc->zNear(),
77 pcc->zFar()
78 ));
79 }
80
81 }
82
83 }

Reference helios::engine::scene::registerComponents.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.