本文整理汇总了C++中Projectile::getPart方法的典型用法代码示例。如果您正苦于以下问题:C++ Projectile::getPart方法的具体用法?C++ Projectile::getPart怎么用?C++ Projectile::getPart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Projectile
的用法示例。
在下文中一共展示了Projectile::getPart方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addCannonProjectiles
void addCannonProjectiles() {
for(int i = 0; i < 8; i++) {
Projectile * p = new Projectile(false, projectileMesh,
CANNON_PROJECTILE_SCALE);
parts.push_back(p->getPart());
p->getPart()->setMaterialGreenProjectile();
cannonProjectiles.push_back(p);
}
}
示例2: addShip
Ship * addShip(bool fullSize) {
Ship * ship = new Ship(fullSize, ID_TIE_FIGHTER_IMG, sphereMesh, shipWingConnector, shipWing, textureMapSphere1);
// projectile
Projectile * p = new Projectile(true, projectileMesh, WALKER_PROJECTILE_SCALE);
p->getPart()->setMaterialRedProjectile();
ship->setProjectile(p);
shipsProjectiles.push_back(p);
parts.push_back(p->getPart());
ships.push_back(ship);
parts.push_back(ship->getBody());
return ship;
}
示例3: addWalker
Walker * addWalker() {
int numWalkers = walkers.size();
int xOffsetMultiplier = (numWalkers % 2 == 0) ? (1*(numWalkers+1)) : (-1*(numWalkers));
xOffsetMultiplier *= WALKER_SPREAD;
Cannon * walkerGun = new Cannon(cannonBodyMesh, cannonSightMesh, false);
Walker * walker = new Walker(ID_WALKER,
ID_METAL,
walkerHeadMesh,
cylMesh,
cubeMesh,
textureMapCubeWalkerHead,
textureMapCylinder,
walkerGun);
GLfloat xStart = xOffsetMultiplier + WALKER_START_X_OFF;
GLfloat yStart = WALKER_BODY_HEIGHT;
GLfloat zStart = WALKER_START_Z;
walker->setStartPosition(xStart, yStart, zStart);
walker->getBody()->setTransformationValueWithId(ID_BODY_TRANSLATION, xStart, yStart, zStart, 0);
// projectile for the walker
Projectile * p = new Projectile(true, projectileMesh, WALKER_PROJECTILE_SCALE);
p->getPart()->setMaterialRedProjectile();
walker->setProjectile(p);
walkerProjectiles.push_back(p);
parts.push_back(p->getPart());
//
walkers.push_back(walker);
parts.push_back(walker->getBody());
walker->start();
return walker;
}