diff options
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r-- | indra/newview/llvovolume.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 78f534bacd..a32abf3ab9 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1638,6 +1638,26 @@ bool LLVOVolume::hasMedia() const return result; } +LLVector3 LLVOVolume::getApproximateFaceNormal(U8 face_id) +{ + LLVolume* volume = getVolume(); + LLVector3 result; + + if (volume && face_id < volume->getNumVolumeFaces()) + { + const LLVolumeFace& face = volume->getVolumeFace(face_id); + for (S32 i = 0; i < (S32)face.mVertices.size(); ++i) + { + result += face.mVertices[i].mNormal; + } + + result = volumeDirectionToAgent(result); + result.normVec(); + } + + return result; +} + void LLVOVolume::requestMediaDataUpdate() { sObjectMediaClient->fetchMedia(new LLMediaDataClientObjectImpl(this)); |