Skip to content

Commit 84758eb

Browse files
committed
translate Fluid::compute_aabb to parry
1 parent 14f5885 commit 84758eb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/object/fluid.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ impl Fluid {
165165
self.positions.len()
166166
}
167167

168+
/// Computes the AABB of this fluid.
169+
pub fn compute_aabb(&self, particle_radius: Real) -> parry::bounding_volume::Aabb {
170+
use parry::bounding_volume::{details::local_point_cloud_aabb, BoundingVolume};
171+
local_point_cloud_aabb(&self.positions).loosened(particle_radius)
172+
}
173+
168174
/// The mass of the `i`-th particle of this fluid.
169175
pub fn particle_mass(&self, i: usize) -> Real {
170176
self.volumes[i] * self.density0

0 commit comments

Comments
 (0)