本文整理汇总了C++中AnimationPlayer::seek方法的典型用法代码示例。如果您正苦于以下问题:C++ AnimationPlayer::seek方法的具体用法?C++ AnimationPlayer::seek怎么用?C++ AnimationPlayer::seek使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnimationPlayer
的用法示例。
在下文中一共展示了AnimationPlayer::seek方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _process_graph
//.........这里部分代码省略.........
src_blendsw[i] = 1.0; //by default all go to 1 for the root input
}
}
//process
{
if (started) {
//if started, seek
root->_pre_process(SceneStringNames::get_singleton()->parameters_base_path, NULL, &state, 0, true, Vector<StringName>());
started = false;
}
root->_pre_process(SceneStringNames::get_singleton()->parameters_base_path, NULL, &state, p_delta, false, Vector<StringName>());
}
if (!state.valid) {
return; //state is not valid. do nothing.
}
//apply value/transform/bezier blends to track caches and execute method/audio/animation tracks
{
bool can_call = is_inside_tree() && !Engine::get_singleton()->is_editor_hint();
for (List<AnimationNode::AnimationState>::Element *E = state.animation_states.front(); E; E = E->next()) {
const AnimationNode::AnimationState &as = E->get();
Ref<Animation> a = as.animation;
float time = as.time;
float delta = as.delta;
bool seeked = as.seeked;
for (int i = 0; i < a->get_track_count(); i++) {
NodePath path = a->track_get_path(i);
TrackCache *track = track_cache[path];
if (track->type != a->track_get_type(i)) {
continue; //may happen should not
}
track->root_motion = root_motion_track == path;
ERR_CONTINUE(!state.track_map.has(path));
int blend_idx = state.track_map[path];
ERR_CONTINUE(blend_idx < 0 || blend_idx >= state.track_count);
float blend = (*as.track_blends)[blend_idx];
if (blend < CMP_EPSILON)
continue; //nothing to blend
switch (track->type) {
case Animation::TYPE_TRANSFORM: {
TrackCacheTransform *t = static_cast<TrackCacheTransform *>(track);
if (t->process_pass != process_pass) {
t->process_pass = process_pass;
t->loc = Vector3();
t->rot = Quat();