mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Fix JacobianIK to apply gradient correctly
This commit is contained in:
parent
6fd949a6dc
commit
069206bc74
2 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="JacobianIK3D" inherits="IterateIK3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
||||
<brief_description>
|
||||
Pseudo inverse Jacobian matrix based inverse kinematics solver.
|
||||
Jacobian transpose based inverse kinematics solver.
|
||||
</brief_description>
|
||||
<description>
|
||||
[JacobianIK3D] calculates rotations for all joints simultaneously, producing natural and smooth movement. It is particularly suited for biological animations.
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ void JacobianIK3D::_solve_iteration(double p_delta, Skeleton3D *p_skeleton, Iter
|
|||
continue;
|
||||
}
|
||||
|
||||
Quaternion to_rot = Quaternion(axis.normalized(), axis.length() / MAX(CMP_EPSILON, head_to_effector.length()));
|
||||
Quaternion to_rot = Quaternion(axis.normalized(), MIN(axis.length() / MAX(CMP_EPSILON, head_to_effector.length_squared()), angular_delta_limit)); // Clip by angular_delta_limit for stability.
|
||||
|
||||
for (int j = TAIL; j < chain_size; j++) {
|
||||
Vector3 to_tail = p_setting->chain[j] - current_head;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue