summaryrefslogtreecommitdiff
path: root/scene/animation
diff options
context:
space:
mode:
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/animation_blend_space_2d.cpp8
-rw-r--r--scene/animation/animation_cache.cpp10
-rw-r--r--scene/animation/animation_tree.cpp30
-rw-r--r--scene/animation/animation_tree_player.cpp30
4 files changed, 39 insertions, 39 deletions
diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp
index 1fe14e633b..95d4644004 100644
--- a/scene/animation/animation_blend_space_2d.cpp
+++ b/scene/animation/animation_blend_space_2d.cpp
@@ -461,9 +461,9 @@ float AnimationNodeBlendSpace2D::process(float p_time, bool p_seek) {
points[j],
points[(j + 1) % 3]
};
- Vector2 closest = Geometry::get_closest_point_to_segment_2d(blend_pos, s);
- if (first || closest.distance_to(blend_pos) < best_point.distance_to(blend_pos)) {
- best_point = closest;
+ Vector2 closest2 = Geometry::get_closest_point_to_segment_2d(blend_pos, s);
+ if (first || closest2.distance_to(blend_pos) < best_point.distance_to(blend_pos)) {
+ best_point = closest2;
blend_triangle = i;
first = false;
float d = s[0].distance_to(s[1]);
@@ -472,7 +472,7 @@ float AnimationNodeBlendSpace2D::process(float p_time, bool p_seek) {
blend_weights[(j + 1) % 3] = 0.0;
blend_weights[(j + 2) % 3] = 0.0;
} else {
- float c = s[0].distance_to(closest) / d;
+ float c = s[0].distance_to(closest2) / d;
blend_weights[j] = 1.0 - c;
blend_weights[(j + 1) % 3] = c;
diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp
index 6c67af5777..feefe3ddd4 100644
--- a/scene/animation/animation_cache.cpp
+++ b/scene/animation/animation_cache.cpp
@@ -133,19 +133,19 @@ void AnimationCache::_update_cache() {
} else {
if (np.get_subname_count() > 0) {
- RES res;
+ RES res2;
Vector<StringName> leftover_subpath;
// We don't want to cache the last resource unless it is a method call
bool is_method = animation->track_get_type(i) == Animation::TYPE_METHOD;
- root->get_node_and_resource(np, res, leftover_subpath, is_method);
+ root->get_node_and_resource(np, res2, leftover_subpath, is_method);
- if (res.is_valid()) {
- path.resource = res;
+ if (res2.is_valid()) {
+ path.resource = res2;
} else {
path.node = node;
}
- path.object = res.is_valid() ? res.ptr() : (Object *)node;
+ path.object = res2.is_valid() ? res2.ptr() : (Object *)node;
path.subpath = leftover_subpath;
} else {
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp
index c32001dbcd..0b6fa26bfc 100644
--- a/scene/animation/animation_tree.cpp
+++ b/scene/animation/animation_tree.cpp
@@ -1009,10 +1009,10 @@ void AnimationTree::_process_graph(float p_delta) {
a->method_track_get_key_indices(i, time, delta, &indices);
- for (List<int>::Element *E = indices.front(); E; E = E->next()) {
+ for (List<int>::Element *F = indices.front(); F; F = F->next()) {
- StringName method = a->method_track_get_name(i, E->get());
- Vector<Variant> params = a->method_track_get_params(i, E->get());
+ StringName method = a->method_track_get_name(i, F->get());
+ Vector<Variant> params = a->method_track_get_params(i, F->get());
int s = params.size();
@@ -1151,9 +1151,9 @@ void AnimationTree::_process_graph(float p_delta) {
TrackCacheAnimation *t = static_cast<TrackCacheAnimation *>(track);
- AnimationPlayer *player = Object::cast_to<AnimationPlayer>(t->object);
+ AnimationPlayer *player2 = Object::cast_to<AnimationPlayer>(t->object);
- if (!player)
+ if (!player2)
continue;
if (delta == 0 || seeked) {
@@ -1165,10 +1165,10 @@ void AnimationTree::_process_graph(float p_delta) {
float pos = a->track_get_key_time(i, idx);
StringName anim_name = a->animation_track_get_key_animation(i, idx);
- if (String(anim_name) == "[stop]" || !player->has_animation(anim_name))
+ if (String(anim_name) == "[stop]" || !player2->has_animation(anim_name))
continue;
- Ref<Animation> anim = player->get_animation(anim_name);
+ Ref<Animation> anim = player2->get_animation(anim_name);
float at_anim_pos;
@@ -1178,14 +1178,14 @@ void AnimationTree::_process_graph(float p_delta) {
at_anim_pos = MAX(anim->get_length(), time - pos); //seek to end
}
- if (player->is_playing() || seeked) {
- player->play(anim_name);
- player->seek(at_anim_pos);
+ if (player2->is_playing() || seeked) {
+ player2->play(anim_name);
+ player2->seek(at_anim_pos);
t->playing = true;
playing_caches.insert(t);
} else {
- player->set_assigned_animation(anim_name);
- player->seek(at_anim_pos, true);
+ player2->set_assigned_animation(anim_name);
+ player2->seek(at_anim_pos, true);
}
} else {
//find stuff to play
@@ -1195,15 +1195,15 @@ void AnimationTree::_process_graph(float p_delta) {
int idx = to_play.back()->get();
StringName anim_name = a->animation_track_get_key_animation(i, idx);
- if (String(anim_name) == "[stop]" || !player->has_animation(anim_name)) {
+ if (String(anim_name) == "[stop]" || !player2->has_animation(anim_name)) {
if (playing_caches.has(t)) {
playing_caches.erase(t);
- player->stop();
+ player2->stop();
t->playing = false;
}
} else {
- player->play(anim_name);
+ player2->play(anim_name);
t->playing = true;
playing_caches.insert(t);
}
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp
index e3a21d8b46..3420b48ae3 100644
--- a/scene/animation/animation_tree_player.cpp
+++ b/scene/animation/animation_tree_player.cpp
@@ -136,9 +136,9 @@ bool AnimationTreePlayer::_set(const StringName &p_name, const Variant &p_value)
else
animation_node_set_animation(id, node.get_valid("animation"));
Array filters = node.get_valid("filter");
- for (int i = 0; i < filters.size(); i++) {
+ for (int j = 0; j < filters.size(); j++) {
- animation_node_set_filter_path(id, filters[i], true);
+ animation_node_set_filter_path(id, filters[j], true);
}
} break;
case NODE_ONESHOT: {
@@ -150,9 +150,9 @@ bool AnimationTreePlayer::_set(const StringName &p_name, const Variant &p_value)
oneshot_node_set_autorestart_delay(id, node.get_valid("autorestart_delay"));
oneshot_node_set_autorestart_random_delay(id, node.get_valid("autorestart_random_delay"));
Array filters = node.get_valid("filter");
- for (int i = 0; i < filters.size(); i++) {
+ for (int j = 0; j < filters.size(); j++) {
- oneshot_node_set_filter_path(id, filters[i], true);
+ oneshot_node_set_filter_path(id, filters[j], true);
}
} break;
@@ -162,9 +162,9 @@ bool AnimationTreePlayer::_set(const StringName &p_name, const Variant &p_value)
case NODE_BLEND2: {
blend2_node_set_amount(id, node.get_valid("blend"));
Array filters = node.get_valid("filter");
- for (int i = 0; i < filters.size(); i++) {
+ for (int j = 0; j < filters.size(); j++) {
- blend2_node_set_filter_path(id, filters[i], true);
+ blend2_node_set_filter_path(id, filters[j], true);
}
} break;
case NODE_BLEND3: {
@@ -278,8 +278,8 @@ bool AnimationTreePlayer::_get(const StringName &p_name, Variant &r_ret) const {
an->filter.get_key_list(&keys);
k.resize(keys.size());
int i = 0;
- for (List<NodePath>::Element *E = keys.front(); E; E = E->next()) {
- k[i++] = E->get();
+ for (List<NodePath>::Element *F = keys.front(); F; F = F->next()) {
+ k[i++] = F->get();
}
node["filter"] = k;
} break;
@@ -297,8 +297,8 @@ bool AnimationTreePlayer::_get(const StringName &p_name, Variant &r_ret) const {
osn->filter.get_key_list(&keys);
k.resize(keys.size());
int i = 0;
- for (List<NodePath>::Element *E = keys.front(); E; E = E->next()) {
- k[i++] = E->get();
+ for (List<NodePath>::Element *F = keys.front(); F; F = F->next()) {
+ k[i++] = F->get();
}
node["filter"] = k;
@@ -315,8 +315,8 @@ bool AnimationTreePlayer::_get(const StringName &p_name, Variant &r_ret) const {
bn->filter.get_key_list(&keys);
k.resize(keys.size());
int i = 0;
- for (List<NodePath>::Element *E = keys.front(); E; E = E->next()) {
- k[i++] = E->get();
+ for (List<NodePath>::Element *F = keys.front(); F; F = F->next()) {
+ k[i++] = F->get();
}
node["filter"] = k;
@@ -874,10 +874,10 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
List<int> indices;
a->method_track_get_key_indices(tr.local_track, anim_list->time, anim_list->step, &indices);
- for (List<int>::Element *E = indices.front(); E; E = E->next()) {
+ for (List<int>::Element *F = indices.front(); F; F = F->next()) {
- StringName method = a->method_track_get_name(tr.local_track, E->get());
- Vector<Variant> args = a->method_track_get_params(tr.local_track, E->get());
+ StringName method = a->method_track_get_name(tr.local_track, F->get());
+ Vector<Variant> args = a->method_track_get_params(tr.local_track, F->get());
args.resize(VARIANT_ARG_MAX);
tr.track->object->call(method, args[0], args[1], args[2], args[3], args[4]);
}