Fix translation hit record
This commit is contained in:
parent
c90b185b8d
commit
560b921b3a
@ -21,7 +21,7 @@ impl<H: Hittable> Hittable for Translate<H> {
|
|||||||
match &self.hittable.hit(&moved_ray, t_min, t_max) {
|
match &self.hittable.hit(&moved_ray, t_min, t_max) {
|
||||||
Some(hit_record) => {
|
Some(hit_record) => {
|
||||||
let mut hr = HitRecord {
|
let mut hr = HitRecord {
|
||||||
point: hit_record.point,
|
point: hit_record.point + self.offset,
|
||||||
material: hit_record.material,
|
material: hit_record.material,
|
||||||
front_face: hit_record.front_face, // Maybe need to calc normal and front_face again?
|
front_face: hit_record.front_face, // Maybe need to calc normal and front_face again?
|
||||||
normal: hit_record.normal,
|
normal: hit_record.normal,
|
||||||
|
Loading…
Reference in New Issue
Block a user