pub struct Ray<T, V>{
pub start: V,
pub direction: V,
/* private fields */
}Expand description
A ray with an origin and direction.
Commonly used for ray casting and intersection tests.
Fields§
§start: VRay origin.
direction: VRay direction (typically normalized).
Implementations§
Source§impl<T, V> Ray<T, V>where
T: FloatScalar,
V: FloatVector<T>,
impl<T, V> Ray<T, V>where
T: FloatScalar,
V: FloatVector<T>,
Source§impl<T> Ray<T, Vector3<T>>where
T: Scalar,
impl<T> Ray<T, Vector3<T>>where
T: Scalar,
Sourcepub fn intersect_plane(&self, p: &Plane<T>, epsilon: T) -> Option<Vector3<T>>
pub fn intersect_plane(&self, p: &Plane<T>, epsilon: T) -> Option<Vector3<T>>
Computes ray-plane intersection.
Returns the intersection point, or None if the ray doesn’t hit the plane
(parallel or pointing away).
Returns None if the ray is parallel to the plane within epsilon.
Trait Implementations§
Source§impl<T> Intersection<(T, Vector3<T>), Tri3<T>> for Ray<T, Vector3<T>>where
T: FloatScalar,
Ray-Triangle Intersection Test Routines
Different optimizations of my and Ben Trumbore’s
code from journals of graphics tools (JGT)
http://www.acm.org/jgt/
by Tomas Moller, May 2000
impl<T> Intersection<(T, Vector3<T>), Tri3<T>> for Ray<T, Vector3<T>>where
T: FloatScalar,
Ray-Triangle Intersection Test Routines Different optimizations of my and Ben Trumbore’s code from journals of graphics tools (JGT) http://www.acm.org/jgt/ by Tomas Moller, May 2000
impl<T, V> Copy for Ray<T, V>
Auto Trait Implementations§
impl<T, V> Freeze for Ray<T, V>where
V: Freeze,
impl<T, V> RefUnwindSafe for Ray<T, V>where
V: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, V> Send for Ray<T, V>
impl<T, V> Sync for Ray<T, V>
impl<T, V> Unpin for Ray<T, V>
impl<T, V> UnwindSafe for Ray<T, V>where
V: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more