riley-harper / RayTracer

Code for a raytracer that I built in spring 2021, along with example images!
0 stars 0 forks source link

Require Primitives to be Bounded #25

Closed riley-harper closed 3 years ago

riley-harper commented 3 years ago

Add a function virtual XYZBounds FindBounds() const = 0 to the Primitive class. This will require primitives to be bounded, but will let us abstract primitives more easily, which will allow us to add lots of different types of primitives more easily. Like with lights, I'd like to avoid complicated inheritance and use the Primitive class essentially as an interface that primitives must implement. I think that this will be helpful and keep things flexible. I don't want to go down the path of over-inheritance.

Some more ideas for primitives:

riley-harper commented 3 years ago

This will require implementing the function in the Sphere and Triangle classes.