Struct collision::Ray
[−]
[src]
pub struct Ray<S, P, V> { pub origin: P, pub direction: V, // some fields omitted }
A generic ray starting at origin
and extending infinitely in
direction
.
Fields
origin: P
Ray origin
direction: V
Normalized ray direction
Methods
impl<S, V, P> Ray<S, P, V> where
S: BaseNum,
V: VectorSpace<Scalar = S>,
P: EuclideanSpace<Scalar = S, Diff = V>,
[src]
S: BaseNum,
V: VectorSpace<Scalar = S>,
P: EuclideanSpace<Scalar = S, Diff = V>,
pub fn new(origin: P, direction: V) -> Ray<S, P, V>
[src]
Create a generic ray starting at origin
and extending infinitely in
direction
.
pub fn transform<T>(&self, transform: T) -> Self where
T: Transform<P>,
[src]
T: Transform<P>,
Create a new ray by applying a transform.
Trait Implementations
impl<P> Discrete<Ray<P::Scalar, P, P::Diff>> for Particle<P> where
P: EuclideanSpace,
P::Diff: InnerSpace,
P::Scalar: BaseFloat,
[src]
P: EuclideanSpace,
P::Diff: InnerSpace,
P::Scalar: BaseFloat,
fn intersects(&self, ray: &Ray<P::Scalar, P, P::Diff>) -> bool
[src]
Ray needs to be in particle object space
impl<P> Continuous<Ray<P::Scalar, P, P::Diff>> for Particle<P> where
P: EuclideanSpace,
P::Diff: InnerSpace,
P::Scalar: BaseFloat,
[src]
P: EuclideanSpace,
P::Diff: InnerSpace,
P::Scalar: BaseFloat,
type Result = P
Result returned by the intersection test
fn intersection(&self, ray: &Ray<P::Scalar, P, P::Diff>) -> Option<P>
[src]
Ray needs to be in particle object space
impl<S: Copy, P: Copy, V: Copy> Copy for Ray<S, P, V>
[src]
impl<S: Clone, P: Clone, V: Clone> Clone for Ray<S, P, V>
[src]
fn clone(&self) -> Ray<S, P, V>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S: PartialEq, P: PartialEq, V: PartialEq> PartialEq for Ray<S, P, V>
[src]
fn eq(&self, __arg_0: &Ray<S, P, V>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Ray<S, P, V>) -> bool
[src]
This method tests for !=
.
impl<S: Debug, P: Debug, V: Debug> Debug for Ray<S, P, V>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<S, P> Continuous<Ray<S, P, P::Diff>> for P where
S: BaseFloat,
P: EuclideanSpace<Scalar = S>,
P::Diff: InnerSpace<Scalar = S>,
[src]
S: BaseFloat,
P: EuclideanSpace<Scalar = S>,
P::Diff: InnerSpace<Scalar = S>,
type Result = P
Result returned by the intersection test
fn intersection(&self, ray: &Ray<S, P, P::Diff>) -> Option<P>
[src]
Intersection test
impl<S, P> Discrete<Ray<S, P, P::Diff>> for P where
S: BaseFloat,
P: EuclideanSpace<Scalar = S>,
P::Diff: InnerSpace<Scalar = S>,
[src]
S: BaseFloat,
P: EuclideanSpace<Scalar = S>,
P::Diff: InnerSpace<Scalar = S>,
fn intersects(&self, ray: &Ray<S, P, P::Diff>) -> bool
[src]
Intersection test
impl<P, C> DiscreteTransformed<Ray<P::Scalar, P, P::Diff>> for C where
C: Discrete<Ray<P::Scalar, P, P::Diff>>,
P: EuclideanSpace,
P::Scalar: BaseFloat,
[src]
C: Discrete<Ray<P::Scalar, P, P::Diff>>,
P: EuclideanSpace,
P::Scalar: BaseFloat,
type Point = P
Point type for transformation of self
fn intersects_transformed<T>(
&self,
ray: &Ray<P::Scalar, P, P::Diff>,
transform: &T
) -> bool where
T: Transform<P>,
[src]
&self,
ray: &Ray<P::Scalar, P, P::Diff>,
transform: &T
) -> bool where
T: Transform<P>,
Intersection test for transformed self
impl<P, C> ContinuousTransformed<Ray<P::Scalar, P, P::Diff>> for C where
C: Continuous<Ray<P::Scalar, P, P::Diff>, Result = P>,
P: EuclideanSpace,
P::Scalar: BaseFloat,
[src]
C: Continuous<Ray<P::Scalar, P, P::Diff>, Result = P>,
P: EuclideanSpace,
P::Scalar: BaseFloat,