Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace List with LocalVector on Skeleton3D's bone transform update. #92164

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions scene/3d/skeleton_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,13 @@ void Skeleton3D::force_update_bone_children_transforms(int p_bone_idx) {
ERR_FAIL_INDEX(p_bone_idx, bone_size);

Bone *bonesptr = bones.ptrw();
List<int> bones_to_process = List<int>();
thread_local LocalVector<int> bones_to_process;
DarioSamo marked this conversation as resolved.
Show resolved Hide resolved
bones_to_process.clear();
bones_to_process.push_back(p_bone_idx);

while (bones_to_process.size() > 0) {
int current_bone_idx = bones_to_process.front()->get();
bones_to_process.erase(current_bone_idx);
uint32_t index = 0;
while (index < bones_to_process.size()) {
int current_bone_idx = bones_to_process[index];

Bone &b = bonesptr[current_bone_idx];
bool bone_enabled = b.enabled && !show_rest_only;
Expand Down Expand Up @@ -905,6 +906,8 @@ void Skeleton3D::force_update_bone_children_transforms(int p_bone_idx) {
for (int i = 0; i < child_bone_size; i++) {
bones_to_process.push_back(b.child_bones[i]);
}

index++;
}
}

Expand Down
Loading