summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorMatthew Breindel (Falcon) <falcon@lindenlab.com>2010-05-24 13:38:16 -0700
committerMatthew Breindel (Falcon) <falcon@lindenlab.com>2010-05-24 13:38:16 -0700
commit52134bdc817ebfdea7733432e43e8e350944ab2e (patch)
tree453d42133ec45dd1b8b29f3694e9bb0942c8c84c /indra/llmath
parenta2eb86b00927439afcf27219e38e58eba421294f (diff)
parentcb487c002a45b1281f0cc028d6ffa74ae993330e (diff)
Merge
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llvolume.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index d7d36d901d..2ff1463b7c 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -4173,7 +4173,7 @@ S32 LLVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& end,
for (S32 i = start_face; i <= end_face; i++)
{
- const LLVolumeFace &face = getVolumeFace((U32)i);
+ LLVolumeFace &face = mVolumeFaces[i];
LLVector3 box_center = (face.mExtents[0] + face.mExtents[1]) / 2.f;
LLVector3 box_size = face.mExtents[1] - face.mExtents[0];
@@ -4235,6 +4235,10 @@ S32 LLVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& end,
if (bi_normal != NULL)
{
+ if (!face.mBinormals)
+ {
+ face.createBinormals();
+ }
LLVector4* binormal = (LLVector4*) face.mBinormals;
if (binormal)
{
@@ -5174,7 +5178,6 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build)
LLVector4a* binorm = (LLVector4a*) mBinormals;
LLVector2* tc = (LLVector2*) mTexCoords;
- S32 vtop = mNumVertices;
for(int gx = 0;gx<grid_size+1;gx++){
for(int gy = 0;gy<grid_size+1;gy++){
VertexData newVert;
@@ -5220,14 +5223,14 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build)
{
for(S32 i=5;i>=0;i--)
{
- *out++ = (vtop+(gy*(grid_size+1))+gx+idxs[i]);
+ *out++ = ((gy*(grid_size+1))+gx+idxs[i]);
}
}
else
{
for(S32 i=0;i<6;i++)
{
- *out++ = (vtop+(gy*(grid_size+1))+gx+idxs[i]);
+ *out++ = ((gy*(grid_size+1))+gx+idxs[i]);
}
}
}