added antialiasing
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use crate::hittable::*;
|
||||
use crate::vec3::*;
|
||||
|
||||
struct Sphere {
|
||||
pub struct Sphere {
|
||||
center: Point3,
|
||||
radius: f64
|
||||
}
|
||||
@@ -13,7 +13,7 @@ impl Sphere {
|
||||
}
|
||||
|
||||
impl Hittable for Sphere {
|
||||
fn hit(&self, r: &crate::ray::Ray, t_min: f64, t_max: f64, rec: &mut HitRecord) -> bool {
|
||||
fn hit(&mut self, r: &crate::ray::Ray, t_min: f64, t_max: f64, rec: &mut HitRecord) -> bool {
|
||||
let oc = r.origin() - self.center;
|
||||
let a = r.direction().length_squared();
|
||||
let half_b = oc.dot(&r.direction());
|
||||
|
||||
Reference in New Issue
Block a user