diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2025-03-16 13:41:17 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-16 13:41:17 -0500 |
| commit | b0bd992adcff71ee294dd05060e00e652f62a7b2 (patch) | |
| tree | 0a36d8b37befbc75c8c65cc2c8779c3df66bd87b /azalea-physics/src/collision/shape.rs | |
| parent | a95408cbcc05b5bd04a084b0a286b571069206f6 (diff) | |
| download | azalea-drasl-b0bd992adcff71ee294dd05060e00e652f62a7b2.tar.xz | |
Fluid physics fixes (#210)
* start fixing code related to fluid physics
* implement force_solid for blocks
* afk pool test
Diffstat (limited to 'azalea-physics/src/collision/shape.rs')
| -rwxr-xr-x | azalea-physics/src/collision/shape.rs | 11 |
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 { |
