mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
Fix #160 with suggestions from @A-lex-Ra
This commit is contained in:
parent
7ee0c672f0
commit
3edf065550
7 changed files with 63 additions and 82 deletions
|
|
@ -220,9 +220,17 @@ void BlocksRenderer::blockAABB(const ivec3& icoord,
|
|||
const UVRegion(&texfaces)[6],
|
||||
const Block* block, ubyte rotation,
|
||||
bool lights) {
|
||||
AABB hitbox = block->hitbox;
|
||||
vec3 size = hitbox.size();
|
||||
if (block->hitboxes.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
AABB hitbox = block->hitboxes[0];
|
||||
for (const auto& box : block->hitboxes) {
|
||||
hitbox.a = glm::min(hitbox.a, box.a);
|
||||
hitbox.b = glm::max(hitbox.b, box.b);
|
||||
}
|
||||
|
||||
vec3 size = hitbox.size();
|
||||
vec3 X(1, 0, 0);
|
||||
vec3 Y(0, 1, 0);
|
||||
vec3 Z(0, 0, 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue