summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 78f534bacd..5ac6dcce5a 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -108,6 +108,11 @@ public:
if (te->getMediaData() != NULL)
{
result = te->getMediaData()->asLLSD();
+ // XXX HACK: workaround bug in asLLSD() where whitelist is not set properly
+ if (!result.has(LLMediaEntry::WHITELIST_KEY))
+ {
+ result[LLMediaEntry::WHITELIST_KEY] = LLSD::emptyArray();
+ }
}
}
return result;
@@ -1638,6 +1643,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));
@@ -1713,6 +1738,10 @@ void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool m
addMediaImpl(media_impl, texture_index) ;
}
+ else
+ {
+ removeMediaImpl(texture_index);
+ }
//llinfos << "AFTER: texture_index = " << texture_index
// << " hasMedia = " << te->hasMedia() << " : "