#include <AnimNode.hpp>
Public Member Functions | |
AnimNodeI (Instance *inst) | |
~AnimNodeI () | |
Instance * | instance () const |
void | status (TableDebugView *view) |
AnimNodeI * | label (std::string const &) |
const std::string & | label () const |
virtual void | StringIO_SetTarget (const char *source, Context const *context) |
virtual std::string | StringIO_GetTarget (Context const *context) |
void | anim_setParent (AnimConnector *) |
void | anim_unsetParent (AnimConnector *) |
AnimConnector * | anim_getParent () |
void | anim_addChild (AnimConnector *) |
void | anim_removeChild (AnimConnector *) |
void | anim_eachChild (std::function< void(AnimConnector *) > const &) |
void | System_UpdateStart () |
void | System_UpdateEnd () |
std::optional< unsigned > | System_UpdateId () const |
void | Connector_RequestStep (Anim_float step_distance) |
void | Connector_UpdateDistance (Anim_float new_distance) |
Anim_float | Step () |
bool | Active () |
void | Activate () |
Anim_float | Distance () |
bool | IsInTarget () |
Anim_float | Speed () const |
AnimNodeI * | Speed (Anim_float) |
AnimNodeI * | Speed_inf () |
Shortcut for AnimNodeI::Speed( std::numeric_limits< Anim_float >::infinity() ). More... | |
Public Attributes | |
ClientMarker | cm |
Protected Member Functions | |
virtual void | UpdateLastTarget () |
virtual bool | TargetStabilized () |
Protected Attributes | |
Instance * | inst |
AnimSystem * | as |
std::string | _label |
Anim_float | _speed |
bool | _anim_initialized |
AnimConnector * | _parent |
std::unordered_set< AnimConnector * > | _children |
std::optional< unsigned > | _activation_id |
Update_id when this should be activated. More... | |
unsigned | _active_cooldown |
How many more frames of inactivity on this node to sleep it. More... | |
bool | _active |
If it is actively updated each frame. Changed only during. More... | |
Anim_float | _distance_start |
Anim_float | _distance_end |
Anim_float | _distance_working |
Anim_float | _requested_step |
std::optional< unsigned > | _update_id |
bool | in_target_notified |
Static Protected Attributes | |
static const constexpr unsigned | ActiveCooldownFrames = 5 |
Detailed Description
Definition at line 15 of file AnimNode.hpp.
Constructor & Destructor Documentation
◆ AnimNodeI()
iv::AnimNodeI::AnimNodeI | ( | Instance * | inst | ) |
Definition at line 9 of file AnimNode.cpp.
◆ ~AnimNodeI()
iv::AnimNodeI::~AnimNodeI | ( | ) |
Definition at line 32 of file AnimNode.cpp.
Member Function Documentation
◆ instance()
Instance * iv::AnimNodeI::instance | ( | ) | const |
Definition at line 43 of file AnimNode.cpp.
◆ status()
void iv::AnimNodeI::status | ( | iv::TableDebugView * | view | ) |
Definition at line 48 of file AnimNode.cpp.
◆ label() [1/2]
AnimNodeI * iv::AnimNodeI::label | ( | std::string const & | val | ) |
Label for the value that is stored in this AnimNode.
Definition at line 60 of file AnimNode.cpp.
◆ label() [2/2]
const std::string & iv::AnimNodeI::label | ( | ) | const |
Definition at line 66 of file AnimNode.cpp.
◆ StringIO_SetTarget()
|
inlinevirtual |
Definition at line 34 of file AnimNode.hpp.
◆ StringIO_GetTarget()
|
inlinevirtual |
Definition at line 35 of file AnimNode.hpp.
◆ anim_setParent()
void iv::AnimNodeI::anim_setParent | ( | AnimConnector * | parent | ) |
Definition at line 73 of file AnimNode.cpp.
◆ anim_unsetParent()
void iv::AnimNodeI::anim_unsetParent | ( | AnimConnector * | parent | ) |
Definition at line 93 of file AnimNode.cpp.
◆ anim_getParent()
AnimConnector * iv::AnimNodeI::anim_getParent | ( | ) |
Definition at line 113 of file AnimNode.cpp.
◆ anim_addChild()
void iv::AnimNodeI::anim_addChild | ( | AnimConnector * | child | ) |
Definition at line 118 of file AnimNode.cpp.
◆ anim_removeChild()
void iv::AnimNodeI::anim_removeChild | ( | AnimConnector * | child | ) |
Definition at line 123 of file AnimNode.cpp.
◆ anim_eachChild()
void iv::AnimNodeI::anim_eachChild | ( | std::function< void(AnimConnector *) > const & | f | ) |
Definition at line 128 of file AnimNode.cpp.
◆ System_UpdateStart()
void iv::AnimNodeI::System_UpdateStart | ( | ) |
Called from AnimSystem before connectors start updating the node.
Definition at line 136 of file AnimNode.cpp.
◆ System_UpdateEnd()
void iv::AnimNodeI::System_UpdateEnd | ( | ) |
Called after updates on node finished.
Definition at line 148 of file AnimNode.cpp.
◆ System_UpdateId()
std::optional< unsigned > iv::AnimNodeI::System_UpdateId | ( | ) | const |
Returns value if node is between System_UpdateStart and System_UpdateEnd calls and returns update_id of AnimSystem when update started.
Definition at line 198 of file AnimNode.cpp.
◆ Connector_RequestStep()
void iv::AnimNodeI::Connector_RequestStep | ( | Anim_float | step_distance | ) |
Connector requests this child node to be updated during AnimConnector::UpdatePass_Down.
Definition at line 203 of file AnimNode.cpp.
◆ Connector_UpdateDistance()
void iv::AnimNodeI::Connector_UpdateDistance | ( | Anim_float | new_distance | ) |
Connector reports new distance of parent node during Animconnector::UpdatePass_Up.
Definition at line 208 of file AnimNode.cpp.
◆ Step()
Anim_float iv::AnimNodeI::Step | ( | ) |
Advance step distance requested through Connector_RequestStep.
Definition at line 219 of file AnimNode.cpp.
◆ Active()
bool iv::AnimNodeI::Active | ( | ) |
Wheter the node is updated each frame. Does not change during frame, only in System_UpdateEnd.
Definition at line 230 of file AnimNode.cpp.
◆ Activate()
void iv::AnimNodeI::Activate | ( | ) |
Start updating node until it stabilizes (IsInTarget returns true for few frames).
Definition at line 247 of file AnimNode.cpp.
◆ Distance()
Anim_float iv::AnimNodeI::Distance | ( | ) |
Current distance to target. Cached from last Advance.
Definition at line 267 of file AnimNode.cpp.
◆ IsInTarget()
bool iv::AnimNodeI::IsInTarget | ( | ) |
Definition at line 289 of file AnimNode.cpp.
◆ Speed() [1/2]
Anim_float iv::AnimNodeI::Speed | ( | ) | const |
Transforms argument of AnimNode::Advance and return value of AnimNode::Distance which relatively changes the transition speed of this node.
Definition at line 272 of file AnimNode.cpp.
◆ Speed() [2/2]
AnimNodeI * iv::AnimNodeI::Speed | ( | Anim_float | speed | ) |
Definition at line 277 of file AnimNode.cpp.
◆ Speed_inf()
AnimNodeI * iv::AnimNodeI::Speed_inf | ( | ) |
Shortcut for AnimNodeI::Speed( std::numeric_limits< Anim_float >::infinity() ).
Definition at line 283 of file AnimNode.cpp.
◆ UpdateLastTarget()
|
inlineprotectedvirtual |
Definition at line 113 of file AnimNode.hpp.
◆ TargetStabilized()
|
inlineprotectedvirtual |
Definition at line 114 of file AnimNode.hpp.
Member Data Documentation
◆ cm
ClientMarker iv::AnimNodeI::cm |
Definition at line 18 of file AnimNode.hpp.
◆ ActiveCooldownFrames
|
staticconstexprprotected |
Definition at line 116 of file AnimNode.hpp.
◆ inst
|
protected |
Definition at line 120 of file AnimNode.hpp.
◆ as
|
protected |
Definition at line 121 of file AnimNode.hpp.
◆ _label
|
protected |
Definition at line 122 of file AnimNode.hpp.
◆ _speed
|
protected |
Definition at line 123 of file AnimNode.hpp.
◆ _anim_initialized
|
protected |
Definition at line 124 of file AnimNode.hpp.
◆ _parent
|
protected |
Definition at line 127 of file AnimNode.hpp.
◆ _children
|
protected |
Definition at line 128 of file AnimNode.hpp.
◆ _activation_id
|
protected |
Update_id when this should be activated.
Definition at line 131 of file AnimNode.hpp.
◆ _active_cooldown
|
protected |
How many more frames of inactivity on this node to sleep it.
Definition at line 132 of file AnimNode.hpp.
◆ _active
|
protected |
If it is actively updated each frame. Changed only during.
Definition at line 133 of file AnimNode.hpp.
◆ _distance_start
|
protected |
Definition at line 135 of file AnimNode.hpp.
◆ _distance_end
|
protected |
Definition at line 136 of file AnimNode.hpp.
◆ _distance_working
|
protected |
Definition at line 137 of file AnimNode.hpp.
◆ _requested_step
|
protected |
Definition at line 139 of file AnimNode.hpp.
◆ _update_id
|
protected |
Definition at line 141 of file AnimNode.hpp.
◆ in_target_notified
|
protected |
Definition at line 143 of file AnimNode.hpp.
The documentation for this class was generated from the following files:
- ivorium_graphics/Animation/Animation/AnimNode.hpp
- ivorium_graphics/Animation/Animation/AnimNode.cpp