parry3d/query/
mod.rs

1//! Non-persistent geometric queries.
2//!
3//! # General cases
4//! The most general methods provided by this module are:
5//!
6//! * [`closest_points()`] to compute the closest points between two shapes.
7//! * [`distance()`] to compute the distance between two shapes.
8//! * [`contact()`] to compute one pair of contact points between two shapes, including penetrating contact.
9//! * [`intersection_test()`] to determine if two shapes are intersecting or not.
10//! * [`cast_shapes()`] to determine when two shapes undergoing translational motions hit for the first time.
11//! * [`cast_shapes_nonlinear()`] to determine when two shapes undergoing continuous rigid motions hit for the first time.
12//!
13//! Ray-casting and point-projection can be achieved by importing traits:
14//!
15//! * [`RayCast`] for ray-casting.
16//! * [`PointQuery`] for point projection.
17//!
18//! # Specific cases
19//! The functions exported by the `details` submodule are more specific versions of the ones described above.
20//! For example `distance_ball_ball` computes the distance between two shapes known at compile-time to be balls.
21//! They are less convenient to use than the most generic version but will be slightly faster due to the lack of dynamic dispatch.
22//! The specific functions have the form `[operation]_[shape1]_[shape2]()` where:
23//!
24//! * `[operation]` can be `closest_points`, `distance`, `contact`, `intersection_test` or `time_of_impact`.
25//! * `[shape1]` is the type of the first shape passed to the function, e.g., `ball`, or `halfspace`. Can also identify a trait implemented by supported shapes, e.g., `support_map`.
26//! * `[shape2]` is the type of the second shape passed to the function, e.g., `ball`, or `halfspace`. Can also identify a trait implemented by supported shapes, e.g., `support_map`.
27
28pub use self::closest_points::{closest_points, ClosestPoints};
29pub use self::contact::{contact, Contact};
30#[cfg(feature = "alloc")]
31pub use self::contact_manifolds::{
32    ContactManifold, ContactManifoldsWorkspace, TrackedContact, TypedWorkspaceData, WorkspaceData,
33};
34pub use self::default_query_dispatcher::DefaultQueryDispatcher;
35pub use self::distance::distance;
36pub use self::error::Unsupported;
37pub use self::intersection_test::intersection_test;
38pub use self::nonlinear_shape_cast::{cast_shapes_nonlinear, NonlinearRigidMotion};
39pub use self::point::{PointProjection, PointQuery, PointQueryWithLocation};
40#[cfg(feature = "alloc")]
41pub use self::query_dispatcher::PersistentQueryDispatcher;
42pub use self::query_dispatcher::{QueryDispatcher, QueryDispatcherChain};
43pub use self::ray::{Ray, RayCast, RayIntersection, SimdRay};
44pub use self::shape_cast::{cast_shapes, ShapeCastHit, ShapeCastOptions, ShapeCastStatus};
45pub use self::split::{IntersectResult, SplitResult};
46
47#[cfg(all(feature = "dim3", feature = "alloc"))]
48pub use self::ray::RayCullingMode;
49
50mod clip;
51pub mod closest_points;
52pub mod contact;
53#[cfg(feature = "alloc")]
54mod contact_manifolds;
55mod default_query_dispatcher;
56mod distance;
57#[cfg(feature = "alloc")]
58pub mod epa;
59mod error;
60pub mod gjk;
61mod intersection_test;
62mod nonlinear_shape_cast;
63pub mod point;
64mod query_dispatcher;
65mod ray;
66pub mod sat;
67mod shape_cast;
68mod split;
69
70/// Queries dedicated to specific pairs of shapes.
71pub mod details {
72    pub use super::clip::*;
73    pub use super::closest_points::*;
74    pub use super::contact::*;
75    #[cfg(feature = "alloc")]
76    pub use super::contact_manifolds::*;
77    pub use super::distance::*;
78    pub use super::intersection_test::*;
79    pub use super::nonlinear_shape_cast::*;
80    pub use super::point::*;
81    pub use super::ray::*;
82    pub use super::shape_cast::*;
83}