本文整理汇总了C++中ISound::SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ ISound::SetPosition方法的具体用法?C++ ISound::SetPosition怎么用?C++ ISound::SetPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISound
的用法示例。
在下文中一共展示了ISound::SetPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RicochetSound
//------------------------------------------------------------------------
void CProjectile::RicochetSound(const Vec3 &pos, const Vec3 &dir)
{
if (!m_pAmmoParams->pRicochet)
return;
ISound *pSound = gEnv->pSoundSystem->CreateSound(m_pAmmoParams->pRicochet->sound, FLAG_SOUND_DEFAULT_3D|FLAG_SOUND_SELFMOVING);
if (pSound)
{
pSound->GetId();
pSound->SetSemantic(eSoundSemantic_Projectile);
pSound->SetPosition(pos);
pSound->SetDirection(dir*m_pAmmoParams->pRicochet->speed);
pSound->Play();
}
}
示例2: TacWarning
int CScriptBind_HUD::TacWarning(IFunctionHandler *pH)
{
CHUD *pHUD = g_pGame->GetHUD();
if (!pHUD)
return pH->EndFunction();
std::vector<CHUDRadar::RadarEntity> buildings = *(pHUD->GetRadar()->GetBuildings());
for(int i = 0; i < buildings.size(); ++i)
{
IEntity *pEntity = gEnv->pEntitySystem->GetEntity(buildings[i].m_id);
if(!stricmp(pEntity->GetClass()->GetName(), "HQ"))
{
Vec3 pos = pEntity->GetWorldPos();
pos.z += 10;
ISound *pSound = gEnv->pSoundSystem->CreateSound("sounds/interface:multiplayer_interface:mp_tac_alarm_ambience", FLAG_SOUND_3D);
if(pSound)
{
pSound->SetPosition(pos);
pSound->Play();
}
}
}
return pH->EndFunction();
}