From b0bd992adcff71ee294dd05060e00e652f62a7b2 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sun, 16 Mar 2025 13:41:17 -0500 Subject: Fluid physics fixes (#210) * start fixing code related to fluid physics * implement force_solid for blocks * afk pool test --- azalea-physics/src/collision/shape.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'azalea-physics/src/collision/shape.rs') 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 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 for VoxelShape { + fn from(aabb: AABB) -> Self { + VoxelShape::from(&aabb) + } +} #[derive(Clone, PartialEq, Debug)] pub struct ArrayVoxelShape { -- cgit v1.2.3