Struct ncollide2d::query::ray_internal::RayIntersection
source · Expand description
Structure containing the result of a successful ray cast.
Fields§
§toi: N
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: Vector<N>
The normal at the intersection point.
If the toi
is exactly zero, the normal might not be reliable.
Implementations§
source§impl<N: Real> RayIntersection<N>
impl<N: Real> RayIntersection<N>
sourcepub fn new(toi: N, normal: Vector<N>) -> RayIntersection<N>
pub fn new(toi: N, normal: Vector<N>) -> RayIntersection<N>
Creates a new RayIntersection
.
Auto Trait Implementations§
impl<N> RefUnwindSafe for RayIntersection<N>where
N: RefUnwindSafe,
impl<N> Send for RayIntersection<N>
impl<N> Sync for RayIntersection<N>
impl<N> Unpin for RayIntersection<N>where
N: Unpin,
impl<N> UnwindSafe for RayIntersection<N>where
N: UnwindSafe,
Blanket Implementations§
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.