Trait heron::rapier_plugin::rapier::parry::query::QueryDispatcher[][src]

pub trait QueryDispatcher: Send + Sync {
    pub fn intersection_test(
        &self,
        pos12: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>,
        g1: &(dyn Shape + 'static),
        g2: &(dyn Shape + 'static)
    ) -> Result<bool, Unsupported>;
pub fn distance(
        &self,
        pos12: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>,
        g1: &(dyn Shape + 'static),
        g2: &(dyn Shape + 'static)
    ) -> Result<f32, Unsupported>;
pub fn contact(
        &self,
        pos12: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>,
        g1: &(dyn Shape + 'static),
        g2: &(dyn Shape + 'static),
        prediction: f32
    ) -> Result<Option<Contact>, Unsupported>;
pub fn closest_points(
        &self,
        pos12: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>,
        g1: &(dyn Shape + 'static),
        g2: &(dyn Shape + 'static),
        max_dist: f32
    ) -> Result<ClosestPoints, Unsupported>;
pub fn time_of_impact(
        &self,
        pos12: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>,
        local_vel12: &Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>,
        g1: &(dyn Shape + 'static),
        g2: &(dyn Shape + 'static),
        max_toi: f32
    ) -> Result<Option<TOI>, Unsupported>;
pub fn nonlinear_time_of_impact(
        &self,
        motion1: &NonlinearRigidMotion,
        g1: &(dyn Shape + 'static),
        motion2: &NonlinearRigidMotion,
        g2: &(dyn Shape + 'static),
        start_time: f32,
        end_time: f32,
        stop_at_penetration: bool
    ) -> Result<Option<TOI>, Unsupported>; pub fn chain<U>(self, other: U) -> QueryDispatcherChain<Self, U>
    where
        U: QueryDispatcher
, { ... } }

Dispatcher for pairwise queries.

Custom implementations allow crates that support an abstract QueryDispatcher to handle custom shapes.

The pos12 argument to most queries is the transform from the local space of g2 to that of g1.

Required methods

pub fn intersection_test(
    &self,
    pos12: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>,
    g1: &(dyn Shape + 'static),
    g2: &(dyn Shape + 'static)
) -> Result<bool, Unsupported>
[src]

Tests whether two shapes are intersecting.

pub fn distance(
    &self,
    pos12: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>,
    g1: &(dyn Shape + 'static),
    g2: &(dyn Shape + 'static)
) -> Result<f32, Unsupported>
[src]

Computes the minimum distance separating two shapes.

Returns 0.0 if the objects are touching or penetrating.

pub fn contact(
    &self,
    pos12: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>,
    g1: &(dyn Shape + 'static),
    g2: &(dyn Shape + 'static),
    prediction: f32
) -> Result<Option<Contact>, Unsupported>
[src]

Computes one pair of contact points point between two shapes.

Returns None if the objects are separated by a distance greater than prediction.

pub fn closest_points(
    &self,
    pos12: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>,
    g1: &(dyn Shape + 'static),
    g2: &(dyn Shape + 'static),
    max_dist: f32
) -> Result<ClosestPoints, Unsupported>
[src]

Computes the pair of closest points between two shapes.

Returns ClosestPoints::Disjoint if the objects are separated by a distance greater than max_dist.

pub fn time_of_impact(
    &self,
    pos12: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>,
    local_vel12: &Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>,
    g1: &(dyn Shape + 'static),
    g2: &(dyn Shape + 'static),
    max_toi: f32
) -> Result<Option<TOI>, Unsupported>
[src]

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

Returns 0.0 if the objects are touching or penetrating.

Parameters

  • pos12: the position of the second shape relative to the first shape.
  • local_vel12: the relative velocity between the two shapes, expressed in the local-space of the first shape. In other world: pos1.inverse() * (vel2 - vel1).
  • g1: the first shape involved in the TOI computation.
  • g2: the second shape involved in the TOI computation.
  • max_toi: the maximum allowed TOI. This method returns None if the time-of-impact detected is theater than this value.

pub fn nonlinear_time_of_impact(
    &self,
    motion1: &NonlinearRigidMotion,
    g1: &(dyn Shape + 'static),
    motion2: &NonlinearRigidMotion,
    g2: &(dyn Shape + 'static),
    start_time: f32,
    end_time: f32,
    stop_at_penetration: bool
) -> Result<Option<TOI>, Unsupported>
[src]

Computes the smallest time of impact of two shapes under translational and rotational movement.

Parameters

  • motion1 - The motion of the first shape.
  • g1 - The first shape involved in the query.
  • motion2 - The motion of the second shape.
  • g2 - The second shape involved in the query.
  • start_time - The starting time of the interval where the motion takes place.
  • end_time - The end time of the interval where the motion takes place.
  • stop_at_penetration - If the casted shape starts in a penetration state with any collider, two results are possible. If stop_at_penetration is true then, the result will have a toi equal to start_time. If stop_at_penetration is false then the nonlinear shape-casting will see if further motion wrt. the penetration normal would result in tunnelling. If it does not (i.e. we have a separating velocity along that normal) then the nonlinear shape-casting will attempt to find another impact, at a time > start_time that could result in tunnelling.
Loading content...

Provided methods

pub fn chain<U>(self, other: U) -> QueryDispatcherChain<Self, U> where
    U: QueryDispatcher
[src]

Construct a QueryDispatcher that falls back on other for cases not handled by self

Loading content...

Implementors

impl QueryDispatcher for DefaultQueryDispatcher[src]

pub fn distance(
    &self,
    pos12: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>,
    shape1: &(dyn Shape + 'static),
    shape2: &(dyn Shape + 'static)
) -> Result<f32, Unsupported>
[src]

Computes the minimum distance separating two shapes.

Returns 0.0 if the objects are touching or penetrating.

impl<T, U> QueryDispatcher for QueryDispatcherChain<T, U> where
    T: QueryDispatcher,
    U: QueryDispatcher
[src]

Loading content...