mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
remove negative checks for box_shape
This commit is contained in:
parent
2dcfbe96c3
commit
aef29daad9
1 changed files with 3 additions and 18 deletions
|
@ -26,24 +26,9 @@ pub fn box_shape(
|
||||||
max_y: f64,
|
max_y: f64,
|
||||||
max_z: f64,
|
max_z: f64,
|
||||||
) -> VoxelShape {
|
) -> VoxelShape {
|
||||||
assert!(min_x >= 0., "min_x must be >= 0 but was {min_x}");
|
// we don't check for the numbers being out of bounds because some blocks are
|
||||||
assert!(min_y >= 0.);
|
// weird and are outside 0-1
|
||||||
assert!(min_z >= 0.);
|
|
||||||
assert!(max_x >= 0.);
|
|
||||||
assert!(max_y >= 0.);
|
|
||||||
assert!(max_z >= 0.);
|
|
||||||
|
|
||||||
box_shape_unchecked(min_x, min_y, min_z, max_x, max_y, max_z)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn box_shape_unchecked(
|
|
||||||
min_x: f64,
|
|
||||||
min_y: f64,
|
|
||||||
min_z: f64,
|
|
||||||
max_x: f64,
|
|
||||||
max_y: f64,
|
|
||||||
max_z: f64,
|
|
||||||
) -> VoxelShape {
|
|
||||||
if max_x - min_x < EPSILON && max_y - min_y < EPSILON && max_z - min_z < EPSILON {
|
if max_x - min_x < EPSILON && max_y - min_y < EPSILON && max_z - min_z < EPSILON {
|
||||||
return EMPTY_SHAPE.clone();
|
return EMPTY_SHAPE.clone();
|
||||||
}
|
}
|
||||||
|
@ -591,7 +576,7 @@ impl VoxelShape {
|
||||||
|
|
||||||
impl From<AABB> for VoxelShape {
|
impl From<AABB> for VoxelShape {
|
||||||
fn from(aabb: AABB) -> Self {
|
fn from(aabb: AABB) -> Self {
|
||||||
box_shape_unchecked(
|
box_shape(
|
||||||
aabb.min.x, aabb.min.y, aabb.min.z, aabb.max.x, aabb.max.y, aabb.max.z,
|
aabb.min.x, aabb.min.y, aabb.min.z, aabb.max.x, aabb.max.y, aabb.max.z,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue