diff options
author | Dave Parks <davep@lindenlab.com> | 2010-10-07 14:00:43 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2010-10-07 14:00:43 -0500 |
commit | b70ccfe8e31cd253069a6e0ae0ec03e301d26578 (patch) | |
tree | 3c0a9311788b99dcf343f43f163d28fa17ffbf3e /indra/newview/llviewerobject.cpp | |
parent | e83b815c0fff09cd7d0d4c0198ed7bdc1fa296ad (diff) |
Add pure physics cost to UI
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r-- | indra/newview/llviewerobject.cpp | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 9b3f81e193..dcd208fea5 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -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,27 +2966,45 @@ F32 LLViewerObject::getObjectCost() return mObjectCost; } -F32 LLViewerObject::getStreamingCost() +F32 LLViewerObject::getLinksetCost() { - return 0.f; + if (mCostStale) + { + gObjectList.updateObjectCost(this); + } + + return mLinksetCost; } -U32 LLViewerObject::getTriangleCount() +F32 LLViewerObject::getPhysicsCost() { - return 0; + if (mCostStale) + { + gObjectList.updateObjectCost(this); + } + + return mPhysicsCost; } -F32 LLViewerObject::getLinksetCost() +F32 LLViewerObject::getLinksetPhysicsCost() { if (mCostStale) { gObjectList.updateObjectCost(this); } - return mLinksetCost; + return mLinksetPhysicsCost; } +F32 LLViewerObject::getStreamingCost() +{ + return 0.f; +} +U32 LLViewerObject::getTriangleCount() +{ + return 0; +} void LLViewerObject::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax) { |