Clamp result
This commit is contained in:
parent
3a1e42dbbd
commit
032df8fb3a
2 changed files with 3 additions and 1 deletions
|
@ -97,6 +97,8 @@ void AtomicRotationTransform::optimize_value(const Vec3 &local_vector, const Vec
|
|||
if (inverse)
|
||||
result = -result;
|
||||
|
||||
result = std::clamp(result, lower_limit, upper_limit);
|
||||
|
||||
set_value(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ void IKViewer::optimize()
|
|||
{
|
||||
for (auto it = kinematic_chain.rbegin(); it != kinematic_chain.rend(); i++)
|
||||
{
|
||||
//it->optimize_value(TODO: local_vector, target, inverse);
|
||||
it->optimize_value(/*local_vector*/, target_position);
|
||||
}
|
||||
|
||||
current_endeffector_matrix.identity();
|
||||
|
|
Loading…
Reference in a new issue