viewer#1692 Crash at LLVOVolume::getReflectionProbeIsBox()

master
Andrey Kleshchev 2024-06-11 12:18:50 +03:00 committed by Andrey Kleshchev
parent 23902789dd
commit be656055c1
3 changed files with 17 additions and 21 deletions

View File

@ -251,32 +251,27 @@ bool LLReflectionMap::getBox(LLMatrix4& box)
if (mViewerObject)
{
LLVolume* volume = mViewerObject->getVolume();
if (volume)
if (volume && mViewerObject->getReflectionProbeIsBox())
{
LLVOVolume* vobjp = (LLVOVolume*)mViewerObject;
if (vobjp->getReflectionProbeIsBox())
glh::matrix4f mv(gGLModelView);
glh::matrix4f scale;
LLVector3 s = mViewerObject->getScale().scaledVec(LLVector3(0.5f, 0.5f, 0.5f));
mRadius = s.magVec();
scale.set_scale(glh::vec3f(s.mV));
if (mViewerObject->mDrawable != nullptr)
{
glh::matrix4f mv(gGLModelView);
glh::matrix4f scale;
LLVector3 s = vobjp->getScale().scaledVec(LLVector3(0.5f, 0.5f, 0.5f));
mRadius = s.magVec();
scale.set_scale(glh::vec3f(s.mV));
if (vobjp->mDrawable != nullptr)
{
// object to agent space (no scale)
glh::matrix4f rm((F32*)vobjp->mDrawable->getWorldMatrix().mMatrix);
// object to agent space (no scale)
glh::matrix4f rm((F32*)mViewerObject->mDrawable->getWorldMatrix().mMatrix);
// construct object to camera space (with scale)
mv = mv * rm * scale;
// construct object to camera space (with scale)
mv = mv * rm * scale;
// inverse is camera space to object unit cube
mv = mv.inverse();
// inverse is camera space to object unit cube
mv = mv.inverse();
box = LLMatrix4(mv.m);
box = LLMatrix4(mv.m);
return true;
}
return true;
}
}
}

View File

@ -258,6 +258,7 @@ public:
virtual bool isRiggedMesh() const { return false; }
virtual bool hasLightTexture() const { return false; }
virtual bool isReflectionProbe() const { return false; }
virtual bool getReflectionProbeIsBox() const { return false; }
// This method returns true if the object is over land owned by
// the agent, one of its groups, or it encroaches and

View File

@ -306,7 +306,7 @@ public:
bool isReflectionProbe() const override;
F32 getReflectionProbeAmbiance() const;
F32 getReflectionProbeNearClip() const;
bool getReflectionProbeIsBox() const;
bool getReflectionProbeIsBox() const override;
bool getReflectionProbeIsDynamic() const;
bool getReflectionProbeIsMirror() const;