From 3b2fe22c33074664b0c4f24be374e4e6c1c0ed2f Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Mon, 9 Nov 2015 09:05:31 +0100 Subject: [PATCH] fix entity/world collision friday afternoon not good for me brain it seems --- src/world/chunk.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/world/chunk.cpp b/src/world/chunk.cpp index 4790f28..cc305cd 100644 --- a/src/world/chunk.cpp +++ b/src/world/chunk.cpp @@ -19,9 +19,6 @@ #include #include -#include -#include - namespace blank { @@ -460,12 +457,6 @@ bool Chunk::Intersection( return false; } - if (entity.ID() == 1) { - std::cout << "chunk: " << (Position() * 16) << ", entity: " << entity.AbsolutePosition() << std::endl; - std::cout << "\tMentity[3]: " << Mentity[3] << std::endl; - std::cout << "\tMchunk[3]: " << Mentity[3] << std::endl; - } - bool any = false; float penetration; glm::vec3 normal; @@ -479,11 +470,11 @@ bool Chunk::Intersection( RoughLocation::Fine(floor(entity_coords - eb_radius)) )); const RoughLocation::Fine end(min( - RoughLocation::Fine(side - 1), + RoughLocation::Fine(side), RoughLocation::Fine(ceil(entity_coords + eb_radius)) - ) - 1); + )); - for (RoughLocation::Fine pos(begin); pos.z < end.y; ++pos.z) { + for (RoughLocation::Fine pos(begin); pos.z < end.z; ++pos.z) { for (pos.y = begin.y; pos.y < end.y; ++pos.y) { for (pos.x = begin.x; pos.x < end.x; ++pos.x) { int idx = ToIndex(pos); -- 2.39.2