#include <Triangle.h>
Definition at line 16 of file Triangle.h.
Public Member Functions | |
Triangle (Vector3D a, Vector3D b, Vector3D c) | |
The constructor of the triangle. | |
virtual | ~Triangle () |
Destructor. | |
bool | Intersect (Ray &ray) |
computes a ray triangle intersection. | |
virtual Vector3D | GetNormal (Ray &ray) |
Gets the normal of the triangle. | |
Private Member Functions | |
Box | CalcBounds () |
Calculates the bounding box of that triangle. | |
Private Attributes | |
Vector3D | a |
The first point of the triangle. | |
Vector3D | b |
The seconf point of the triangle. | |
Vector3D | c |
The third point of the triangle. |
virtual Triangle::~Triangle | ( | ) | [inline, virtual] |
Box Triangle::CalcBounds | ( | ) | [inline, private, virtual] |
Calculates the bounding box of that triangle.
Implements Primitive.
Definition at line 43 of file Triangle.h.
References a, b, Primitive::bounds, c, and Box::Extend().
bool Triangle::Intersect | ( | Ray & | ray | ) | [inline, virtual] |
computes a ray triangle intersection.
ray | The ray to test intersection with. |
Implements Primitive.
Definition at line 75 of file Triangle.h.
References a, b, c, Cross(), Ray::dir, Dot(), Epsilon, Ray::hit, Ray::org, Ray::t, Ray::u, and Ray::v.
Gets the normal of the triangle.
Implements Primitive.
Reimplemented in SmoothTriangle.
Definition at line 116 of file Triangle.h.
References a, b, c, Cross(), and Vector3D::Normalized().
Vector3D Triangle::a [private] |
The first point of the triangle.
Vector3D a
Definition at line 24 of file Triangle.h.
Referenced by CalcBounds(), GetNormal(), and Intersect().
Vector3D Triangle::b [private] |
The seconf point of the triangle.
Vector3D b
Definition at line 30 of file Triangle.h.
Referenced by CalcBounds(), GetNormal(), and Intersect().
Vector3D Triangle::c [private] |
The third point of the triangle.
Vector3D c
Definition at line 36 of file Triangle.h.
Referenced by CalcBounds(), GetNormal(), and Intersect().