TimeScale node: scale return value (time remaining).

This commit is contained in:
Josh Grams 2016-03-07 17:21:07 -05:00
parent 20308c0475
commit 2e1b1234a3
1 changed files with 4 additions and 2 deletions

View File

@ -637,10 +637,12 @@ float AnimationTreePlayer::_process_node(const StringName& p_node,AnimationNode
} break; } break;
case NODE_TIMESCALE: { case NODE_TIMESCALE: {
TimeScaleNode *tsn = static_cast<TimeScaleNode*>(nb); TimeScaleNode *tsn = static_cast<TimeScaleNode*>(nb);
float rem;
if (p_seek) if (p_seek)
return _process_node(tsn->inputs[0].node,r_prev_anim,p_weight,p_time,switched,true,p_filter,p_reverse_weight); rem = _process_node(tsn->inputs[0].node,r_prev_anim,p_weight,p_time,switched,true,p_filter,p_reverse_weight);
else else
return _process_node(tsn->inputs[0].node,r_prev_anim,p_weight,p_time*tsn->scale,switched,false,p_filter,p_reverse_weight); rem = _process_node(tsn->inputs[0].node,r_prev_anim,p_weight,p_time*tsn->scale,switched,false,p_filter,p_reverse_weight);
return rem / tsn->scale;
} break; } break;
case NODE_TIMESEEK: { case NODE_TIMESEEK: {