[−][src]Trait dinotree_alg::query::RayTrait
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 NumTrait to a minimum of only needing Ord.
Associated Types
Loading content...Required methods
fn compute_distance_to_rect(
&self,
ray: &Ray<Self::N>,
a: &Rect<Self::N>
) -> RayIntersectResult<Self::N>
&self,
ray: &Ray<Self::N>,
a: &Rect<Self::N>
) -> RayIntersectResult<Self::N>
Returns true if the ray intersects with this rectangle. This function allows as to prune which nodes to visit.
Provided methods
fn compute_distance_to_bot(
&self,
ray: &Ray<Self::N>,
a: &Self::T
) -> RayIntersectResult<Self::N>
&self,
ray: &Ray<Self::N>,
a: &Self::T
) -> RayIntersectResult<Self::N>
Returns the length of ray between its origin, and where it intersects the line provided. Returns none if the ray doesnt intersect it. We use this to further prune nodes.If the closest possible distance of a bot in a particular node is bigger than what we've already seen, then we dont need to visit that node. 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()