Skip to main content

SnapshotItem Struct

Structure for representing a snapshot item of a renderable's object state at a specific point in time. More...

Declaration

struct helios::scene::SnapshotItem { ... }

Public Constructors Index

SnapshotItem (const helios::rendering::Renderable *renderable, const helios::math::mat4f &worldMatrix)

Constructs a new SnapshotItem with the specified renderable and the worldMatrix. More...

Public Member Functions Index

const helios::rendering::Renderable *renderable () const noexcept

Returns a raw pointer to the Renderable of this SnapshotItem. More...

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

Returns a const ref to the worldMatrix of this SnapshotItem. The world transformation matrix is a copy from the world transformation matrix created with this SnapshotItem. More...

Private Member Attributes Index

const helios::rendering::Renderable *renderable_

A non-owning raw pointer to the Renderable object. More...

const helios::math::mat4fworldMatrix_

A copy of the world transformation matrix for the Renderable. More...

Description

Structure for representing a snapshot item of a renderable's object state at a specific point in time.

The structure bundles a non-owning raw pointer to a Renderable and a pre-calculated worldMatrix, serving as a lightweight DTO to be used with a `Snapshot`.

A SnapshotItem captures the essential information to render an item without the need to traverse the entire Scene Graph during the rendering phase. The worldMatrix is a copy of the SceneNode's worldMatrix at the time of this creation, ensuring that its value remains constant, even if the transformation of the SceneNode should change during rendering.

The caller must ensure that the Renderable remains valid for the lifetime of this SnapshotItem (typically within a single frame).

While internal properties of the Renderable might change while this SnapshotItem is processed, the worldMatrix is immutable and reflects the transformation state at the moment the Snapshot was taken.

Definition at line 38 of file SnapshotItem.ixx.

Public Constructors

SnapshotItem()

helios::scene::SnapshotItem::SnapshotItem (const helios::rendering::Renderable * renderable, const helios::math::mat4f & worldMatrix)
inline

Constructs a new SnapshotItem with the specified renderable and the worldMatrix.

Parameters
renderable

A raw pointer to the Renderable (must remain valid for the lifetime of this item).

worldMatrix

A const ref to the world transformation matrix, which gets copied.

Definition at line 62 of file SnapshotItem.ixx.

65 ) :
66 renderable_(renderable),
67 worldMatrix_(worldMatrix) {
68 assert(renderable_ && "Unexpected nullptr forRenderable");
69 }

References renderable and worldMatrix.

Public Member Functions

renderable()

const helios::rendering::Renderable * helios::scene::SnapshotItem::renderable ()
inline nodiscard noexcept

Returns a raw pointer to the Renderable of this SnapshotItem.

Returns

A raw pointer to the Renderable of this SnapshotItem.

Definition at line 76 of file SnapshotItem.ixx.

76 [[nodiscard]] const helios::rendering::Renderable* renderable() const noexcept {
77 return renderable_;
78 }

Referenced by SnapshotItem.

worldMatrix()

const helios::math::mat4f & helios::scene::SnapshotItem::worldMatrix ()
inline nodiscard noexcept

Returns a const ref to the worldMatrix of this SnapshotItem. The world transformation matrix is a copy from the world transformation matrix created with this SnapshotItem.

Returns

The const ref to the world matrix of this SnapshotItem.

Definition at line 87 of file SnapshotItem.ixx.

87 [[nodiscard]] const helios::math::mat4f& worldMatrix() const noexcept {
88 return worldMatrix_;
89 }

Referenced by SnapshotItem.

Private Member Attributes

renderable_

const helios::rendering::Renderable* helios::scene::SnapshotItem::renderable_

A non-owning raw pointer to the Renderable object.

The Renderable must remain valid for the lifetime of this SnapshotItem.

Definition at line 45 of file SnapshotItem.ixx.

45 const helios::rendering::Renderable* renderable_;

worldMatrix_

const helios::math::mat4f helios::scene::SnapshotItem::worldMatrix_

A copy of the world transformation matrix for the Renderable.

Definition at line 50 of file SnapshotItem.ixx.

50 const helios::math::mat4f worldMatrix_;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.