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

pub trait RayCast {
    type T: Aabb<Num = Self::N>;
    type N: Num;
    fn cast_to_aaline<A: Axis>(
        &mut self,
        ray: &Ray<Self::N>,
        line: A,
        val: Self::N
    ) -> CastResult<Self::N>;
fn cast_broad(
        &mut self,
        ray: &Ray<Self::N>,
        a: PMut<'_, Self::T>
    ) -> Option<CastResult<Self::N>>;
fn cast_fine(
        &mut self,
        ray: &Ray<Self::N>,
        a: PMut<'_, Self::T>
    ) -> CastResult<Self::N>; }
Expand description

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

Required methods

Return the cast result to a axis aligned line of infinite length.

Return the cast result that is cheap and overly conservative. It may be that the precise cast is fast enough, in which case you can simply return None. If None is desired, every call to this function for a particular element must always return None.

Return the exact cast result.

Implementors