[][src]Struct collision::Ray

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]

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]

Create a new ray by applying a transform.

Trait Implementations

impl<S> Continuous<Ray<S, Point2<S>, Vector2<S>>> for Circle<S> where
    S: BaseFloat
[src]

type Result = Point2<S>

Result returned by the intersection test

impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Cylinder<S> where
    S: BaseFloat
[src]

type Result = Point3<S>

Result returned by the intersection test

impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Capsule<S> where
    S: BaseFloat
[src]

type Result = Point3<S>

Result returned by the intersection test

impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Cuboid<S> where
    S: BaseFloat
[src]

type Result = Point3<S>

Result returned by the intersection test

impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Cube<S> where
    S: BaseFloat
[src]

type Result = Point3<S>

Result returned by the intersection test

impl<P> Continuous<Ray<<P as EuclideanSpace>::Scalar, P, <P as EuclideanSpace>::Diff>> for Particle<P> where
    P: EuclideanSpace,
    P::Diff: InnerSpace,
    P::Scalar: BaseFloat
[src]

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> Continuous<Ray<S, Point2<S>, Vector2<S>>> for ConvexPolygon<S> where
    S: BaseFloat
[src]

type Result = Point2<S>

Result returned by the intersection test

fn intersection(&self, ray: &Ray2<S>) -> Option<Point2<S>>
[src]

Ray must be in object space

impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for ConvexPolyhedron<S> where
    S: BaseFloat
[src]

type Result = Point3<S>

Result returned by the intersection test

fn intersection(&self, ray: &Ray3<S>) -> Option<Point3<S>>
[src]

Ray must be in object space

impl<S> Continuous<Ray<S, Point2<S>, Vector2<S>>> for Rectangle<S> where
    S: BaseFloat
[src]

type Result = Point2<S>

Result returned by the intersection test

fn intersection(&self, ray: &Ray2<S>) -> Option<Point2<S>>
[src]

Ray must be in object space of the rectangle

impl<S> Continuous<Ray<S, Point2<S>, Vector2<S>>> for Square<S> where
    S: BaseFloat
[src]

type Result = Point2<S>

Result returned by the intersection test

fn intersection(&self, ray: &Ray2<S>) -> Option<Point2<S>>
[src]

Ray must be in object space of the rectangle

impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Quad<S> where
    S: BaseFloat
[src]

type Result = Point3<S>

Result returned by the intersection test

fn intersection(&self, ray: &Ray3<S>) -> Option<Point3<S>>
[src]

Ray must be in object space of the rectangle

impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Sphere<S> where
    S: BaseFloat
[src]

type Result = Point3<S>

Result returned by the intersection test

impl<S: BaseFloat> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Plane<S>
[src]

type Result = Point3<S>

Result returned by the intersection test

impl<S, P> Continuous<Ray<S, P, <P as EuclideanSpace>::Diff>> for P where
    S: BaseFloat,
    P: EuclideanSpace<Scalar = S>,
    P::Diff: InnerSpace<Scalar = S>, 
[src]

type Result = P

Result returned by the intersection test

impl<S: BaseFloat> Continuous<Ray<S, Point2<S>, Vector2<S>>> for Line2<S>
[src]

type Result = Point2<S>

Result returned by the intersection test

impl<S: BaseFloat> Continuous<Ray<S, Point2<S>, Vector2<S>>> for Aabb2<S>
[src]

type Result = Point2<S>

Result returned by the intersection test

impl<S: BaseFloat> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Aabb3<S>
[src]

type Result = Point3<S>

Result returned by the intersection test

impl<S: BaseFloat> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Sphere<S>
[src]

type Result = Point3<S>

Result returned by the intersection test

impl<S> Discrete<Ray<S, Point2<S>, Vector2<S>>> for Circle<S> where
    S: BaseFloat
[src]

impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Cylinder<S> where
    S: BaseFloat
[src]

impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Capsule<S> where
    S: BaseFloat
[src]

impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Cuboid<S> where
    S: BaseFloat
[src]

impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Cube<S> where
    S: BaseFloat
[src]

impl<P> Discrete<Ray<<P as EuclideanSpace>::Scalar, P, <P as EuclideanSpace>::Diff>> for Particle<P> where
    P: EuclideanSpace,
    P::Diff: InnerSpace,
    P::Scalar: BaseFloat
[src]

fn intersects(&self, ray: &Ray<P::Scalar, P, P::Diff>) -> bool
[src]

