aboutsummaryrefslogtreecommitdiff
path: root/azalea-physics/src/collision/shape.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-physics/src/collision/shape.rs')
-rwxr-xr-xazalea-physics/src/collision/shape.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/azalea-physics/src/collision/shape.rs b/azalea-physics/src/collision/shape.rs
index 726e62ad..fc5615c3 100755
--- a/azalea-physics/src/collision/shape.rs
+++ b/azalea-physics/src/collision/shape.rs
@@ -194,7 +194,7 @@ impl Shapes {
}
/// Check if the op is true anywhere when joining the two shapes
- /// vanilla calls this joinIsNotEmpty
+ /// vanilla calls this joinIsNotEmpty (join_is_not_empty).
pub fn matches_anywhere(
a: &VoxelShape,
b: &VoxelShape,
@@ -574,13 +574,18 @@ impl VoxelShape {
}
}
-impl From<AABB> for VoxelShape {
- fn from(aabb: AABB) -> Self {
+impl From<&AABB> for VoxelShape {
+ fn from(aabb: &AABB) -> Self {
box_shape(
aabb.min.x, aabb.min.y, aabb.min.z, aabb.max.x, aabb.max.y, aabb.max.z,
)
}
}
+impl From<AABB> for VoxelShape {
+ fn from(aabb: AABB) -> Self {
+ VoxelShape::from(&aabb)
+ }
+}
#[derive(Clone, PartialEq, Debug)]
pub struct ArrayVoxelShape {