35 : m_triggerState {static_cast<
agx::UInt8>(triggerInitially ? 2u : 0u)}
53 inline bool shouldTrigger() const noexcept {
return m_triggerState > 0u; }
65 auto value = m_triggerState.load();
67 m_triggerState.compare_exchange_weak(value, 2u, std::memory_order_relaxed);
75 auto value = m_triggerState.load();
77 m_triggerState.compare_exchange_weak(value, 1u, std::memory_order_relaxed);
85 auto value = m_triggerState.load();
87 m_triggerState.compare_exchange_weak(value, 0u, std::memory_order_relaxed);
96 std::atomic<agx::UInt8> m_triggerState;
Type for triggering effects at a later point in time.
LazyTrigger(bool triggerInitially=false)
Initialize a lazy trigger.
void softResetTrigger()
Reset the trigger state, only if it has triggered.
LazyTrigger(const LazyTrigger &)=delete
Trigger is unique.
void flagTriggered()
Tell the trigger that it has triggered.
bool shouldTrigger() const noexcept
void trigger()
Set the trigger to the trigger state.
LazyTrigger & operator=(const LazyTrigger &)=delete
Trigger is unique.
void hardResetTrigger()
Reset the trigger state, no matter if it has triggered or not.
The agxSensor namespace contains components to model real-time sensors connected to the physics of AG...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.