How do games like 3D Games Minecraft with a grid handle collisions their are thousands of block divided into chunks each with its own bounding box
how is collision detected calculated and processed
i tried AABB but it didnt work well with each block having its own collider
is their a way to check collision with a WHOLE MESH
this is the crude AABB function i could come up with
bool Entity::AABB(int x, int y, int z) {
return
(x - 1 <= Position.x && x >= Position.x - Size.x) &&
(y - 1 <= Position.y && y >= Position.y - Size.y) &&
(z - 1 <= Position.z && z >= Position.z - Size.z);
}
plz help... Thanks
Minecraft first calculates the player's AABB, then rounds it bigger to a whole number of blocks on each side, then checks whether the player's AABB (not rounded) collides with the AABB of any of the blocks in the rounded AABB.
One extra block is added on the bottom, because fence blocks have AABBs that go up into the next block space above themselves. If the collision check didn't check one block below the AABB, it would miss out on fences.
Chunks are irrelevant for this.