本文整理汇总了C++中CGameRules::QueueExplosion方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameRules::QueueExplosion方法的具体用法?C++ CGameRules::QueueExplosion怎么用?C++ CGameRules::QueueExplosion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameRules
的用法示例。
在下文中一共展示了CGameRules::QueueExplosion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateExplosion
void CVTOLVehicleManager::CreateExplosion(IParticleEffect *inParticleEffect, const Vec3& pos, const float inEffectScale, TAudioSignalID inAudioSignal/*=INVALID_AUDIOSIGNAL_ID*/)
{
#if !defined(DEDICATED_SERVER)
CRY_ASSERT_MESSAGE(inParticleEffect, "CreateExplosion() passsed a NULL inParticleEffect");
#endif
if (gEnv->bServer)
{
// server wants to create actual explosions
CGameRules *pGameRules = g_pGame->GetGameRules();
ExplosionInfo explosionInfo;
explosionInfo.pParticleEffect = inParticleEffect;
explosionInfo.effect_name = s_explosionEffectName;// needed so the explosion can be synced to clients
explosionInfo.type = pGameRules->GetHitTypeId("explosion");
explosionInfo.effect_scale = inEffectScale; // this is likely not connected up in the particle effect but should be able to be so that the effect can be adjusted dynamically
explosionInfo.pos = pos;
explosionInfo.dir.Set(0.0f,-1.0f,0.0f);
explosionInfo.effect_scale = cry_random(0.9f,1.1f);
explosionInfo.pressure = 1000.0f;
explosionInfo.maxblurdistance = 10.0;
explosionInfo.radius = 12.0f;
explosionInfo.blindAmount = 0.0f;
explosionInfo.flashbangScale = 8.0f;
explosionInfo.damage = 0.0f;
explosionInfo.hole_size = 0.0f;
pGameRules->QueueExplosion(explosionInfo);
}
// the gamerules SHOULD be syncing the server queued ones above to clients!
if (inAudioSignal != INVALID_AUDIOSIGNAL_ID)
{
CAudioSignalPlayer::JustPlay(inAudioSignal, pos);
}
}