pub struct Ray3 {
pub origin: Vec3,
pub direction: Vec3,
}Expand description
A normalized 3D ray.
Fields§
§origin: Vec3Ray origin.
direction: Vec3Normalized ray direction.
Implementations§
Source§impl Ray3
impl Ray3
Sourcepub fn intersect_aabb(self, aabb: Aabb) -> Option<f32>
pub fn intersect_aabb(self, aabb: Aabb) -> Option<f32>
Intersects this ray with an AABB and returns nearest non-negative t.
Sourcepub fn intersect_sphere(self, center: Vec3, radius: f32) -> Option<f32>
pub fn intersect_sphere(self, center: Vec3, radius: f32) -> Option<f32>
Intersects this ray with a sphere and returns nearest non-negative t.
Sourcepub fn intersect_bounding_sphere(self, sphere: Sphere) -> Option<f32>
pub fn intersect_bounding_sphere(self, sphere: Sphere) -> Option<f32>
Intersects this ray with a sphere and returns nearest non-negative t.
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