Merge pull request #101285 from Nazarwadim/use_LocalVector_in_animation

Use `LocalVector` in `Animation`
This commit is contained in:
Thaddeus Crews 2025-09-16 20:28:52 -05:00
commit 2557b0da9f
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
5 changed files with 285 additions and 285 deletions

File diff suppressed because it is too large Load diff

View file

@ -135,7 +135,7 @@ private:
/* POSITION TRACK */
struct PositionTrack : public Track {
Vector<TKey<Vector3>> positions;
LocalVector<TKey<Vector3>> positions;
int32_t compressed_track = -1;
PositionTrack() { type = TYPE_POSITION_3D; }
};
@ -143,7 +143,7 @@ private:
/* ROTATION TRACK */
struct RotationTrack : public Track {
Vector<TKey<Quaternion>> rotations;
LocalVector<TKey<Quaternion>> rotations;
int32_t compressed_track = -1;
RotationTrack() { type = TYPE_ROTATION_3D; }
};
@ -151,7 +151,7 @@ private:
/* SCALE TRACK */
struct ScaleTrack : public Track {
Vector<TKey<Vector3>> scales;
LocalVector<TKey<Vector3>> scales;
int32_t compressed_track = -1;
ScaleTrack() { type = TYPE_SCALE_3D; }
};
@ -159,7 +159,7 @@ private:
/* BLEND SHAPE TRACK */
struct BlendShapeTrack : public Track {
Vector<TKey<float>> blend_shapes;
LocalVector<TKey<float>> blend_shapes;
int32_t compressed_track = -1;
BlendShapeTrack() { type = TYPE_BLEND_SHAPE; }
};
@ -169,7 +169,7 @@ private:
struct ValueTrack : public Track {
UpdateMode update_mode = UPDATE_CONTINUOUS;
bool update_on_seek = false;
Vector<TKey<Variant>> values;
LocalVector<TKey<Variant>> values;
ValueTrack() {
type = TYPE_VALUE;
@ -184,7 +184,7 @@ private:
};
struct MethodTrack : public Track {
Vector<MethodKey> methods;
LocalVector<MethodKey> methods;
MethodTrack() { type = TYPE_METHOD; }
};
@ -200,7 +200,7 @@ private:
};
struct BezierTrack : public Track {
Vector<TKey<BezierKey>> values;
LocalVector<TKey<BezierKey>> values;
BezierTrack() {
type = TYPE_BEZIER;
@ -218,7 +218,7 @@ private:
};
struct AudioTrack : public Track {
Vector<TKey<AudioKey>> values;
LocalVector<TKey<AudioKey>> values;
bool use_blend = true;
AudioTrack() {
@ -229,7 +229,7 @@ private:
/* ANIMATION TRACK */
struct AnimationTrack : public Track {
Vector<TKey<StringName>> values;
LocalVector<TKey<StringName>> values;
AnimationTrack() {
type = TYPE_ANIMATION;
@ -246,20 +246,20 @@ private:
MarkerKey() = default;
};
Vector<MarkerKey> marker_names; // time -> name
LocalVector<MarkerKey> marker_names; // time -> name
HashMap<StringName, double> marker_times; // name -> time
HashMap<StringName, Color> marker_colors; // name -> color
Vector<Track *> tracks;
LocalVector<Track *> tracks;
template <typename T, typename V>
int _insert(double p_time, T &p_keys, const V &p_value);
int _marker_insert(double p_time, Vector<MarkerKey> &p_keys, const MarkerKey &p_value);
int _marker_insert(double p_time, LocalVector<MarkerKey> &p_keys, const MarkerKey &p_value);
template <typename K>
inline int _find(const Vector<K> &p_keys, double p_time, bool p_backward = false, bool p_limit = false) const;
inline int _find(const LocalVector<K> &p_keys, double p_time, bool p_backward = false, bool p_limit = false) const;
_FORCE_INLINE_ Vector3 _interpolate(const Vector3 &p_a, const Vector3 &p_b, real_t p_c) const;
_FORCE_INLINE_ Quaternion _interpolate(const Quaternion &p_a, const Quaternion &p_b, real_t p_c) const;
@ -274,10 +274,10 @@ private:
_FORCE_INLINE_ Variant _cubic_interpolate_angle_in_time(const Variant &p_pre_a, const Variant &p_a, const Variant &p_b, const Variant &p_post_b, real_t p_c, real_t p_pre_a_t, real_t p_b_t, real_t p_post_b_t) const;
template <typename T>
_FORCE_INLINE_ T _interpolate(const Vector<TKey<T>> &p_keys, double p_time, InterpolationType p_interp, bool p_loop_wrap, bool *p_ok, bool p_backward = false) const;
_FORCE_INLINE_ T _interpolate(const LocalVector<TKey<T>> &p_keys, double p_time, InterpolationType p_interp, bool p_loop_wrap, bool *p_ok, bool p_backward = false) const;
template <typename T>
_FORCE_INLINE_ void _track_get_key_indices_in_range(const Vector<T> &p_array, double from_time, double to_time, List<int> *p_indices, bool p_is_backward) const;
_FORCE_INLINE_ void _track_get_key_indices_in_range(const LocalVector<T> &p_array, double from_time, double to_time, List<int> *p_indices, bool p_is_backward) const;
double length = 1.0;
real_t step = DEFAULT_STEP;
@ -408,7 +408,7 @@ public:
int add_track(TrackType p_type, int p_at_pos = -1);
void remove_track(int p_track);
_FORCE_INLINE_ const Vector<Track *> get_tracks() {
_FORCE_INLINE_ const LocalVector<Track *> &get_tracks() {
return tracks;
}