# [−][src]Module parry3d::query

Non-persistent geometric queries.

# General cases

The most general methods provided by this module are:

- [
`query::closest_points()`

] to compute the closest points between two shapes. - [
`query::distance()`

] to compute the distance between two shapes. - [
`query::contact()`

] to compute one pair of contact points between two shapes, including penetrating contact. - [
`query::intersection_test()`

] to determine if two shapes are intersecting or not. - [
`query::time_of_impact()`

] to determine when two shapes undergoing translational motions hit for the first time. - [
`query::nonlinear_time_of_impact()`

] to determine when two shapes undergoing continuous rigid motions hit for the first time.

Ray-casting and point-projection can be achieved by importing traits:

- [
`query::RayCast`

] for ray-casting. - [
`query::PointQuery`

] for point projection.

# Specific cases

The functions exported by the `details`

submodule are more specific versions of the ones described above.
For example `distance_ball_ball`

computes the distance between two shapes known at compile-time to be balls.
They are less convenient to use than the most generic version but will be slightly faster due to the lack of dynamic dispatch.
The specific functions have the form `[operation]_[shape1]_[shape2]()`

where:

`[operation]`

can be`closest_points`

,`distance`

,`contact`

,`intersection_test`

or`time_of_impact`

.`[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`

.`[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`

.

## Modules

closest_points | Implementation details of the |

contact | Implementation details of the |

details | Queries dedicated to specific pairs of shapes. |

epa | The EPA algorithm for penetration depth computation. |

gjk | The GJK algorithm for distance computation. |

point | Point inclusion and projection. |

sat | Application of the Separating-Axis-Theorem (SAT). |

visitors | Visitors for performing geometric queries exploiting spatial partitioning data structures. |

## Structs

Contact | Geometric description of a contact. |

ContactManifold | A contact manifold between two shapes. |

ContactManifoldsWorkspace | A serializable workspace used by some contact-manifolds computation algorithms. |

DefaultQueryDispatcher | A dispatcher that exposes built-in queries |

PointProjection | Description of the projection of a point on a shape. |

QueryDispatcherChain | The composition of two dispatchers |

Ray | A Ray. |

RayIntersection | Structure containing the result of a successful ray cast. |

SimdRay | A structure representing 4 rays in an SIMD SoA fashion. |

TOI | The result of a time-of-impact (TOI) computation. |

TrackedContact | A single contact between two shape. |

Unsupported | Error indicating that a query is not supported between certain shapes |

## Enums

ClosestPoints | Closest points information. |

TOIStatus | The status of the time-of-impact computation algorithm. |

## Traits

PersistentQueryDispatcher | A query dispatcher for queries relying on spatial coherence, including contact-manifold computation. |

PointQuery | Trait of objects that can be tested for point inclusion and projection. |

PointQueryWithLocation | Returns shape-specific info in addition to generic projection information |

QueryDispatcher | Dispatcher for pairwise queries. |

RayCast | Traits of objects which can be transformed and tested for intersection with a ray. |

## Functions

closest_points | Computes the pair of closest points between two shapes. |

contact | Computes one pair of contact points point between two shapes. |

distance | Computes the minimum distance separating two shapes. |

intersection_test | Tests whether two shapes are intersecting. |

nonlinear_time_of_impact | Computes the smallest time of impact of two shapes under arbitrary smooth movement. |

time_of_impact | Computes the smallest time when two shapes under translational movement are separated by a
distance smaller or equal to |