From 7ba7f3ac393c7c6e9b85afa36402b9ba1b4060fe Mon Sep 17 00:00:00 2001 From: ugozapad Date: Sun, 8 Mar 2026 16:59:30 +0300 Subject: [PATCH] fix --- src/render/model.cpp | 7 ++++++- src/render/model.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/render/model.cpp b/src/render/model.cpp index 819a5e2..a0e0f42 100644 --- a/src/render/model.cpp +++ b/src/render/model.cpp @@ -35,6 +35,7 @@ static std::string getFileNameWithoutExtension(const std::string& filename) Model::Model() { m_numPoses = 0; + m_iqm = false; //m_boundingBox.min = glm::vec3(0.0f); //m_boundingBox.max = glm::vec3(0.0f); @@ -430,6 +431,8 @@ void Model::LoadIqm(const char* filename) } free(pHdr); + + m_iqm = true; } void Model::LoadObj(const char* filename) @@ -617,7 +620,9 @@ void Model::Draw(const glm::mat4& model, SkeletonInstance* instance /*= nullptr* glm::vec3 pos = model[3]; - Shader* shader = g_unlitSkinnedShader; //instance ? g_unlitSkinnedShader : g_unlitShader; + Shader* shader = g_unlitShader; + if (m_iqm) + shader = g_unlitSkinnedShader; static glm::mat4 s_identityBones[128]; static bool ready = false; diff --git a/src/render/model.h b/src/render/model.h index 06ded23..4c1621e 100644 --- a/src/render/model.h +++ b/src/render/model.h @@ -72,6 +72,8 @@ private: BoundingBox m_boundingBox; int m_numPoses; + + bool m_iqm; }; #endif // !MODEL_H