AABB blocks rotation support (WIP part 1)

This commit is contained in:
MihailRis
2023-12-04 15:52:09 +03:00
parent 8bc8eb14bd
commit 0c764bcbd9
8 changed files with 120 additions and 90 deletions
+6 -1
View File
@@ -193,7 +193,12 @@ void WorldRenderer::draw(const GfxContext& pctx, Camera* camera){
const vec3 pos = PlayerController::selectedBlockPosition;
const vec3 point = PlayerController::selectedPointPosition;
const vec3 norm = PlayerController::selectedBlockNormal;
const AABB& hitbox = block->hitbox;
AABB hitbox = block->hitbox;
if (block->rotatable) {
auto states = PlayerController::selectedBlockStates;
block->rotations.variants[states].transform(hitbox);
}
const vec3 center = pos + hitbox.center();
const vec3 size = hitbox.size();
linesShader->use();