added hemispherical scattering, switched to ppm version 6
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::material::Material;
|
||||
use crate::ray::*;
|
||||
use crate::vec3::*;
|
||||
|
||||
@@ -5,13 +8,14 @@ use crate::vec3::*;
|
||||
pub struct HitRecord {
|
||||
pub p: Point3,
|
||||
pub normal: Vec3,
|
||||
pub mat_ptr: Rc<Material>,
|
||||
pub t: f64,
|
||||
pub front_face: bool,
|
||||
}
|
||||
|
||||
impl HitRecord {
|
||||
pub fn new_empty() -> Self {
|
||||
HitRecord { p: Point3::new(0.0, 0.0, 0.0), normal: Vec3::new(0.0, 0.0, 0.0), t: 0.0, front_face: false }
|
||||
HitRecord { p: Point3::new(0.0, 0.0, 0.0), normal: Vec3::new(0.0, 0.0, 0.0), t: 0.0, front_face: false, mat_ptr: Rc::new(Material { }) }
|
||||
}
|
||||
|
||||
pub fn set_face_normal(&mut self, r: &Ray, outward_normal: &Vec3) {
|
||||
|
||||
Reference in New Issue
Block a user