mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 15:01:49 +00:00
add 'normal' vector attribute to 'rect' in vcm
This commit is contained in:
parent
968528c706
commit
21ad011e76
1 changed files with 6 additions and 1 deletions
|
|
@ -192,7 +192,12 @@ static void perform_rect(const xmlelement& root, ModelBuilder& builder) {
|
||||||
}
|
}
|
||||||
std::string texture = root.attr("texture", "$0").getText();
|
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(
|
builder.addRect(
|
||||||
texture,
|
texture,
|
||||||
shading,
|
shading,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue