Trait parry3d::query::point::PointQueryWithLocation
source · pub trait PointQueryWithLocation {
type Location;
// Required method
fn project_local_point_and_get_location(
&self,
pt: &Point<Real>,
solid: bool
) -> (PointProjection, Self::Location);
// Provided methods
fn project_point_and_get_location(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> (PointProjection, Self::Location) { ... }
fn project_local_point_and_get_location_with_max_dist(
&self,
pt: &Point<Real>,
solid: bool,
max_dist: Real
) -> Option<(PointProjection, Self::Location)> { ... }
fn project_point_and_get_location_with_max_dist(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool,
max_dist: Real
) -> Option<(PointProjection, Self::Location)> { ... }
}
Expand description
Returns shape-specific info in addition to generic projection information
One requirement for the PointQuery
trait is to be usable as a trait
object. Unfortunately this precludes us from adding an associated type to it
that might allow us to return shape-specific information in addition to the
general information provided in PointProjection
. This is where
PointQueryWithLocation
comes in. It forgoes the ability to be used as a trait
object in exchange for being able to provide shape-specific projection
information.
Any shapes that implement PointQuery
but are able to provide extra
information, can implement PointQueryWithLocation
in addition and have their
PointQuery::project_point
implementation just call out to
PointQueryWithLocation::project_point_and_get_location
.
Required Associated Types§
Required Methods§
sourcefn project_local_point_and_get_location(
&self,
pt: &Point<Real>,
solid: bool
) -> (PointProjection, Self::Location)
fn project_local_point_and_get_location( &self, pt: &Point<Real>, solid: bool ) -> (PointProjection, Self::Location)
Projects a point on self
.
Provided Methods§
sourcefn project_point_and_get_location(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> (PointProjection, Self::Location)
fn project_point_and_get_location( &self, m: &Isometry<Real>, pt: &Point<Real>, solid: bool ) -> (PointProjection, Self::Location)
Projects a point on self
transformed by m
.
sourcefn project_local_point_and_get_location_with_max_dist(
&self,
pt: &Point<Real>,
solid: bool,
max_dist: Real
) -> Option<(PointProjection, Self::Location)>
fn project_local_point_and_get_location_with_max_dist( &self, pt: &Point<Real>, solid: bool, max_dist: Real ) -> Option<(PointProjection, Self::Location)>
Projects a point on self
, with a maximum projection distance.