hit.h
1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* hit.h :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* By: gychoi <gychoi@student.42seoul.kr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* Created: 2023/05/25 20:03:47 by gychoi #+# #+# */ 9 /* Updated: 2023/05/28 20:33:35 by gychoi ### ########.fr */ 10 /* */ 11 /* ************************************************************************** */ 12 13 #ifndef HIT_H 14 # define HIT_H 15 16 # include "libvec.h" 17 # include "object.h" 18 # include "pracrt.h" 19 # include "ray.h" 20 21 typedef struct s_hit_record 22 { 23 t_point3 p; 24 t_vec3 normal; 25 double tmin; 26 double tmax; 27 double t; 28 t_bool front_face; 29 t_color3 albedo; 30 } t_hit_record; 31 32 t_bool hit(t_object *world, t_ray ray, t_hit_record *rec); 33 t_bool hit_obj(t_object *world, t_ray ray, t_hit_record *rec); 34 t_bool hit_sphere(t_sphere *sp, t_color3 albedo, t_ray ray, t_hit_record *rec); 35 36 #endif