mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
converting block states to a bitfield
This commit is contained in:
parent
5dd06b233e
commit
6d933ac263
17 changed files with 197 additions and 164 deletions
|
|
@ -219,13 +219,11 @@ bool PhysicsSolver::isBlockInside(int x, int y, int z, Hitbox* hitbox) {
|
|||
y >= floor(pos.y-half.y) && y <= floor(pos.y+half.y);
|
||||
}
|
||||
|
||||
bool PhysicsSolver::isBlockInside(int x, int y, int z, Block* def, blockstate_t states, Hitbox* hitbox) {
|
||||
bool PhysicsSolver::isBlockInside(int x, int y, int z, Block* def, blockstate state, Hitbox* hitbox) {
|
||||
const glm::vec3& pos = hitbox->position;
|
||||
const glm::vec3& half = hitbox->halfsize;
|
||||
voxel v {};
|
||||
v.states = states;
|
||||
const auto& boxes = def->rotatable
|
||||
? def->rt.hitboxes[v.rotation()]
|
||||
? def->rt.hitboxes[state.rotation]
|
||||
: def->hitboxes;
|
||||
for (const auto& block_hitbox : boxes) {
|
||||
glm::vec3 min = block_hitbox.min();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue