Skip to main content

Snapshot Class

Represents an immutable snapshot of a SceneGraph at a given point in time. More...

Declaration

class helios::scene::Snapshot { ... }

Public Constructors Index

Snapshot (const Snapshot &)=delete

Delete copy constructor. More...

Snapshot (Snapshot &&) noexcept=delete

Delete move constructor. More...

Snapshot (const helios::rendering::Viewport &viewport, const math::mat4f &projectionMatrix, const math::mat4f &viewMatrix, std::vector< SnapshotItem > snapshotItems) noexcept

Constructs a new immutable Snapshot from the given data. More...

Public Destructor Index

~Snapshot ()=default

Public Operators Index

Snapshot &operator= (const Snapshot &)=delete

Delete copy assignment operator. More...

Snapshot &operator= (Snapshot &&) noexcept=delete

Delete move assignment. More...

Public Member Functions Index

std::span< const SnapshotItem >snapshotItems () const noexcept

Returns a const reference to this Snapshot's SnapshotItems. More...

const helios::rendering::Viewport &viewport () const noexcept

Returns the viewport associated with this Snapshot. More...

const helios::math::mat4f &projectionMatrix () const noexcept

Returns a const reference to the projection matrix for this Snapshot. More...

const helios::math::mat4f &viewMatrix () const noexcept

Returns a const reference to the view matrix for this Snapshot. More...

Protected Member Attributes Index

const helios::math::mat4fprojectionMatrix_

The projection matrix that should be used with this Snapshot. More...

const helios::math::mat4fviewMatrix_

The view matrix that should be used with this Snapshot. More...

const std::vector< SnapshotItem >snapshotItems_

A const collection of `SnapshotItem`s representing all renderable objects visible in this Snapshot. More...

const helios::rendering::Viewport &viewport_

The viewport associated with this Snapshot. More...

Description

Represents an immutable snapshot of a SceneGraph at a given point in time.

The class encapsulates all necessary data to render a single frame. It is designed to be a lightweight DTO to pass information to the rendering engine abstraction layer, such as the `RenderPass` class.

A snapshot includes a camera's projection and view matrix that should be used for rendering the scene. A collection of `SnapshotItems` holds the information about the renderable objects in the scene, preferably computed by using a `FrustumCullingStrategy` (

See Also

Scene::createSnapshot).

The class is not copyable to enforce its immutability and prevent unintended duplication of potentially large data sets.

Definition at line 35 of file Snapshot.ixx.

Public Constructors

Snapshot()

helios::scene::Snapshot::Snapshot (const Snapshot &)
delete

Delete copy constructor.

Snapshots are not intended to be copied.

Definition at line 73 of file Snapshot.ixx.

Reference Snapshot.

Referenced by operator=, operator=, Snapshot, Snapshot and Snapshot.

Snapshot()

helios::scene::Snapshot::Snapshot (Snapshot &&)
noexcept delete

Delete move constructor.

Definition at line 85 of file Snapshot.ixx.

Reference Snapshot.

Snapshot()

helios::scene::Snapshot::Snapshot (const helios::rendering::Viewport & viewport, const math::mat4f & projectionMatrix, const math::mat4f & viewMatrix, std::vector< SnapshotItem > snapshotItems)
inline noexcept

Constructs a new immutable Snapshot from the given data.

Parameters
viewport

The viewport associated with this snapshot.

projectionMatrix

The projection matrix of the camera for this snapshot.

viewMatrix

The view matrix of the camera for this snapshot.

snapshotItems

A vector of snapshot items. The vector is moved into the Snapshot, transferring ownership to this instance.

Definition at line 101 of file Snapshot.ixx.

102 const helios::rendering::Viewport& viewport,
103 const math::mat4f& projectionMatrix,
104 const math::mat4f& viewMatrix,
105 std::vector<SnapshotItem> snapshotItems) noexcept :
110 {}

References projectionMatrix, projectionMatrix_, Snapshot, snapshotItems, snapshotItems_, viewMatrix, viewMatrix_, viewport and viewport_.

Public Destructor

~Snapshot()

helios::scene::Snapshot::~Snapshot ()
default

Definition at line 66 of file Snapshot.ixx.

