summaryrefslogtreecommitdiff
path: root/indra/llmath/llvolumeoctree.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-06-13 14:59:28 -0700
committerRoxie Linden <roxie@lindenlab.com>2024-06-13 14:59:28 -0700
commit5e60392c273f0c9c5efa765a05414c618381780a (patch)
treed1eedbb1dfa86e66532a6d8746b7a81e5a444d3a /indra/llmath/llvolumeoctree.cpp
parent0f3c3563b0861e8ea82b201aab8343d99f993bbc (diff)
parent100ebbab2437de7f5d124a0d7b8279a7a7b57656 (diff)
Merge branch 'develop' of github.com:secondlife/viewer into roxie/webrtc-voice
Diffstat (limited to 'indra/llmath/llvolumeoctree.cpp')
-rw-r--r--indra/llmath/llvolumeoctree.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/indra/llmath/llvolumeoctree.cpp b/indra/llmath/llvolumeoctree.cpp
index 341b9a6465..71288daa89 100644
--- a/indra/llmath/llvolumeoctree.cpp
+++ b/indra/llmath/llvolumeoctree.cpp
@@ -27,7 +27,7 @@
#include "llvolumeoctree.h"
#include "llvector4a.h"
-BOOL LLLineSegmentBoxIntersect(const LLVector4a& start, const LLVector4a& end, const LLVector4a& center, const LLVector4a& size)
+bool LLLineSegmentBoxIntersect(const LLVector4a& start, const LLVector4a& end, const LLVector4a& center, const LLVector4a& size)
{
LLVector4a fAWdU;
LLVector4a dir;
@@ -71,10 +71,9 @@ BOOL LLLineSegmentBoxIntersect(const LLVector4a& start, const LLVector4a& end, c
grt = f.greaterThan(rhs).getGatheredBits();
- return (grt & 0x7) ? false : true;
+ return (grt & 0x7) == 0;
}
-
LLVolumeOctreeListener::LLVolumeOctreeListener(LLOctreeNode<LLVolumeTriangle, LLVolumeTriangle*>* node)
{
node->addListener(this);
@@ -114,7 +113,7 @@ void LLOctreeTriangleRayIntersect::traverse(const LLOctreeNode<LLVolumeTriangle,
if (LLLineSegmentBoxIntersect(mStart, mEnd, vl->mBounds[0], vl->mBounds[1]))
{
node->accept(this);
- for (S32 i = 0; i < node->getChildCount(); ++i)
+ for (U32 i = 0; i < node->getChildCount(); ++i)
{
traverse(node->getChild(i));
}
@@ -152,7 +151,7 @@ void LLOctreeTriangleRayIntersect::visit(const LLOctreeNode<LLVolumeTriangle, LL
U32 idx1 = tri->mIndex[1];
U32 idx2 = tri->mIndex[2];
- if (mTexCoord != NULL)
+ if (mTexCoord != NULL && mFace->mTexCoords)
{
LLVector2* tc = (LLVector2*) mFace->mTexCoords;
*mTexCoord = ((1.f - a - b) * tc[idx0] +
@@ -161,7 +160,7 @@ void LLOctreeTriangleRayIntersect::visit(const LLOctreeNode<LLVolumeTriangle, LL
}
- if (mNormal != NULL)
+ if (mNormal != NULL && mFace->mNormals)
{
LLVector4a* norm = mFace->mNormals;
@@ -181,7 +180,7 @@ void LLOctreeTriangleRayIntersect::visit(const LLOctreeNode<LLVolumeTriangle, LL
*mNormal = n1;
}
- if (mTangent != NULL)
+ if (mTangent != NULL && mFace->mTangents)
{
LLVector4a* tangents = mFace->mTangents;