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

◆ on_tick_if()

HookId MayaFlux::Nodes::Input::InputNode::on_tick_if ( const NodeCondition &  condition,
const TypedHook< InputContext > &  callback 
)

Register conditional callback for input received.

Parameters
conditionPredicate that determines when callback is triggered
callbackFunction to call when condition is met

The callback receives an InputContext with the current value and input details. Fires on every process_input() call where the condition returns true.

Definition at line 140 of file InputNode.cpp.

141{
142 return m_conditional_callbacks.add_conditional(adapt_hook(callback), condition, callback.target_type());
143}
PickCallback callback
Definition Picker.cpp:22
HookId add_conditional(NodeHook hook, NodeCondition condition, const std::type_info &key, uint8_t tag=0)
Appends a hook that fires only while condition holds.
HookList m_conditional_callbacks
Hooks fired on a tick only while their condition holds.
Definition Node.hpp:485
NodeHook adapt_hook(const TypedHook< ContextT > &hook)
Wraps a context-typed hook into a NodeHook.

References MayaFlux::Nodes::adapt_hook(), MayaFlux::Nodes::HookList::add_conditional(), callback, and MayaFlux::Nodes::Node::m_conditional_callbacks.

Referenced by while_in_range().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: