本文整理汇总了C++中Missile::getMissilePhysics方法的典型用法代码示例。如果您正苦于以下问题:C++ Missile::getMissilePhysics方法的具体用法?C++ Missile::getMissilePhysics怎么用?C++ Missile::getMissilePhysics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Missile
的用法示例。
在下文中一共展示了Missile::getMissilePhysics方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateMissile
void Player::updateMissile()
{
std::set<Missile*>::iterator i = mMissile.begin();
while( i != mMissile.end() )
{
Missile* missile = *i;
//if (missile->getMissilePhysics()->isCollided() && !missile->isExploded())
//{
// missile->makeExplode();
//}
missile->update();
if ( missile->getMissilePhysics()->isCollided() || missile->isMissileTick() )
{
i = mMissile.erase(i);
mPhysicsWorld->removeObject(missile->getMissilePhysics());
missile->getSceneNode()->removeAndDestroyAllChildren();
mSceneMgr->destroySceneNode(missile->getSceneNode());
delete missile;
}
else
{
i++;
}
}
}
示例2: fireMissile
Missile* Player::fireMissile()
{
// 총알 생성 //
Missile *missile = new Missile(mSceneMgr);
// 총알의 발사 방향 //
Vector3 direction = getDirection();
direction.normalise();
btVector3 velocity = btVector3(direction.x, direction.y, direction.z) * 5000;
// 총알의 생성 위치 //
Vector3 Rotation = mPlayerNode->getPosition() - Vector3(0, 3, 0);
missile->makeMissile( Rotation );
missile->setVelocity( velocity );
mPhysicsWorld->addObject( missile->getMissilePhysics() );
// 불빛 //
mFireFlash->create( mWeaponNode, mWeaponNode->getPosition() + Vector3(5, -14, 38));
mMissileTimer.reset();
return missile;
}