pub struct Ray3 { /* private fields */ }Expand description
A 3D ray with a unit-length direction; distances are world units.
Implementations§
Source§impl Ray3
impl Ray3
Sourcepub fn new(origin: Vec3, direction: Vec3) -> Result<Self, SpatialError>
pub fn new(origin: Vec3, direction: Vec3) -> Result<Self, SpatialError>
Constructs a ray, normalizing its finite, nonzero direction.
Sourcepub fn cast(
self,
bounds: Aabb3,
max_distance: f32,
) -> Result<Option<RayHit3>, SpatialError>
pub fn cast( self, bounds: Aabb3, max_distance: f32, ) -> Result<Option<RayHit3>, SpatialError>
First box contact, inclusive of faces and max_distance.
Strict inside starts return distance zero and a zero normal.
A boundary start reports zero distance; an outward start uses
zero normal, while an inward start reports that face’s normal.
f32::INFINITY is accepted for an unbounded search.
Trait Implementations§
impl Copy for Ray3
impl StructuralPartialEq for Ray3
Auto Trait Implementations§
impl Freeze for Ray3
impl RefUnwindSafe for Ray3
impl Send for Ray3
impl Sync for Ray3
impl Unpin for Ray3
impl UnsafeUnpin for Ray3
impl UnwindSafe for Ray3
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