mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-21 01:49:44 +00:00
feat: variant-based hitboxes
This commit is contained in:
parent
563001351b
commit
b8b2e4f451
16 changed files with 145 additions and 102 deletions
|
|
@ -48,6 +48,7 @@
|
|||
#include "voxels/Block.hpp"
|
||||
#include "voxels/Chunk.hpp"
|
||||
#include "voxels/Chunks.hpp"
|
||||
#include "voxels/blocks_agent.hpp"
|
||||
#include "voxels/Pathfinding.hpp"
|
||||
#include "window/Window.hpp"
|
||||
#include "world/Level.hpp"
|
||||
|
|
@ -322,9 +323,9 @@ void WorldRenderer::renderBlockSelection() {
|
|||
const glm::vec3 point = selection.hitPosition;
|
||||
const glm::vec3 norm = selection.normal;
|
||||
|
||||
const std::vector<AABB>& hitboxes =
|
||||
block.rotatable ? block.rt.hitboxes[selection.vox.state.rotation]
|
||||
: block.hitboxes;
|
||||
const auto& hitboxes = block.getHitboxes(
|
||||
blocks_agent::hitbox_state(*player.chunks, pos, selection.vox.state)
|
||||
);
|
||||
|
||||
lineBatch->lineWidth(2.0f);
|
||||
for (auto& hitbox : hitboxes) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue