Skip to content

material.h should include hittable.h #1608

@hollasch

Description

@hollasch

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions