public override bool Hit(Ray ray, float t_min, float t_max, ref HitRecord rec) { var temp_record = new HitRecord(); var hit_anything = false; var closest = t_max; foreach (var h in list) { if (!h.Hit(ray, t_min, closest, ref temp_record)) { continue; } hit_anything = true; closest = temp_record.t; rec = temp_record; } return(hit_anything); }
public abstract bool scatter(Ray rayIn, HitRecord record, ref Color32 attenuation, ref Ray scattered);
public abstract bool Hit(Ray ray, float t_min, float t_max, ref HitRecord rec);