本文整理汇总了C++中Tank::setSubsetDirection方法的典型用法代码示例。如果您正苦于以下问题:C++ Tank::setSubsetDirection方法的具体用法?C++ Tank::setSubsetDirection怎么用?C++ Tank::setSubsetDirection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tank
的用法示例。
在下文中一共展示了Tank::setSubsetDirection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
else if(color == 2)
tempObj->setColor(D3DXCOLOR(1.0f,1.0f,0.0f,1.0f));
else if(color == 3)
tempObj->setColor(D3DXCOLOR(0.0f,1.0f,1.0f,1.0f));
colorCounter++;
}
}
//module->loadObjectShapeInstance(gfx::ShapeTypes::CUBE, 1, "Cube", 5000);
module->loadMeshInstance("../../ModelFiles/TankGround/TankGeometry.txt", 2, "LongRangeTank", 5000);
//module->loadMeshInstance("../../ModelFiles/TankGround/TankGeometry.txt", 1, "Tank3", 5000);
module->loadMeshInstance("../../ModelFiles/TankAir/TankAirGeometry.txt", 3, "CloseRangeTank", 5000);
/*gfx::InstanceMesh *mesh1 = module->createMeshInstanced("Tank");
mesh1->setTextureID(0);
mesh1->setFlagUpdateAbsolute(false);
mesh1->setID(lolAnt->getKey());
mesh1->setName("enemy");
mesh1->setPosition(D3DXVECTOR3(lolAnt->getPosition().x, lolAnt->getPosition().y, lolAnt->getPosition().z));
mesh1->setScale(D3DXVECTOR3(2.5f, 1.5f, 2.5f));
mesh1->setColor(D3DXCOLOR(0.0f, 0.25f, 1.0f, 1.0f));
mesh1 = module->createMeshInstanced("Tank3");
mesh1->setTextureID(0);
mesh1->setFlagUpdateAbsolute(false);
mesh1->setID(spindelFan->getKey());
mesh1->setName("enemy2");
mesh1->setPosition(D3DXVECTOR3(spindelFan->getPosition().x, spindelFan->getPosition().y, spindelFan->getPosition().z));
mesh1->setScale(D3DXVECTOR3(2.5f, 1.5f, 2.5f));
mesh1->setColor(D3DXCOLOR(0.0f, 0.25f, 1.0f, 1.0f));
mesh1 = module->createMeshInstanced("Tank2");
mesh1->setTextureID(1);
mesh1->setFlagUpdateAbsolute(false);
mesh1->setID(pt->getKey());
mesh1->setName("player");
mesh1->setPosition(D3DXVECTOR3(pt->getPosition().x, pt->getPosition().y, pt->getPosition().z));
mesh1->setScale(D3DXVECTOR3(2.5f, 1.5f, 2.5f));
mesh1->setColor(D3DXCOLOR(1.0f, 0.0f, 1.0f, 1.0f));*/
//Create actors
Tank *pt = myNew Tank(200, 15, Tank::TankType_CloseCombat);
pi->setTankActorId(pt->getKey());
//safeQueueEvent(EventDataPtr(myNew EvtData_From_ActorCreated(pt->getKey())));
FireAnt *lolAnt = myNew FireAnt(100,20,Enemy::Size_Small,1,150.0f);
//safeQueueEvent(EventDataPtr(myNew EvtData_From_ActorCreated(lolAnt->getKey())));
actorHandler->insertActor(lolAnt);
lolAnt->setPosition(-120.0f,0.0f,0.0f);
lolAnt->setDirection(1.0f,0.0f,0.0f);
BlackWidow *spindelFan = myNew BlackWidow(100,20,Enemy::Size_Medium,1,150.0f);
actorHandler->insertActor(spindelFan);
spindelFan->setPosition(-50.0f,0.0f,0.0f);
spindelFan->setDirection(1.0f,0.0f,0.0f);
actorHandler->insertActor(pt);
pt->setPosition(-10.0f, 3.0f, 0.0f);
pt->setDirection(1.0f, 0.0f, 0.0f);
pt->setSubsetDirection(1.0f,0.0f,0.0f);
actorHandler->setDXModule();
module->unlock(0);
sound::SoundSystem *ss = sound::SoundSystem::getInstance();
ss->setActor();
LogicQuadTree *pQuadTree = LogicQuadTree::getInstance();
float dt;
while(!module->getQuit())
{
test->tick(EventManager::KINFINITE);
pQuadTree->updateQuadTree();
//camera->setTarget(mesh1->getPositionX(), mesh1->getPositionY(), mesh1->getPositionZ());
//camera->setPosition(D3DXVECTOR3(mesh1->getPositionX()-100.0f, 50.0f, mesh1->getPositionZ()-100.0f));
dt = gt->tick();
actorHandler->update(dt);
ss->Update();
input->update();
Sleep(10);
}
logic::safeTriggerEvent(logic::EvtData_System_EndGame());
KeyHandler *tmp = KeyHandler::getInstance();
network::ShutdownNetwork();
SAFE_DELETE(ss);
SAFE_DELETE(pQuadTree);
SAFE_DELETE(tmp);
SAFE_DELETE(input);
SAFE_DELETE(gt);
SAFE_DELETE(test);
SAFE_DELETE(pi);
SAFE_DELETE(module);
return 0;
}