Public Operators

operator=()

Snapshot & helios::scene::Snapshot::operator= (const Snapshot &)
delete

Delete copy assignment operator.

Snapshots are not intended to be copied.

Definition at line 80 of file Snapshot.ixx.

Reference Snapshot.

operator=()

Snapshot & helios::scene::Snapshot::operator= (Snapshot &&)
noexcept delete

Delete move assignment.

Definition at line 90 of file Snapshot.ixx.

Reference Snapshot.

Public Member Functions

projectionMatrix()

const helios::math::mat4f & helios::scene::Snapshot::projectionMatrix ()
inline nodiscard noexcept

Returns a const reference to the projection matrix for this Snapshot.

The matrix represents the projection matrix of the camera that was used to capture this scene.

Returns

A const reference to the projection matrix used for creating this Snapshot.

Definition at line 140 of file Snapshot.ixx.

140 [[nodiscard]] const helios::math::mat4f& projectionMatrix() const noexcept {
141 return projectionMatrix_;
142 }

Reference projectionMatrix_.

Referenced by helios::rendering::RenderPassFactory::buildRenderPass and Snapshot.

snapshotItems()

std::span< const SnapshotItem > helios::scene::Snapshot::snapshotItems ()
inline nodiscard noexcept

Returns a const reference to this Snapshot's SnapshotItems.

The vector contains all renderable items in the scene.

Returns

A const reference to this Snapshot's collection of SnapshotItems.

Definition at line 119 of file Snapshot.ixx.

119 [[nodiscard]] std::span<const SnapshotItem> snapshotItems() const noexcept {
120 return snapshotItems_;
121 }

Reference snapshotItems_.

Referenced by helios::rendering::RenderPassFactory::populateRenderQueue and Snapshot.

viewMatrix()

const helios::math::mat4f & helios::scene::Snapshot::viewMatrix ()
inline nodiscard noexcept

Returns a const reference to the view matrix for this Snapshot.

The matrix represents the view matrix of the camera that was used to capture this scene.

Returns

A const reference to the view matrix used for creating this Snapshot.

Definition at line 152 of file Snapshot.ixx.

152 [[nodiscard]] const helios::math::mat4f& viewMatrix() const noexcept {
153 return viewMatrix_;
154 }

Reference viewMatrix_.

Referenced by helios::rendering::RenderPassFactory::buildRenderPass and Snapshot.

viewport()

const helios::rendering::Viewport & helios::scene::Snapshot::viewport ()
inline nodiscard noexcept

Returns the viewport associated with this Snapshot.

Returns

A shared pointer to the const Viewport.

Definition at line 128 of file Snapshot.ixx.

128 [[nodiscard]] const helios::rendering::Viewport& viewport() const noexcept {
129 return viewport_;
130 }

Reference viewport_.

Referenced by helios::rendering::RenderPassFactory::buildRenderPass and Snapshot.

Protected Member Attributes

projectionMatrix_

const helios::math::mat4f helios::scene::Snapshot::projectionMatrix_
protected

The projection matrix that should be used with this Snapshot.

The projection matrix transforms camera space into clip space.

Definition at line 43 of file Snapshot.ixx.

Referenced by projectionMatrix and Snapshot.

snapshotItems_

const std::vector<SnapshotItem> helios::scene::Snapshot::snapshotItems_
protected

A const collection of `SnapshotItem`s representing all renderable objects visible in this Snapshot.

Each item contains the world transformation along with the renderable object.

Definition at line 57 of file Snapshot.ixx.

57 const std::vector<SnapshotItem> snapshotItems_;

Referenced by Snapshot and snapshotItems.

viewMatrix_

const helios::math::mat4f helios::scene::Snapshot::viewMatrix_
protected

The view matrix that should be used with this Snapshot.

The view matrix transforms world space coordinates into camera space.

Definition at line 50 of file Snapshot.ixx.

Referenced by Snapshot and viewMatrix.

viewport_

const helios::rendering::Viewport& helios::scene::Snapshot::viewport_
protected

The viewport associated with this Snapshot.

Definition at line 62 of file Snapshot.ixx.

Referenced by Snapshot and viewport.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.