pub struct RayHit {
pub triangle: TriangleId,
pub t: f32,
pub point: [f32; 3],
pub barycentric: [f32; 3],
pub normal: [f32; 3],
}Expand description
Where a ray hit a triangle.
Fields§
§triangle: TriangleIdThe triangle that was hit.
t: f32The ray parameter of the hit, in units of the ray’s dir.
point: [f32; 3]The hit point, origin + t * dir.
barycentric: [f32; 3]Weights of the triangle’s corners 0, 1 and 2 at the hit.
normal: [f32; 3]The unit geometric normal, facing the side the counter-clockwise winding is seen from.
Trait Implementations§
impl Copy for RayHit
impl StructuralPartialEq for RayHit
Auto Trait Implementations§
impl Freeze for RayHit
impl RefUnwindSafe for RayHit
impl Send for RayHit
impl Sync for RayHit
impl Unpin for RayHit
impl UnsafeUnpin for RayHit
impl UnwindSafe for RayHit
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