[][src]Struct ncollide_geometry::query::RayIntersection

pub struct RayIntersection<V: Vector> {
    pub toi: V::Real,
    pub normal: V,
    pub uvs: Option<Point2<V::Real>>,
}

Structure containing the result of a successful ray cast.

Fields

toi: V::Real

The time of impact of the ray with the object. The exact contact point can be computed with: origin + dir * toi where origin is the origin of the ray; dir is its direction and toi is the value of this field.

normal: V

The normal at the intersection point.

If the toi is exactly zero, the normal might not be reliable.

uvs: Option<Point2<V::Real>>

The textures coordinates at the intersection point. This is an Option because some shape do not support texture coordinates.

Methods

impl<V: Vector> RayIntersection<V>[src]

pub fn new_with_uvs(
    toi: V::Real,
    normal: V,
    uvs: Option<Point2<V::Real>>
) -> RayIntersection<V>
[src]

Creates a new RayIntersection.

pub fn new(toi: V::Real, normal: V) -> RayIntersection<V>[src]

Creates a new RayIntersection.

Auto Trait Implementations

impl<V> Send for RayIntersection<V> where
    <V as InnerSpace>::Real: Scalar + Send

impl<V> Sync for RayIntersection<V> where
    <V as InnerSpace>::Real: Scalar + Sync

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Same for T

type Output = T

Should always be Self