summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-06-11 12:18:50 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-06-12 18:12:35 +0300
commitbe656055c1ba86682c3ee1d74b110c66028e435c (patch)
tree2d2515512ea65236e093c55c8c630a6e9b98c63c
parent23902789dd41808779b8ba2b5ec8fd074eeec243 (diff)
viewer#1692 Crash at LLVOVolume::getReflectionProbeIsBox()
-rw-r--r--indra/newview/llreflectionmap.cpp35
-rw-r--r--indra/newview/llviewerobject.h1
-rw-r--r--indra/newview/llvovolume.h2
3 files changed, 17 insertions, 21 deletions
diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp
index 79c07d8c09..31fd6f3f07 100644
--- a/indra/newview/llreflectionmap.cpp
+++ b/indra/newview/llreflectionmap.cpp
@@ -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;
}
}
}
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 3a2c96b936..3f12fb5a61 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -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
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index a004dab8c9..07e02e042c 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -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;