Ray Tracer
2020
|
Class for Plane objects. More...
#include <Plane.h>
Public Member Functions | |
Plane () | |
Plane default constructor. More... | |
Plane (const Plane &plane) | |
Plane copy constructor. More... | |
~Plane () | |
Plane destructor. More... | |
Plane & | operator= (const Plane &plane) |
Plane assignment operator. More... | |
std::vector< RayIntersection > | intersect (const Ray &ray) const |
Plane-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 Plane objects.
This class provides an Object which is a plane centred at the origin, extending \(\pm 1\) units along the \(X\) and \(Y\) axes, as shown 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.
Plane::Plane | ( | ) |
Plane::~Plane | ( | ) |
Plane destructor.
|
virtual |
Plane-Ray intersection computation.
The intersection of a Ray with a Plane comes down to determining when the \(Z\) component of the Ray is zero. If that lies within the bounds of the plane there is an intersection.
Implements Object.