本文整理汇总了C++中Animation::action方法的典型用法代码示例。如果您正苦于以下问题:C++ Animation::action方法的具体用法?C++ Animation::action怎么用?C++ Animation::action使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animation
的用法示例。
在下文中一共展示了Animation::action方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: My_Timer
void My_Timer(int val)
{
angle += 1.0f;
if (angle >= 360.0f)angle = 0.0f;
magiccircle.rotate_angle += 2.0f;
if (magiccircle.rotate_angle >= 360.0f)magiccircle.rotate_angle = 0.0f;
body.change_core_color(angle);
if (magiccircle.light_enable){
magiccircle.light_offset += 0.2f;
if (magiccircle.light_offset >= magiccircle.light_blank)magiccircle.light_offset = 0.0f;
}
// animation control
if (animation.enable){
switch (animation.kind){
case ACTION_WALK_UP:
if (!animation.action()){
animation.walk_down();
animation.start(40,0);
}break;
case ACTION_WALK_DOWN:
if (!animation.action()){
animation.walk_up();
animation.start(40, 0);
}break;
case ACTION_RUN_UP_BACK:
if (!animation.action()){
animation.run_up_front();
animation.start(8, 0);
}break;
case ACTION_RUN_UP_FRONT:
if (!animation.action()){
animation.run_down_back();
animation.start(8, 0);
}break;
case ACTION_RUN_DOWN_BACK:
if (!animation.action()){
animation.run_down_front();
animation.start(8, 0);
}break;
case ACTION_RUN_DOWN_FRONT:
if (!animation.action()){
animation.run_up_back();
animation.start(8, 0);
}break;
case ACTION_PATRONUM_STAY:
if (!animation.action()){
animation.patronum_begin();
animation.start(80, 0);
}break;
case ACTION_PATRONUM_BEGIN:
if (!animation.action()){
animation.patronum_appear();
animation.start(100, 0);
}break;
case ACTION_PATRONUM_APPEAR:
if (!animation.action()){
animation.magiccircle_disappear();
animation.start(80, 0);
}break;
case ACTION_MAGICCIRCLE_DISAPPEAR:
if (!animation.action()){
magiccircle.enable = 0;
animation.animation_disable = 0;
animation.init_pos();
animation.start(20, 0);
}
break;
case STOP_ACTION:
if (!animation.action()){
animation.enable = false;
}
break;
default:
break;
}
}
//....
glutPostRedisplay();
if(timer_enabled)
{
glutTimerFunc(timer_speed, My_Timer, val);
}
}