From 9c1bcdcf1a407b21d3881f690f1c366d64fdcf32 Mon Sep 17 00:00:00 2001 From: benbot Date: Wed, 24 Aug 2022 16:49:39 -0400 Subject: [PATCH] removes unused skeleton functions and stray comments in RigidDynamicBody3D --- doc/classes/Skeleton3D.xml | 26 ------------------------ scene/3d/physics_body_3d.cpp | 4 +--- scene/3d/skeleton_3d.cpp | 39 ------------------------------------ 3 files changed, 1 insertion(+), 68 deletions(-) diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml index 69b9988641c..75f7a377528 100644 --- a/doc/classes/Skeleton3D.xml +++ b/doc/classes/Skeleton3D.xml @@ -20,15 +20,6 @@ Adds a bone, with name [param name]. [method get_bone_count] will become the bone index. - - - - - - Takes the given bone pose/transform and converts it to a world transform, relative to the [Skeleton3D] node. - This is useful for using the bone transform in calculations with transforms from [Node3D]-based nodes. - - @@ -272,15 +263,6 @@ Binds the given Skin to the Skeleton. - - - - - - Removes the passed in child bone index, [param child_bone_idx], from the passed-in bone, [param bone_idx], if it exists. - [b]Note:[/b] This does not remove the child bone, but instead it removes the connection it has to the parent bone. - - @@ -294,14 +276,6 @@ Sets all bone poses to rests. - - - - - - Sets the children for the passed in bone, [param bone_idx], to the passed-in array of bone indexes, [param bone_children]. - - diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index cf0f2d3a02e..9b033e955d4 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -525,7 +525,7 @@ void RigidDynamicBody3D::_body_state_changed(PhysicsDirectBodyState3D *p_state) } _RigidDynamicBodyInOut *toadd = (_RigidDynamicBodyInOut *)alloca(p_state->get_contact_count() * sizeof(_RigidDynamicBodyInOut)); - int toadd_count = 0; //state->get_contact_count(); + int toadd_count = 0; RigidDynamicBody3D_RemoveAction *toremove = (RigidDynamicBody3D_RemoveAction *)alloca(rc * sizeof(RigidDynamicBody3D_RemoveAction)); int toremove_count = 0; @@ -537,8 +537,6 @@ void RigidDynamicBody3D::_body_state_changed(PhysicsDirectBodyState3D *p_state) int local_shape = p_state->get_contact_local_shape(i); int shape = p_state->get_contact_collider_shape(i); - //bool found=false; - HashMap::Iterator E = contact_monitor->body_map.find(obj); if (!E) { toadd[toadd_count].rid = rid; diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index 0cd7188c237..1bc138704ec 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -613,42 +613,6 @@ Vector Skeleton3D::get_bone_children(int p_bone) { return bones[p_bone].child_bones; } -void Skeleton3D::set_bone_children(int p_bone, Vector p_children) { - const int bone_size = bones.size(); - ERR_FAIL_INDEX(p_bone, bone_size); - bones.write[p_bone].child_bones = p_children; - - process_order_dirty = true; - rest_dirty = true; - _make_dirty(); -} - -void Skeleton3D::add_bone_child(int p_bone, int p_child) { - const int bone_size = bones.size(); - ERR_FAIL_INDEX(p_bone, bone_size); - bones.write[p_bone].child_bones.push_back(p_child); - - process_order_dirty = true; - rest_dirty = true; - _make_dirty(); -} - -void Skeleton3D::remove_bone_child(int p_bone, int p_child) { - const int bone_size = bones.size(); - ERR_FAIL_INDEX(p_bone, bone_size); - - int child_idx = bones[p_bone].child_bones.find(p_child); - if (child_idx >= 0) { - bones.write[p_bone].child_bones.remove_at(child_idx); - } else { - WARN_PRINT("Cannot remove child bone: Child bone not found."); - } - - process_order_dirty = true; - rest_dirty = true; - _make_dirty(); -} - Vector Skeleton3D::get_parentless_bones() { _update_process_order(); return parentless_bones; @@ -1238,9 +1202,6 @@ void Skeleton3D::_bind_methods() { ClassDB::bind_method(D_METHOD("unparent_bone_and_rest", "bone_idx"), &Skeleton3D::unparent_bone_and_rest); ClassDB::bind_method(D_METHOD("get_bone_children", "bone_idx"), &Skeleton3D::get_bone_children); - ClassDB::bind_method(D_METHOD("set_bone_children", "bone_idx", "bone_children"), &Skeleton3D::set_bone_children); - ClassDB::bind_method(D_METHOD("add_bone_child", "bone_idx", "child_bone_idx"), &Skeleton3D::add_bone_child); - ClassDB::bind_method(D_METHOD("remove_bone_child", "bone_idx", "child_bone_idx"), &Skeleton3D::remove_bone_child); ClassDB::bind_method(D_METHOD("get_parentless_bones"), &Skeleton3D::get_parentless_bones);