pub trait ShapeQuery {
// Required methods
fn ray_cast(
&self,
ray_origin: [f64; 3],
ray_dir: [f64; 3],
max_toi: f64,
) -> Option<RayCastResult>;
fn point_query(&self, point: [f64; 3]) -> PointQueryResult;
fn aabb(&self) -> ([f64; 3], [f64; 3]);
}Expand description
Common shape query interface.
Required Methods§
Sourcefn ray_cast(
&self,
ray_origin: [f64; 3],
ray_dir: [f64; 3],
max_toi: f64,
) -> Option<RayCastResult>
fn ray_cast( &self, ray_origin: [f64; 3], ray_dir: [f64; 3], max_toi: f64, ) -> Option<RayCastResult>
Cast a ray from ray_origin in direction ray_dir (need not be normalised)
up to parameter max_toi. Returns None when there is no hit.
Sourcefn point_query(&self, point: [f64; 3]) -> PointQueryResult
fn point_query(&self, point: [f64; 3]) -> PointQueryResult
Find the closest point on the shape to point and return it together
with the signed distance and an inside flag.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".