summaryrefslogtreecommitdiffstats
path: root/src/AssetManager.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-21 17:43:26 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-21 17:43:26 +0200
commit228920cde3d3860280cdedbbe69c33767791e4a7 (patch)
tree1a31fc4e2aa9a2e78de775fd283dbcadf51b6590 /src/AssetManager.cpp
parentFixed linux compilation errors (diff)
downloadAltCraft-228920cde3d3860280cdedbbe69c33767791e4a7.tar
AltCraft-228920cde3d3860280cdedbbe69c33767791e4a7.tar.gz
AltCraft-228920cde3d3860280cdedbbe69c33767791e4a7.tar.bz2
AltCraft-228920cde3d3860280cdedbbe69c33767791e4a7.tar.lz
AltCraft-228920cde3d3860280cdedbbe69c33767791e4a7.tar.xz
AltCraft-228920cde3d3860280cdedbbe69c33767791e4a7.tar.zst
AltCraft-228920cde3d3860280cdedbbe69c33767791e4a7.zip
Diffstat (limited to 'src/AssetManager.cpp')
-rw-r--r--src/AssetManager.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp
index aa796b8..03a672e 100644
--- a/src/AssetManager.cpp
+++ b/src/AssetManager.cpp
@@ -352,7 +352,7 @@ void ParseBlockModels() {
VectorF elementSize(VectorF(t.x, t.y, t.z) / 16.0f);
VectorF elementOrigin(VectorF(element.from.x, element.from.y, element.from.z) / 16.0f);
- glm::mat4 elementTransform;
+ glm::mat4 elementTransform = glm::mat4(1.0);
if (element.rotationAngle != 0) {
static const glm::vec3 xAxis(1.0f, 0.0f, 0.0f);
@@ -374,7 +374,7 @@ void ParseBlockModels() {
VectorF rotateOrigin(VectorF(element.rotationOrigin.x, element.rotationOrigin.y, element.rotationOrigin.z) / 16.0f);
- glm::mat4 rotationMat;
+ glm::mat4 rotationMat = glm::mat4(1.0);
rotationMat = glm::translate(rotationMat, rotateOrigin.glm());
rotationMat = glm::rotate(rotationMat, glm::radians((float)element.rotationAngle), *targetAxis);
@@ -410,7 +410,7 @@ void ParseBlockModels() {
ParsedFace parsedFace;
parsedFace.visibility = face.second.cullface;
- glm::mat4 faceTransform;
+ glm::mat4 faceTransform = glm::mat4(1.0);
switch (face.first) {
case FaceDirection::down:
faceTransform = glm::translate(elementTransform, glm::vec3(0, 0, 0));
@@ -512,6 +512,7 @@ BlockFaces &AssetManager::GetBlockModelByBlockId(BlockId block) {
if (block.id == 7788) {
BlockFaces blockFaces;
+ blockFaces.transform = glm::mat4(1.0);
blockFaces.faces = GetAsset<AssetBlockModel>("/minecraft/models/block/error")->blockModel.parsedFaces;
blockFaces.isBlock = GetAsset<AssetBlockModel>("/minecraft/models/block/error")->blockModel.IsBlock;
for (int i = 0; i < FaceDirection::none; i++) {
@@ -540,9 +541,10 @@ BlockFaces &AssetManager::GetBlockModelByBlockId(BlockId block) {
return GetBlockModelByBlockId(BlockId{ 7788,0 });
BlockFaces blockFaces;
+ blockFaces.transform = glm::mat4(1.0);
blockFaces.faces = assetModel->blockModel.parsedFaces;
blockFaces.isBlock = assetModel->blockModel.IsBlock;
- glm::mat4 transform;
+ glm::mat4 transform = glm::mat4(1.0);
if (model.y != 0) {
blockFaces.transform = glm::translate(blockFaces.transform, glm::vec3(0.5f, 0.0f, 0.5f));