hi, all!
I am trying to use inverse kinematics to control the flexion of my fingers, but there seems to be a problem.
I am currently controlling the index finger. The method I use is to set the effector on the farthest joint of the index finger, and set the solver on the bottom joint of the index finger, and update the target position of the effector every time to make the index finger bend.
//set the Effector and Solver
//...
bindLeftHandTrans = modelNode->GetChild(("LeftHand"), true);
bindLeftHandTrans->SetWorldPosition(Vector3(0, -10, 0));
bindLeftHandTrans->SetRotation(Quaternion(0, 90, 90));
bindLeftHandIndex1 = modelNode->GetChild(("LeftHandIndex1"), true);
bindLeftHandIndex2 = modelNode->GetChild(("LeftHandIndex2"), true);
bindLeftHandIndex3 = modelNode->GetChild(("LeftHandIndex3"), true);
indexEffector_3 = bindLeftHandIndex3->CreateComponent<IKEffector>();
indexEffector_3->SetChainLength(2);
solver_index2 = bindLeftHandIndex1->CreateComponent<IKSolver>();
solver_index2->SetFeature(IKSolver::UPDATE_ORIGINAL_POSE, true);
solver_index2->SetAlgorithm(IKSolver::TWO_BONE);
solver_index2->SetFeature(IKSolver::AUTO_SOLVE, false);
//...
// HandleSceneDrawableUpdateFinished fuction
//...
indexEffector_3->SetTargetPosition(indexPos3);
solver_index2->Solve();
//...
But the result was different from what I imagined. The model’s finger looked like it was broken.
I also tried the constraints in the ragdoll example, but to no avail
I don’t know if the bones of the model are bound incorrectly or the way I control it is incorrect. I want to know if anyone has solved such a problem
This is the skeleton of the model