#include <Triangle.h>
Inherits Primitive.
Public Member Functions | |
Triangle (Material *material, const Point &A, const Point &B, const Point &C) | |
Define parameters. | |
virtual | ~Triangle () |
virtual void | getBounds (BoundingBox &bbox) const |
virtual void | intersect (HitRecord &hit, const RenderContext &context, const Ray &ray) const |
Intersect ray with triangle. | |
virtual void | normal (Vector &normal, const RenderContext &context, const Point &hitpos, const Ray &ray, const HitRecord &hit) const |
Return normal for the hit location. Generally called after all ray-geometry intersection to get the normal for the hit point. |
Definition at line 17 of file Triangle.h.
|
Define parameters.
Definition at line 17 of file Triangle.cc. |
|
Definition at line 25 of file Triangle.cc. |
|
Implements Object. Definition at line 103 of file Triangle.cc. References BoundingBox::extend(). |
|
Intersect ray with triangle. Taken from the Moller-Trombore implementation Implements Primitive. Definition at line 37 of file Triangle.cc. References Cross(), Ray::direction(), Dot(), EPSILON, HitRecord::hit(), Primitive::matl, and Ray::origin(). |
|
Return normal for the hit location. Generally called after all ray-geometry intersection to get the normal for the hit point.
Implements Primitive. Definition at line 86 of file Triangle.cc. References Cross(). |