本文整理汇总了C++中LLVOAvatar::isDead方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVOAvatar::isDead方法的具体用法?C++ LLVOAvatar::isDead怎么用?C++ LLVOAvatar::isDead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVOAvatar
的用法示例。
在下文中一共展示了LLVOAvatar::isDead方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: haveTrackingInfo
bool LLTrackingData::haveTrackingInfo()
{
LLVOAvatar* avatarp = gObjectList.findAvatar(mAvatarID);
if(avatarp && !avatarp->isDead())
{
mCoarseLocationTimer.checkExpirationAndReset(COARSE_FREQUENCY);
mUpdateTimer.setTimerExpirySec(FIND_FREQUENCY);
mAgentGone.setTimerExpirySec(OFFLINE_SECONDS);
mHaveInfo = true;
return true;
}
if(mHaveCoarseInfo &&
!mCoarseLocationTimer.checkExpirationAndReset(COARSE_FREQUENCY))
{
// if we reach here, then we have a 'recent' coarse update
mUpdateTimer.setTimerExpirySec(FIND_FREQUENCY);
mAgentGone.setTimerExpirySec(OFFLINE_SECONDS);
return true;
}
if(mUpdateTimer.checkExpirationAndReset(FIND_FREQUENCY))
{
LLAvatarTracker::instance().findAgent();
mHaveCoarseInfo = false;
}
if(mAgentGone.checkExpirationAndReset(OFFLINE_SECONDS))
{
mHaveInfo = false;
mHaveCoarseInfo = false;
}
return mHaveInfo;
}
示例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: sendRenderInfoToRegion
// static
// Send request for one region, no timer checks
void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regionp)
{
std::string url = regionp->getCapability("AvatarRenderInfo");
if (!url.empty())
{
if (logRenderInfo())
{
LL_INFOS() << "LRI: Sending avatar render info to region "
<< regionp->getName()
<< " from " << url
<< LL_ENDL;
}
// Build the render info to POST to the region
LLSD report = LLSD::emptyMap();
LLSD agents = LLSD::emptyMap();
std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
while( iter != LLCharacter::sInstances.end() )
{
LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(*iter);
if (avatar &&
avatar->getRezzedStatus() >= 2 && // Mostly rezzed (maybe without baked textures downloaded)
!avatar->isDead() && // Not dead yet
avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region
{
avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date
LLSD info = LLSD::emptyMap();
if (avatar->getVisualComplexity() > 0)
{
info[KEY_WEIGHT] = avatar->getVisualComplexity();
agents[avatar->getID().asString()] = info;
if (logRenderInfo())
{
LL_INFOS() << "LRI: Sending avatar render info for " << avatar->getID()
<< ": " << info << LL_ENDL;
LL_INFOS() << "LRI: other info geometry " << avatar->getAttachmentGeometryBytes()
<< ", area " << avatar->getAttachmentSurfaceArea()
<< LL_ENDL;
}
}
}
iter++;
}
report[KEY_AGENTS] = agents;
if (agents.size() > 0)
{
LLHTTPClient::post(url, report, new LLAvatarRenderInfoPostResponder(regionp->getHandle()));
}
}
}
示例5:
//-----------------------------------------------------------------------------
// shutdown()
//-----------------------------------------------------------------------------
void LLMorphView::shutdown()
{
LLVOAvatar::onCustomizeEnd();
LLVOAvatar *avatarp = gAgent.getAvatarObject();
if(avatarp && !avatarp->isDead())
{
avatarp->startMotion( ANIM_AGENT_BODY_NOISE );
avatarp->mSpecialRenderMode = 0;
// reset camera
LLViewerCamera::getInstance()->setNear(mOldCameraNearClip);
}
}
示例6: renderShadow
void LLDrawPoolAvatar::renderShadow(S32 pass)
{
LLFastTimer t(LLFastTimer::FTM_SHADOW_AVATAR);
if (mDrawFace.empty())
{
return;
}
const LLFace *facep = mDrawFace[0];
if (!facep->getDrawable())
{
return;
}
LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get();
if (avatarp->isDead() || avatarp->mIsDummy || avatarp->mDrawable.isNull())
{
return;
}
BOOL impostor = avatarp->isImpostor();
if (impostor)
{
return;
}
if (pass == 0)
{
if (sShaderLevel > 0)
{
gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX];
}
avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
}
else
{
renderRigged(avatarp, RIGGED_SIMPLE);
renderRigged(avatarp, RIGGED_ALPHA);
renderRigged(avatarp, RIGGED_FULLBRIGHT);
renderRigged(avatarp, RIGGED_FULLBRIGHT_SHINY);
renderRigged(avatarp, RIGGED_SHINY);
renderRigged(avatarp, RIGGED_FULLBRIGHT_ALPHA);
}
}
示例7: getGlobalPos
LLVector3d LLAvatarTracker::getGlobalPos()
{
if(!mTrackedAgentValid || !mTrackingData) return LLVector3d();
LLVector3d global_pos;
LLVOAvatar* avatarp = gObjectList.findAvatar(mTrackingData->mAvatarID);
if(avatarp && !avatarp->isDead())
{
global_pos = avatarp->getPositionGlobal();
// HACK - for making the tracker point above the avatar's head
// rather than its groin
global_pos.mdV[VZ] += 0.7f * avatarp->mBodySize.mV[VZ];
mTrackingData->mGlobalPositionEstimate = global_pos;
}
else
{
global_pos = mTrackingData->mGlobalPositionEstimate;
}
return global_pos;
}
示例8: getDegreesAndDist
void LLAvatarTracker::getDegreesAndDist(F32& rot,
F64& horiz_dist,
F64& vert_dist)
{
if(!mTrackingData) return;
LLVector3d global_pos;
LLVOAvatar* avatarp = gObjectList.findAvatar(mTrackingData->mAvatarID);
if(avatarp && !avatarp->isDead())
{
global_pos = avatarp->getPositionGlobal();
mTrackingData->mGlobalPositionEstimate = global_pos;
}
else
{
global_pos = mTrackingData->mGlobalPositionEstimate;
}
LLVector3d to_vec = global_pos - gAgent.getPositionGlobal();
horiz_dist = sqrt(to_vec.mdV[VX] * to_vec.mdV[VX] + to_vec.mdV[VY] * to_vec.mdV[VY]);
vert_dist = to_vec.mdV[VZ];
rot = F32(RAD_TO_DEG * atan2(to_vec.mdV[VY], to_vec.mdV[VX]));
}
示例9: 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);
}
}
}
}
示例10: getAvatars
void LLWorld::getAvatars(std::vector<LLUUID>* avatar_ids, std::vector<LLVector3d>* positions, const LLVector3d& relative_to, F32 radius) const
{
if(avatar_ids != NULL)
{
avatar_ids->clear();
}
if(positions != NULL)
{
positions->clear();
}
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{
LLViewerRegion* regionp = *iter;
const LLVector3d& origin_global = regionp->getOriginGlobal();
S32 count = regionp->mMapAvatars.count();
for (S32 i = 0; i < count; i++)
{
LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.get(i), origin_global);
if(dist_vec(pos_global, relative_to) <= radius)
{
if(positions != NULL)
{
positions->push_back(pos_global);
}
if(avatar_ids != NULL)
{
avatar_ids->push_back(regionp->mMapAvatarIDs.get(i));
}
}
}
}
// retrieve the list of close avatars from viewer objects as well
// for when we are above 1000m, only do this when we are retrieving
// uuid's too as there could be duplicates
if(avatar_ids != NULL)
{
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
LLVOAvatar* pVOAvatar = (LLVOAvatar*) *iter;
if(pVOAvatar->isDead() || pVOAvatar->isSelf())
continue;
LLUUID uuid = pVOAvatar->getID();
if(uuid.isNull())
continue;
LLVector3d pos_global = pVOAvatar->getPositionGlobal();
if(dist_vec(pos_global, relative_to) <= radius)
{
bool found = false;
uuid_vec_t::iterator sel_iter = avatar_ids->begin();
for (; sel_iter != avatar_ids->end(); sel_iter++)
{
if(*sel_iter == uuid)
{
found = true;
break;
}
}
if(!found)
{
if(positions != NULL)
positions->push_back(pos_global);
avatar_ids->push_back(uuid);
}
}
}
}
}
示例11: updateAvatarList
void LLFloaterAvatarList::updateAvatarList()
{
if (sInstance != this) return;
#ifdef LL_RRINTERFACE_H //MK
if (gRRenabled && gAgent.mRRInterface.mContainsShownames)
{
close();
}
#endif //mk
//llinfos << "radar refresh: updating map" << llendl;
// Check whether updates are enabled
LLCheckboxCtrl* check = getChild<LLCheckboxCtrl>("update_enabled_cb");
if (check && !check->getValue())
{
mUpdate = FALSE;
refreshTracker();
return;
}
else
{
mUpdate = TRUE;
}
LLVector3d mypos = gAgent.getPositionGlobal();
{
std::vector<LLUUID> avatar_ids;
std::vector<LLUUID> sorted_avatar_ids;
std::vector<LLVector3d> positions;
LLWorld::instance().getAvatars(&avatar_ids, &positions, mypos, F32_MAX);
sorted_avatar_ids = avatar_ids;
std::sort(sorted_avatar_ids.begin(), sorted_avatar_ids.end());
for (std::vector<LLCharacter*>::const_iterator iter = LLCharacter::sInstances.begin(); iter != LLCharacter::sInstances.end(); ++iter)
{
LLUUID avid = (*iter)->getID();
if (!std::binary_search(sorted_avatar_ids.begin(), sorted_avatar_ids.end(), avid))
{
avatar_ids.push_back(avid);
}
}
size_t i;
size_t count = avatar_ids.size();
bool announce = gSavedSettings.getBOOL("RadarChatKeys");
std::queue<LLUUID> announce_keys;
for (i = 0; i < count; ++i)
{
std::string name, first, last;
const LLUUID &avid = avatar_ids[i];
LLVector3d position;
LLViewerObject *obj = gObjectList.findObject(avid);
if (obj)
{
LLVOAvatar* avatarp = dynamic_cast<LLVOAvatar*>(obj);
if (avatarp == NULL)
{
continue;
}
// Skip if avatar is dead(what's that?)
// or if the avatar is ourselves.
// or if the avatar is a dummy
if (avatarp->isDead() || avatarp->isSelf() || avatarp->mIsDummy)
{
continue;
}
// Get avatar data
position = gAgent.getPosGlobalFromAgent(avatarp->getCharacterPosition());
name = avatarp->getFullname();
// Apparently, sometimes the name comes out empty, with a " " name. This is because
// getFullname concatenates first and last name with a " " in the middle.
// This code will avoid adding a nameless entry to the list until it acquires a name.
//duped for lower section
if (name.empty() || (name.compare(" ") == 0))// || (name.compare(gCacheName->getDefaultName()) == 0))
{
if (gCacheName->getName(avid, first, last))
{
name = first + " " + last;
}
else
{
continue;
}
}
ifdef LL_DISPLAY_NAMES
//.........这里部分代码省略.........
示例12: updateAvatarList
void LLFloaterAvatarList::updateAvatarList()
{
//llinfos << "radar refresh: updating map" << llendl;
// Check whether updates are enabled
LLCheckboxCtrl* check = getChild<LLCheckboxCtrl>("update_enabled_cb");
if (check && !check->getValue())
{
mUpdate = FALSE;
refreshTracker();
return;
}
else
{
mUpdate = TRUE;
}
//moved to pipeline to prevent a crash
//gPipeline.forAllVisibleDrawables(updateParticleActivity);
//todo: make this less of a hacked up copypasta from dales 1.18.
if(gAudiop != NULL)
{
LLAudioEngine::source_map::iterator iter;
for (iter = gAudiop->mAllSources.begin(); iter != gAudiop->mAllSources.end(); ++iter)
{
LLAudioSource *sourcep = iter->second;
LLUUID uuid = sourcep->getOwnerID();
LLAvatarListEntry *ent = getAvatarEntry(uuid);
if ( ent )
{
ent->setActivity(LLAvatarListEntry::ACTIVITY_SOUND);
}
}
}
LLVector3d mypos = gAgent.getPositionGlobal();
{
std::vector<LLUUID> avatar_ids;
std::vector<LLUUID> sorted_avatar_ids;
std::vector<LLVector3d> positions;
LLWorld::instance().getAvatars(&avatar_ids, &positions, mypos, F32_MAX);
sorted_avatar_ids = avatar_ids;
std::sort(sorted_avatar_ids.begin(), sorted_avatar_ids.end());
BOOST_FOREACH(std::vector<LLCharacter*>::value_type& iter, LLCharacter::sInstances)
{
LLUUID avid = iter->getID();
if (!std::binary_search(sorted_avatar_ids.begin(), sorted_avatar_ids.end(), avid))
{
avatar_ids.push_back(avid);
}
}
size_t i;
size_t count = avatar_ids.size();
static LLCachedControl<bool> announce(gSavedSettings, "RadarChatKeys");
std::queue<LLUUID> announce_keys;
for (i = 0; i < count; ++i)
{
std::string name;
const LLUUID &avid = avatar_ids[i];
LLVector3d position;
LLVOAvatar* avatarp = gObjectList.findAvatar(avid);
if (avatarp)
{
// Skip if avatar is dead(what's that?)
// or if the avatar is ourselves.
// or if the avatar is a dummy
if (avatarp->isDead() || avatarp->isSelf() || avatarp->mIsDummy)
{
continue;
}
// Get avatar data
position = gAgent.getPosGlobalFromAgent(avatarp->getCharacterPosition());
name = avatarp->getFullname();
if (!LLAvatarNameCache::getPNSName(avatarp->getID(), name))
continue;
//duped for lower section
if (name.empty() || (name.compare(" ") == 0))// || (name.compare(gCacheName->getDefaultName()) == 0))
{
if (!gCacheName->getFullName(avid, name)) //seems redudant with LLAvatarNameCache::getPNSName above...
{
continue;
}
}
if (avid.isNull())
{
//.........这里部分代码省略.........
示例13: 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;
//.........这里部分代码省略.........
示例14: 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);
}
}
//.........这里部分代码省略.........
示例15: updateAvatarList
void LLFloaterAvatarList::updateAvatarList()
{
if (sInstance != this) return;
//llinfos << "radar refresh: updating map" << llendl;
// Check whether updates are enabled
LLCheckboxCtrl* check = getChild<LLCheckboxCtrl>("update_enabled_cb");
if (check && !check->getValue())
{
mUpdate = FALSE;
refreshTracker();
return;
}
else
{
mUpdate = TRUE;
}
LLVector3d mypos = gAgent.getPositionGlobal();
{
std::vector<LLUUID> avatar_ids;
std::vector<LLUUID> sorted_avatar_ids;
std::vector<LLVector3d> positions;
LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, mypos, F32_MAX);
sorted_avatar_ids = avatar_ids;
std::sort(sorted_avatar_ids.begin(), sorted_avatar_ids.end());
for (std::vector<LLCharacter*>::const_iterator iter = LLCharacter::sInstances.begin(); iter != LLCharacter::sInstances.end(); ++iter)
{
LLUUID avid = (*iter)->getID();
if (!std::binary_search(sorted_avatar_ids.begin(), sorted_avatar_ids.end(), avid))
{
avatar_ids.push_back(avid);
}
}
size_t i;
size_t count = avatar_ids.size();
for (i = 0; i < count; ++i)
{
std::string name;
std::string first;
std::string last;
const LLUUID &avid = avatar_ids[i];
LLVector3d position;
LLViewerObject *obj = gObjectList.findObject(avid);
if (obj)
{
LLVOAvatar* avatarp = dynamic_cast<LLVOAvatar*>(obj);
if (avatarp == NULL)
{
continue;
}
// Skip if avatar is dead(what's that?)
// or if the avatar is ourselves.
if (avatarp->isDead() || avatarp->isSelf())
{
continue;
}
// Get avatar data
position = gAgent.getPosGlobalFromAgent(avatarp->getCharacterPosition());
name = avatarp->getFullname();
// Apparently, sometimes the name comes out empty, with a " " name. This is because
// getFullname concatenates first and last name with a " " in the middle.
// This code will avoid adding a nameless entry to the list until it acquires a name.
//duped for lower section
if (name.empty() || (name.compare(" ") == 0))// || (name.compare(gCacheName->getDefaultName()) == 0))
{
if (gCacheName->getName(avid, first, last))
{
name = first + " " + last;
}
else
{
continue;
}
}
if (avid.isNull())
{
//llinfos << "Key empty for avatar " << name << llendl;
continue;
}
if (mAvatars.count(avid) > 0)
{
// Avatar already in list, update position
//.........这里部分代码省略.........