4 template<
class T,
class Interp >
7 cm( inst, this,
"Destination_ConnectorGI" ),
8 _accumulated_distance( 0.0 ),
10 _destination( destination )
12 this->cm.inherits( this->AnimConnector::cm );
13 this->SetParent( parent );
16 template<
class T,
class Interp >
20 this->_parent->anim_removeChild(
this );
23 template<
class T,
class Interp >
29 this->SetParent(
nullptr );
32 this->_parent->anim_addChild(
this );
37 this->_parent->anim_removeChild(
this );
38 this->_parent =
nullptr;
43 template<
class T,
class Interp >
50 template<
class T,
class Interp >
53 if( this->_parent == node )
55 this->_parent->anim_removeChild(
this );
56 this->_parent =
nullptr;
61 template<
class T,
class Interp >
64 this->_destination = destination;
68 template<
class T,
class Interp >
71 if( !this->_parent || !this->_destination )
73 this->_distance = 0.0;
78 Anim_float distance = this->_parent->Step() + this->_accumulated_distance;
79 T tgt = this->_parent->Target();
80 T current_value = this->_destination->Get();
82 auto val_rem = Interp().Interpolate( current_value, tgt, distance );
83 this->_accumulated_distance = val_rem.second;
86 auto dist = Interp().Distance( val_rem.first, tgt );
87 auto result = dist - this->_accumulated_distance;
89 this->cm.log(
SRC_INFO, ::
iv::Defs::Log::Animation_ConnectorUpdate,
"UpdatePass_Down | step ", distance,
", value ", current_value,
" -> ", val_rem.first,
" -> ", tgt,
", accumulated_distance ", this->_accumulated_distance,
"." );
92 this->_destination->Modify( &this->cm, val_rem.first );
93 this->_distance = result;
96 template<
class T,
class Interp >
99 if( !this->_parent || !this->_destination )
104 this->_parent->Connector_UpdateDistance( this->_distance );