aboutsummaryrefslogtreecommitdiff
path: root/src/geometry/broad_phase_multi_sap/sap_utils.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2022-10-30 13:43:52 +0100
committerSébastien Crozet <developer@crozet.re>2022-10-30 13:43:52 +0100
commitb5b3431a632b4927a8ccc46aaaadccbdf2c6bebf (patch)
tree6bee4883f81c9f0882581fbb452da7864fb60ee6 /src/geometry/broad_phase_multi_sap/sap_utils.rs
parent8fd3e61c921894ac53b24c69bee757aaf061ccf9 (diff)
downloadrapier-b5b3431a632b4927a8ccc46aaaadccbdf2c6bebf.tar.gz
rapier-b5b3431a632b4927a8ccc46aaaadccbdf2c6bebf.tar.bz2
rapier-b5b3431a632b4927a8ccc46aaaadccbdf2c6bebf.zip
Switch to the published parry 0.11
Diffstat (limited to 'src/geometry/broad_phase_multi_sap/sap_utils.rs')
-rw-r--r--src/geometry/broad_phase_multi_sap/sap_utils.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/geometry/broad_phase_multi_sap/sap_utils.rs b/src/geometry/broad_phase_multi_sap/sap_utils.rs
index 43a8bb4..56183eb 100644
--- a/src/geometry/broad_phase_multi_sap/sap_utils.rs
+++ b/src/geometry/broad_phase_multi_sap/sap_utils.rs
@@ -1,5 +1,5 @@
use crate::math::{Point, Real, Vector};
-use parry::bounding_volume::AABB;
+use parry::bounding_volume::Aabb;
pub(crate) const NUM_SENTINELS: usize = 1;
pub(crate) const NEXT_FREE_SENTINEL: u32 = u32::MAX;
@@ -30,26 +30,26 @@ pub(crate) fn point_key(point: Point<Real>, region_width: Real) -> Point<i32> {
.into()
}
-pub(crate) fn region_aabb(index: Point<i32>, region_width: Real) -> AABB {
+pub(crate) fn region_aabb(index: Point<i32>, region_width: Real) -> Aabb {
let mins = index.coords.map(|i| i as Real * region_width).into();
let maxs = mins + Vector::repeat(region_width);
- AABB::new(mins, maxs)
+ Aabb::new(mins, maxs)
}
pub(crate) fn region_width(depth: i8) -> Real {
(REGION_WIDTH_BASE * REGION_WIDTH_POWER_BASIS.powi(depth as i32)).min(MAX_AABB_EXTENT)
}
-/// Computes the depth of the layer the given AABB should be part of.
+/// Computes the depth of the layer the given Aabb should be part of.
///
-/// The idea here is that an AABB should be part of a layer which has
-/// regions large enough so that one AABB doesn't crosses too many
+/// The idea here is that an Aabb should be part of a layer which has
+/// regions large enough so that one Aabb doesn't crosses too many
/// regions. But the regions must also not be too large, otherwise
/// we are loosing the benefits of Multi-SAP.
///
/// If the code bellow, we select a layer such that each region can
-/// contain at least a chain of 10 contiguous objects with that AABB.
-pub(crate) fn layer_containing_aabb(aabb: &AABB) -> i8 {
+/// contain at least a chain of 10 contiguous objects with that Aabb.
+pub(crate) fn layer_containing_aabb(aabb: &Aabb) -> i8 {
// Max number of elements of this size we would like one region to be able to contain.
const NUM_ELEMENTS_PER_DIMENSION: Real = 10.0;