本文整理汇总了C++中Animation::addActionInFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ Animation::addActionInFrame方法的具体用法?C++ Animation::addActionInFrame怎么用?C++ Animation::addActionInFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animation
的用法示例。
在下文中一共展示了Animation::addActionInFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prepareJumpAnim
void prepareJumpAnim(Scene* s) {
Animation* prepareJump = new Animation;
prepareJump->setFrameDuration(0.5);
prepareJump->setScene(s);
Animation* stand = new Animation;
stand->setFrameDuration(0.5);
stand->setScene(s);
float h1pos1[3] = {0.0, 0.0, 0.0};
float h1pos2[3] = {-30.0, 0.0, 0.0};
float h2pos1[3] = {0.0, 0.0, 0.0};
float h2pos2[3] = {120.0, 0.0, 0.0};
float h3pos1[3] = {0.0, 0.0, 0.0};
float h3pos2[3] = {-120.0, 0.0, 0.0};
float cpos1[3] = {0.0, 0.0, 0.0};
float cpos2[3] = {30.0, 0.0, 0.0};
prepareJump->addActionInFrame("haste1R", h1pos1, 'r', 0);
prepareJump->addActionInFrame("haste1R", h1pos2, 'r', 1);
prepareJump->addActionInFrame("haste2R", h2pos1, 'r', 0);
prepareJump->addActionInFrame("haste2R", h2pos2, 'r', 1);
prepareJump->addActionInFrame("haste3R", h3pos1, 'r', 0);
prepareJump->addActionInFrame("haste3R", h3pos2, 'r', 1);
prepareJump->addActionInFrame("cupulaR", cpos1, 'r', 0);
prepareJump->addActionInFrame("cupulaR", cpos2, 'r', 1);
stand->addActionInFrame("haste1R", h1pos2, 'r', 0);
stand->addActionInFrame("haste1R", h1pos1, 'r', 1);
stand->addActionInFrame("haste2R", h2pos2, 'r', 0);
stand->addActionInFrame("haste2R", h2pos1, 'r', 1);
stand->addActionInFrame("haste3R", h3pos2, 'r', 0);
stand->addActionInFrame("haste3R", h3pos1, 'r', 1);
stand->addActionInFrame("cupulaR", cpos2, 'r', 0);
stand->addActionInFrame("cupulaR", cpos1, 'r', 1);
s->addAnimation(prepareJump, "prepareJump");
s->addAnimation(stand, "stand");
}
示例2: jumpAnim
void jumpAnim(Scene* s) {
Animation* jump = new Animation;
jump->setScene(s);
jump->setFrameDuration(0.5);
s->addAnimation(jump, "jump");
Animation* reverseJump = new Animation;
reverseJump->setScene(s);
reverseJump->setFrameDuration(0.5);
s->addAnimation(reverseJump, "reverseJump");
float h1pos1[3] = {-30.0, 0.0, 0.0};
float h2pos1[3] = {120.0, 0.0, 0.0};
float h3pos1[3] = {-120.0, 0.0, 0.0};
float cpos1[3] = {30.0, 0.0, 0.0};
jump->addActionInFrame("haste1R", h1pos1, 'r', 0);
jump->addActionInFrame("haste2R", h2pos1, 'r', 0);
jump->addActionInFrame("haste3R", h3pos1, 'r', 0);
jump->addActionInFrame("cupulaR", cpos1, 'r', 0);
float btpos2[3] = {0.0, 0.0, 0.0};
float brpos2[3] = {0.0, 0.0, 0.0};
float h1pos2[3] = {-40.0, 0.0, 0.0};
float h2pos2[3] = {150.0, 0.0, 0.0};
float h3pos2[3] = {-145.0, 0.0, 0.0};
float cpos2[3] = {60.0, 0.0, 0.0};
jump->addActionInFrame("baseR", brpos2, 'r', 1);
jump->addActionInFrame("baseT", btpos2, 't', 1);
jump->addActionInFrame("haste1R", h1pos2, 'r', 1);
jump->addActionInFrame("haste2R", h2pos2, 'r', 1);
jump->addActionInFrame("haste3R", h3pos2, 'r', 1);
jump->addActionInFrame("cupulaR", cpos2, 'r', 1);
float btpos3[3] = {0.0, 30.0, 50.0};
float brpos3[3] = {-30.0, 0.0, 0.0};
float h1pos3[3] = {10.0, 0.0, 0.0};
float h2pos3[3] = {50.0, 0.0, 0.0};
float h3pos3[3] = {-50.0, 0.0, 0.0};
float cpos3[3] = {65.0, 0.0, 0.0};
jump->addActionInFrame("baseR", brpos3, 'r', 2);
jump->addActionInFrame("baseT", btpos3, 't', 2);
jump->addActionInFrame("haste1R", h1pos3, 'r', 2);
jump->addActionInFrame("haste2R", h2pos3, 'r', 2);
jump->addActionInFrame("haste3R", h3pos3, 'r', 2);
jump->addActionInFrame("cupulaR", cpos3, 'r', 2);
float brpos4[3] = {0.0, 0.0, 0.0};
float btpos4[3] = {0.0, 0.0, 90.0};
float h1pos4[3] = {-60.0, 0.0, 0.0};
float h2pos4[3] = {160.0, 0.0, 0.0};
float h3pos4[3] = {-165.0, 0.0, 0.0};
float cpos4[3] = {60.0, 0.0, 0.0};
jump->addActionInFrame("baseR", brpos4, 'r', 3);
jump->addActionInFrame("baseT", btpos4, 't', 3);
jump->addActionInFrame("haste1R", h1pos4, 'r', 3);
jump->addActionInFrame("haste2R", h2pos4, 'r', 3);
jump->addActionInFrame("haste3R", h3pos4, 'r', 3);
jump->addActionInFrame("cupulaR", cpos4, 'r', 3);
float btpos5[3] = {0.0f, 0.0f, 90.0f};
jump->addActionInFrame("baseT", btpos5, 't', 4);
//This part is exactly the first frame
jump->addActionInFrame("haste1R", h1pos1, 'r', 4);
jump->addActionInFrame("haste2R", h2pos1, 'r', 4);
jump->addActionInFrame("haste3R", h3pos1, 'r', 4);
jump->addActionInFrame("cupulaR", cpos1, 'r', 4);
//Reversing the jump
reverseJump->addActionInFrame("haste1R", h1pos1, 'r', 0);
reverseJump->addActionInFrame("haste2R", h2pos1, 'r', 0);
reverseJump->addActionInFrame("haste3R", h3pos1, 'r', 0);
reverseJump->addActionInFrame("cupulaR", cpos1, 'r', 0);
reverseJump->addActionInFrame("baseR", brpos4, 'r', 1);
reverseJump->addActionInFrame("baseT", btpos4, 't', 1);
reverseJump->addActionInFrame("haste1R", h1pos4, 'r', 1);
reverseJump->addActionInFrame("haste2R", h2pos4, 'r', 1);
reverseJump->addActionInFrame("haste3R", h3pos4, 'r', 1);
reverseJump->addActionInFrame("cupulaR", cpos4, 'r', 1);
reverseJump->addActionInFrame("baseR", brpos3, 'r', 2);
reverseJump->addActionInFrame("baseT", btpos3, 't', 2);
reverseJump->addActionInFrame("haste1R", h1pos3, 'r', 2);
reverseJump->addActionInFrame("haste2R", h2pos3, 'r', 2);
reverseJump->addActionInFrame("haste3R", h3pos3, 'r', 2);
reverseJump->addActionInFrame("cupulaR", cpos3, 'r', 2);
reverseJump->addActionInFrame("baseR", brpos2, 'r', 3);
reverseJump->addActionInFrame("baseT", btpos2, 't', 3);
reverseJump->addActionInFrame("haste1R", h1pos2, 'r', 3);
reverseJump->addActionInFrame("haste2R", h2pos2, 'r', 3);
reverseJump->addActionInFrame("haste3R", h3pos2, 'r', 3);
reverseJump->addActionInFrame("cupulaR", cpos2, 'r', 3);
//.........这里部分代码省略.........