aboutsummaryrefslogtreecommitdiff
path: root/src/geometry/mod.rs
diff options
context:
space:
mode:
authorCrozet Sébastien <developer@crozet.re>2020-12-17 13:23:00 +0100
committerCrozet Sébastien <developer@crozet.re>2020-12-29 11:31:59 +0100
commit29717c2887b2db39faf9c25053730b661dc5da2b (patch)
treed7ec5abf85af4b3519ead56891dda23e02c08323 /src/geometry/mod.rs
parente231bacec608fa5efd24f7a876572927dbd6c9c4 (diff)
downloadrapier-29717c2887b2db39faf9c25053730b661dc5da2b.tar.gz
rapier-29717c2887b2db39faf9c25053730b661dc5da2b.tar.bz2
rapier-29717c2887b2db39faf9c25053730b661dc5da2b.zip
Externalize the proximity code (renamed intersection).
Diffstat (limited to 'src/geometry/mod.rs')
-rw-r--r--src/geometry/mod.rs29
1 files changed, 6 insertions, 23 deletions
diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs
index 9f32a7f..efb0cd4 100644
--- a/src/geometry/mod.rs
+++ b/src/geometry/mod.rs
@@ -11,10 +11,7 @@ pub use self::interaction_graph::{
};
pub use self::narrow_phase::NarrowPhase;
pub use self::polygon::Polygon;
-pub use self::proximity_detector::{DefaultProximityDispatcher, ProximityDispatcher};
-pub use self::proximity_pair::ProximityPair;
pub use self::user_callbacks::{ContactPairFilter, PairFilterContext, ProximityPairFilter};
-pub use eagl::query::Proximity;
pub use eagl::query::{KinematicsCategory, TrackedContact};
@@ -62,36 +59,24 @@ pub enum ContactEvent {
#[derive(Copy, Clone, Debug)]
/// Events occurring when two collision objects start or stop being in close proximity, contact, or disjoint.
-pub struct ProximityEvent {
+pub struct IntersectionEvent {
/// The first collider to which the proximity event applies.
pub collider1: ColliderHandle,
/// The second collider to which the proximity event applies.
pub collider2: ColliderHandle,
- /// The previous state of proximity between the two collision objects.
- pub prev_status: Proximity,
- /// The new state of proximity between the two collision objects.
- pub new_status: Proximity,
+ /// Are the two colliders intersecting?
+ pub intersecting: bool,
}
-impl ProximityEvent {
+impl IntersectionEvent {
/// Instantiates a new proximity event.
///
/// Panics if `prev_status` is equal to `new_status`.
- pub fn new(
- collider1: ColliderHandle,
- collider2: ColliderHandle,
- prev_status: Proximity,
- new_status: Proximity,
- ) -> Self {
- assert_ne!(
- prev_status, new_status,
- "The previous and new status of a proximity event must not be the same."
- );
+ pub fn new(collider1: ColliderHandle, collider2: ColliderHandle, intersecting: bool) -> Self {
Self {
collider1,
collider2,
- prev_status,
- new_status,
+ intersecting,
}
}
}
@@ -117,8 +102,6 @@ mod contact_pair;
mod interaction_graph;
mod narrow_phase;
mod polygon;
-mod proximity_detector;
-mod proximity_pair;
pub(crate) mod sat;
//mod z_order;
mod interaction_groups;