Struct ncollide2d::query::ray_internal::Ray
source · Expand description
A Ray.
Fields§
§origin: Point<N>
Starting point of the ray.
dir: Vector<N>
Direction of the ray.
Implementations§
source§impl<N: Real> Ray<N>
impl<N: Real> Ray<N>
sourcepub fn new(origin: Point<N>, dir: Vector<N>) -> Ray<N>
pub fn new(origin: Point<N>, dir: Vector<N>) -> Ray<N>
Creates a new ray starting from origin
and with the direction dir
. dir
must be
normalized.
sourcepub fn transform_by(&self, m: &Isometry<N>) -> Self
pub fn transform_by(&self, m: &Isometry<N>) -> Self
Transforms this ray by the given isometry.
sourcepub fn inverse_transform_by(&self, m: &Isometry<N>) -> Self
pub fn inverse_transform_by(&self, m: &Isometry<N>) -> Self
Transforms this ray by the inverse of the given isometry.
sourcepub fn translate_by(&self, v: Vector<N>) -> Self
pub fn translate_by(&self, v: Vector<N>) -> Self
Translates this ray by the given vector. Its direction is left unchanged.
Trait Implementations§
impl<N: Copy + Real> Copy for Ray<N>
Auto Trait Implementations§
impl<N> RefUnwindSafe for Ray<N>where
N: RefUnwindSafe,
impl<N> Send for Ray<N>
impl<N> Sync for Ray<N>
impl<N> Unpin for Ray<N>where
N: Unpin,
impl<N> UnwindSafe for Ray<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.