62 std::shared_ptr<Buffers::VKBuffer>
buf;
65 std::vector<std::pair<std::shared_ptr<Buffers::RenderProcessor>, std::shared_ptr<PlacementStack>>>
followed;
77 std::shared_ptr<Buffers::VKBuffer> buf,
78 const AttachConfig& config,
79 const std::optional<glm::quat>& orientation);
88 Attachment& attachment,
90 const std::optional<glm::quat>& orientation);
103 Attachment& attachment,
105 const std::optional<glm::quat>& orientation);
113 Attachment& attachment,
114 const InfluenceContext& ctx);
std::optional< glm::vec3 > position
void apply_attachment(Attachment &attachment, const InfluenceContext &ctx)
Rebuild the transform from ctx and place every render processor of the buffer.
void recenter_attachment(Attachment &attachment, std::optional< glm::vec3 > &position, const std::optional< glm::quat > &orientation)
Read the buffer's geometry again and move the anchor to match.
void place_attachment(Attachment &attachment)
Place every render processor of the buffer that is not placed yet.
void follow_attachment(Attachment &attachment, std::optional< glm::vec3 > &position, const std::optional< glm::quat > &orientation)
Set position from the buffer, or fold an outside move into the attachment.
void release_attachment(Attachment &attachment)
Give every placed render processor back the geometry transform it had.
Attachment make_attachment(std::shared_ptr< Buffers::VKBuffer > buf, const AttachConfig &config, const std::optional< glm::quat > &orientation)
Build an attachment to buf.
std::optional< uint32_t > index
Vertex whose position anchors the Agent.
glm::vec3 offset
Offset of the Agent from the anchor, in the Agent's own frame.
OnMove
What a move of the Agent from outside does to the attachment.
@ Carry
The buffer is moved along with the Agent.
@ Offset
The move becomes the Agent's new offset from the buffer.
How an Agent attaches to a buffer that already exists.
std::shared_ptr< Buffers::VKBuffer > buf
std::shared_ptr< glm::mat4 > transform
std::vector< std::pair< std::shared_ptr< Buffers::RenderProcessor >, std::shared_ptr< PlacementStack > > > followed
State of one Agent attached to an existing buffer.