diff options
author | Dave Parks <davep@lindenlab.com> | 2009-11-13 17:01:56 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2009-11-13 17:01:56 -0600 |
commit | c02702f3871979cb7745b49aa502ac3c71f77681 (patch) | |
tree | f3bc57b17e276068ad68884c8087c30f97620817 | |
parent | 0c50236a944898502405a31aa1f0b6ae61ae38ae (diff) |
CTS-7 Add hard edge threshold capability to normal generation.
-rw-r--r-- | indra/llmath/llvolume.cpp | 12 | ||||
-rw-r--r-- | indra/llmath/llvolume.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 6286d1bcea..f252b2a232 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1876,6 +1876,18 @@ bool LLVolumeFace::VertexData::operator==(const LLVolumeFace::VertexData& rhs)co return true; } +bool LLVolumeFace::VertexData::compareNormal(const LLVolumeFace::VertexData& rhs, F32 angle_cutoff) const +{ + bool retval = false; + if (rhs.mPosition == mPosition && rhs.mTexCoord == mTexCoord) + { + F32 cur_angle = rhs.mNormal*mNormal; + + retval = cur_angle > angle_cutoff; + } + + return retval; +} BOOL LLVolume::createVolumeFacesFromFile(const std::string& file_name) { diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 9f595ccbc4..d2727d8f21 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -814,6 +814,7 @@ public: bool operator<(const VertexData& rhs) const; bool operator==(const VertexData& rhs) const; + bool compareNormal(const VertexData& rhs, F32 angle_cutoff) const; }; enum |