From 5bf398389449978ae168bf26be76726472253fb2 Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Wed, 24 Jan 2024 22:50:07 +0100 Subject: feat: re-export BoundingVolume, RayCast, PointQuery, PointQueryWithlocation from parry. --- src/geometry/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/geometry') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index a91c4b9..1525211 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -17,7 +17,9 @@ pub use self::narrow_phase::NarrowPhase; pub use self::collider::{Collider, ColliderBuilder}; pub use self::collider_set::ColliderSet; -pub use parry::query::TrackedContact; +pub use parry::bounding_volume::BoundingVolume; +pub use parry::query::{PointQuery, PointQueryWithLocation, RayCast, TrackedContact}; +pub use parry::shape::SharedShape; use crate::math::{Real, Vector}; @@ -53,7 +55,6 @@ pub type RayIntersection = parry::query::RayIntersection; pub type PointProjection = parry::query::PointProjection; /// The the time of impact between two shapes. pub type TOI = parry::query::TOI; -pub use parry::shape::SharedShape; bitflags::bitflags! { /// Flags providing more information regarding a collision event. -- cgit From 46b244167ce3a63331b2526689a3bc3d7faafde0 Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Wed, 24 Jan 2024 22:51:30 +0100 Subject: feat!: rename narrow-phase methods for more clarity. Renames `contacts_with` to`contact_pairs_with`; and `intersections_with` to `intersection_pairs_with`. --- src/geometry/narrow_phase.rs | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'src/geometry') diff --git a/src/geometry/narrow_phase.rs b/src/geometry/narrow_phase.rs index 8b5f0c9..4c3895a 100644 --- a/src/geometry/narrow_phase.rs +++ b/src/geometry/narrow_phase.rs @@ -109,7 +109,10 @@ impl NarrowPhase { /// /// It is strongly recommended to use the [`NarrowPhase::contacts_with`] method instead. This /// method can be used if the generation number of the collider handle isn't known. - pub fn contacts_with_unknown_gen(&self, collider: u32) -> impl Iterator { + pub fn contact_pairs_with_unknown_gen( + &self, + collider: u32, + ) -> impl Iterator { self.graph_indices .get_unknown_gen(collider) .map(|id| id.contact_graph_index) @@ -118,8 +121,12 @@ impl NarrowPhase { .map(|pair| pair.2) } - /// All the contacts involving the given collider. - pub fn contacts_with<'a>( + /// All the contact pairs involving the given collider. + /// + /// The returned contact pairs identify pairs of colliders with intersecting bounding-volumes. + /// To check if any geometric contact happened between the collider shapes, check + /// [`ContactPair::has_any_active_contact`]. + pub fn contact_pairs_with<'a>( &self, collider: ColliderHandle, ) -> impl Iterator { @@ -131,11 +138,11 @@ impl NarrowPhase { .map(|pair| pair.2) } - /// All the intersections involving the given collider. + /// All the intersection pairs involving the given collider. /// /// It is strongly recommended to use the [`NarrowPhase::intersections_with`] method instead. /// This method can be used if the generation number of the collider handle isn't known. - pub fn intersections_with_unknown_gen( + pub fn intersection_pairs_with_unknown_gen( &self, collider: u32, ) -> impl Iterator + '_ { @@ -150,8 +157,13 @@ impl NarrowPhase { }) } - /// All the intersections involving the given collider. - pub fn intersections_with( + /// All the intersection pairs involving the given collider, where at least one collider + /// involved in the intersection is a sensor. + /// + /// The returned contact pairs identify pairs of colliders (where at least one is a sensor) with + /// intersecting bounding-volumes. To check if any geometric overlap happened between the collider shapes, check + /// the returned boolean. + pub fn intersection_pairs_with( &self, collider: ColliderHandle, ) -> impl Iterator + '_ { -- cgit