pub struct Ray<T: Scalar, V: Vector<T>> {
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: FloatScalar, V: FloatVector<T>> Ray<T, V>
impl<T: FloatScalar, V: FloatVector<T>> Ray<T, V>
Source§impl<T: FloatScalar> Ray<T, Vector3<T>>
impl<T: FloatScalar> Ray<T, Vector3<T>>
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: FloatScalar> Intersection<(T, Vector3<T>), Ray<T, Vector3<T>>> for Tri3<T>
impl<T: FloatScalar> Intersection<(T, Vector3<T>), Ray<T, Vector3<T>>> for Tri3<T>
Source§impl<T: FloatScalar> Intersection<(T, Vector3<T>), Tri3<T>> for Ray<T, Vector3<T>>
impl<T: FloatScalar> Intersection<(T, Vector3<T>), Tri3<T>> for Ray<T, Vector3<T>>
impl<T: Copy + Scalar, V: Copy + Vector<T>> 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> UnsafeUnpin for Ray<T, V>where
V: UnsafeUnpin,
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