Ray Tracer
2020
|
Class for Tube objects. More...
#include <Tube.h>
Public Member Functions | |
Tube (double ratio=0.5) | |
Tube default constructor. More... | |
Tube (const Tube &tube) | |
Tube copy constructor. More... | |
~Tube () | |
Tube destructor. More... | |
Tube & | operator= (const Tube &tube) |
Tube assignment operator. More... | |
std::vector< RayIntersection > | intersect (const Ray &ray) const |
Tube-Ray intersection computation. More... | |
Private Attributes | |
double | ratio_ |
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 Tube objects.
This class provides an Object which is a Tune centred at the origin with outer radius 1 and a user-specified inner radius in the range \((0,1)\), as shown below.
Note that the Tube 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 assignment.
Tube::Tube | ( | double | ratio = 0.5 | ) |
Tube default constructor.
A newly constructed Octahedron is centred at the origin, and is aligned with the Z-axis It has outer radius 1, and an inner radius specified by the ratio parameter. It extends out to \(Z= \pm 1\) It may be moved, rotated, and scaled through its transform member.
ratio | The ratio of the inner and outer radii of the Tube. |
Tube::~Tube | ( | ) |
Tube destructor.
|
virtual |
Tube-Ray intersection computation.
The intersection of a Ray with an Tube is similar to that of a Cylinder, except:
Implements Object.
|
private |