Add pure physics cost to UI

meow-7.2.2
Dave Parks 2010-10-07 14:00:43 -05:00
parent e83b815c0f
commit b70ccfe8e3
10 changed files with 166 additions and 51 deletions

View File

@ -1,4 +1,4 @@
version 23
version 24
// NOTE: This is mostly identical to featuretable_mac.txt with a few differences
// Should be combined into one table
@ -454,6 +454,7 @@ RenderAvatarCloth 0 0
list ATI
RenderUseStreamVBO 1 0
RenderAvatarVP 1 0
/// Tweaked NVIDIA

View File

@ -1,4 +1,4 @@
version 23
version 24
// NOTE: This is mostly identical to featuretable_mac.txt with a few differences
// Should be combined into one table
@ -451,6 +451,7 @@ RenderAvatarCloth 0 0
list ATI
RenderUseStreamVBO 1 0
RenderAvatarVP 1 0
/// Tweaked NVIDIA

View File

@ -434,6 +434,10 @@ void LLFloaterTools::refresh()
LLSelectMgr::getInstance()->getSelection()->getSelectedObjectCost();
F32 link_cost =
LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetCost();
F32 obj_physics_cost =
LLSelectMgr::getInstance()->getSelection()->getSelectedPhysicsCost();
F32 link_physics_cost =
LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetPhysicsCost();
// Update the text for the counts
childSetTextArg(
@ -443,11 +447,10 @@ void LLFloaterTools::refresh()
childSetTextArg("object_count", "[COUNT]", object_count_string);
// Update the text for the resource costs
childSetTextArg(
"linked_set_cost",
"[COST]",
llformat("%.1f", link_cost));
childSetTextArg("linked_set_cost","[COST]",llformat("%.1f", link_cost));
childSetTextArg("object_cost", "[COST]", llformat("%.1f", obj_cost));
childSetTextArg("linked_set_cost","[PHYSICS]",llformat("%.1f", link_physics_cost));
childSetTextArg("object_cost", "[PHYSICS]", llformat("%.1f", obj_physics_cost));
// Display rendering cost if needed
if (sShowObjectCost)

View File

@ -6230,6 +6230,83 @@ F32 LLObjectSelection::getSelectedObjectCost()
return cost;
}
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;
LLViewerObject* object = node->getObject();
if (object)
{
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;
}
F32 LLObjectSelection::getSelectedPhysicsCost()
{
cleanupNodes();
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->getPhysicsCost();
}
}
return cost;
}
F32 LLObjectSelection::getSelectedLinksetPhysicsCost()
{
cleanupNodes();
F32 cost = 0.f;
std::set<LLViewerObject*> me_roots;
for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter)
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if (object)
{
LLViewerObject* root = static_cast<LLViewerObject*>(object->getRoot());
if (root)
{
if (me_roots.find(root) == me_roots.end())
{
me_roots.insert(root);
cost += root->getLinksetPhysicsCost();
}
}
}
}
return cost;
}
F32 LLObjectSelection::getSelectedObjectStreamingCost()
{
F32 cost = 0.f;
@ -6264,34 +6341,6 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount()
return count;
}
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;
LLViewerObject* object = node->getObject();
if (object)
{
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;
}
//-----------------------------------------------------------------------------
// getTECount()

View File

@ -288,6 +288,9 @@ public:
S32 getObjectCount(BOOL mesh_adjust = FALSE);
F32 getSelectedObjectCost();
F32 getSelectedLinksetCost();
F32 getSelectedPhysicsCost();
F32 getSelectedLinksetPhysicsCost();
F32 getSelectedObjectStreamingCost();
U32 getSelectedObjectTriangleCount();

View File

