diff options
Diffstat (limited to 'scene/3d/skeleton_3d.cpp')
-rw-r--r-- | scene/3d/skeleton_3d.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index 72b5b53b19..a4804e928a 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -34,7 +34,6 @@ #include "core/variant/type_info.h" #include "scene/3d/skeleton_modifier_3d.h" #include "scene/resources/surface_tool.h" -#include "scene/scene_string_names.h" #ifndef DISABLE_DEPRECATED #include "scene/3d/physical_bone_simulator_3d.h" #endif // _DISABLE_DEPRECATED @@ -314,7 +313,7 @@ void Skeleton3D::_notification(int p_what) { _process_modifiers(); } - emit_signal(SceneStringNames::get_singleton()->skeleton_updated); + emit_signal(SceneStringName(skeleton_updated)); // Update skins. RenderingServer *rs = RenderingServer::get_singleton(); @@ -605,7 +604,7 @@ void Skeleton3D::set_bone_enabled(int p_bone, bool p_enabled) { ERR_FAIL_INDEX(p_bone, bone_size); bones.write[p_bone].enabled = p_enabled; - emit_signal(SceneStringNames::get_singleton()->bone_enabled_changed, p_bone); + emit_signal(SceneStringName(bone_enabled_changed), p_bone); _make_dirty(); } @@ -617,7 +616,7 @@ bool Skeleton3D::is_bone_enabled(int p_bone) const { void Skeleton3D::set_show_rest_only(bool p_enabled) { show_rest_only = p_enabled; - emit_signal(SceneStringNames::get_singleton()->show_rest_only_changed); + emit_signal(SceneStringName(show_rest_only_changed)); _make_dirty(); } @@ -840,7 +839,7 @@ void Skeleton3D::force_update_all_bone_transforms() { if (updating) { return; } - emit_signal(SceneStringNames::get_singleton()->pose_updated); + emit_signal(SceneStringName(pose_updated)); } void Skeleton3D::force_update_bone_children_transforms(int p_bone_idx) { @@ -848,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; + 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; @@ -906,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++; } } |