pub trait RayCast<N>where
    N: RealField + Copy,{
    // Required method
    fn toi_and_normal_with_ray(
        &self,
        m: &Isometry<N, Unit<Complex<N>>, 2>,
        ray: &Ray<N>,
        max_toi: N,
        solid: bool
    ) -> Option<RayIntersection<N>>;

    // Provided methods
    fn toi_with_ray(
        &self,
        m: &Isometry<N, Unit<Complex<N>>, 2>,
        ray: &Ray<N>,
        max_toi: N,
        solid: bool
    ) -> Option<N> { ... }
    fn intersects_ray(
        &self,
        m: &Isometry<N, Unit<Complex<N>>, 2>,
        ray: &Ray<N>,
        max_toi: N
    ) -> bool { ... }
}
Expand description

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

Required Methods§

source

fn toi_and_normal_with_ray( &self, m: &Isometry<N, Unit<Complex<N>>, 2>, ray: &Ray<N>, max_toi: N, solid: bool ) -> Option<RayIntersection<N>>

Computes the time of impact, and normal between this transformed shape and a ray.

Provided Methods§

source

fn toi_with_ray( &self, m: &Isometry<N, Unit<Complex<N>>, 2>, ray: &Ray<N>, max_toi: N, solid: bool ) -> Option<N>

Computes the time of impact between this transform shape and a ray.

source

fn intersects_ray( &self, m: &Isometry<N, Unit<Complex<N>>, 2>, ray: &Ray<N>, max_toi: N ) -> bool

Tests whether a ray intersects this transformed shape.

Implementors§

source§

impl<N> RayCast<N> for AABB<N>where N: RealField + Copy,

source§

impl<N> RayCast<N> for BoundingSphere<N>where N: RealField + Copy,

source§

impl<N> RayCast<N> for Ball<N>where N: RealField + Copy,

source§

impl<N> RayCast<N> for Capsule<N>where N: RealField + Copy,

source§

impl<N> RayCast<N> for Compound<N>where N: RealField + Copy,

source§

impl<N> RayCast<N> for ConvexPolygon<N>where N: RealField + Copy,

source§

impl<N> RayCast<N> for Cuboid<N>where N: RealField + Copy,

source§

impl<N> RayCast<N> for HeightField<N>where N: RealField + Copy,

source§

impl<N> RayCast<N> for Plane<N>where N: RealField + Copy,

source§

impl<N> RayCast<N> for Polyline<N>where N: RealField + Copy,

source§

impl<N> RayCast<N> for Segment<N>where N: RealField + Copy,

source§

impl<N> RayCast<N> for Triangle<N>where N: RealField + Copy,

source§

impl<N> RayCast<N> for dyn Shape<N>where N: RealField + Copy,