本文整理汇总了C++中Object3D::pushAnimation方法的典型用法代码示例。如果您正苦于以下问题:C++ Object3D::pushAnimation方法的具体用法?C++ Object3D::pushAnimation怎么用?C++ Object3D::pushAnimation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Object3D
的用法示例。
在下文中一共展示了Object3D::pushAnimation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleMouseKeypress
void handleMouseKeypress(int key, int state, int x, int y)
{
switch (key) {
case GLUT_LEFT_BUTTON:
if (state == 0 && pause==FALSE){
if (gun0.bullet_number > 0) {
gun0.bullet_number--;
pistola.pushAnimation(animation(locRot(0,0,0,10,0,-10),100,std::chrono::system_clock::now()));
pistola.pushAnimation(animation(locRot(0,0,0,-10,0,10),100,std::chrono::system_clock::now()+std::chrono::milliseconds(100)));
collisionCurse();
}
else
{
sound.setBuffer(sound_youreempty);
sound.play();
}
}
break;
}
}
示例2: changeLevel
void changeLevel(int move)
{
if (move == 1){
// UP!
if(livello<MAX_LIV){
//animazione della camera
if (livello==1) {
//ruota verso destra
main_camera.pushAnimation(animation( locRot(0.0,0.0,0.0,0.0,40.0,0.0),1500, std::chrono::system_clock::now() ));
//spostati a destra
main_camera.pushAnimation(animation( locRot(-65.0,0.0,5.0,0.0,-10.0,0.0),3000, std::chrono::system_clock::now() + std::chrono::milliseconds(1500) ));
//ruota verso sinistra
main_camera.pushAnimation(animation( locRot(0.0,0.0,0.0,0.0,-30.0,0.0),1000, std::chrono::system_clock::now() + std::chrono::milliseconds(4500) ));
} else if (livello==2) {
//ruota verso destra
main_camera.pushAnimation(animation( locRot(0.0,0.0,0.0,0.0,40.0,0.0),1500, std::chrono::system_clock::now() ));
//spostati a destra
main_camera.pushAnimation(animation( locRot(-75.0,0.0,-15.0,0.0,-10.0,0.0),3000, std::chrono::system_clock::now() + std::chrono::milliseconds(1500) ));
//ruota verso sinistra
main_camera.pushAnimation(animation( locRot(0.0,0.0,0.0,0.0,-30.0,0.0),1000, std::chrono::system_clock::now() + std::chrono::milliseconds(4500) ));
}
for(int i=(livello*6);i<6+(livello*6);i++){
m[i]=reset_motion(m[i]);
}
for(int i=((livello-1)*6);i<6+((livello-1)*6);i++){
m[i].stato=2;
}
livello++;
}
} else {
// DOWN!
if(livello!=1){
for(int i=((livello-2)*6);i<6+((livello-2)*6);i++){
m[i]=reset_motion(m[i]);
}
for(int i=((livello-1)*6);i<6+((livello-1)*6);i++){
m[i].stato=2;
}
livello--;
}
}
}