Passing animation data to the solver

This process requires obtaining animation data (in local space) from the source (possibly after performing typical animation pipeline functions such as blending, etc.) and passing it to the avatar using 

 IKSegment::setTargetOrientation(x,y,z,w) 

The pseudo code for setting animation data for the whole figure is included below.

Enable root translation, so that the root of the skeleton follows the translation of the root in the original animation. For all other bones we will only need to pass orientation data in most cases.

 g_pIKinemaSolver->translateRoot( true );

Enable retargeting for some bones or all bones. You can have retargeting only on selected bones, for example lower body. Animation input can also come from several animation sources, say lower body from one source and upper body from a separate source.

 for( unsigned int i = 0 ; i < iBoneNum ; i++ )
{
FIK::IKSegment *seg = g_pIKinemaSolver->getSegmentByHandle( i );
if( seg )
seg->enableRetargeting( true );
}

Pass animation data from the source animation for every frame

 for( unsigned int i = 0 ; i < iBoneNum ; i++ )
{
FIK::IKSegment *seg = g_pIKinemaSolver->getSegmentByHandle( i );
if( seg )
{
FIK::Quaternion q = animQuat[ f ][ i ];
seg->setTargetOrientation( q[0], q[1], q[2], q[3] );
}
}

At that point if you run the code you should see the animation transferred and the target IKinema controlled avatar animated. The figure at that stage would not be translated in the scene.