diff options
author | Jonathan Yap <jhwelch@gmail.com> | 2018-01-12 09:08:49 -0500 |
---|---|---|
committer | Jonathan Yap <jhwelch@gmail.com> | 2018-01-12 09:08:49 -0500 |
commit | 1e586749efeeb8c40503330572680a8709ae5487 (patch) | |
tree | 5c1ebee5dbdb5004f354b9fb0837d60f6dd3cfcc /indra/llprimitive | |
parent | 32f16633c77564d567ed0752e56eb38abb916ccd (diff) | |
parent | 1693ccba58eef676df1f91e50627545ac35bb819 (diff) |
STORM-2145 Merge up to viewer-release
Diffstat (limited to 'indra/llprimitive')
-rw-r--r-- | indra/llprimitive/lldaeloader.cpp | 22 | ||||
-rw-r--r-- | indra/llprimitive/llprimitive.cpp | 2 |
2 files changed, 20 insertions, 4 deletions
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index d73bdd7693..8401cb976e 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -305,6 +305,8 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa } face = LLVolumeFace(); + face.mExtents[0].set(v[0], v[1], v[2]); + face.mExtents[1].set(v[0], v[1], v[2]); point_map.clear(); } } @@ -549,6 +551,8 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac } face = LLVolumeFace(); + face.mExtents[0].set(v[0], v[1], v[2]); + face.mExtents[1].set(v[0], v[1], v[2]); verts.clear(); indices.clear(); point_map.clear(); @@ -855,17 +859,29 @@ struct ModelSort bool LLDAELoader::OpenFile(const std::string& filename) { + setLoadState( READING_FILE ); + //no suitable slm exists, load from the .dae file + + // Collada expects file and folder names to be escaped + // Note: cdom::nativePathToUri() + const char* allowed = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "%-._~:\"|\\/"; + std::string uri_filename = LLURI::escape(filename, allowed); + DAE dae; domCOLLADA* dom; if (mPreprocessDAE) { - dom = dae.openFromMemory(filename, preprocessDAE(filename).c_str()); + dom = dae.openFromMemory(uri_filename, preprocessDAE(filename).c_str()); } else { LL_INFOS() << "Skipping dae preprocessing" << LL_ENDL; - dom = dae.open(filename); + dom = dae.open(uri_filename); } if (!dom) @@ -894,7 +910,7 @@ bool LLDAELoader::OpenFile(const std::string& filename) daeInt count = db->getElementCount(NULL, COLLADA_TYPE_MESH); - daeDocument* doc = dae.getDoc(filename); + daeDocument* doc = dae.getDoc(uri_filename); if (!doc) { LL_WARNS() << "can't find internal doc" << LL_ENDL; diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 186716609c..bfa65666b5 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -172,7 +172,7 @@ LLPrimitive::~LLPrimitive() { clearTextureList(); // Cleanup handled by volume manager - if (mVolumep) + if (mVolumep && sVolumeManager) { sVolumeManager->unrefVolume(mVolumep); } |