Pathfinding search
This commit is contained in:
+2
-1
@@ -212,7 +212,8 @@ export function box_is_free(
|
||||
return !overlaps_solid(min, max, is_blocked);
|
||||
}
|
||||
|
||||
function overlaps_solid(min: number[], max: number[], is_solid: BlockCollision) {
|
||||
// whether the box between min and max (x, y, z) touches anything solid
|
||||
export function overlaps_solid(min: number[], max: number[], is_solid: BlockCollision) {
|
||||
for (let x = lowest(0, min[0]); x <= Math.floor(max[0] - EPSILON); x++) {
|
||||
for (let y = lowest(1, min[1]); y <= Math.floor(max[1] - EPSILON); y++) {
|
||||
for (let z = lowest(2, min[2]); z <= Math.floor(max[2] - EPSILON); z++) {
|
||||
|
||||
Reference in New Issue
Block a user