diff options
Diffstat (limited to 'scene/resources/animation.cpp')
-rw-r--r-- | scene/resources/animation.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index b8edd70712..f4670ca850 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -33,8 +33,6 @@ #include "core/math/geometry_3d.h" -#define ANIM_MIN_LENGTH 0.001 - bool Animation::_set(const StringName &p_name, const Variant &p_value) { String name = p_name; @@ -721,7 +719,6 @@ bool Animation::track_get_interpolation_loop_wrap(int p_track) const { /* template<class T> int Animation::_insert_pos(float p_time, T& p_keys) { - // simple, linear time inset that should be fast enough in reality. int idx=p_keys.size(); @@ -734,14 +731,12 @@ int Animation::_insert_pos(float p_time, T& p_keys) { p_keys.insert(idx,T()); return idx; } else if (p_keys[idx-1].time == p_time) { - // condition for replacing. return idx-1; } idx--; } - } */ @@ -813,8 +808,8 @@ int Animation::transform_track_insert_key(int p_track, float p_time, const Vecto return ret; } -void Animation::track_remove_key_at_position(int p_track, float p_pos) { - int idx = track_find_key(p_track, p_pos, true); +void Animation::track_remove_key_at_time(int p_track, float p_time) { + int idx = track_find_key(p_track, p_time, true); ERR_FAIL_COND(idx < 0); track_remove_key(p_track, idx); } @@ -2611,7 +2606,7 @@ void Animation::_bind_methods() { ClassDB::bind_method(D_METHOD("transform_track_insert_key", "track_idx", "time", "location", "rotation", "scale"), &Animation::transform_track_insert_key); ClassDB::bind_method(D_METHOD("track_insert_key", "track_idx", "time", "key", "transition"), &Animation::track_insert_key, DEFVAL(1)); ClassDB::bind_method(D_METHOD("track_remove_key", "track_idx", "key_idx"), &Animation::track_remove_key); - ClassDB::bind_method(D_METHOD("track_remove_key_at_position", "track_idx", "position"), &Animation::track_remove_key_at_position); + ClassDB::bind_method(D_METHOD("track_remove_key_at_time", "track_idx", "time"), &Animation::track_remove_key_at_time); ClassDB::bind_method(D_METHOD("track_set_key_value", "track_idx", "key", "value"), &Animation::track_set_key_value); ClassDB::bind_method(D_METHOD("track_set_key_transition", "track_idx", "key_idx", "transition"), &Animation::track_set_key_transition); ClassDB::bind_method(D_METHOD("track_set_key_time", "track_idx", "key_idx", "time"), &Animation::track_set_key_time); @@ -2633,6 +2628,7 @@ void Animation::_bind_methods() { ClassDB::bind_method(D_METHOD("value_track_get_update_mode", "track_idx"), &Animation::value_track_get_update_mode); ClassDB::bind_method(D_METHOD("value_track_get_key_indices", "track_idx", "time_sec", "delta"), &Animation::_value_track_get_key_indices); + ClassDB::bind_method(D_METHOD("value_track_interpolate", "track_idx", "time_sec"), &Animation::value_track_interpolate); ClassDB::bind_method(D_METHOD("method_track_get_key_indices", "track_idx", "time_sec", "delta"), &Animation::_method_track_get_key_indices); ClassDB::bind_method(D_METHOD("method_track_get_name", "track_idx", "key_idx"), &Animation::method_track_get_name); |