本文整理汇总了C++中Object3D::TransfoMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ Object3D::TransfoMatrix方法的具体用法?C++ Object3D::TransfoMatrix怎么用?C++ Object3D::TransfoMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Object3D
的用法示例。
在下文中一共展示了Object3D::TransfoMatrix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: playTrack
//.........这里部分代码省略.........
persoQuad8.initDraw();
persoQuad8.bindTex(texturePerso[getIdPersoByRank(Players, 8)]);
persoQuad8.Draw(locVarTexture);
}
prog.use();
//Decalage camera
if(tStart-anglefile.front().second>330){
if(anglefile.size()>1)
anglefile.pop();
}
//Camera
ViewMatrix=camera.getViewMatrix(Karts[0]->getPosition(), anglefile.front().first,Karts[0]->back);
glUniform3fv(uLightDir_vs, 1, glm::value_ptr(glm::rotate(ViewMatrix,Karts[0]->getAngle()+90, glm::vec3(0,1,0))));
//Kart (boucle sur tous les karts)
for (int id=0;id<8;++id){
if((id!=0 && ready) || raceFinished ){
//Deplacement IA
int sortie=Karts[id]->moveIA(track.getMapObjects(),track.getPowObjects(), Karts,Players[id]->getPower(),
Players[id]->getCharacter().getHero(), Players[id]->getCharacter().isPowerReady(tStart));
if(sortie==1)
Players[id]->usePower(Karts,id,tStart,track.getMapObjects());
else if(sortie==2)
Players[id]->getCharacter().useSuperPower(tStart,*Karts[id],track.getMapObjects());
}else{
Karts[id]->crossANode();
}
Karts[id]->getVAO().bind(); //Bind du VAO
Karts[id]->TransfoMatrix(ViewMatrix,Karts[id]->getPosition()); //Transformations (View, Translation, anglerotation,scale)
Karts[id]->MatrixToShader(uMVMatrix, uMVPMatrix, uNormalMatrix, WINDOW_WIDTH, WINDOW_HEIGHT); //Envoi des matrices au shader
Karts[id]->Draw(uTex); //Draw de l'objet
//Pouvoirs Classiques
if(Players[id]->getPower()){
if(Players[id]->getPower()->isLaunched() && Players[id]->getPower()->withKart()){
Players[id]->getPower()->getVAO().bind(); //Bind du VAO
Players[id]->getPower()->TransfoMatrix(ViewMatrix, Players[id]->getKart().getPosition()); //Transformations (View, Translation, anglerotation,scale)
Players[id]->getPower()->MatrixToShader(uMVMatrix, uMVPMatrix, uNormalMatrix, WINDOW_WIDTH, WINDOW_HEIGHT); //Envoi des matrices au shader
Players[id]->getPower()->Draw(uTex); //Draw de l'objet
}
if(Players[id]->getPower()->isLaunched() && Players[id]->getPower()->isPerimed(tStart)){
Players[id]->stopPower(Karts,id);
}
}
//Pouvoirs Speciaux
if(Players[id]->getCharacter().isLaunched()){
if(Players[id]->getCharacter().isPerimed(tStart)){
Players[id]->getCharacter().useSuperPowerBack(Players[id]->getKart());
Players[id]->getCharacter().hitSuperPowerBack(Karts);
}
else {
Players[id]->getCharacter().continuousHitSuperPower(Karts,Players[id]->getKart());
}
}
}
//Dessin des objets de la map
for(int id=0;id<track.getMapObjects().size();++id){
if(track.getMapObjects()[id]->isVisible()){
track.getMapObjects()[id]->getVAO().bind();