IK transforms are better affected by other bones

This commit is contained in:
devZoGok
2021-10-19 19:06:41 +03:00
parent f8d5beb5d6
commit 539c147c92
2 changed files with 16 additions and 44 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ namespace vb01{
sumLengths += boneChain[i]->getLength();
Bone *subBase = (Bone*)boneChain[0]->getIkTarget()->getParent();
Vector3 startPos = boneChain[chainLength - 1]->getBoneSpaceRestPos(subBase);
Vector3 startPos = subBase->globalToLocalPosition(boneChain[chainLength - 1]->localToGlobalPosition(Vector3::VEC_ZERO));
if(startPos.getDistanceFrom(targetPos) < sumLengths){
int numIterations = 500;