summaryrefslogtreecommitdiffstats
path: root/src/RendererWorld.cpp
diff options
context:
space:
mode:
authorElisey Puzko <puzko.e02@gmail.com>2018-02-18 12:18:48 +0100
committerElisey Puzko <puzko.e02@gmail.com>2018-02-18 12:18:48 +0100
commita33df10e04b26bcc81e1910d2b3bacb0b0e0dcb4 (patch)
tree3228933773c255b69aa670fcca765dcec18cbec6 /src/RendererWorld.cpp
parentSmall changes to conform Google C++ styleguide (diff)
downloadAltCraft-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.cpp14
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();