From 9bf1321f8f1d2e116f44c2461a53f302c4ef4171 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Tue, 8 Dec 2020 17:31:49 +0100 Subject: Outsource the contact manifold, SAT, and some shapes. --- src/geometry/mod.rs | 110 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 69 insertions(+), 41 deletions(-) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index c8ad28e..caa229a 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -1,17 +1,11 @@ //! Structures related to geometry: colliders, shapes, etc. pub use self::broad_phase_multi_sap::BroadPhase; -pub use self::capsule::Capsule; pub use self::collider::{Collider, ColliderBuilder, ColliderShape}; pub use self::collider_set::{ColliderHandle, ColliderSet}; -pub use self::contact::{ - Contact, ContactKinematics, ContactManifold, ContactPair, KinematicsCategory, SolverFlags, -}; +pub use self::contact::{ContactData, ContactManifoldData}; +pub use self::contact::{ContactPair, SolverFlags}; pub use self::contact_generator::{ContactDispatcher, DefaultContactDispatcher}; -#[cfg(feature = "dim2")] -pub(crate) use self::cuboid_feature2d::{CuboidFeature, CuboidFeatureFace}; -#[cfg(feature = "dim3")] -pub(crate) use self::cuboid_feature3d::{CuboidFeature, CuboidFeatureFace}; pub use self::interaction_graph::{ ColliderGraphIndex, InteractionGraph, RigidBodyGraphIndex, TemporaryInteractionIndex, }; @@ -23,36 +17,87 @@ pub use self::proximity_detector::{DefaultProximityDispatcher, ProximityDispatch pub use self::round_cylinder::RoundCylinder; pub use self::trimesh::Trimesh; pub use self::user_callbacks::{ContactPairFilter, PairFilterContext, ProximityPairFilter}; -pub use ncollide::query::Proximity; +pub use buckler::query::Proximity; + +pub use buckler::query::{KinematicsCategory, TrackedContact}; +pub type Contact = buckler::query::TrackedContact; +pub type ContactManifold = buckler::query::ContactManifold; /// A segment shape. -pub type Segment = ncollide::shape::Segment; +pub type Segment = buckler::shape::Segment; /// A cuboid shape. -pub type Cuboid = ncollide::shape::Cuboid; +pub type Cuboid = buckler::shape::Cuboid; /// A triangle shape. -pub type Triangle = ncollide::shape::Triangle; +pub type Triangle = buckler::shape::Triangle; /// A ball shape. -pub type Ball = ncollide::shape::Ball; +pub type Ball = buckler::shape::Ball; +/// A capsule shape. +pub type Capsule = buckler::shape::Capsule; /// A heightfield shape. -pub type HeightField = ncollide::shape::HeightField; +pub type HeightField = buckler::shape::HeightField; /// A cylindrical shape. #[cfg(feature = "dim3")] -pub type Cylinder = ncollide::shape::Cylinder; +pub type Cylinder = buckler::shape::Cylinder; /// A cone shape. #[cfg(feature = "dim3")] -pub type Cone = ncollide::shape::Cone; +pub type Cone = buckler::shape::Cone; /// An axis-aligned bounding box. -pub type AABB = ncollide::bounding_volume::AABB; -/// Event triggered when two non-sensor colliders start or stop being in contact. -pub type ContactEvent = ncollide::pipeline::ContactEvent; -/// Event triggered when a sensor collider starts or stop being in proximity with another collider (sensor or not). -pub type ProximityEvent = ncollide::pipeline::ProximityEvent; +pub type AABB = buckler::bounding_volume::AABB; /// A ray that can be cast against colliders. -pub type Ray = ncollide::query::Ray; +pub type Ray = buckler::query::Ray; /// The intersection between a ray and a collider. -pub type RayIntersection = ncollide::query::RayIntersection; +pub type RayIntersection = buckler::query::RayIntersection; /// The the projection of a point on a collider. -pub type PointProjection = ncollide::query::PointProjection; +pub type PointProjection = buckler::query::PointProjection; + +#[derive(Copy, Clone, Hash, Debug)] +/// Events occurring when two collision objects start or stop being in contact (or penetration). +pub enum ContactEvent { + /// Event occurring when two collision objects start being in contact. + /// + /// This event is generated whenever the narrow-phase finds a contact between two collision objects that did not have any contact at the last update. + Started(ColliderHandle, ColliderHandle), + /// Event occurring when two collision objects stop being in contact. + /// + /// This event is generated whenever the narrow-phase fails to find any contact between two collision objects that did have at least one contact at the last update. + Stopped(ColliderHandle, ColliderHandle), +} + +#[derive(Copy, Clone, Debug)] +/// Events occurring when two collision objects start or stop being in close proximity, contact, or disjoint. +pub struct ProximityEvent { + /// 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, +} + +impl ProximityEvent { + /// 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." + ); + Self { + collider1, + collider2, + prev_status, + new_status, + } + } +} #[cfg(feature = "simd-is-enabled")] pub(crate) use self::ball::WBall; @@ -60,14 +105,7 @@ pub(crate) use self::broad_phase_multi_sap::{BroadPhasePairEvent, ColliderPair}; pub(crate) use self::collider_set::RemovedCollider; #[cfg(feature = "simd-is-enabled")] pub(crate) use self::contact::WContact; -pub(crate) use self::contact_generator::clip_segments; -#[cfg(feature = "dim2")] -pub(crate) use self::contact_generator::clip_segments_with_normal; pub(crate) use self::narrow_phase::ContactManifoldIndex; -#[cfg(feature = "dim3")] -pub(crate) use self::polygonal_feature_map::PolygonalFeatureMap; -#[cfg(feature = "dim3")] -pub(crate) use self::polyhedron_feature3d::PolyhedronFace; pub(crate) use self::waabb::{WRay, WAABB}; pub(crate) use self::wquadtree::WQuadtree; //pub(crate) use self::z_order::z_cmp_floats; @@ -80,16 +118,9 @@ mod collider; mod collider_set; mod contact; mod contact_generator; -pub(crate) mod cuboid; -#[cfg(feature = "dim2")] -mod cuboid_feature2d; -#[cfg(feature = "dim3")] -mod cuboid_feature3d; mod interaction_graph; mod narrow_phase; mod polygon; -#[cfg(feature = "dim3")] -mod polyhedron_feature3d; mod proximity; mod proximity_detector; pub(crate) mod sat; @@ -98,11 +129,8 @@ mod trimesh; mod waabb; mod wquadtree; //mod z_order; -mod capsule; mod interaction_groups; #[cfg(feature = "dim3")] -mod polygonal_feature_map; -#[cfg(feature = "dim3")] mod round_cylinder; mod shape; mod user_callbacks; -- cgit From cc6d1b973002b4d366bc81ec6bf9e8240ad7b404 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Mon, 14 Dec 2020 15:51:43 +0100 Subject: Outsource the Shape trait, wquadtree, and shape types. --- src/geometry/mod.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index caa229a..46fe360 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -13,9 +13,6 @@ pub use self::narrow_phase::NarrowPhase; pub use self::polygon::Polygon; pub use self::proximity::ProximityPair; pub use self::proximity_detector::{DefaultProximityDispatcher, ProximityDispatcher}; -#[cfg(feature = "dim3")] -pub use self::round_cylinder::RoundCylinder; -pub use self::trimesh::Trimesh; pub use self::user_callbacks::{ContactPairFilter, PairFilterContext, ProximityPairFilter}; pub use buckler::query::Proximity; @@ -106,11 +103,10 @@ pub(crate) use self::collider_set::RemovedCollider; #[cfg(feature = "simd-is-enabled")] pub(crate) use self::contact::WContact; pub(crate) use self::narrow_phase::ContactManifoldIndex; -pub(crate) use self::waabb::{WRay, WAABB}; -pub(crate) use self::wquadtree::WQuadtree; +pub(crate) use buckler::partitioning::WQuadtree; //pub(crate) use self::z_order::z_cmp_floats; pub use self::interaction_groups::InteractionGroups; -pub use self::shape::{Shape, ShapeType}; +pub use buckler::shape::*; mod ball; mod broad_phase_multi_sap; @@ -125,12 +121,6 @@ mod proximity; mod proximity_detector; pub(crate) mod sat; pub(crate) mod triangle; -mod trimesh; -mod waabb; -mod wquadtree; //mod z_order; mod interaction_groups; -#[cfg(feature = "dim3")] -mod round_cylinder; -mod shape; mod user_callbacks; -- cgit From e231bacec608fa5efd24f7a876572927dbd6c9c4 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Thu, 17 Dec 2020 10:24:36 +0100 Subject: Move all the contact manifold computations out of Rapier. --- src/geometry/mod.rs | 53 ++++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index 46fe360..9f32a7f 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -3,49 +3,49 @@ pub use self::broad_phase_multi_sap::BroadPhase; pub use self::collider::{Collider, ColliderBuilder, ColliderShape}; pub use self::collider_set::{ColliderHandle, ColliderSet}; -pub use self::contact::{ContactData, ContactManifoldData}; -pub use self::contact::{ContactPair, SolverFlags}; -pub use self::contact_generator::{ContactDispatcher, DefaultContactDispatcher}; +// pub use self::contact_generator::{ContactDispatcher, DefaultContactDispatcher}; +pub use self::contact_pair::{ContactData, ContactManifoldData}; +pub use self::contact_pair::{ContactPair, SolverFlags}; pub use self::interaction_graph::{ ColliderGraphIndex, InteractionGraph, RigidBodyGraphIndex, TemporaryInteractionIndex, }; pub use self::narrow_phase::NarrowPhase; pub use self::polygon::Polygon; -pub use self::proximity::ProximityPair; pub use self::proximity_detector::{DefaultProximityDispatcher, ProximityDispatcher}; +pub use self::proximity_pair::ProximityPair; pub use self::user_callbacks::{ContactPairFilter, PairFilterContext, ProximityPairFilter}; -pub use buckler::query::Proximity; +pub use eagl::query::Proximity; -pub use buckler::query::{KinematicsCategory, TrackedContact}; +pub use eagl::query::{KinematicsCategory, TrackedContact}; -pub type Contact = buckler::query::TrackedContact; -pub type ContactManifold = buckler::query::ContactManifold; +pub type Contact = eagl::query::TrackedContact; +pub type ContactManifold = eagl::query::ContactManifold; /// A segment shape. -pub type Segment = buckler::shape::Segment; +pub type Segment = eagl::shape::Segment; /// A cuboid shape. -pub type Cuboid = buckler::shape::Cuboid; +pub type Cuboid = eagl::shape::Cuboid; /// A triangle shape. -pub type Triangle = buckler::shape::Triangle; +pub type Triangle = eagl::shape::Triangle; /// A ball shape. -pub type Ball = buckler::shape::Ball; +pub type Ball = eagl::shape::Ball; /// A capsule shape. -pub type Capsule = buckler::shape::Capsule; +pub type Capsule = eagl::shape::Capsule; /// A heightfield shape. -pub type HeightField = buckler::shape::HeightField; +pub type HeightField = eagl::shape::HeightField; /// A cylindrical shape. #[cfg(feature = "dim3")] -pub type Cylinder = buckler::shape::Cylinder; +pub type Cylinder = eagl::shape::Cylinder; /// A cone shape. #[cfg(feature = "dim3")] -pub type Cone = buckler::shape::Cone; +pub type Cone = eagl::shape::Cone; /// An axis-aligned bounding box. -pub type AABB = buckler::bounding_volume::AABB; +pub type AABB = eagl::bounding_volume::AABB; /// A ray that can be cast against colliders. -pub type Ray = buckler::query::Ray; +pub type Ray = eagl::query::Ray; /// The intersection between a ray and a collider. -pub type RayIntersection = buckler::query::RayIntersection; +pub type RayIntersection = eagl::query::RayIntersection; /// The the projection of a point on a collider. -pub type PointProjection = buckler::query::PointProjection; +pub type PointProjection = eagl::query::PointProjection; #[derive(Copy, Clone, Hash, Debug)] /// Events occurring when two collision objects start or stop being in contact (or penetration). @@ -101,26 +101,25 @@ pub(crate) use self::ball::WBall; pub(crate) use self::broad_phase_multi_sap::{BroadPhasePairEvent, ColliderPair}; pub(crate) use self::collider_set::RemovedCollider; #[cfg(feature = "simd-is-enabled")] -pub(crate) use self::contact::WContact; +pub(crate) use self::contact_pair::WContact; pub(crate) use self::narrow_phase::ContactManifoldIndex; -pub(crate) use buckler::partitioning::WQuadtree; +pub(crate) use eagl::partitioning::WQuadtree; //pub(crate) use self::z_order::z_cmp_floats; pub use self::interaction_groups::InteractionGroups; -pub use buckler::shape::*; +pub use eagl::shape::*; mod ball; mod broad_phase_multi_sap; mod collider; mod collider_set; -mod contact; -mod contact_generator; +// mod contact_generator; +mod contact_pair; mod interaction_graph; mod narrow_phase; mod polygon; -mod proximity; mod proximity_detector; +mod proximity_pair; pub(crate) mod sat; -pub(crate) mod triangle; //mod z_order; mod interaction_groups; mod user_callbacks; -- cgit From 29717c2887b2db39faf9c25053730b661dc5da2b Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Thu, 17 Dec 2020 13:23:00 +0100 Subject: Externalize the proximity code (renamed intersection). --- src/geometry/mod.rs | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'src/geometry/mod.rs') 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; -- cgit From 8fe2df126a279a435cc544b150aadf8f7b757868 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Thu, 17 Dec 2020 18:37:16 +0100 Subject: Remove some irrelevant code. --- src/geometry/mod.rs | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index efb0cd4..2d0b5d9 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -10,39 +10,38 @@ pub use self::interaction_graph::{ ColliderGraphIndex, InteractionGraph, RigidBodyGraphIndex, TemporaryInteractionIndex, }; pub use self::narrow_phase::NarrowPhase; -pub use self::polygon::Polygon; -pub use self::user_callbacks::{ContactPairFilter, PairFilterContext, ProximityPairFilter}; +pub use self::pair_filter::{ContactPairFilter, PairFilterContext, ProximityPairFilter}; -pub use eagl::query::{KinematicsCategory, TrackedContact}; +pub use cdl::query::{KinematicsCategory, TrackedContact}; -pub type Contact = eagl::query::TrackedContact; -pub type ContactManifold = eagl::query::ContactManifold; +pub type Contact = cdl::query::TrackedContact; +pub type ContactManifold = cdl::query::ContactManifold; /// A segment shape. -pub type Segment = eagl::shape::Segment; +pub type Segment = cdl::shape::Segment; /// A cuboid shape. -pub type Cuboid = eagl::shape::Cuboid; +pub type Cuboid = cdl::shape::Cuboid; /// A triangle shape. -pub type Triangle = eagl::shape::Triangle; +pub type Triangle = cdl::shape::Triangle; /// A ball shape. -pub type Ball = eagl::shape::Ball; +pub type Ball = cdl::shape::Ball; /// A capsule shape. -pub type Capsule = eagl::shape::Capsule; +pub type Capsule = cdl::shape::Capsule; /// A heightfield shape. -pub type HeightField = eagl::shape::HeightField; +pub type HeightField = cdl::shape::HeightField; /// A cylindrical shape. #[cfg(feature = "dim3")] -pub type Cylinder = eagl::shape::Cylinder; +pub type Cylinder = cdl::shape::Cylinder; /// A cone shape. #[cfg(feature = "dim3")] -pub type Cone = eagl::shape::Cone; +pub type Cone = cdl::shape::Cone; /// An axis-aligned bounding box. -pub type AABB = eagl::bounding_volume::AABB; +pub type AABB = cdl::bounding_volume::AABB; /// A ray that can be cast against colliders. -pub type Ray = eagl::query::Ray; +pub type Ray = cdl::query::Ray; /// The intersection between a ray and a collider. -pub type RayIntersection = eagl::query::RayIntersection; +pub type RayIntersection = cdl::query::RayIntersection; /// The the projection of a point on a collider. -pub type PointProjection = eagl::query::PointProjection; +pub type PointProjection = cdl::query::PointProjection; #[derive(Copy, Clone, Hash, Debug)] /// Events occurring when two collision objects start or stop being in contact (or penetration). @@ -81,19 +80,16 @@ impl IntersectionEvent { } } -#[cfg(feature = "simd-is-enabled")] -pub(crate) use self::ball::WBall; pub(crate) use self::broad_phase_multi_sap::{BroadPhasePairEvent, ColliderPair}; pub(crate) use self::collider_set::RemovedCollider; #[cfg(feature = "simd-is-enabled")] pub(crate) use self::contact_pair::WContact; pub(crate) use self::narrow_phase::ContactManifoldIndex; -pub(crate) use eagl::partitioning::WQuadtree; +pub(crate) use cdl::partitioning::WQuadtree; //pub(crate) use self::z_order::z_cmp_floats; pub use self::interaction_groups::InteractionGroups; -pub use eagl::shape::*; +pub use cdl::shape::*; -mod ball; mod broad_phase_multi_sap; mod collider; mod collider_set; @@ -101,8 +97,6 @@ mod collider_set; mod contact_pair; mod interaction_graph; mod narrow_phase; -mod polygon; -pub(crate) mod sat; //mod z_order; mod interaction_groups; -mod user_callbacks; +mod pair_filter; -- cgit From 0d2eb5f2e00b3c9b1ae4d323280fd7c405582b2e Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Fri, 18 Dec 2020 15:26:39 +0100 Subject: Remove some commented code. --- src/geometry/mod.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index 2d0b5d9..4d16929 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -3,7 +3,6 @@ pub use self::broad_phase_multi_sap::BroadPhase; pub use self::collider::{Collider, ColliderBuilder, ColliderShape}; pub use self::collider_set::{ColliderHandle, ColliderSet}; -// pub use self::contact_generator::{ContactDispatcher, DefaultContactDispatcher}; pub use self::contact_pair::{ContactData, ContactManifoldData}; pub use self::contact_pair::{ContactPair, SolverFlags}; pub use self::interaction_graph::{ @@ -84,19 +83,16 @@ pub(crate) use self::broad_phase_multi_sap::{BroadPhasePairEvent, ColliderPair}; pub(crate) use self::collider_set::RemovedCollider; #[cfg(feature = "simd-is-enabled")] pub(crate) use self::contact_pair::WContact; +pub use self::interaction_groups::InteractionGroups; pub(crate) use self::narrow_phase::ContactManifoldIndex; pub(crate) use cdl::partitioning::WQuadtree; -//pub(crate) use self::z_order::z_cmp_floats; -pub use self::interaction_groups::InteractionGroups; pub use cdl::shape::*; mod broad_phase_multi_sap; mod collider; mod collider_set; -// mod contact_generator; mod contact_pair; mod interaction_graph; -mod narrow_phase; -//mod z_order; mod interaction_groups; +mod narrow_phase; mod pair_filter; -- cgit From 94c67a0c31e9da373c3aca3560dc9accc3308a7a Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Mon, 28 Dec 2020 18:12:33 +0100 Subject: Support compound shapes. --- src/geometry/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index 4d16929..0e8a288 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -85,7 +85,7 @@ pub(crate) use self::collider_set::RemovedCollider; pub(crate) use self::contact_pair::WContact; pub use self::interaction_groups::InteractionGroups; pub(crate) use self::narrow_phase::ContactManifoldIndex; -pub(crate) use cdl::partitioning::WQuadtree; +pub(crate) use cdl::partitioning::SimdQuadTree; pub use cdl::shape::*; mod broad_phase_multi_sap; -- cgit From 43628c8846c8805d2f835dda4182b7240292900c Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Wed, 30 Dec 2020 17:30:07 +0100 Subject: Try using solver contacts again, but in a more cache-coherent way. --- src/geometry/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index 0e8a288..cfc3086 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -4,7 +4,7 @@ pub use self::broad_phase_multi_sap::BroadPhase; pub use self::collider::{Collider, ColliderBuilder, ColliderShape}; pub use self::collider_set::{ColliderHandle, ColliderSet}; pub use self::contact_pair::{ContactData, ContactManifoldData}; -pub use self::contact_pair::{ContactPair, SolverFlags}; +pub use self::contact_pair::{ContactPair, SolverContact, SolverFlags}; pub use self::interaction_graph::{ ColliderGraphIndex, InteractionGraph, RigidBodyGraphIndex, TemporaryInteractionIndex, }; -- cgit From 348a339fe350aff6d885cb5a857a0bb6afbea990 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Thu, 31 Dec 2020 10:02:51 +0100 Subject: Remove code related to point-point kinematics. --- src/geometry/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index cfc3086..23e34cc 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -11,7 +11,7 @@ pub use self::interaction_graph::{ pub use self::narrow_phase::NarrowPhase; pub use self::pair_filter::{ContactPairFilter, PairFilterContext, ProximityPairFilter}; -pub use cdl::query::{KinematicsCategory, TrackedContact}; +pub use cdl::query::TrackedContact; pub type Contact = cdl::query::TrackedContact; pub type ContactManifold = cdl::query::ContactManifold; -- cgit From 967145a9492175be59e8db33299b1687d69d84e2 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Thu, 31 Dec 2020 11:16:03 +0100 Subject: Perform contact sorting in the narrow-phase directly. --- src/geometry/mod.rs | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index 23e34cc..2b6d14f 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -81,8 +81,6 @@ impl IntersectionEvent { pub(crate) use self::broad_phase_multi_sap::{BroadPhasePairEvent, ColliderPair}; pub(crate) use self::collider_set::RemovedCollider; -#[cfg(feature = "simd-is-enabled")] -pub(crate) use self::contact_pair::WContact; pub use self::interaction_groups::InteractionGroups; pub(crate) use self::narrow_phase::ContactManifoldIndex; pub(crate) use cdl::partitioning::SimdQuadTree; -- cgit From 7b098606c230256c72b73291c15cbd5fabe02653 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Thu, 31 Dec 2020 16:30:38 +0100 Subject: QueryPipeline: add shape casting, point projection, and intersection queries. --- src/geometry/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index 2b6d14f..ac7e63b 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -86,6 +86,15 @@ pub(crate) use self::narrow_phase::ContactManifoldIndex; pub(crate) use cdl::partitioning::SimdQuadTree; pub use cdl::shape::*; +pub(crate) fn default_persistent_query_dispatcher( +) -> std::sync::Arc> { + std::sync::Arc::new(cdl::query::DefaultQueryDispatcher) +} + +pub(crate) fn default_query_dispatcher() -> std::sync::Arc { + std::sync::Arc::new(cdl::query::DefaultQueryDispatcher) +} + mod broad_phase_multi_sap; mod collider; mod collider_set; -- cgit From 98d3980db7a9803f4ee965237599a87771a417d1 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Thu, 21 Jan 2021 16:03:27 +0100 Subject: Allow several rules for combining friction/restitution coefficients. --- src/geometry/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index ac7e63b..75fbb75 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -1,13 +1,15 @@ //! Structures related to geometry: colliders, shapes, etc. pub use self::broad_phase_multi_sap::BroadPhase; -pub use self::collider::{Collider, ColliderBuilder, ColliderShape}; +pub use self::collider::{Collider, ColliderBuilder}; pub use self::collider_set::{ColliderHandle, ColliderSet}; +pub use self::collider_shape::ColliderShape; pub use self::contact_pair::{ContactData, ContactManifoldData}; pub use self::contact_pair::{ContactPair, SolverContact, SolverFlags}; pub use self::interaction_graph::{ ColliderGraphIndex, InteractionGraph, RigidBodyGraphIndex, TemporaryInteractionIndex, }; +pub use self::interaction_groups::InteractionGroups; pub use self::narrow_phase::NarrowPhase; pub use self::pair_filter::{ContactPairFilter, PairFilterContext, ProximityPairFilter}; @@ -81,7 +83,6 @@ impl IntersectionEvent { pub(crate) use self::broad_phase_multi_sap::{BroadPhasePairEvent, ColliderPair}; pub(crate) use self::collider_set::RemovedCollider; -pub use self::interaction_groups::InteractionGroups; pub(crate) use self::narrow_phase::ContactManifoldIndex; pub(crate) use cdl::partitioning::SimdQuadTree; pub use cdl::shape::*; @@ -98,6 +99,7 @@ pub(crate) fn default_query_dispatcher() -> std::sync::Arc Date: Fri, 22 Jan 2021 18:10:54 +0100 Subject: Move ColliderShape out of Rapier. --- src/geometry/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index 75fbb75..9323ffc 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -3,7 +3,6 @@ pub use self::broad_phase_multi_sap::BroadPhase; pub use self::collider::{Collider, ColliderBuilder}; pub use self::collider_set::{ColliderHandle, ColliderSet}; -pub use self::collider_shape::ColliderShape; pub use self::contact_pair::{ContactData, ContactManifoldData}; pub use self::contact_pair::{ContactPair, SolverContact, SolverFlags}; pub use self::interaction_graph::{ @@ -43,6 +42,7 @@ pub type Ray = cdl::query::Ray; pub type RayIntersection = cdl::query::RayIntersection; /// The the projection of a point on a collider. pub type PointProjection = cdl::query::PointProjection; +pub use cdl::shape::SharedShape; #[derive(Copy, Clone, Hash, Debug)] /// Events occurring when two collision objects start or stop being in contact (or penetration). @@ -99,7 +99,6 @@ pub(crate) fn default_query_dispatcher() -> std::sync::Arc Date: Sat, 23 Jan 2021 13:11:00 +0100 Subject: Fix WASM build. --- src/geometry/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index 9323ffc..9666589 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -87,11 +87,13 @@ pub(crate) use self::narrow_phase::ContactManifoldIndex; pub(crate) use cdl::partitioning::SimdQuadTree; pub use cdl::shape::*; +#[cfg(feature = "serde-serialize")] pub(crate) fn default_persistent_query_dispatcher( ) -> std::sync::Arc> { std::sync::Arc::new(cdl::query::DefaultQueryDispatcher) } +#[cfg(feature = "serde-serialize")] pub(crate) fn default_query_dispatcher() -> std::sync::Arc { std::sync::Arc::new(cdl::query::DefaultQueryDispatcher) } -- cgit From 8f7220f03d3c23574b9ece09d81d32e862f1b5c6 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Sun, 24 Jan 2021 11:13:44 +0100 Subject: Rename cdl to parry. --- src/geometry/mod.rs | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index 9666589..6b8aebf 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -10,39 +10,39 @@ pub use self::interaction_graph::{ }; pub use self::interaction_groups::InteractionGroups; pub use self::narrow_phase::NarrowPhase; -pub use self::pair_filter::{ContactPairFilter, PairFilterContext, ProximityPairFilter}; +pub use self::pair_filter::{ContactPairFilter, IntersectionPairFilter, PairFilterContext}; -pub use cdl::query::TrackedContact; +pub use parry::query::TrackedContact; -pub type Contact = cdl::query::TrackedContact; -pub type ContactManifold = cdl::query::ContactManifold; +pub type Contact = parry::query::TrackedContact; +pub type ContactManifold = parry::query::ContactManifold; /// A segment shape. -pub type Segment = cdl::shape::Segment; +pub type Segment = parry::shape::Segment; /// A cuboid shape. -pub type Cuboid = cdl::shape::Cuboid; +pub type Cuboid = parry::shape::Cuboid; /// A triangle shape. -pub type Triangle = cdl::shape::Triangle; +pub type Triangle = parry::shape::Triangle; /// A ball shape. -pub type Ball = cdl::shape::Ball; +pub type Ball = parry::shape::Ball; /// A capsule shape. -pub type Capsule = cdl::shape::Capsule; +pub type Capsule = parry::shape::Capsule; /// A heightfield shape. -pub type HeightField = cdl::shape::HeightField; +pub type HeightField = parry::shape::HeightField; /// A cylindrical shape. #[cfg(feature = "dim3")] -pub type Cylinder = cdl::shape::Cylinder; +pub type Cylinder = parry::shape::Cylinder; /// A cone shape. #[cfg(feature = "dim3")] -pub type Cone = cdl::shape::Cone; +pub type Cone = parry::shape::Cone; /// An axis-aligned bounding box. -pub type AABB = cdl::bounding_volume::AABB; +pub type AABB = parry::bounding_volume::AABB; /// A ray that can be cast against colliders. -pub type Ray = cdl::query::Ray; +pub type Ray = parry::query::Ray; /// The intersection between a ray and a collider. -pub type RayIntersection = cdl::query::RayIntersection; +pub type RayIntersection = parry::query::RayIntersection; /// The the projection of a point on a collider. -pub type PointProjection = cdl::query::PointProjection; -pub use cdl::shape::SharedShape; +pub type PointProjection = parry::query::PointProjection; +pub use parry::shape::SharedShape; #[derive(Copy, Clone, Hash, Debug)] /// Events occurring when two collision objects start or stop being in contact (or penetration). @@ -84,18 +84,18 @@ impl IntersectionEvent { pub(crate) use self::broad_phase_multi_sap::{BroadPhasePairEvent, ColliderPair}; pub(crate) use self::collider_set::RemovedCollider; pub(crate) use self::narrow_phase::ContactManifoldIndex; -pub(crate) use cdl::partitioning::SimdQuadTree; -pub use cdl::shape::*; +pub(crate) use parry::partitioning::SimdQuadTree; +pub use parry::shape::*; #[cfg(feature = "serde-serialize")] pub(crate) fn default_persistent_query_dispatcher( -) -> std::sync::Arc> { - std::sync::Arc::new(cdl::query::DefaultQueryDispatcher) +) -> std::sync::Arc> { + std::sync::Arc::new(parry::query::DefaultQueryDispatcher) } #[cfg(feature = "serde-serialize")] -pub(crate) fn default_query_dispatcher() -> std::sync::Arc { - std::sync::Arc::new(cdl::query::DefaultQueryDispatcher) +pub(crate) fn default_query_dispatcher() -> std::sync::Arc { + std::sync::Arc::new(parry::query::DefaultQueryDispatcher) } mod broad_phase_multi_sap; -- cgit From 4799a81214d3b2ea5ee69220ea179f44142d40cc Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Mon, 25 Jan 2021 17:22:57 +0100 Subject: Add missing constructor for a round-triangle collider. --- src/geometry/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index 6b8aebf..d1c4161 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -42,6 +42,8 @@ pub type Ray = parry::query::Ray; pub type RayIntersection = parry::query::RayIntersection; /// The the projection of a point on a collider. 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; #[derive(Copy, Clone, Hash, Debug)] -- cgit From 8ff2bcc3ec666805aceedaa477bde89f2a577d1c Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Wed, 27 Jan 2021 14:20:14 +0100 Subject: Add all the missing docs. --- src/geometry/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/geometry/mod.rs') diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index d1c4161..861763e 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -14,7 +14,9 @@ pub use self::pair_filter::{ContactPairFilter, IntersectionPairFilter, PairFilte pub use parry::query::TrackedContact; +/// A contact between two colliders. pub type Contact = parry::query::TrackedContact; +/// A contact manifold between two colliders. pub type ContactManifold = parry::query::ContactManifold; /// A segment shape. pub type Segment = parry::shape::Segment; -- cgit