Currently in material.h we have a forward declaration of class hit_record. However, this line is unnecessary because in main.cc, we include hittable.h (where hit_record is defined) before we include material.h. Further, the class declaration is insufficient, as there are multiple member dereferences throughout material.h, which requires the hit_record definition.
The solution to this is to include hittable.h in the beginning of material.h. The current situation likely came about as I wrestled with the potential circular dependency where material classes needed access to hit_record, and hit_record has a shared pointer to a material instance. The current class material declaration at the top of hittable.h should be sufficient to address this.
Currently in
material.h
we have a forward declaration ofclass hit_record
. However, this line is unnecessary because inmain.cc
, we includehittable.h
(wherehit_record
is defined) before we includematerial.h
. Further, the class declaration is insufficient, as there are multiple member dereferences throughoutmaterial.h
, which requires thehit_record
definition.The solution to this is to include
hittable.h
in the beginning ofmaterial.h
. The current situation likely came about as I wrestled with the potential circular dependency where material classes needed access tohit_record
, andhit_record
has a shared pointer to amaterial
instance. The currentclass material
declaration at the top ofhittable.h
should be sufficient to address this.