Experimental SHOverrideRiggedBounds setting to generate more accurate avatar bboxes. Defaults to off, for now.
This commit is contained in:
@@ -1963,7 +1963,9 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE)
|
|||||||
const LLVector4a* ext;
|
const LLVector4a* ext;
|
||||||
LLVector4a pos, size;
|
LLVector4a pos, size;
|
||||||
|
|
||||||
if (drawable->getVOVolume())
|
static LLCachedControl<bool> sh_override_rigged_bounds("SHOverrideRiggedBounds", false);
|
||||||
|
LLVOVolume* volume = drawable->getVOVolume();
|
||||||
|
if (volume && (!sh_override_rigged_bounds || !volume->isAttachment() || !(drawable->isState(LLDrawable::RIGGED) || volume->isRiggedMesh())))
|
||||||
{
|
{
|
||||||
//render face bounding boxes
|
//render face bounding boxes
|
||||||
for (S32 i = 0; i < drawable->getNumFaces(); i++)
|
for (S32 i = 0; i < drawable->getNumFaces(); i++)
|
||||||
|
|||||||
@@ -1557,10 +1557,21 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global)
|
|||||||
|
|
||||||
bool any_valid_boxes = false;
|
bool any_valid_boxes = false;
|
||||||
|
|
||||||
if (getRiggedVolume())
|
static LLCachedControl<bool> sh_override_rigged_bounds("SHOverrideRiggedBounds", false);
|
||||||
|
if (sh_override_rigged_bounds && isAttachment() && (mDrawable->isState(LLDrawable::RIGGED) || isRiggedMesh()))
|
||||||
{
|
{
|
||||||
LL_DEBUGS("RiggedBox") << "rebuilding box, volume face count " << getVolume()->getNumVolumeFaces() << " drawable face count " << mDrawable->getNumFaces() << LL_ENDL;
|
LLVOAvatar* root = getAvatar();
|
||||||
|
if (root)
|
||||||
|
{
|
||||||
|
any_valid_boxes = true;
|
||||||
|
static const LLVector3 PAD_SIZE(.1f, .1f, .1f);
|
||||||
|
LLVector3 minpos = -PAD_SIZE;
|
||||||
|
LLVector3 maxpos = PAD_SIZE;
|
||||||
|
min.load3(minpos.mV,1.f);
|
||||||
|
max.load3(maxpos.mV, 1.f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (!any_valid_boxes) {
|
||||||
for (S32 i = 0; i < getVolume()->getNumVolumeFaces(); i++)
|
for (S32 i = 0; i < getVolume()->getNumVolumeFaces(); i++)
|
||||||
{
|
{
|
||||||
LLFace *face = mDrawable->getFace(i);
|
LLFace *face = mDrawable->getFace(i);
|
||||||
|
|||||||
Reference in New Issue
Block a user