The material attribute in the HitRecord struct is a Trait object. This is not needed, since the HitRecord shouldn't own a copy of the material, and it is also innefficient, since a copy of the material struct takes place.
Instead, the material attribute should be defined as a reference to something that implements the Material trait.
The material attribute in the HitRecord struct is a Trait object. This is not needed, since the HitRecord shouldn't own a copy of the material, and it is also innefficient, since a copy of the material struct takes place.
Instead, the material attribute should be defined as a reference to something that implements the Material trait.