Triangle Class Reference

#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.


Detailed Description

Definition at line 17 of file Triangle.h.


Constructor & Destructor Documentation

Triangle Material material,
const Point &  A,
const Point &  B,
const Point &  C
 

Define parameters.

Definition at line 17 of file Triangle.cc.

~Triangle  )  [virtual]
 

Definition at line 25 of file Triangle.cc.


Member Function Documentation

void getBounds BoundingBox bbox  )  const [virtual]
 

Implements Object.

Definition at line 103 of file Triangle.cc.

References BoundingBox::extend().

void intersect HitRecord hit,
const RenderContext context,
const Ray ray
const [virtual]
 

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().

void normal Vector normal,
const RenderContext context,
const Point &  hitpos,
const Ray ray,
const HitRecord hit
const [virtual]
 

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().


The documentation for this class was generated from the following files:
Generated on Tue Jan 29 21:34:56 2008 for specter by  doxygen 1.4.6