当前位置: 首页>>代码示例>>C++>>正文


C++ MyVector::setVector方法代码示例

本文整理汇总了C++中MyVector::setVector方法的典型用法代码示例。如果您正苦于以下问题:C++ MyVector::setVector方法的具体用法?C++ MyVector::setVector怎么用?C++ MyVector::setVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MyVector的用法示例。


在下文中一共展示了MyVector::setVector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char** argv){
  //Initialize globals
  //srand(time(NULL));
  camera.setPosition(0.0, 10.0, 10.0);
  camera.setVector(0.0, 0.0, 0.0);
  newCam = camera;
  u.setVector(-1.0, 0.0, 0.0);
  v.setVector(0.0, 1.0, 0.0);
  w.setVector(0.0, 0.0, -1.0);
  p1.setOpponent(&(opponent.player));
  p1.setPosition(P1_POSX, P1_POSY, P1_POSZ);
  opponent.player.setPosition(OPP_POSX2, OPP_POSY2, OPP_POSZ2);

  cam.setListenerPos();
  sound.toggleMusic();

  tlx = 0;
  tly = 0;
  ulx = 0;   
  uly = 0;
  //Initialize window
  GW = 800;
  GH = 600;
  
    /* initialize buttons */
  GLfloat col[] = {1.0,1.0,1.0};
  for (int i = 0; i < 18; i++) {
	Button * newBtn = new Button(i, col, NULL);
    buttons.push_back(newBtn);
  }
  
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
  glutInitWindowSize(GW, GH);
  glutInitWindowPosition(100, 100);
  glutCreateWindow("Crash & Burn");
  glClearColor(1.0, 1.0, 1.0, 1.0);

  //Register GLUT callbacks
  glutDisplayFunc(display);
  glutReshapeFunc(reshape);
  glutKeyboardFunc(keyboard);
  glutKeyboardUpFunc(keyboardUp);
  glutSpecialFunc(specKeys);
  glutMouseFunc(mouseClick);
  glutPassiveMotionFunc(mouseMotion);

  glEnable(GL_DEPTH_TEST);
  glEnable(GL_LIGHTING);
  init_lighting();
  composeDisplayLists();
  glutTimerFunc(1000/60, update, 0);

  initializeParticleTextures();
  buttons.at(17)->setObject(new BasicTower(float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0.25, 
     float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0, 0));
  buttons.at(16)->setObject(new FreezeTower(float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0.25, 
     float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0, 0));
  buttons.at(15)->setObject(new FastTower(float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0.25, 
     float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0, 0));
  buttons.at(14)->setObject(new SlowTower(float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0.25, 
     float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0, 0));
  buttons.at(13)->setObject(new TrapTower(float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0.25, 
     float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0, 0));
  buttons.at(12)->setObject(new WallTower(float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0.25, 
     float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0, 0));

  initializeUI();
  winTexture = LoadHQTexture("Win.bmp");
  startTexture = LoadHQTexture("title.bmp");

  p1.pGrid.initialize(false);
  opponent.player.pGrid.initialize(true);
  scene.initialize();

  glutMainLoop();
}
开发者ID:xiongchiamiov,项目名称:virus-td,代码行数:77,代码来源:VTD_main.cpp


注:本文中的MyVector::setVector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。