]> git.localhorst.tv Git - blank.git/blobdiff - src/entity.cpp
minor optimizations in chunk
[blank.git] / src / entity.cpp
index 054af2a52950abe7842360be59f5192d2704aece..275c8467345dbd0f72eba5718b8456e1cfdcaa4d 100644 (file)
@@ -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;
        }
 }