src/chunk/chunk.c
// for checking if neighbour exists
// maybe not super efficient but who cares
for checking if neighbour exists
maybe not super efficient but who cares
for checking if neighbour exists maybe not super efficient but who cares
bool neighbour_exists(vec3i pos, int direction) {
    if (direction == PLUS_X) {
        return pos.x < CHUNK_MAX;
    } else if (direction == MINUS_X) {
        return pos.x > 0;
    } else if (direction == PLUS_Y) {
        return pos.y < CHUNK_MAX;
    } else if (direction == MINUS_Y) {
        return pos.y > 0;
    } else if (direction == PLUS_Z) {
        return pos.z < CHUNK_MAX;
    } else if (direction == MINUS_Z) {
        return pos.z > 0;
    }
    panicf("shouldnt happen, direction %d\n", direction);
    return false;
}
bool neighbour_exists ( vec3i pos , int direction ) { if ( direction == PLUS_X ) { return pos . x < CHUNK_MAX ; } else if ( direction == MINUS_X ) { return pos . x > 0 ; } else if ( direction == PLUS_Y ) { return pos . y < CHUNK_MAX ; } else if ( direction == MINUS_Y ) { return pos . y > 0 ; } else if ( direction == PLUS_Z ) { return pos . z < CHUNK_MAX ; } else if ( direction == MINUS_Z ) { return pos . z > 0 ; } panicf ( " \n " , direction ) ; return false ; }
for checking if neighbour exists
maybe not super efficient but who cares
for checking if neighbour exists maybe not super efficient but who cares