適切な設定を行ったあとで、クリーチャーをアニメートすることができます。更新シーケンスは次のとおりです。
HIKCreatureSetNodeStateTQSfv(mHIKCreature, mHIKInputOutputState, lizardProfile->mBoneMapping[i].mChainID, lizardProfile->mBoneMapping[i].mBoneID, translation, orientation, scale);
// Synchronize Effectors with current FK transforms HIKEffectorSetFromCreature(mHIKCreature, mHIKEffectorSetState, mHIKInputOutputState); // Get the current Effector position HIKCreatureGetEffectorStateTQSfv(mHIKEffectorSetState, TAIL_EFFECTOR, lTranslation, lOrientation, lScale); // Move the current Effector position (tail position) lTranslation[0] += cosf(gCurrentTime*2.0f) * 80.0f; lTranslation[1] += cosf(gCurrentTime*2.5f) * 150.0f; lTranslation[2] -= sinf(gCurrentTime*5.0f) * 40.0f; // Provide the solver with the new Effector position (position constraint) HIKCreatureSetEffectorStateTQSfv(mHIKEffectorSetState, TAIL_EFFECTOR, lTranslation, lOrientation, lScale); // Enable the position constraint (full reach, no blend with FK) HIKCreatureSetTranslationActive(mHIKEffectorSetState, TAIL_EFFECTOR, 1.0f); // Enable pull, full force HIKCreatureSetPull(mHIKEffectorSetState, TAIL_EFFECTOR, 0.25f);
HIKCreatureSolveForEffectorSet(mHIKCreature, mHIKInputOutputState, mHIKEffectorSetState);
HIKCreatureGetNodeStateTQSfv(mHIKCreature, mHIKInputOutputState, lizardProfile->mBoneMapping[i].mChainID, lizardProfile->mBoneMapping[i].mBoneID, translation, orientation, scale);
詳細については、Creature および Snake のサンプルを参照してください。「Molecule に基づくサンプル」を参照してください。