本文整理汇总了C++中LLViewerJointAttachment::getIsHUDAttachment方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerJointAttachment::getIsHUDAttachment方法的具体用法?C++ LLViewerJointAttachment::getIsHUDAttachment怎么用?C++ LLViewerJointAttachment::getIsHUDAttachment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerJointAttachment
的用法示例。
在下文中一共展示了LLViewerJointAttachment::getIsHUDAttachment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: populateMenus
// static
void LLViewerAttachMenu::populateMenus(const std::string& attach_to_menu_name, const std::string& attach_to_hud_menu_name)
{
// *TODO: share this code with other similar menus
// (inventory panel context menu, in-world object menu).
if (attach_to_menu_name.empty() || attach_to_hud_menu_name.empty() || !isAgentAvatarValid()) return;
LLContextMenu* attach_menu = gMenuHolder->getChild<LLContextMenu>(attach_to_menu_name);
LLContextMenu* attach_hud_menu = gMenuHolder->getChild<LLContextMenu>(attach_to_hud_menu_name);
if (!attach_menu || attach_menu->getChildCount() != 0 ||
!attach_hud_menu || attach_hud_menu->getChildCount() != 0)
{
return;
}
// Populate "Attach to..." / "Attach to HUD..." submenus.
for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin();
iter != gAgentAvatarp->mAttachmentPoints.end(); )
{
LLVOAvatar::attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
LLMenuItemCallGL::Params p;
std::string submenu_name = attachment->getName();
std::string translated_submenu_name;
if (LLTrans::findString(translated_submenu_name, submenu_name))
{
p.name = (" ") + translated_submenu_name + " ";
}
else
{
p.name = submenu_name;
}
LLSD cbparams;
cbparams["index"] = curiter->first;
cbparams["label"] = p.name;
p.on_click.function_name = "Object.Attach";
p.on_click.parameter = LLSD(attachment->getName());
p.on_enable.function_name = "Attachment.Label";
p.on_enable.parameter = cbparams;
LLMenuItemCallGL* item = LLUICtrlFactory::create<LLMenuItemCallGL>(p);
LLView* parent_menu = attachment->getIsHUDAttachment() ? attach_hud_menu : attach_menu;
parent_menu->addChild(item);
}
}
示例2: renderObjectsForSelect
U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parcel_wall, BOOL keep_pick_list)
{
gRenderForSelect = TRUE;
// LLTimer pick_timer;
if (!keep_pick_list)
{
LLViewerObject *objectp;
S32 i;
// Reset all of the GL names to zero.
for (i = 0; i < mObjects.count(); i++)
{
objectp = mObjects[i];
objectp->mGLName = 0;
}
mSelectPickList.clear();
std::vector<LLDrawable*> pick_drawables;
for (i = 0; i < LLPipeline::NUM_PARTITIONS-1; i++)
{
LLSpatialPartition* part = gPipeline.getSpatialPartition(i);
if (part)
{
part->cull(camera, &pick_drawables, TRUE);
}
}
for (std::vector<LLDrawable*>::iterator iter = pick_drawables.begin();
iter != pick_drawables.end(); iter++)
{
LLDrawable* drawablep = *iter;
if( !drawablep )
continue;
LLViewerObject* last_objectp = NULL;
for (S32 face_num = 0; face_num < drawablep->getNumFaces(); face_num++)
{
LLViewerObject* objectp = drawablep->getFace(face_num)->getViewerObject();
if (objectp && objectp != last_objectp)
{
mSelectPickList.insert(objectp);
last_objectp = objectp;
}
}
}
LLHUDText::addPickable(mSelectPickList);
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
objectp = (LLVOAvatar*) *iter;
if (!objectp->isDead())
{
if (objectp->mDrawable.notNull() && objectp->mDrawable->isVisible())
{
mSelectPickList.insert(objectp);
}
}
}
// add all hud objects to pick list
LLVOAvatar* avatarp = gAgent.getAvatarObject();
if (avatarp)
{
LLViewerJointAttachment* attachmentp;
for (attachmentp = avatarp->mAttachmentPoints.getFirstData();
attachmentp;
attachmentp = avatarp->mAttachmentPoints.getNextData())
{
if (attachmentp->getIsHUDAttachment())
{
LLViewerObject* objectp = attachmentp->getObject();
if (objectp)
{
mSelectPickList.insert(objectp);
for (U32 i = 0; i < objectp->mChildList.size(); i++)
{
LLViewerObject* childp = objectp->mChildList[i];
if (childp)
{
mSelectPickList.insert(childp);
}
}
}
}
}
}
S32 num_pickables = (S32)mSelectPickList.size() + LLHUDIcon::getNumInstances();
if (num_pickables != 0)
{
S32 step = (0x000fffff - GL_NAME_INDEX_OFFSET) / num_pickables;
std::set<LLViewerObject*>::iterator pick_it;
i = 0;
//.........这里部分代码省略.........
示例3: generatePickList
void LLViewerObjectList::generatePickList(LLCamera &camera)
{
LLViewerObject *objectp;
S32 i;
// Reset all of the GL names to zero.
for (i = 0; i < mObjects.count(); i++)
{
objectp = mObjects[i];
objectp->mGLName = 0;
}
mSelectPickList.clear();
std::vector<LLDrawable*> pick_drawables;
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{
LLViewerRegion* region = *iter;
for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++)
{
LLSpatialPartition* part = region->getSpatialPartition(i);
if (part)
{
part->cull(camera, &pick_drawables, TRUE);
}
}
}
for (std::vector<LLDrawable*>::iterator iter = pick_drawables.begin();
iter != pick_drawables.end(); iter++)
{
LLDrawable* drawablep = *iter;
if( !drawablep )
continue;
LLViewerObject* last_objectp = NULL;
for (S32 face_num = 0; face_num < drawablep->getNumFaces(); face_num++)
{
LLViewerObject* objectp = drawablep->getFace(face_num)->getViewerObject();
if (objectp && objectp != last_objectp)
{
mSelectPickList.insert(objectp);
last_objectp = objectp;
}
}
}
LLHUDText::addPickable(mSelectPickList);
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
objectp = (LLVOAvatar*) *iter;
if (!objectp->isDead())
{
if (objectp->mDrawable.notNull() && objectp->mDrawable->isVisible())
{
mSelectPickList.insert(objectp);
}
}
}
// add all hud objects to pick list
LLVOAvatar* avatarp = gAgent.getAvatarObject();
if (avatarp)
{
for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin();
iter != avatarp->mAttachmentPoints.end(); )
{
LLVOAvatar::attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachmentp = curiter->second;
if (attachmentp->getIsHUDAttachment())
{
LLViewerObject* objectp = attachmentp->getObject();
if (objectp)
{
mSelectPickList.insert(objectp);
LLViewerObject::const_child_list_t& child_list = objectp->getChildren();
for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
iter != child_list.end(); iter++)
{
LLViewerObject* childp = *iter;
if (childp)
{
mSelectPickList.insert(childp);
}
}
}
}
}
}
S32 num_pickables = (S32)mSelectPickList.size() + LLHUDIcon::getNumInstances();
if (num_pickables != 0)
{
S32 step = (0x000fffff - GL_NAME_INDEX_OFFSET) / num_pickables;
//.........这里部分代码省略.........