diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-06-11 12:18:50 +0300 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-06-11 18:33:44 +0300 |
commit | 51f5e09bd6457c8f90c1f63d24503e5bd8a51dab (patch) | |
tree | 6f06bc0a4601456057859f6a3d47258b70aa7c9c /indra | |
parent | daad8dcc08ab9e1d767b7d1fe1b033bda52602ff (diff) |
viewer#1692 Crash at LLVOVolume::getReflectionProbeIsBox()
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llreflectionmap.cpp | 35 | ||||
-rw-r--r-- | indra/newview/llviewerobject.h | 1 | ||||
-rw-r--r-- | indra/newview/llvovolume.h | 2 |
3 files changed, 17 insertions, 21 deletions
diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp index 2604c2ba53..b563967cd6 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 a01e0b435f..f80ff69599 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 44a964a363..ee1e3cda73 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; |