-
Notifications
You must be signed in to change notification settings - Fork 74
Animation System
Thomas Trocha edited this page Mar 22, 2015
·
1 revision
http://www.pasteall.org/pic/show.php?id=6770&nonsense=something_that_ends_with.png
- gkActionManager (singleton) contains all actions of all objects.
- gkGameObject contain a ActionBlender that can prioritize animations and blend after a transition.
- you must first call gkGameObject::addAction("action_name");
- then gkGameObject::playAction("action_name", blend, mode, priority);
- you can get the action player corresponding to a specific action with gkGameObject::getActionPlayer("action_name");
- and jumping across the action with gkActionPlayer::setTimePosition(time);
- you can can also check if an gkActionPlayer isDone() or change its mode (loop,reverse).
- To create an animation (not linked to any object), call gkActionManager::getSingleton().createKeyedAction("action_name"); or gkActionManager::getSingleton().creatActionSequence("action_name");
- Contains a bunch of channels each containing a bunch of keyframed curves.
- Contains a bunch of ActionStrip with custom end start time for non linear action.
- Action Strip can correspond to any type of action (keyframed or other sequences)
// COMBO: Kick + Run + Whip
m_comboAttack = gkActionManager::getSingleton().createActionSequence("Momo_ComboAttack");
m_comboAttack->addItem("Momo_Kick", gkVector2(0.f, 17.f), gkVector2(0.f, 3.f));
m_comboAttack->addItem("Momo_Run", gkVector2(15.f, 32.f), gkVector2(2.f, 4.f));
m_comboAttack->addItem("Momo_TailWhip", gkVector2(25.f, 45.f), gkVector2(7.f, 0.f));
m_animations[= m_skeleton->addAction(m_comboAttack);
m_animations[GK_ANIM_COMBO_ATTACK](GK_ANIM_COMBO_ATTACK])->setMode(GK_ACT_END); //not LOOP
- NLA action are not converted to gkActionSequence yet.
- Only Bone and Object (loc/rot/scale) for now.