pub struct HitRecord {
pub world_point: Point,
pub normal: Normal,
pub surface_point: Vector2D,
pub t: f32,
pub ray: Ray,
pub material: Material,
}
Expand description
Struct used to store the results of RayIntersection
.
Fields§
§world_point: Point
Coordinates of the point of impact.
normal: Normal
Normal of the shape surface on the impact point.
surface_point: Vector2D
Coordinates of the point of impact in the frame of reference of the shape’s surface.
t: f32
Time the ray travelled before the impact.
ray: Ray
The ray that impacted on the shape.
material: Material
The Material
of the impacted shape
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for HitRecord
impl Send for HitRecord
impl Sync for HitRecord
impl Unpin for HitRecord
impl UnwindSafe for HitRecord
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