Ray Tracer
2020
|
Class for Cube objects. More...
#include <Cube.h>
Public Member Functions | |
Cube () | |
Cube default constructor. More... | |
Cube (const Cube &cube) | |
Cube copy constructor. More... | |
~Cube () | |
Cube destructor. More... | |
Cube & | operator= (const Cube &cube) |
Cube assignment operator. More... | |
std::vector< RayIntersection > | intersect (const Ray &ray) const |
Cube-Ray intersection computation. More... | |
Additional Inherited Members | |
Public Attributes inherited from Object | |
Transform | transform |
A 3D transformation to apply to this Object. More... | |
Material | material |
The colour and reflectance properties of the Object. More... | |
Protected Member Functions inherited from Object | |
Object () | |
Object default constructor. More... | |
Object (const Object &object) | |
Object copy constructor. More... | |
virtual | ~Object () |
Object destructor. More... | |
Object & | operator= (const Object &object) |
Object assignment operator. More... | |
Class for Cube objects.
This class provides an Object which is a Cube at the origin with "radius" 1. That is, a Cube that extends from \(-1\) to \(+1\) along each axis, as illustrated below:
Note that the Cube provided in the skeleton code is not complete and returns no RayIntersections from intersect(). This method needs to be implemented correctly as part of the labs/assignment.
Cube::Cube | ( | ) |
Cube::~Cube | ( | ) |
Cube destructor.
|
virtual |
Cube-Ray intersection computation.
Intersection with a Cube can be seen as six instances of intersection with a Plane. However, these planes are oriented to align to different pairs of axes, and do not pass through the origin.
Implements Object.