From 0f379ba04ae99f5d02753759d2ac8af018f40c20 Mon Sep 17 00:00:00 2001 From: Anakin Date: Sun, 13 Nov 2016 12:47:19 +0100 Subject: [PATCH] ignore null, bones, shadow mesh and hidden things --- MshViewer/Source/OpenGlController.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/MshViewer/Source/OpenGlController.cpp b/MshViewer/Source/OpenGlController.cpp index 11da94a..7cc1fef 100644 --- a/MshViewer/Source/OpenGlController.cpp +++ b/MshViewer/Source/OpenGlController.cpp @@ -306,6 +306,13 @@ void OpenGLController::updateScene() for (unsigned int modelIndex = 0; modelIndex < vModels.size(); modelIndex++) { + // skip null, bones, shadowMesh, hidden things (don't increase textrue index!!) + if (vModels[modelIndex]->type == null || + vModels[modelIndex]->type == bone || + vModels[modelIndex]->type == shadowMesh || + vModels[modelIndex]->renderFlags == 1) + continue; + for (auto& segIt : vModels[modelIndex]->segmLst) { // give texture to the shader @@ -360,6 +367,10 @@ void OpenGLController::loadMsh(const char * path) for (auto& modIt : vModels) { + // don't draw bones, nulls, shadow mesh and hidden things + if (modIt->type == null || modIt->type == bone || modIt->type == shadowMesh || modIt->renderFlags == 1) + continue; + for (auto& segIt : modIt->segmLst) { for (unsigned int i = 0; i < segIt->meshSize; i++) @@ -399,6 +410,9 @@ void OpenGLController::loadMsh(const char * path) // get textures for (auto& modIt : vModels) { + // we don't need textures from null, bones, shadowMesh and hidden things, since they are not displayed + if (modIt->type == null || modIt->type == bone || modIt->type == shadowMesh || modIt->renderFlags == 1) + continue; for (auto& segIt : modIt->segmLst) { textureData* tempData = new textureData;