[][src]Trait broccoli::query::RayCast

pub trait RayCast {
    type T: Aabb<Num = Self::N>;
    type N: Num;
    pub fn compute_distance_to_rect(
        &mut self,
        ray: &Ray<Self::N>,
        a: &Rect<Self::N>
    ) -> CastResult<Self::N>; pub fn compute_distance_to_bot(
        &mut self,
        ray: &Ray<Self::N>,
        a: &Self::T
    ) -> CastResult<Self::N> { ... } }

A Vec is returned since there coule be ties where the ray hits multiple T at a length N away. This is the trait that defines raycast specific geometric functions that are needed by this raytracing algorithm. By containing all these functions in this trait, we can keep the trait bounds of the underlying Num to a minimum of only needing Ord.

Associated Types

type T: Aabb<Num = Self::N>[src]

type N: Num[src]

Loading content...

Required methods

pub fn compute_distance_to_rect(
    &mut self,
    ray: &Ray<Self::N>,
    a: &Rect<Self::N>
) -> CastResult<Self::N>
[src]

Returns true if the ray intersects with this rectangle. This function allows as to prune which nodes to visit.

Loading content...

Provided methods

pub fn compute_distance_to_bot(
    &mut self,
    ray: &Ray<Self::N>,
    a: &Self::T
) -> CastResult<Self::N>
[src]

The expensive collision detection This is where the user can do expensive collision detection on the shape contains within it's bounding box. Its default implementation just calls compute_distance_to_rect()

Loading content...

Implementors

Loading content...