MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ attach()

void MayaFlux::Nexus::Emitter::attach ( const std::shared_ptr< Buffers::VKBuffer > &  buf,
const AttachConfig &  config = {} 
)

Make an existing, already rendered buffer the look of this object.

Works as Agent::attach does, except that an Emitter has no orientation: every render processor the buffer has is moved to the object's position and never rotated. If the object already has a position, that position is kept and becomes the offset. Replaces any previous attachment. An attachment is not part of encoded state and must be made again after decoding.

Parameters
bufBuffer to attach. Ignored if null.
configAnchor vertex, offset and move behaviour.

Definition at line 17 of file Emitter.cpp.

18{
19 if (!buf) {
21 "Cannot attach null buffer");
22 return;
23 }
24
25 detach();
26 m_attachment = make_attachment(buf, config, {});
28}
#define MF_ERROR(comp, ctx,...)
void detach()
Release the attached buffer and reset its placement.
Definition Emitter.cpp:30
std::optional< Attachment > m_attachment
Definition Emitter.hpp:284
@ Init
Engine/subsystem initialization.
@ Nexus
Spatial indexing and scheduling for user-defined behaviour.
Attachment make_attachment(std::shared_ptr< Buffers::VKBuffer > buf, const AttachConfig &config, const std::optional< glm::quat > &orientation)
Build an attachment to buf.

References detach(), follow_attachment(), MayaFlux::Journal::Init, m_attachment, MayaFlux::Nexus::make_attachment(), MF_ERROR, and MayaFlux::Journal::Nexus.

+ Here is the call graph for this function: