diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-09-22 18:04:03 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-09-22 18:04:03 +0100 |
commit | a6068419e7fe1a5a0eda007b2e989769c0a92262 (patch) | |
tree | 8faf3e8004b6ec1e79d611a86e9c9c131f156702 /indra/newview/llvovolume.cpp | |
parent | a634d878098cff98b0622d492f5454a1bd41cff6 (diff) |
SL-794, SL-790 - viewer-side enforcement in UI for various animated object limits that are also enforced on the server.
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r-- | indra/newview/llvovolume.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 403bff5a9e..07032ca0ae 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3349,22 +3349,25 @@ bool LLVOVolume::canBeAnimatedObject() const { return false; } -// AXON remove this check if animated object attachments are allowed -#if 0 - if (isAttachment()) - { - return false; - } -#endif if (!getVolume()) { return false; } + if (!isRootEdit()) + { + return false; + } const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(getVolume()->getParams().getSculptID(), this); if (!skin) { return false; } + F32 est_tris = recursiveGetEstTrianglesHigh(); + if (est_tris > getAnimatedObjectMaxTris()) + { + LL_INFOS() << "est_tris " << est_tris << " exceeds limit " << getAnimatedObjectMaxTris() << LL_ENDL; + return false; + } return true; } @@ -3833,6 +3836,15 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const return (U32)shame; } +F32 LLVOVolume::getEstTrianglesHigh() const +{ + if (isMesh()) + { + return gMeshRepo.getEstTrianglesHigh(getVolume()->getParams().getSculptID()); + } + return 0.f; +} + F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const { F32 radius = getScale().length()*0.5f; |