本文整理汇总了C++中MyVector::setPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ MyVector::setPosition方法的具体用法?C++ MyVector::setPosition怎么用?C++ MyVector::setPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyVector
的用法示例。
在下文中一共展示了MyVector::setPosition方法的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();
}