add 'normal' vector attribute to 'rect' in vcm

This commit is contained in:
MihailRis 2026-09-06 19:40:09 +03:00
parent 968528c706
commit 21ad011e76

View file

@ -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,