当前位置: 首页>>代码示例>>C++>>正文


C++ LLPipeline::renderForSelect方法代码示例

本文整理汇总了C++中LLPipeline::renderForSelect方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPipeline::renderForSelect方法的具体用法?C++ LLPipeline::renderForSelect怎么用?C++ LLPipeline::renderForSelect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLPipeline的用法示例。


在下文中一共展示了LLPipeline::renderForSelect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: renderPickList

void LLViewerObjectList::renderPickList(const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent)
{
	gRenderForSelect = TRUE;
		
	gPipeline.renderForSelect(mSelectPickList, render_transparent, screen_rect);

	//
	// Render pass for selected objects
	//
	gGL.color4f(1,1,1,1);	
	gViewerWindow->renderSelections( TRUE, pick_parcel_wall, FALSE );

	//fix for DEV-19335.  Don't pick hud objects when customizing avatar (camera mode doesn't play nice with nametags).
	if (!gAgent.cameraCustomizeAvatar())
	{
		// render pickable ui elements, like names, etc.
		LLHUDObject::renderAllForSelect();
	}
	
	gGL.flush();
	LLVertexBuffer::unbind();

	gRenderForSelect = FALSE;

	//llinfos << "Rendered " << count << " for select" << llendl;
	//llinfos << "Took " << pick_timer.getElapsedTimeF32()*1000.f << "ms to pick" << llendl;
}
开发者ID:kow,项目名称:pleiaviewer,代码行数:27,代码来源:llviewerobjectlist.cpp

示例2: renderObjectsForSelect


//.........这里部分代码省略.........

			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;
			for (pick_it = mSelectPickList.begin(); pick_it != mSelectPickList.end();)
			{
				LLViewerObject* objp = (*pick_it);
				if (!objp || objp->isDead() || !objp->mbCanSelect)
				{
					mSelectPickList.erase(pick_it++);
					continue;
				}
				
				objp->mGLName = (i * step) + GL_NAME_INDEX_OFFSET;
				i++;
				++pick_it;
			}

			LLHUDIcon::generatePickIDs(i * step, step);
		
			// At this point, we should only have live drawables/viewer objects
			gPipeline.renderForSelect(mSelectPickList);
		}
	}

	//
	// Render pass for selected objects
	//
	gViewerWindow->renderSelections( TRUE, pick_parcel_wall, FALSE );

	// render pickable ui elements, like names, etc.
	LLHUDObject::renderAllForSelect();

	gRenderForSelect = FALSE;

	//llinfos << "Rendered " << count << " for select" << llendl;
	//llinfos << "Took " << pick_timer.getElapsedTimeF32()*1000.f << "ms to pick" << llendl;
	return 0;
}
开发者ID:Boy,项目名称:netbook,代码行数:101,代码来源:llviewerobjectlist.cpp


注:本文中的LLPipeline::renderForSelect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。