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


C++ LLViewerObject::getHighLODTriangleCount方法代码示例

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


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

示例1: draw

void LLSceneView::draw()
{
	S32 margin = 10;
	S32 height = (S32) (gViewerWindow->getWindowRectScaled().getHeight()*0.75f);
	S32 width = (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f);
	
	LLRect new_rect;
	new_rect.setLeftTopAndSize(getRect().mLeft, getRect().mTop, width, height);
	setRect(new_rect);

	// Draw the window background
	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
	gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.f, 0.f, 0.f, 0.25f));
	

	//aggregate some statistics

	//object sizes
	std::vector<F32> size[2];

	//triangle counts
	std::vector<S32> triangles[2]; 
	std::vector<S32> visible_triangles[2];
	S32 total_visible_triangles[] = {0, 0};
	S32 total_triangles[] = {0, 0};
	
	//streaming cost
	std::vector<F32> streaming_cost[2];
	F32 total_streaming[] = { 0.f, 0.f };

	//physics cost
	std::vector<F32> physics_cost[2];
	F32 total_physics[] = { 0.f, 0.f };
	

	U32 object_count = 0;

	LLViewerRegion* region = gAgent.getRegion();
	if (region)
	{
		for (U32 i = 0; i < gObjectList.getNumObjects(); ++i)
		{
			LLViewerObject* object = gObjectList.getObject(i);
			
			if (object && 
				object->getVolume()&&
				object->getRegion() == region)
			{
				U32 idx = object->isAttachment() ? 1 : 0;

				LLVolume* volume = object->getVolume();
				object_count++;
				
				F32 radius = object->getScale().magVec();
				size[idx].push_back(radius);

				S32 visible = volume->getNumTriangles();
				S32 high_triangles = object->getHighLODTriangleCount();

				total_visible_triangles[idx] += visible;
				total_triangles[idx] += high_triangles;

				visible_triangles[idx].push_back(visible);
				triangles[idx].push_back(high_triangles);

				F32 streaming = object->getStreamingCost();
				total_streaming[idx] += streaming;
				streaming_cost[idx].push_back(streaming);

				F32 physics = object->getPhysicsCost();
				total_physics[idx] += physics;
				physics_cost[idx].push_back(physics);
			}
		}
	}

	const char* category[] =
	{
		"Region",
		"Attachment"
	};

	S32 graph_pos[4];

	for (U32 i = 0; i < 4; ++i)
	{
		graph_pos[i] = new_rect.getHeight()/4*(i+1);
	}

	for (U32 idx = 0; idx < 2; idx++)
	{
		if (!size[idx].empty())
		{ //display graph of object sizes
			std::sort(size[idx].begin(), size[idx].end());

			ll_remove_outliers(size[idx], 1.f);

			LLRect size_rect;
			
			if (idx == 0)
//.........这里部分代码省略.........
开发者ID:Xara,项目名称:kris-clone,代码行数:101,代码来源:llsceneview.cpp


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