mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +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
|
|
@ -191,18 +191,9 @@ void WorldRenderer::draw(const GfxContext& pctx, Camera* camera, bool hudVisible
|
|||
const vec3 point = PlayerController::selectedPointPosition;
|
||||
const vec3 norm = PlayerController::selectedBlockNormal;
|
||||
|
||||
std::vector<AABB> hitboxes;
|
||||
if (!block->hitboxExplicit) {
|
||||
hitboxes = block->modelBoxes;
|
||||
} else {
|
||||
hitboxes = { block->hitbox };
|
||||
}
|
||||
if (block->rotatable) {
|
||||
auto states = PlayerController::selectedBlockStates;
|
||||
for (auto& hitbox: hitboxes) {
|
||||
block->rotations.variants[states].transform(hitbox);
|
||||
}
|
||||
}
|
||||
std::vector<AABB>& hitboxes = block->rotatable
|
||||
? block->rt.hitboxes[PlayerController::selectedBlockStates]
|
||||
: block->hitboxes;
|
||||
|
||||
linesShader->use();
|
||||
linesShader->uniformMatrix("u_projview", camera->getProjView());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue