#include <AnimNode.hpp>

Public Member Functions

 AnimNodeI (Instance *inst)
 
 ~AnimNodeI ()
 
Instanceinstance () const
 
void status (TableDebugView *view)
 
AnimNodeIlabel (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 *)
 
AnimConnectoranim_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
 
AnimNodeISpeed (Anim_float)
 
AnimNodeISpeed_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

Instanceinst
 
AnimSystemas
 
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()

virtual void iv::AnimNodeI::StringIO_SetTarget ( const char *  source,
Context const *  context 
)
inlinevirtual

Definition at line 34 of file AnimNode.hpp.

◆ StringIO_GetTarget()

virtual std::string iv::AnimNodeI::StringIO_GetTarget ( Context const *  context)
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()

virtual void iv::AnimNodeI::UpdateLastTarget ( )
inlineprotectedvirtual

Definition at line 113 of file AnimNode.hpp.

◆ TargetStabilized()

virtual bool iv::AnimNodeI::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

const constexpr unsigned iv::AnimNodeI::ActiveCooldownFrames = 5
staticconstexprprotected

Definition at line 116 of file AnimNode.hpp.

◆ inst

Instance* iv::AnimNodeI::inst
protected

Definition at line 120 of file AnimNode.hpp.

◆ as

AnimSystem* iv::AnimNodeI::as
protected

Definition at line 121 of file AnimNode.hpp.

◆ _label

std::string iv::AnimNodeI::_label
protected

Definition at line 122 of file AnimNode.hpp.

◆ _speed

Anim_float iv::AnimNodeI::_speed
protected

Definition at line 123 of file AnimNode.hpp.

◆ _anim_initialized

bool iv::AnimNodeI::_anim_initialized
protected

Definition at line 124 of file AnimNode.hpp.

◆ _parent

AnimConnector* iv::AnimNodeI::_parent
protected

Definition at line 127 of file AnimNode.hpp.

◆ _children

std::unordered_set< AnimConnector * > iv::AnimNodeI::_children
protected

Definition at line 128 of file AnimNode.hpp.

◆ _activation_id

std::optional< unsigned > iv::AnimNodeI::_activation_id
protected

Update_id when this should be activated.

Definition at line 131 of file AnimNode.hpp.

◆ _active_cooldown

unsigned iv::AnimNodeI::_active_cooldown
protected

How many more frames of inactivity on this node to sleep it.

Definition at line 132 of file AnimNode.hpp.

◆ _active

bool iv::AnimNodeI::_active
protected

If it is actively updated each frame. Changed only during.

Definition at line 133 of file AnimNode.hpp.

◆ _distance_start

Anim_float iv::AnimNodeI::_distance_start
protected

Definition at line 135 of file AnimNode.hpp.

◆ _distance_end

Anim_float iv::AnimNodeI::_distance_end
protected

Definition at line 136 of file AnimNode.hpp.

◆ _distance_working

Anim_float iv::AnimNodeI::_distance_working
protected

Definition at line 137 of file AnimNode.hpp.

◆ _requested_step

Anim_float iv::AnimNodeI::_requested_step
protected

Definition at line 139 of file AnimNode.hpp.

◆ _update_id

std::optional< unsigned > iv::AnimNodeI::_update_id
protected

Definition at line 141 of file AnimNode.hpp.

◆ in_target_notified

bool iv::AnimNodeI::in_target_notified
protected

Definition at line 143 of file AnimNode.hpp.


The documentation for this class was generated from the following files: