X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fentity.cpp;h=275c8467345dbd0f72eba5718b8456e1cfdcaa4d;hb=e53a0e2e711a7d8bd9b0ddacd1360aa14370643f;hp=054af2a52950abe7842360be59f5192d2704aece;hpb=76b3ec0f6aa0dacf6d4944a2787991f3585299e8;p=blank.git diff --git a/src/entity.cpp b/src/entity.cpp index 054af2a..275c846 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -45,28 +45,28 @@ void Entity::Velocity(const glm::vec3 &vel) noexcept { void Entity::Position(const Block::Pos &pos) noexcept { position = pos; - while (position.x >= Chunk::Width()) { - position.x -= Chunk::Width(); + while (position.x >= Chunk::width) { + position.x -= Chunk::width; ++chunk.x; } while (position.x < 0) { - position.x += Chunk::Width(); + position.x += Chunk::width; --chunk.x; } - while (position.y >= Chunk::Height()) { - position.y -= Chunk::Height(); + while (position.y >= Chunk::height) { + position.y -= Chunk::height; ++chunk.y; } while (position.y < 0) { - position.y += Chunk::Height(); + position.y += Chunk::height; --chunk.y; } - while (position.z >= Chunk::Depth()) { - position.z -= Chunk::Depth(); + while (position.z >= Chunk::depth) { + position.z -= Chunk::depth; ++chunk.z; } while (position.z < 0) { - position.z += Chunk::Depth(); + position.z += Chunk::depth; --chunk.z; } }