From 21ad011e763247018430bc85491a4fb79c3576de Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sun, 6 Sep 2026 19:40:09 +0300 Subject: [PATCH] add 'normal' vector attribute to 'rect' in vcm --- src/coders/vcm.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/coders/vcm.cpp b/src/coders/vcm.cpp index 260657338..bf9a152a6 100644 --- a/src/coders/vcm.cpp +++ b/src/coders/vcm.cpp @@ -192,7 +192,12 @@ static void perform_rect(const xmlelement& root, ModelBuilder& builder) { } std::string texture = root.attr("texture", "$0").getText(); - auto normal = glm::cross(glm::normalize(right), glm::normalize(up)); + glm::vec3 normal; + if (root.has("normal")) { + normal = root.attr("normal").asVec3(); + } else { + normal = glm::cross(glm::normalize(right), glm::normalize(up)); + } builder.addRect( texture, shading,