aboutsummaryrefslogtreecommitdiff
path: root/azalea-physics/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-01-20 05:49:13 +0000
committermat <git@matdoes.dev>2025-01-20 05:49:13 +0000
commitaef29daad94189fb5dd5fc97bccf49ff9dbba661 (patch)
tree6003088f1d166dfe87026295699ae2c07e604aca /azalea-physics/src
parent2dcfbe96c3024f9e1d32473d58130efa518c91cf (diff)
downloadazalea-drasl-aef29daad94189fb5dd5fc97bccf49ff9dbba661.tar.xz
remove negative checks for box_shape
Diffstat (limited to 'azalea-physics/src')
-rwxr-xr-xazalea-physics/src/collision/shape.rs21
1 files changed, 3 insertions, 18 deletions
diff --git a/azalea-physics/src/collision/shape.rs b/azalea-physics/src/collision/shape.rs
index 9d870498..b0dceabb 100755
--- a/azalea-physics/src/collision/shape.rs
+++ b/azalea-physics/src/collision/shape.rs
@@ -26,24 +26,9 @@ pub fn box_shape(
max_y: f64,
max_z: f64,
) -> VoxelShape {
- assert!(min_x >= 0., "min_x must be >= 0 but was {min_x}");
- assert!(min_y >= 0.);
- 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)
-}
+ // we don't check for the numbers being out of bounds because some blocks are
+ // weird and are outside 0-1
-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 {
return EMPTY_SHAPE.clone();
}
@@ -591,7 +576,7 @@ impl VoxelShape {
impl From<AABB> for VoxelShape {
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,
)
}