Skip to content

Commit

Permalink
translate Fluid::compute_aabb for parry
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz committed Sep 9, 2024
1 parent 89ca820 commit d75d412
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/object/fluid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ impl Fluid {
self.positions.len()
}

/// Computes the AABB of this fluid.
#[cfg(feature = "parry")]
pub fn compute_aabb(&self, particle_radius: Real) -> parry::bounding_volume::Aabb {
use parry::bounding_volume::{details::local_point_cloud_aabb, BoundingVolume};
local_point_cloud_aabb(&self.positions).loosened(particle_radius)
}

/// The mass of the `i`-th particle of this fluid.
pub fn particle_mass(&self, i: usize) -> Real {
self.volumes[i] * self.density0
Expand Down

0 comments on commit d75d412

Please sign in to comment.