mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add particles collision detection
This commit is contained in:
parent
1974298c82
commit
b944f257f7
7 changed files with 58 additions and 22 deletions
|
|
@ -61,10 +61,10 @@ voxel* Chunks::get(int32_t x, int32_t y, int32_t z) const {
|
|||
return &chunk->voxels[(y * CHUNK_D + lz) * CHUNK_W + lx];
|
||||
}
|
||||
|
||||
const AABB* Chunks::isObstacleAt(float x, float y, float z) {
|
||||
int ix = floor(x);
|
||||
int iy = floor(y);
|
||||
int iz = floor(z);
|
||||
const AABB* Chunks::isObstacleAt(float x, float y, float z) const {
|
||||
int ix = std::floor(x);
|
||||
int iy = std::floor(y);
|
||||
int iz = std::floor(z);
|
||||
voxel* v = get(ix, iy, iz);
|
||||
if (v == nullptr) {
|
||||
if (iy >= CHUNK_H) {
|
||||
|
|
@ -172,8 +172,9 @@ Chunk* Chunks::getChunk(int x, int z) {
|
|||
}
|
||||
|
||||
glm::ivec3 Chunks::seekOrigin(
|
||||
glm::ivec3 pos, const Block& def, blockstate state
|
||||
) {
|
||||
const glm::ivec3& srcpos, const Block& def, blockstate state
|
||||
) const {
|
||||
auto pos = srcpos;
|
||||
const auto& rotation = def.rotations.variants[state.rotation];
|
||||
auto segment = state.segment;
|
||||
while (true) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue