@@ -142,6 +142,15 @@ class AnimationMixer : public Node {
142142 ObjectID object_id;
143143 real_t total_weight = 0.0 ;
144144
145+ TrackCache () = default ;
146+ TrackCache (const TrackCache &p_other) :
147+ root_motion (p_other.root_motion),
148+ setup_pass (p_other.setup_pass),
149+ type (p_other.type),
150+ object (p_other.object),
151+ object_id (p_other.object_id),
152+ total_weight (p_other.total_weight) {}
153+
145154 virtual ~TrackCache () {}
146155 };
147156
@@ -161,6 +170,24 @@ class AnimationMixer : public Node {
161170 Quaternion rot;
162171 Vector3 scale;
163172
173+ TrackCacheTransform (const TrackCacheTransform &p_other) :
174+ TrackCache (p_other),
175+ #ifndef _3D_DISABLED
176+ node_3d (p_other.node_3d),
177+ skeleton(p_other.skeleton),
178+ #endif
179+ bone_idx (p_other.bone_idx),
180+ loc_used (p_other.loc_used),
181+ rot_used (p_other.rot_used),
182+ scale_used (p_other.scale_used),
183+ init_loc (p_other.init_loc),
184+ init_rot (p_other.init_rot),
185+ init_scale (p_other.init_scale),
186+ loc (p_other.loc),
187+ rot (p_other.rot),
188+ scale (p_other.scale) {
189+ }
190+
164191 TrackCacheTransform () {
165192 type = Animation::TYPE_POSITION_3D;
166193 }
@@ -178,6 +205,14 @@ class AnimationMixer : public Node {
178205 float init_value = 0 ;
179206 float value = 0 ;
180207 int shape_index = -1 ;
208+
209+ TrackCacheBlendShape (const TrackCacheBlendShape &p_other) :
210+ TrackCache (p_other),
211+ mesh_3d (p_other.mesh_3d),
212+ init_value (p_other.init_value),
213+ value (p_other.value),
214+ shape_index (p_other.shape_index) {}
215+
181216 TrackCacheBlendShape () { type = Animation::TYPE_BLEND_SHAPE; }
182217 ~TrackCacheBlendShape () {}
183218 };
@@ -189,6 +224,16 @@ class AnimationMixer : public Node {
189224 bool is_continuous = false ;
190225 bool is_using_angle = false ;
191226 Variant element_size;
227+
228+ TrackCacheValue (const TrackCacheValue &p_other) :
229+ TrackCache (p_other),
230+ init_value (p_other.init_value),
231+ value (p_other.value),
232+ subpath (p_other.subpath),
233+ is_continuous (p_other.is_continuous),
234+ is_using_angle (p_other.is_using_angle),
235+ element_size (p_other.element_size) {}
236+
192237 TrackCacheValue () { type = Animation::TYPE_VALUE; }
193238 ~TrackCacheValue () {
194239 // Clear ref to avoid leaking.
@@ -206,6 +251,13 @@ class AnimationMixer : public Node {
206251 real_t init_value = 0.0 ;
207252 real_t value = 0.0 ;
208253 Vector<StringName> subpath;
254+
255+ TrackCacheBezier (const TrackCacheBezier &p_other) :
256+ TrackCache (p_other),
257+ init_value (p_other.init_value),
258+ value (p_other.value),
259+ subpath (p_other.subpath) {}
260+
209261 TrackCacheBezier () {
210262 type = Animation::TYPE_BEZIER;
211263 }
@@ -235,6 +287,12 @@ class AnimationMixer : public Node {
235287 Ref<AudioStreamPlaybackPolyphonic> audio_stream_playback;
236288 HashMap<ObjectID, PlayingAudioTrackInfo> playing_streams; // Key is Animation resource ObjectID.
237289
290+ TrackCacheAudio (const TrackCacheAudio &p_other) :
291+ TrackCache (p_other),
292+ audio_stream (p_other.audio_stream),
293+ audio_stream_playback (p_other.audio_stream_playback),
294+ playing_streams (p_other.playing_streams) {}
295+
238296 TrackCacheAudio () {
239297 type = Animation::TYPE_AUDIO;
240298 }
0 commit comments