当前位置: 首页>>代码示例>>C++>>正文


C++ CGameRules::QueueExplosion方法代码示例

本文整理汇总了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);
	}
}
开发者ID:souxiaosou,项目名称:FireNET,代码行数:36,代码来源:VTOLVehicleManager.cpp


注:本文中的CGameRules::QueueExplosion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。