diff options
author | Elisey Puzko <puzko.e02@gmail.com> | 2018-02-18 12:18:48 +0100 |
---|---|---|
committer | Elisey Puzko <puzko.e02@gmail.com> | 2018-02-18 12:18:48 +0100 |
commit | a33df10e04b26bcc81e1910d2b3bacb0b0e0dcb4 (patch) | |
tree | 3228933773c255b69aa670fcca765dcec18cbec6 /src/RendererWorld.cpp | |
parent | Small changes to conform Google C++ styleguide (diff) | |
download | AltCraft-a33df10e04b26bcc81e1910d2b3bacb0b0e0dcb4.tar AltCraft-a33df10e04b26bcc81e1910d2b3bacb0b0e0dcb4.tar.gz AltCraft-a33df10e04b26bcc81e1910d2b3bacb0b0e0dcb4.tar.bz2 AltCraft-a33df10e04b26bcc81e1910d2b3bacb0b0e0dcb4.tar.lz AltCraft-a33df10e04b26bcc81e1910d2b3bacb0b0e0dcb4.tar.xz AltCraft-a33df10e04b26bcc81e1910d2b3bacb0b0e0dcb4.tar.zst AltCraft-a33df10e04b26bcc81e1910d2b3bacb0b0e0dcb4.zip |
Diffstat (limited to '')
-rw-r--r-- | src/RendererWorld.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp index 8390de7..5065f9d 100644 --- a/src/RendererWorld.cpp +++ b/src/RendererWorld.cpp @@ -60,8 +60,7 @@ void RendererWorld::WorkerFunction(size_t workerId) { } } -void RendererWorld::UpdateAllSections(VectorF playerPos) -{ +void RendererWorld::UpdateAllSections(VectorF playerPos) { Vector playerChunk(std::floor(gs->player->pos.x / 16), 0, std::floor(gs->player->pos.z / 16)); std::vector<Vector> suitableChunks; @@ -227,7 +226,10 @@ RendererWorld::~RendererWorld() { void RendererWorld::Render(RenderState & renderState) { //Common GLint projectionLoc, viewLoc, modelLoc, pvLoc, windowSizeLoc, colorLoc; - glm::mat4 projection = glm::perspective(45.0f, (float)renderState.WindowWidth / (float)renderState.WindowHeight, 0.1f, 10000000.0f); + glm::mat4 projection = glm::perspective( + 45.0f, (float) renderState.WindowWidth / (float) renderState.WindowHeight, + 0.1f, 10000000.0f + ); glm::mat4 view = gs->GetViewMatrix(); glm::mat4 projView = projection * view; @@ -328,7 +330,11 @@ void RendererWorld::Render(RenderState & renderState) { } } - double lengthToSection = (gs->player->pos - VectorF(section.first.x*16,section.first.y*16,section.first.z*16)).GetLength(); + double lengthToSection = (gs->player->pos - + VectorF(section.first.x*16, + section.first.y*16, + section.first.z*16) + ).GetLength(); if (!isVisible && lengthToSection > 30.0f) { sectionsMutex.lock(); |