本文整理汇总了C++中Gun::setSlotPitch方法的典型用法代码示例。如果您正苦于以下问题:C++ Gun::setSlotPitch方法的具体用法?C++ Gun::setSlotPitch怎么用?C++ Gun::setSlotPitch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gun
的用法示例。
在下文中一共展示了Gun::setSlotPitch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fire
void LifeForm::fire()
{
Basic::Number* hdgObj = new Basic::Number(getHeadingR());
Basic::Number* pitchObj = new Basic::Number(lookAngle * Basic::Angle::D2RCC);
StoresMgr* mgr = getStoresManagement();
if (mgr != nullptr) {
if (getSimulation() != nullptr) {
if (weaponSel == LF_MISSILE) {
mgr->setGunSelected(false);
Missile* missile = mgr->getNextMissile();
if (missile != nullptr) {
missile->setSlotInitPitch(pitchObj);
missile->setSlotInitHeading(hdgObj);
missile->reset();
Missile* msl = mgr->releaseOneMissile();
if (msl != nullptr) {
if (tgtAquired && tgtPlayer != nullptr) msl->setTargetPlayer(tgtPlayer, true);
}
}
}
else if (weaponSel == LF_GUN) {
mgr->setGunSelected(true);
Gun* myGun = mgr->getGun();
if (myGun != nullptr) {
myGun->setGunArmed(true);
Basic::Number* num = new Basic::Number(lookAngle * Basic::Angle::D2RCC);
myGun->setSlotPitch(num);
num->unref();
myGun->fireControl(true);
}
}
}
}
hdgObj->unref();
pitchObj->unref();
}