Ray needs to be in particle object space

impl<S> Discrete<Ray<S, Point2<S>, Vector2<S>>> for ConvexPolygon<S> where
    S: BaseFloat
[src]

fn intersects(&self, ray: &Ray2<S>) -> bool
[src]

Ray must be in object space

impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for ConvexPolyhedron<S> where
    S: BaseFloat
[src]

TODO: better algorithm for finding faces to intersect with?

fn intersects(&self, ray: &Ray3<S>) -> bool
[src]

Ray must be in object space

impl<S> Discrete<Ray<S, Point2<S>, Vector2<S>>> for Rectangle<S> where
    S: BaseFloat
[src]

fn intersects(&self, ray: &Ray2<S>) -> bool
[src]

Ray must be in object space of the rectangle

impl<S> Discrete<Ray<S, Point2<S>, Vector2<S>>> for Square<S> where
    S: BaseFloat
[src]

fn intersects(&self, ray: &Ray2<S>) -> bool
[src]

Ray must be in object space of the rectangle

impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Quad<S> where
    S: BaseFloat
[src]

fn intersects(&self, ray: &Ray3<S>) -> bool
[src]

Ray must be in object space of the rectangle

impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Sphere<S> where
    S: BaseFloat
[src]

impl<S: BaseFloat> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Plane<S>
[src]

impl<S, P> Discrete<Ray<S, P, <P as EuclideanSpace>::Diff>> for P where
    S: BaseFloat,
    P: EuclideanSpace<Scalar = S>,
    P::Diff: InnerSpace<Scalar = S>, 
[src]

impl<S: BaseFloat> Discrete<Ray<S, Point2<S>, Vector2<S>>> for Line2<S>
[src]

impl<S: BaseFloat> Discrete<Ray<S, Point2<S>, Vector2<S>>> for Aabb2<S>
[src]

impl<S: BaseFloat> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Aabb3<S>
[src]

impl<S: BaseFloat> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Sphere<S>
[src]

impl<S> DiscreteTransformed<Ray<S, Point2<S>, Vector2<S>>> for Primitive2<S> where
    S: BaseFloat
[src]

type Point = Point2<S>

Point type for transformation of self

impl<S> DiscreteTransformed<Ray<S, Point3<S>, Vector3<S>>> for Primitive3<S> where
    S: BaseFloat
[src]

type Point = Point3<S>

Point type for transformation of self

impl<P, C> DiscreteTransformed<Ray<<P as EuclideanSpace>::Scalar, P, <P as EuclideanSpace>::Diff>> for C where
    C: Discrete<Ray<P::Scalar, P, P::Diff>>,
    P: EuclideanSpace,
    P::Scalar: BaseFloat
[src]

type Point = P

Point type for transformation of self

impl<S> ContinuousTransformed<Ray<S, Point2<S>, Vector2<S>>> for Primitive2<S> where
    S: BaseFloat
[src]

type Point = Point2<S>

Point type for transformation of self

type Result = Point2<S>

Result of intersection test

impl<S> ContinuousTransformed<Ray<S, Point3<S>, Vector3<S>>> for Primitive3<S> where
    S: BaseFloat
[src]

type Point = Point3<S>

Point type for transformation of self

type Result = Point3<S>

Result of intersection test

impl<P, C> ContinuousTransformed<Ray<<P as EuclideanSpace>::Scalar, P, <P as EuclideanSpace>::Diff>> for C where
    C: Continuous<Ray<P::Scalar, P, P::Diff>, Result = P>,
    P: EuclideanSpace,
    P::Scalar: BaseFloat
[src]

type Point = P

Point type for transformation of self

type Result = P

Result of intersection test

impl<S: Copy, P: Copy, V: Copy> Copy for Ray<S, P, V>
[src]

impl<S: PartialEq, P: PartialEq, V: PartialEq> PartialEq<Ray<S, P, V>> for Ray<S, P, V>
[src]

impl<S: Clone, P: Clone, V: Clone> Clone for Ray<S, P, V>
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<S: Debug, P: Debug, V: Debug> Debug for Ray<S, P, V>
[src]

Auto Trait Implementations

impl<S, P, V> Send for Ray<S, P, V> where
    P: Send,
    S: Send,
    V: Send

impl<S, P, V> Sync for Ray<S, P, V> where
    P: Sync,
    S: Sync,
    V: Sync

Blanket Implementations

impl<T> From for T
[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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