本文整理汇总了C++中LLViewerObject::getPhysicsCost方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerObject::getPhysicsCost方法的具体用法?C++ LLViewerObject::getPhysicsCost怎么用?C++ LLViewerObject::getPhysicsCost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerObject
的用法示例。
在下文中一共展示了LLViewerObject::getPhysicsCost方法的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)
//.........这里部分代码省略.........