@ -240,6 +240,8 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
mClickAction(0),
mObjectCost(0.f),
mLinksetCost(0.f),
mPhysicsCost(0.f),
mLinksetPhysicsCost(0.f),
mCostStale(true),
mAttachmentItemID(LLUUID::null)
{
@ -2931,6 +2933,28 @@ void LLViewerObject::setLinksetCost(F32 cost)
}
}
void LLViewerObject::setPhysicsCost(F32 cost)
{
mPhysicsCost = cost;
mCostStale = false;
if (isSelected())
{
gFloaterTools->dirty();
}
}
void LLViewerObject::setLinksetPhysicsCost(F32 cost)
{
mLinksetPhysicsCost = cost;
mCostStale = false;
if (isSelected())
{
gFloaterTools->dirty();
}
}
F32 LLViewerObject::getObjectCost()
{
@ -2942,16 +2966,6 @@ F32 LLViewerObject::getObjectCost()
return mObjectCost;
}
F32 LLViewerObject::getStreamingCost()
{
return 0.f;
}
U32 LLViewerObject::getTriangleCount()
{
return 0;
}
F32 LLViewerObject::getLinksetCost()
{
if (mCostStale)
@ -2962,7 +2976,35 @@ F32 LLViewerObject::getLinksetCost()
return mLinksetCost;
}
F32 LLViewerObject::getPhysicsCost()
{
if (mCostStale)
{
gObjectList.updateObjectCost(this);
}
return mPhysicsCost;
}
F32 LLViewerObject::getLinksetPhysicsCost()
{
if (mCostStale)
{
gObjectList.updateObjectCost(this);
}
return mLinksetPhysicsCost;
}
F32 LLViewerObject::getStreamingCost()
{
return 0.f;
}
U32 LLViewerObject::getTriangleCount()
{
return 0;
}
void LLViewerObject::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
{

View File

@ -334,14 +334,20 @@ public:
virtual void setScale(const LLVector3 &scale, BOOL damped = FALSE);
void setObjectCost(F32 cost);
F32 getObjectCost();
virtual F32 getStreamingCost();
virtual U32 getTriangleCount();
void setObjectCost(F32 cost);
F32 getObjectCost();
void setLinksetCost(F32 cost);
F32 getLinksetCost();
void setPhysicsCost(F32 cost);
F32 getPhysicsCost();
void setLinksetPhysicsCost(F32 cost);
F32 getLinksetPhysicsCost();
void sendShapeUpdate();
@ -699,6 +705,9 @@ protected:
U8 mClickAction;
F32 mObjectCost; //resource cost of this object or -1 if unknown
F32 mLinksetCost;
F32 mPhysicsCost;
F32 mLinksetPhysicsCost;
bool mCostStale;
static U32 sNumZombieObjects; // Objects which are dead, but not deleted

View File

@ -728,7 +728,10 @@ public:
F32 object_cost =
content[iter->asString()]["resource_cost"].asReal();
gObjectList.updateObjectCost(object_id, object_cost, link_cost);
F32 physics_cost = content[iter->asString()]["physics_cost"].asReal();
F32 link_physics_cost = content[iter->asString()]["linked_set_physics_cost"].asReal();
gObjectList.updateObjectCost(object_id, object_cost, link_cost, physics_cost, link_physics_cost);
}
else
{
@ -1187,7 +1190,7 @@ void LLViewerObjectList::updateObjectCost(LLViewerObject* object)
mStaleObjectCost.insert(object->getID());
}
void LLViewerObjectList::updateObjectCost(LLUUID object_id, F32 object_cost, F32 link_cost)
void LLViewerObjectList::updateObjectCost(LLUUID object_id, F32 object_cost, F32 link_cost, F32 physics_cost, F32 link_physics_cost)
{
mPendingObjectCost.erase(object_id);
@ -1196,6 +1199,8 @@ void LLViewerObjectList::updateObjectCost(LLUUID object_id, F32 object_cost, F32
{
object->setObjectCost(object_cost);
object->setLinksetCost(link_cost);
object->setPhysicsCost(physics_cost);
object->setLinksetPhysicsCost(link_physics_cost);
}
}

View File

@ -92,7 +92,7 @@ public:
void update(LLAgent &agent, LLWorld &world);
void updateObjectCost(LLViewerObject* object);
void updateObjectCost(LLUUID object_id, F32 object_cost, F32 link_cost);
void updateObjectCost(LLUUID object_id, F32 object_cost, F32 link_cost, F32 physics_cost, F32 link_physics_cost);
void onObjectCostFetchFailure(LLUUID object_id);
void shiftObjects(const LLVector3 &offset);

View File

@ -747,8 +747,9 @@
top_delta="0"
right="-10"
name="linked_set_cost"
tool_tip="Cost of currently selected linked sets as [prims],[physics complexity]"
width="80">
Cost: [COST]
Cost: [COST] / [PHYSICS]
</text>
<text
text_color="LtGray_50"
@ -773,8 +774,9 @@
top_delta="0"
right="-10"
name="object_cost"
tool_tip="Cost of currently selected objects as [prims] / [physics complexity]"
width="80">
Cost: [COST]
Cost: [COST] / [PHYSICS]
</text>
<!-- <text -->
<!-- text_color="LtGray_50" -->