本文整理汇总了C++中LLVOAvatar::getPositionAgent方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVOAvatar::getPositionAgent方法的具体用法?C++ LLVOAvatar::getPositionAgent怎么用?C++ LLVOAvatar::getPositionAgent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVOAvatar
的用法示例。
在下文中一共展示了LLVOAvatar::getPositionAgent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateSpeakerList
void LLLocalSpeakerMgr::updateSpeakerList()
{
// pull speakers from voice channel
LLSpeakerMgr::updateSpeakerList();
// add non-voice speakers in chat range
std::vector< LLCharacter* >::iterator avatar_it;
for(avatar_it = LLCharacter::sInstances.begin(); avatar_it != LLCharacter::sInstances.end(); ++avatar_it)
{
LLVOAvatar* avatarp = (LLVOAvatar*)*avatar_it;
if (!avatarp->isDead() && dist_vec(avatarp->getPositionAgent(), gAgent.getPositionAgent()) <= CHAT_NORMAL_RADIUS)
{
setSpeaker(avatarp->getID());
}
}
// check if text only speakers have moved out of chat range
for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it)
{
LLUUID speaker_id = speaker_it->first;
LLSpeaker* speakerp = speaker_it->second;
if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
{
LLVOAvatar* avatarp = (LLVOAvatar*)gObjectList.findObject(speaker_id);
if (!avatarp || avatarp->isDead() || dist_vec(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS)
{
speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL;
speakerp->mDotColor = INACTIVE_COLOR;
speakerp->mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT);
}
}
}
}
示例2: updateSpeakerList
void LLLocalSpeakerMgr::updateSpeakerList()
{
// pull speakers from voice channel
LLSpeakerMgr::updateSpeakerList();
if (gDisconnected)//the world is cleared.
{
return ;
}
// pick up non-voice speakers in chat range
uuid_vec_t avatar_ids;
std::vector<LLVector3d> positions;
LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgent.getPositionGlobal(), CHAT_NORMAL_RADIUS);
for(U32 i=0; i<avatar_ids.size(); i++)
{
setSpeaker(avatar_ids[i]);
}
// check if text only speakers have moved out of chat range
for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it)
{
LLUUID speaker_id = speaker_it->first;
LLSpeaker* speakerp = speaker_it->second;
if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
{
LLVOAvatar* avatarp = (LLVOAvatar*)gObjectList.findObject(speaker_id);
if (!avatarp || dist_vec(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS)
{
setSpeakerNotInChannel(speakerp);
}
}
}
}
示例3: find
void LLFloaterHUD::find() // Scanner activated by Scan button
{
if(mHalt) return; // this basically checks if the scan has been toggled on or off otherwise llvoavatar calls the scan on avatar activity
mListNames->deleteAllItems(); //Clear the list
std::vector< LLCharacter* >::iterator avatar_it;
for(avatar_it = LLCharacter::sInstances.begin(); avatar_it != LLCharacter::sInstances.end(); ++avatar_it)
{
LLVOAvatar* avatarp = (LLVOAvatar*)*avatar_it;
if (avatarp->isDead() || avatarp->isSelf()) //Dont show the user!
{
continue;
}
if (dist_vec(avatarp->getPositionAgent(), gAgent.getPositionAgent()) <= SCAN_MAX_RADIUS) //Scanner radius set in indra constants.
{
// Pull in that avatar data!
std::string name = avatarp->getFullname();
LLVector3d position = gAgent.getPosGlobalFromAgent(avatarp->getCharacterPosition());
LLUUID avid = avatarp->getID();
// Work out distance relative to user!
LLVector3d mypos = gAgent.getPositionGlobal();
LLVector3d delta = position - mypos;
F32 distance = (F32)delta.magVec();
//Build the list
LLSD element;
element["id"] = avid;
element["columns"][LIST_AVATAR_NAME]["column"] = "name";
element["columns"][LIST_AVATAR_NAME]["value"] = name;
element["columns"][LIST_DISTANCE]["column"] = "distance";
element["columns"][LIST_DISTANCE]["value"] = distance;
mListNames->addElement(element);
mListNames->sortByColumn("distance", TRUE);
mListNames->setCallbackUserData(this);
}
}
return;
}
示例4: updateSpeakerList
void LLLocalSpeakerMgr::updateSpeakerList()
{
// pull speakers from voice channel
LLSpeakerMgr::updateSpeakerList();
if (gDisconnected)//the world is cleared.
{
return ;
}
// pick up non-voice speakers in chat range
std::vector<LLUUID> avatar_ids;
std::vector<LLVector3d> positions;
LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgent.getPositionGlobal(), CHAT_NORMAL_RADIUS);
for(U32 i=0; i<avatar_ids.size(); i++)
{
setSpeaker(avatar_ids[i]);
}
// check if text only speakers have moved out of chat range
for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it)
{
LLUUID speaker_id = speaker_it->first;
LLSpeaker* speakerp = speaker_it->second;
if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
{
LLVOAvatar* avatarp = (LLVOAvatar*)gObjectList.findObject(speaker_id);
if (!avatarp || avatarp->isDead() || dist_vec(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS)
{
speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL;
speakerp->mDotColor = INACTIVE_COLOR;
speakerp->mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT);
}
}
}
}
示例5: renderAvatars
void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
{
if (pass == -1)
{
for (S32 i = 1; i < getNumPasses(); i++)
{ //skip foot shadows
prerender();
beginRenderPass(i);
renderAvatars(single_avatar, i);
endRenderPass(i);
}
return;
}
if (mDrawFace.empty() && !single_avatar)
{
return;
}
LLVOAvatar *avatarp;
if (single_avatar)
{
avatarp = single_avatar;
}
else
{
const LLFace *facep = mDrawFace[0];
if (!facep->getDrawable())
{
return;
}
avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get();
}
if (avatarp->isDead() || avatarp->mDrawable.isNull())
{
return;
}
if (!single_avatar && !avatarp->isFullyLoaded())
{
if (pass == 0 && (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES) || LLViewerPartSim::getMaxPartCount() <= 0))
{
// debug code to draw a sphere in place of avatar
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
gGL.setColorMask(true, true);
LLVector3 pos = avatarp->getPositionAgent();
gGL.color4f(1.0f, 1.0f, 1.0f, 0.7f);
gGL.pushMatrix();
gGL.translatef((F32)(pos.mV[VX]), (F32)(pos.mV[VY]), (F32)(pos.mV[VZ]));
gGL.scalef(0.15f, 0.15f, 0.3f);
gSphere.renderGGL();
gGL.popMatrix();
gGL.setColorMask(true, false);
}
// don't render please
return;
}
BOOL impostor = avatarp->isImpostor() && !single_avatar;
if (impostor && pass != 0)
{ //don't draw anything but the impostor for impostored avatars
return;
}
if (pass == 0 && !impostor && LLPipeline::sUnderWaterRender)
{ //don't draw foot shadows under water
return;
}
if (pass == 0)
{
if (!LLPipeline::sReflectionRender)
{
LLVOAvatar::sNumVisibleAvatars++;
}
if (impostor)
{
if (LLPipeline::sRenderDeferred && !LLPipeline::sReflectionRender &&
avatarp->mImpostor.isComplete())
{
if (normal_channel > -1)
{
avatarp->mImpostor.bindTexture(2, normal_channel);
}
if (specular_channel > -1)
{
avatarp->mImpostor.bindTexture(1, specular_channel);
}
}
avatarp->renderImpostor(LLColor4U(255,255,255,255), sDiffuseChannel);
}
return;
//.........这里部分代码省略.........
示例6: renderAvatars
void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
{
LLFastTimer t(FTM_RENDER_AVATARS);
if (pass == -1)
{
for (S32 i = 1; i < getNumPasses(); i++)
{ //skip foot shadows
prerender();
beginRenderPass(i);
renderAvatars(single_avatar, i);
endRenderPass(i);
}
return;
}
if (mDrawFace.empty() && !single_avatar)
{
return;
}
LLVOAvatar *avatarp;
if (single_avatar)
{
avatarp = single_avatar;
}
else
{
const LLFace *facep = mDrawFace[0];
if (!facep->getDrawable())
{
return;
}
avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get();
}
if (avatarp->isDead() || avatarp->mDrawable.isNull())
{
return;
}
if (!single_avatar && !avatarp->isFullyLoaded() )
{
if (pass==0 && (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES) || LLViewerPartSim::getMaxPartCount() <= 0))
{
// debug code to draw a sphere in place of avatar
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
gGL.setColorMask(true, true);
LLVector3 pos = avatarp->getPositionAgent();
gGL.color4f(1.0f, 1.0f, 1.0f, 0.7f);
gGL.pushMatrix();
gGL.translatef((F32)(pos.mV[VX]),
(F32)(pos.mV[VY]),
(F32)(pos.mV[VZ]));
gGL.scalef(0.15f, 0.15f, 0.3f);
gSphere.renderGGL();
gGL.popMatrix();
gGL.setColorMask(true, false);
}
// don't render please
return;
}
BOOL impostor = avatarp->isImpostor() && !single_avatar;
if (impostor && pass != 0)
{ //don't draw anything but the impostor for impostored avatars
return;
}
if (pass == 0 && !impostor && LLPipeline::sUnderWaterRender)
{ //don't draw foot shadows under water
return;
}
if (pass == 0)
{
if (!LLPipeline::sReflectionRender)
{
LLVOAvatar::sNumVisibleAvatars++;
}
if (impostor)
{
if (LLPipeline::sRenderDeferred && !LLPipeline::sReflectionRender && avatarp->mImpostor.isComplete())
{
if (normal_channel > -1)
{
avatarp->mImpostor.bindTexture(2, normal_channel);
}
if (specular_channel > -1)
{
avatarp->mImpostor.bindTexture(1, specular_channel);
}
}
//.........这里部分代码省略.........