[−][src]Struct collision::Ray
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<S> Continuous<Ray<S, Point2<S>, Vector2<S>>> for Circle<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Result = Point2<S>
Result returned by the intersection test
fn intersection(&self, r: &Ray2<S>) -> Option<Point2<S>>
[src]
impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Cylinder<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Result = Point3<S>
Result returned by the intersection test
fn intersection(&self, r: &Ray3<S>) -> Option<Point3<S>>
[src]
impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Capsule<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Result = Point3<S>
Result returned by the intersection test
fn intersection(&self, r: &Ray3<S>) -> Option<Point3<S>>
[src]
impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Cuboid<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Result = Point3<S>
Result returned by the intersection test
fn intersection(&self, ray: &Ray3<S>) -> Option<Point3<S>>
[src]
impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Cube<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Result = Point3<S>
Result returned by the intersection test
fn intersection(&self, ray: &Ray3<S>) -> Option<Point3<S>>
[src]
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]
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> Continuous<Ray<S, Point2<S>, Vector2<S>>> for ConvexPolygon<S> where
S: BaseFloat,
[src]
S: BaseFloat,
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]
S: BaseFloat,
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]
S: BaseFloat,
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]
S: BaseFloat,
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]
S: BaseFloat,
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]
S: BaseFloat,
type Result = Point3<S>
Result returned by the intersection test
fn intersection(&self, r: &Ray3<S>) -> Option<Point3<S>>
[src]
impl<S: BaseFloat> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Plane<S>
[src]
type Result = Point3<S>
Result returned by the intersection test
fn intersection(&self, r: &Ray3<S>) -> Option<Point3<S>>
[src]
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]
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]
impl<S: BaseFloat> Continuous<Ray<S, Point2<S>, Vector2<S>>> for Line2<S>
[src]
type Result = Point2<S>
Result returned by the intersection test
fn intersection(&self, ray: &Ray2<S>) -> Option<Self::Result>
[src]
impl<S: BaseFloat> Continuous<Ray<S, Point2<S>, Vector2<S>>> for Aabb2<S>
[src]
type Result = Point2<S>
Result returned by the intersection test
fn intersection(&self, ray: &Ray2<S>) -> Option<Point2<S>>
[src]
impl<S: BaseFloat> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Aabb3<S>
[src]
type Result = Point3<S>
Result returned by the intersection test
fn intersection(&self, ray: &Ray3<S>) -> Option<Point3<S>>
[src]
impl<S: BaseFloat> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Sphere<S>
[src]
type Result = Point3<S>
Result returned by the intersection test
fn intersection(&self, r: &Ray3<S>) -> Option<Point3<S>>
[src]
impl<S> Discrete<Ray<S, Point2<S>, Vector2<S>>> for Circle<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn intersects(&self, r: &Ray2<S>) -> bool
[src]
impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Cylinder<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn intersects(&self, r: &Ray3<S>) -> bool
[src]
impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Capsule<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn intersects(&self, r: &Ray3<S>) -> bool
[src]
impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Cuboid<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn intersects(&self, ray: &Ray3<S>) -> bool
[src]
impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Cube<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn intersects(&self, ray: &Ray3<S>) -> bool
[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]
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<S> Discrete<Ray<S, Point2<S>, Vector2<S>>> for ConvexPolygon<S> where
S: BaseFloat,
[src]
S: BaseFloat,
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]
S: BaseFloat,
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]
S: BaseFloat,
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]
S: BaseFloat,
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]
S: BaseFloat,
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]
S: BaseFloat,
fn intersects(&self, r: &Ray3<S>) -> bool
[src]
impl<S: BaseFloat> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Plane<S>
[src]
fn intersects(&self, r: &Ray3<S>) -> bool
[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]
S: BaseFloat,
P: EuclideanSpace<Scalar = S>,
P::Diff: InnerSpace<Scalar = S>,
fn intersects(&self, ray: &Ray<S, P, P::Diff>) -> bool
[src]
impl<S: BaseFloat> Discrete<Ray<S, Point2<S>, Vector2<S>>> for Line2<S>
[src]
fn intersects(&self, ray: &Ray2<S>) -> bool
[src]
impl<S: BaseFloat> Discrete<Ray<S, Point2<S>, Vector2<S>>> for Aabb2<S>
[src]
fn intersects(&self, ray: &Ray2<S>) -> bool
[src]
impl<S: BaseFloat> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Aabb3<S>
[src]
fn intersects(&self, ray: &Ray3<S>) -> bool
[src]
impl<S: BaseFloat> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Sphere<S>
[src]
fn intersects(&self, r: &Ray3<S>) -> bool
[src]
impl<S> DiscreteTransformed<Ray<S, Point2<S>, Vector2<S>>> for Primitive2<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Point = Point2<S>
Point type for transformation of self
fn intersects_transformed<T>(&self, ray: &Ray2<S>, transform: &T) -> bool where
T: Transform<Self::Point>,
[src]
T: Transform<Self::Point>,
impl<S> DiscreteTransformed<Ray<S, Point3<S>, Vector3<S>>> for Primitive3<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Point = Point3<S>
Point type for transformation of self
fn intersects_transformed<T>(&self, ray: &Ray3<S>, transform: &T) -> bool where
T: Transform<Self::Point>,
[src]
T: Transform<Self::Point>,
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]
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>,
impl<S> ContinuousTransformed<Ray<S, Point2<S>, Vector2<S>>> for Primitive2<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Point = Point2<S>
Point type for transformation of self
type Result = Point2<S>
Result of intersection test
fn intersection_transformed<T>(
&self,
ray: &Ray2<S>,
transform: &T
) -> Option<Point2<S>> where
T: Transform<Point2<S>>,
[src]
&self,
ray: &Ray2<S>,
transform: &T
) -> Option<Point2<S>> where
T: Transform<Point2<S>>,
impl<S> ContinuousTransformed<Ray<S, Point3<S>, Vector3<S>>> for Primitive3<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Point = Point3<S>
Point type for transformation of self
type Result = Point3<S>
Result of intersection test
fn intersection_transformed<T>(
&self,
ray: &Ray3<S>,
transform: &T
) -> Option<Point3<S>> where
T: Transform<Point3<S>>,
[src]
&self,
ray: &Ray3<S>,
transform: &T
) -> Option<Point3<S>> where
T: Transform<Point3<S>>,
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]
C: Continuous<Ray<P::Scalar, P, P::Diff>, Result = P>,
P: EuclideanSpace,
P::Scalar: BaseFloat,
type Point = P
Point type for transformation of self
type Result = P
Result of intersection test
fn intersection_transformed<T>(
&self,
ray: &Ray<P::Scalar, P, P::Diff>,
transform: &T
) -> Option<P> where
T: Transform<P>,
[src]
&self,
ray: &Ray<P::Scalar, P, P::Diff>,
transform: &T
) -> Option<P> where
T: Transform<P>,
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(&self) -> Ray<S, P, V>
[src]
default 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,
P: Send,
S: Send,
V: Send,
impl<S, P, V> Sync for Ray<S, P, V> where
P: Sync,
S: Sync,
V: Sync,
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]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,