improved bone test

remade IK chain bone orientation method
This commit is contained in:
devZoGok
2021-10-19 19:06:41 +03:00
parent 7111ef24e4
commit b7d9a82eec
7 changed files with 89 additions and 42 deletions
+2 -1
View File
@@ -7,7 +7,8 @@ namespace vb01{
for(int i = 0; i < chainLength; i++)
sumLengths += boneChain[i]->getLength();
Vector3 startPos = boneChain[chainLength - 1]->getModelSpacePos();
Bone *subBase = (Bone*)boneChain[0]->getIkTarget()->getParent();
Vector3 startPos = boneChain[chainLength - 1]->getBoneSpaceRestPos(subBase);
if(startPos.getDistanceFrom(targetPos) < sumLengths){
int numIterations = 500;