#[repr(C)]pub struct Ray3<T> {
pub origin: Point3<T>,
pub direction: Vec3<T>,
pub distance: Interval<T>,
}Expand description
Ray3 structure.
Rays are typically used to trace shapes for intersection tests.
See Ray3::trace for more information.
Fields§
§origin: Point3<T>The origin point where the ray starts.
direction: Vec3<T>The direction in which the ray extends from its origin.
This vector should be normalized and non-zero; otherwise, results may be incorrect.
distance: Interval<T>Distance limit.
Implementations§
Source§impl<T: Float> Ray3<T>
impl<T: Float> Ray3<T>
Sourcepub fn inside<U: Trace3<T> + ?Sized>(&self, shape: &U) -> bool
pub fn inside<U: Trace3<T> + ?Sized>(&self, shape: &U) -> bool
Returns if the ray starts inside the shape.
Sourcepub fn inside_collection<Shape: Trace3<T>, I: IntoIterator<Item = Shape>>(
&self,
shapes: I,
) -> bool
pub fn inside_collection<Shape: Trace3<T>, I: IntoIterator<Item = Shape>>( &self, shapes: I, ) -> bool
Returns if the ray starts inside any shape in the collection.
Sourcepub fn trace<U: Trace3<T> + ?Sized>(&self, shape: &U) -> Option<Hit3<T>>
pub fn trace<U: Trace3<T> + ?Sized>(&self, shape: &U) -> Option<Hit3<T>>
Trace the ray against a shape.
Sourcepub fn trace_collection<Shape: Trace3<T>, I: IntoIterator<Item = Shape>>(
&self,
shapes: I,
) -> Option<Hit3<T>>
pub fn trace_collection<Shape: Trace3<T>, I: IntoIterator<Item = Shape>>( &self, shapes: I, ) -> Option<Hit3<T>>
Trace the ray against a collection of shapes.
Trait Implementations§
Source§impl<T: Float> Mul<Ray3<T>> for Transform3<T>
impl<T: Float> Mul<Ray3<T>> for Transform3<T>
impl<T: Copy> Copy for Ray3<T>
impl<T> StructuralPartialEq for Ray3<T>
Auto Trait Implementations§
impl<T> Freeze for Ray3<T>where
T: Freeze,
impl<T> RefUnwindSafe for Ray3<T>where
T: RefUnwindSafe,
impl<T> Send for Ray3<T>where
T: Send,
impl<T> Sync for Ray3<T>where
T: Sync,
impl<T> Unpin for Ray3<T>where
T: Unpin,
impl<T> UnsafeUnpin for Ray3<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Ray3<T>where
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