ncollide3d/query/point/
point_shape.rsuse crate::math::{Isometry, Point};
use crate::query::{PointProjection, PointQuery};
use crate::shape::{FeatureId, Shape};
use na::RealField;
impl<N: RealField + Copy> PointQuery<N> for dyn Shape<N> {
#[inline]
fn project_point(&self, m: &Isometry<N>, pt: &Point<N>, solid: bool) -> PointProjection<N> {
self.as_point_query()
.expect("No PointQuery implementation for the underlying shape.")
.project_point(m, pt, solid)
}
#[inline]
fn project_point_with_feature(
&self,
m: &Isometry<N>,
pt: &Point<N>,
) -> (PointProjection<N>, FeatureId) {
self.as_point_query()
.expect("No PointQuery implementation for the underlying shape.")
.project_point_with_feature(m, pt)
}
#[inline]
fn distance_to_point(&self, m: &Isometry<N>, pt: &Point<N>, solid: bool) -> N {
self.as_point_query()
.expect("No PointQuery implementation for the underlying shape.")
.distance_to_point(m, pt, solid)
}
#[inline]
fn contains_point(&self, m: &Isometry<N>, pt: &Point<N>) -> bool {
self.as_point_query()
.expect("No PointQuery implementation for the underlying shape.")
.contains_point(m, pt)
}
}