summaryrefslogtreecommitdiffstats
path: root/src/RendererSectionData.cpp
diff options
context:
space:
mode:
authorLaG1924 <lag1924@gmail.com>2021-06-27 18:31:00 +0200
committerLaG1924 <lag1924@gmail.com>2021-06-27 18:31:00 +0200
commit5a6aaf633ce217f828d981cd8c55951ada67e2df (patch)
tree4719852bbba79f005a95be8d632a32200abcf142 /src/RendererSectionData.cpp
parentMerge pull request #63 from LaG1924/ftr/cmake-minor-improvements (diff)
downloadAltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.tar
AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.tar.gz
AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.tar.bz2
AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.tar.lz
AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.tar.xz
AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.tar.zst
AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.zip
Diffstat (limited to 'src/RendererSectionData.cpp')
-rw-r--r--src/RendererSectionData.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/RendererSectionData.cpp b/src/RendererSectionData.cpp
index 69ed665..cf05528 100644
--- a/src/RendererSectionData.cpp
+++ b/src/RendererSectionData.cpp
@@ -37,7 +37,13 @@ void AddFacesByBlockModel(RendererSectionData &data, const BlockFaces &model, co
continue;
lightness = glm::vec2(light.face[faceDirection], skyLight.face[faceDirection]);
}
- data.models.push_back(transform * model.transform * face.transform);
+ glm::mat4 transformed = transform * model.transform * face.transform;
+ data.positions.push_back(transformed * glm::vec4(0, 0, 0, 1));
+ data.positions.push_back(transformed * glm::vec4(1, 0, 1, 1));
+ data.positions.push_back(transformed * glm::vec4(1, 0, 0, 1));
+ data.positions.push_back(transformed * glm::vec4(0, 0, 0, 1));
+ data.positions.push_back(transformed * glm::vec4(0, 0, 1, 1));
+ data.positions.push_back(transformed * glm::vec4(1, 0, 1, 1));
data.textures.push_back(face.texture);
data.textureLayers.push_back(face.layer);
data.textureFrames.push_back(face.frames);
@@ -137,7 +143,7 @@ RendererSectionData ParseSection(const SectionsData &sections) {
}
data.textures.shrink_to_fit();
data.textureLayers.shrink_to_fit();
- data.models.shrink_to_fit();
+ data.positions.shrink_to_fit();
data.colors.shrink_to_fit();
return data;