Merge pull request #64802 from benbot/master

This commit is contained in:
Rémi Verschelde 2022-08-25 17:50:51 +02:00 committed by GitHub
commit 78033235bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 68 deletions

View File

@ -20,15 +20,6 @@
Adds a bone, with name [param name]. [method get_bone_count] will become the bone index.
</description>
</method>
<method name="add_bone_child">
<return type="void" />
<param index="0" name="bone_idx" type="int" />
<param index="1" name="child_bone_idx" type="int" />
<description>
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.
</description>
</method>
<method name="clear_bones">
<return type="void" />
<description>
@ -272,15 +263,6 @@
Binds the given Skin to the Skeleton.
</description>
</method>
<method name="remove_bone_child">
<return type="void" />
<param index="0" name="bone_idx" type="int" />
<param index="1" name="child_bone_idx" type="int" />
<description>
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.
</description>
</method>
<method name="reset_bone_pose">
<return type="void" />
<param index="0" name="bone_idx" type="int" />
@ -294,14 +276,6 @@
Sets all bone poses to rests.
</description>
</method>
<method name="set_bone_children">
<return type="void" />
<param index="0" name="bone_idx" type="int" />
<param index="1" name="bone_children" type="PackedInt32Array" />
<description>
Sets the children for the passed in bone, [param bone_idx], to the passed-in array of bone indexes, [param bone_children].
</description>
</method>
<method name="set_bone_enabled">
<return type="void" />
<param index="0" name="bone_idx" type="int" />

View File

@ -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<ObjectID, BodyState>::Iterator E = contact_monitor->body_map.find(obj);
if (!E) {
toadd[toadd_count].rid = rid;

View File

@ -613,42 +613,6 @@ Vector<int> Skeleton3D::get_bone_children(int p_bone) {
return bones[p_bone].child_bones;
}
void Skeleton3D::set_bone_children(int p_bone, Vector<int> 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<int> 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);