summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-10-07 14:00:43 -0500
committerDave Parks <davep@lindenlab.com>2010-10-07 14:00:43 -0500
commitb70ccfe8e31cd253069a6e0ae0ec03e301d26578 (patch)
tree3c0a9311788b99dcf343f43f163d28fa17ffbf3e /indra/newview/llselectmgr.cpp
parente83b815c0fff09cd7d0d4c0198ed7bdc1fa296ad (diff)
Add pure physics cost to UI
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r--indra/newview/llselectmgr.cpp65
1 files changed, 57 insertions, 8 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 57e04a43a2..f819e9fcbc 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -6230,9 +6230,13 @@ F32 LLObjectSelection::getSelectedObjectCost()
return cost;
}
-F32 LLObjectSelection::getSelectedObjectStreamingCost()
+F32 LLObjectSelection::getSelectedLinksetCost()
{
+ cleanupNodes();
F32 cost = 0.f;
+
+ std::set<LLViewerObject*> me_roots;
+
for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter)
{
LLSelectNode* node = *iter;
@@ -6240,16 +6244,26 @@ F32 LLObjectSelection::getSelectedObjectStreamingCost()
if (object)
{
- cost += object->getStreamingCost();
+ LLViewerObject* root = static_cast<LLViewerObject*>(object->getRoot());
+ if (root)
+ {
+ if (me_roots.find(root) == me_roots.end())
+ {
+ me_roots.insert(root);
+ cost += root->getLinksetCost();
+ }
+ }
}
}
return cost;
}
-U32 LLObjectSelection::getSelectedObjectTriangleCount()
+F32 LLObjectSelection::getSelectedPhysicsCost()
{
- U32 count = 0;
+ cleanupNodes();
+ F32 cost = 0.f;
+
for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter)
{
LLSelectNode* node = *iter;
@@ -6257,14 +6271,14 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount()
if (object)
{
- count += object->getTriangleCount();
+ cost += object->getPhysicsCost();
}
}
- return count;
+ return cost;
}
-F32 LLObjectSelection::getSelectedLinksetCost()
+F32 LLObjectSelection::getSelectedLinksetPhysicsCost()
{
cleanupNodes();
F32 cost = 0.f;
@@ -6284,7 +6298,7 @@ F32 LLObjectSelection::getSelectedLinksetCost()
if (me_roots.find(root) == me_roots.end())
{
me_roots.insert(root);
- cost += root->getLinksetCost();
+ cost += root->getLinksetPhysicsCost();
}
}
}
@@ -6293,6 +6307,41 @@ F32 LLObjectSelection::getSelectedLinksetCost()
return cost;
}
+F32 LLObjectSelection::getSelectedObjectStreamingCost()
+{
+ F32 cost = 0.f;
+ for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter)
+ {
+ LLSelectNode* node = *iter;
+ LLViewerObject* object = node->getObject();
+
+ if (object)
+ {
+ cost += object->getStreamingCost();
+ }
+ }
+
+ return cost;
+}
+
+U32 LLObjectSelection::getSelectedObjectTriangleCount()
+{
+ U32 count = 0;
+ for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter)
+ {
+ LLSelectNode* node = *iter;
+ LLViewerObject* object = node->getObject();
+
+ if (object)
+ {
+ count += object->getTriangleCount();
+ }
+ }
+
+ return count;
+}
+
+
//-----------------------------------------------------------------------------
// getTECount()
//-----------------------------------------------------------------------------