@@ -318,12 +318,16 @@ void SceneTreeFTI::_update_dirty_nodes(Node *p_node, uint32_t p_current_frame, f
318
318
return ;
319
319
}
320
320
321
+ p_node->update_cached_children ();
322
+ Span<Node *> children = p_node->get_cached_children ();
323
+ uint32_t num_children = children.size ();
324
+
321
325
// Not a Node3D.
322
326
// Could be e.g. a viewport or something
323
327
// so we should still recurse to children.
324
328
if (!s) {
325
- for (int n = 0 ; n < p_node-> get_child_count () ; n++) {
326
- _update_dirty_nodes (p_node-> get_child (n) , p_current_frame, p_interpolation_fraction, p_active, nullptr , p_depth + 1 );
329
+ for (uint32_t n = 0 ; n < num_children ; n++) {
330
+ _update_dirty_nodes (children. ptr ()[n] , p_current_frame, p_interpolation_fraction, p_active, nullptr , p_depth + 1 );
327
331
}
328
332
return ;
329
333
}
@@ -424,8 +428,8 @@ void SceneTreeFTI::_update_dirty_nodes(Node *p_node, uint32_t p_current_frame, f
424
428
s->_clear_dirty_bits (Node3D::DIRTY_GLOBAL_INTERPOLATED_TRANSFORM);
425
429
426
430
// Recurse to children.
427
- for (int n = 0 ; n < p_node-> get_child_count () ; n++) {
428
- _update_dirty_nodes (p_node-> get_child (n) , p_current_frame, p_interpolation_fraction, p_active, s->data .fti_global_xform_interp_set ? &s->data .global_transform_interpolated : &s->data .global_transform , p_depth + 1 );
431
+ for (uint32_t n = 0 ; n < num_children ; n++) {
432
+ _update_dirty_nodes (children. ptr ()[n] , p_current_frame, p_interpolation_fraction, p_active, s->data .fti_global_xform_interp_set ? &s->data .global_transform_interpolated : &s->data .global_transform , p_depth + 1 );
429
433
}
430
434
}
431
435
0 commit comments