Struct kdtree_ray::KDtree[][src]

pub struct KDtree<P> where
    P: BoundingBox
{ /* fields omitted */ }

The KD-tree data structure stores the elements implementing BoundingBox.

Implementations

impl<P: BoundingBox> KDtree<P>[src]

pub fn new(values: Vec<P>) -> Self[src]

This function is used to create a new KD-tree. You need to provide a Vec of values that implement BoundingBox trait.

pub fn intersect(
    &self,
    ray_origin: &Vector3<f32>,
    ray_direction: &Vector3<f32>
) -> Vec<Arc<P>>
[src]

This function takes a ray and return a reduced list of candidates that can be intersected by the ray.

Trait Implementations

impl<P> BoundingBox for KDtree<P> where
    P: BoundingBox
[src]

impl<P: Clone> Clone for KDtree<P> where
    P: BoundingBox
[src]

impl<P: Debug> Debug for KDtree<P> where
    P: BoundingBox
[src]

Auto Trait Implementations

impl<P> RefUnwindSafe for KDtree<P> where
    P: RefUnwindSafe

impl<P> Send for KDtree<P> where
    P: Send + Sync

impl<P> Sync for KDtree<P> where
    P: Send + Sync

impl<P> Unpin for KDtree<P>

impl<P> UnwindSafe for KDtree<P> where
    P: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.