diff options
author | Oz Linden <oz@lindenlab.com> | 2011-01-31 12:34:17 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-01-31 12:34:17 -0500 |
commit | ed308d15bf2f88f91687411cd92f6cc55b1e75b4 (patch) | |
tree | 9353a91515097c1088ed850ab27372e433f2f7c1 /indra/llmath/llvolume.cpp | |
parent | 5322021746582195df6b7ad5843a7da09e617917 (diff) | |
parent | cb6d59513eabe72029821a96191873351fd5c753 (diff) |
merge changes for storm-845
Diffstat (limited to 'indra/llmath/llvolume.cpp')
-rw-r--r-- | indra/llmath/llvolume.cpp | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 14e1ca8d43..71b92962fb 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -4406,19 +4406,54 @@ std::ostream& operator<<(std::ostream &s, const LLVolume *volumep) BOOL LLVolumeFace::create(LLVolume* volume, BOOL partial_build) { + BOOL ret = FALSE ; if (mTypeMask & CAP_MASK) { - return createCap(volume, partial_build); + ret = createCap(volume, partial_build); } else if ((mTypeMask & END_MASK) || (mTypeMask & SIDE_MASK)) { - return createSide(volume, partial_build); + ret = createSide(volume, partial_build); } else { llerrs << "Unknown/uninitialized face type!" << llendl; - return FALSE; } + + //update the range of the texture coordinates + if(ret) + { + mTexCoordExtents[0].setVec(1.f, 1.f) ; + mTexCoordExtents[1].setVec(0.f, 0.f) ; + + U32 end = mVertices.size() ; + for(U32 i = 0 ; i < end ; i++) + { + if(mTexCoordExtents[0].mV[0] > mVertices[i].mTexCoord.mV[0]) + { + mTexCoordExtents[0].mV[0] = mVertices[i].mTexCoord.mV[0] ; + } + if(mTexCoordExtents[1].mV[0] < mVertices[i].mTexCoord.mV[0]) + { + mTexCoordExtents[1].mV[0] = mVertices[i].mTexCoord.mV[0] ; + } + + if(mTexCoordExtents[0].mV[1] > mVertices[i].mTexCoord.mV[1]) + { + mTexCoordExtents[0].mV[1] = mVertices[i].mTexCoord.mV[1] ; + } + if(mTexCoordExtents[1].mV[1] < mVertices[i].mTexCoord.mV[1]) + { + mTexCoordExtents[1].mV[1] = mVertices[i].mTexCoord.mV[1] ; + } + } + mTexCoordExtents[0].mV[0] = llmax(0.f, mTexCoordExtents[0].mV[0]) ; + mTexCoordExtents[0].mV[1] = llmax(0.f, mTexCoordExtents[0].mV[1]) ; + mTexCoordExtents[1].mV[0] = llmin(1.f, mTexCoordExtents[1].mV[0]) ; + mTexCoordExtents[1].mV[1] = llmin(1.f, mTexCoordExtents[1].mV[1]) ; + } + + return ret ; } void LerpPlanarVertex(LLVolumeFace::VertexData& v0, |