本文整理汇总了C++中LLAudioSource::setPositionGlobal方法的典型用法代码示例。如果您正苦于以下问题:C++ LLAudioSource::setPositionGlobal方法的具体用法?C++ LLAudioSource::setPositionGlobal怎么用?C++ LLAudioSource::setPositionGlobal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLAudioSource
的用法示例。
在下文中一共展示了LLAudioSource::setPositionGlobal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: triggerSound
void LLAudioEngine::triggerSound(const LLUUID &audio_uuid, const LLUUID& owner_id, const F32 gain,
// <edit>
//const S32 type, const LLVector3d &pos_global)
const S32 type, const LLVector3d &pos_global, const LLUUID source_object)
// </edit>
{
// Create a new source (since this can't be associated with an existing source.
//llinfos << "Localized: " << audio_uuid << llendl;
if (mMuted)
{
return;
}
LLUUID source_id;
source_id.generate();
// <edit>
//LLAudioSource *asp = new LLAudioSource(source_id, owner_id, gain, type);
LLAudioSource *asp = new LLAudioSource(source_id, owner_id, gain, type, source_object, true);
// </edit>
gAudiop->addAudioSource(asp);
if (pos_global.isExactlyZero())
{
asp->setAmbient(true);
}
else
{
asp->setPositionGlobal(pos_global);
}
asp->updatePriority();
asp->play(audio_uuid);
}
示例2: triggerSound
void LLAudioEngine::triggerSound(const LLUUID &audio_uuid, const LLUUID& owner_id, const F32 gain,
const S32 type, const LLVector3d &pos_global, const LLUUID& source_object)
{
// Create a new source (since this can't be associated with an existing source.
//LL_INFOS() << "Localized: " << audio_uuid << LL_ENDL;
// NaCl - Do not load silent sounds.
if (mMuted || gain <FLT_EPSILON*2)
{
return;
}
LLUUID source_id;
source_id.generate();
LLAudioSource *asp = new LLAudioSource(source_id, owner_id, gain, type, source_object, true);
addAudioSource(asp);
if (pos_global.isExactlyZero())
{
asp->setAmbient(true);
}
else
{
asp->setPositionGlobal(pos_global);
}
asp->updatePriority();
asp->play(audio_uuid);
}
示例3: triggerSound
void LLAudioEngine::triggerSound(const LLUUID &audio_uuid, const LLUUID& owner_id, const F32 gain,
const S32 type, const LLVector3d &pos_global)
{
// Create a new source (since this can't be associated with an existing source.
//llinfos << "Localized: " << audio_uuid << llendl;
if (mMuted || gain == 0.0)
{
return;
}
//fix collision sounds under OpenAL
F32 fixedGain=llclamp(gain,0.0f,1.0f);
if (fixedGain == 0.f) return;
LLUUID source_id;
source_id.generate();
LLAudioSource *asp = new LLAudioSource(source_id, owner_id, fixedGain, type);
gAudiop->addAudioSource(asp);
if (pos_global.isExactlyZero())
{
asp->setAmbient(true);
}
else
{
asp->setPositionGlobal(pos_global);
}
asp->updatePriority();
asp->play(audio_uuid);
}
示例4: triggerSound
void LLAudioEngine::triggerSound(const LLUUID &audio_uuid, const LLUUID& owner_id, const F32 gain,
const S32 type, const LLVector3d &pos_global)
{
// Create a new source (since this can't be associated with an existing source.
//llinfos << "Localized: " << audio_uuid << llendl;
//If we cannot hear it, dont even try to load the sound.
if (mMuted || gain == 0.0)
{
return;
}
LLUUID source_id;
source_id.generate();
LLAudioSource *asp = new LLAudioSource(source_id, owner_id, gain, type);
gAudiop->addAudioSource(asp);
if (pos_global.isExactlyZero())
{
asp->setAmbient(true);
}
else
{
asp->setPositionGlobal(pos_global);
}
asp->updatePriority();
asp->play(audio_uuid);
}