|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
Primary operator that drives slot local transforms via Tendency fields and propagates world transforms down the slot DAG. More...
#include <MeshTransformOperator.hpp>
Inheritance diagram for MayaFlux::Nodes::Network::MeshTransformOperator:
Collaboration diagram for MayaFlux::Nodes::Network::MeshTransformOperator:Public Types | |
| using | TransformField = std::function< glm::mat4(float)> |
| Field type: maps accumulated time (seconds) to a local glm::mat4. | |
Public Member Functions | |
| void | bind (uint32_t slot_index, TransformField field) |
| Bind a TransformField to a slot. | |
| std::string_view | get_type_name () const override |
| Type name for introspection. | |
| MeshTransformOperator ()=default | |
| void | process (float dt) override |
| Iterate slots in topological order and call process_slot() on each. | |
| void | process_slot (MeshSlot &slot, float dt) override |
| Evaluate the bound field (if any), update local_transform, then propagate the world_transform from the parent. | |
| void | unbind (uint32_t slot_index) |
| Remove the TransformField bound to a slot. | |
| void | unbind_all () |
| Remove all bound fields. | |
| ~MeshTransformOperator () override=default | |
Public Member Functions inherited from MayaFlux::Nodes::Network::MeshOperator | |
| std::optional< double > | query_state (std::string_view) const override |
| Query operator internal state. | |
| void | set_parameter (std::string_view, double) override |
| Set operator parameter. | |
| void | set_slots (std::vector< MeshSlot > &slots, const std::vector< uint32_t > &order) |
| Supply the slot list and processing order for the coming cycle. | |
| ~MeshOperator () override=default | |
Public Member Functions inherited from MayaFlux::Nodes::Network::NetworkOperator | |
| virtual void | apply_one_to_one (std::string_view param, const std::shared_ptr< NodeNetwork > &source) |
| Apply ONE_TO_ONE parameter mapping (per-point control) | |
| virtual | ~NetworkOperator ()=default |
Private Member Functions | |
| glm::mat4 | parent_world (const MeshSlot &slot) const |
| Resolve the world transform of a slot's parent, or identity if root. | |
Private Attributes | |
| std::unordered_map< uint32_t, float > | m_accumulated_time |
| Per-slot accumulated time in seconds, keyed by slot index. | |
| std::unordered_map< uint32_t, TransformField > | m_fields |
| std::chrono::steady_clock::time_point | m_last_tick { std::chrono::steady_clock::now() } |
| Wall-clock timestamp of the last process() call. | |
Additional Inherited Members | |
Protected Attributes inherited from MayaFlux::Nodes::Network::MeshOperator | |
| const std::vector< uint32_t > * | m_order { nullptr } |
| std::vector< MeshSlot > * | m_slots { nullptr } |
Primary operator that drives slot local transforms via Tendency fields and propagates world transforms down the slot DAG.
Each slot may have at most one bound TemporalField (glm::mat4 -> glm::mat4). On process_slot() the field is evaluated with dt as the scalar input, converting it to a glm::vec3 (unused) placeholder – in practice the mat4 overload is used: the field receives the slot's current local_transform and returns the new local_transform for the cycle.
Because transform propagation requires the parent's world_transform to already be resolved before a child is processed, process_slot() is called in topological order (guaranteed by MeshOperator::process()). Each call:
Slots without a bound field still receive world transform propagation – their local_transform is used as-is, matching the behaviour of the manual example in the fracture example (which drives local_transform and dirty directly without an operator).
The TemporalField signature: glm::mat4 -> glm::mat4. In Kinesis terms this is modelled as a std::function<glm::mat4(float)> where the float argument is the accumulated time in seconds. The operator tracks per-slot accumulated time independently.
Usage:
Definition at line 45 of file MeshTransformOperator.hpp.