public bool buildFrameLocalBones(int frameIndex, BoneOrientations bones) { for (int i = 0; i < animJoints.Count; i++) { Quat q; Vec3 v; buildFrameLocalBone(frameIndex, i, out q, out v); bones.setBonePos(i, v); bones.setBoneQuat(i, q); } return(false); }
public bool buildFrameABSBones(int frameIndex, BoneOrientations bones) { if (buildFrameLocalBones(frameIndex, bones)) { return(true); } for (int i = 0; i < animJoints.Count; i++) { int parent = animJoints[i].getParentIndex(); if (parent != -1) { Vec3 rotatedPos = bones.getBoneQuat(parent).rotatePoint(bones.getBonePos(i)); Vec3 newPos = rotatedPos + bones.getBonePos(parent); Quat newRot = bones.getBoneQuat(parent).multiplyQuat(bones.getBoneQuat(i)); newRot.normalize(); bones.setBonePos(i, newPos); bones.setBoneQuat(i, newRot); } } return(false); }