Skip to content

Commit

Permalink
git subrepo pull (merge) modules/many_bone_ik
Browse files Browse the repository at this point in the history
subrepo:
  subdir:   "modules/many_bone_ik"
  merged:   "c4eff9af44"
upstream:
  origin:   "https://github.com/V-Sekai/many_bone_ik.git"
  branch:   "main"
  commit:   "447f521e90"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "110b9eb"
  • Loading branch information
fire committed Mar 17, 2024
2 parents 8860fac + 447f521 commit 721619b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
6 changes: 3 additions & 3 deletions doc_classes/ManyBoneIK3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,15 @@
<member name="constraint_mode" type="bool" setter="set_constraint_mode" getter="get_constraint_mode" default="false">
A boolean value indicating whether the IK system is in constraint mode or not.
</member>
<member name="default_damp" type="float" setter="set_default_damp" getter="get_default_damp" default="0.00872665">
<member name="default_damp" type="float" setter="set_default_damp" getter="get_default_damp" default="0.0872665">
The default maximum number of radians a bone is allowed to rotate per solver iteration. The lower this value, the more natural the pose results. However, this will increase the number of iterations_per_frame the solver requires to converge.
</member>
<member name="iterations_per_frame" type="float" setter="set_iterations_per_frame" getter="get_iterations_per_frame" default="10.0">
<member name="iterations_per_frame" type="float" setter="set_iterations_per_frame" getter="get_iterations_per_frame" default="15.0">
The number of iterations performed by the solver per frame. A higher value will result in more accurate poses but may impact performance.
</member>
<member name="skeleton_node_path" type="NodePath" setter="set_skeleton_node_path" getter="get_skeleton_node_path" default="NodePath(&quot;..&quot;)">
</member>
<member name="stabilization_passes" type="int" setter="set_stabilization_passes" getter="get_stabilization_passes" default="4">
<member name="stabilization_passes" type="int" setter="set_stabilization_passes" getter="get_stabilization_passes" default="1">
The number of stabilization passes performed by the solver. This can help to improve the stability of the IK solution.
</member>
<member name="ui_selected_bone" type="int" setter="set_ui_selected_bone" getter="get_ui_selected_bone" default="-1">
Expand Down
5 changes: 0 additions & 5 deletions src/ik_effector_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,16 @@ int32_t IKEffector3D::update_effector_tip_headings(PackedVector3Array *p_heading
int32_t index = p_index;
p_headings->write[index] = tip_xform_relative_to_skeleton_origin.origin - bone_origin_relative_to_skeleton_origin;
index++;
double distance = target_relative_to_skeleton_origin.origin.distance_to(bone_origin_relative_to_skeleton_origin);
double scale_by = MAX(1.0, distance);

const Vector3 priority = get_direction_priorities();

for (int axis = Vector3::AXIS_X; axis <= Vector3::AXIS_Z; ++axis) {
if (priority[axis] > 0.0) {
Vector3 column = tip_basis.get_column(axis) * priority[axis];

p_headings->write[index] = (column + tip_xform_relative_to_skeleton_origin.origin) - bone_origin_relative_to_skeleton_origin;
p_headings->write[index] *= scale_by;
index++;

p_headings->write[index] = (tip_xform_relative_to_skeleton_origin.origin - column) - bone_origin_relative_to_skeleton_origin;
p_headings->write[index] *= scale_by;
index++;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/many_bone_ik_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ class ManyBoneIK3D : public Node3D {
Vector<Vector<Vector4>> kusudama_limit_cones;
Vector<int> kusudama_limit_cone_count;
float MAX_KUSUDAMA_LIMIT_CONES = 10;
int32_t iterations_per_frame = 10;
float default_damp = Math::deg_to_rad(0.5f);
int32_t iterations_per_frame = 15;
float default_damp = Math::deg_to_rad(5.0f);
bool queue_debug_skeleton = false;
Ref<IKNode3D> godot_skeleton_transform;
Transform3D godot_skeleton_transform_inverse;
Ref<IKNode3D> ik_origin;
bool is_dirty = true;
NodePath skeleton_node_path = NodePath("..");
int32_t ui_selected_bone = -1, stabilize_passes = 4;
int32_t ui_selected_bone = -1, stabilize_passes = 1;

void _on_timer_timeout();
void _update_ik_bones_transform();
Expand Down

0 comments on commit 721619b

Please sign in to comment.