Calls at every frame

The following calls are typically executed at every frame

A. Pass retargeting information for one or many joints from one or several sources

          for(std::size_t i = 0; i < sourceAnimation.NumberOfBones i++)
		{
			
		FIK::IKSegment* pSeg = m_Solver->getSegment(animationTargetBoneName);
		if(pSeg)
		     {
			FIK::Quaternion target = sourceAnimationBone[i].getLocalOrientation();
			pSeg->setTargetOrientation(target[0],target[1],target[2],target[3]);
		     }
		}

B. Update the targets for the tasks. If there are no changes in the targets, no need to update as solver will maintain previous targets

//For Position Task
FIK::Vector targetPos = required Target Position
m_Pos->setTarget(targetPos[0], targetPos[1], targetPos[2]);
//For Orientation Task
FIK::Vector targetQuat = required Target Orientation
m_Orient->setTarget(targetQuat[0], targetQuat[1], targetQuat[2],targetQuat[3]);

C. Change any of the tasks' parameters as required, for example: task precision, task weight, task's depth of solving (length), active/non-active state.

D. Update any of the segments' tuning parameters, for example: retargeting gain, limits gain, stiffness, active/non-active state.

E. call the solver;s Solve function with the required number of iterations

m_Solver->solve(Number of Iterations);

If you are using global position and/or orientation data from the solver, i.e. getGlobalPos or getGlobalQ, then call

m_Solver->updateFK();

F. Update root position in th eengine

FIK::Vector rootPos(m_Solver->getRootSegment()->getPos());
// pass rootPos to game engine.

G. Update bones orientations using segment->GetQ() for your avatar

for(std::size_t i = 0; i < m_Solver->numSegments(); i++)
     {
         FIK::IKSegment* pSeg = m_Solver->getSegmentByHandle(i);
             if(pSeg)
                 {
                 FIK::Quaternion quat (pSeg->getQ() );//Return segment orientation in parent space
                 // pass quat to game engine
                  }
      }