Triangle Class Reference

Inheritance diagram for Triangle:

Shape ReferenceCounted

List of all members.

Public Member Functions

 Triangle (const Transform &o2w, bool ro, TriangleMesh *m, int n)
BBox ObjectBound () const
BBox WorldBound () const
bool Intersect (const Ray &ray, float *tHit, DifferentialGeometry *dg) const
bool IntersectP (const Ray &ray) const
void GetUVs (float uv[3][2]) const
float Area () const
virtual void GetShadingGeometry (const Transform &obj2world, const DifferentialGeometry &dg, DifferentialGeometry *dgShading) const
Point Sample (float u1, float u2, Normal *Ns) const

Private Attributes

Reference< TriangleMeshmesh
int * v


Detailed Description

Definition at line 51 of file trianglemesh.cpp.


Constructor & Destructor Documentation

Triangle::Triangle ( const Transform o2w,
bool  ro,
TriangleMesh m,
int  n 
) [inline]

Definition at line 54 of file trianglemesh.cpp.

References mesh, and v.


Member Function Documentation

BBox Triangle::ObjectBound (  )  const [virtual]

Implements Shape.

Definition at line 198 of file trianglemesh.cpp.

References mesh, Union(), v, and Shape::WorldToObject.

BBox Triangle::WorldBound (  )  const [virtual]

Reimplemented from Shape.

Definition at line 206 of file trianglemesh.cpp.

References mesh, Union(), and v.

bool Triangle::Intersect ( const Ray ray,
float *  tHit,
DifferentialGeometry dg 
) const [virtual]

Reimplemented from Shape.

Definition at line 213 of file trianglemesh.cpp.

References StatsPercentage::Add(), CoordinateSystem(), Cross(), Ray::d, Dot(), GetUVs(), Ray::maxt, mesh, Normalize(), Ray::o, and v.

bool Triangle::IntersectP ( const Ray ray  )  const [virtual]

Reimplemented from Shape.

Definition at line 279 of file trianglemesh.cpp.

References StatsPercentage::Add(), Cross(), Ray::d, Dot(), Ray::maxt, mesh, Ray::o, and v.

void Triangle::GetUVs ( float  uv[3][2]  )  const

Definition at line 315 of file trianglemesh.cpp.

References mesh, and v.

Referenced by GetShadingGeometry(), and Intersect().

float Triangle::Area (  )  const [virtual]

Reimplemented from Shape.

Definition at line 329 of file trianglemesh.cpp.

References Cross(), Vector::Length(), mesh, and v.

virtual void Triangle::GetShadingGeometry ( const Transform obj2world,
const DifferentialGeometry dg,
DifferentialGeometry dgShading 
) const [inline, virtual]

Point Triangle::Sample ( float  u1,
float  u2,
Normal Ns 
) const [virtual]

Reimplemented from Shape.

Definition at line 336 of file trianglemesh.cpp.

References Cross(), mesh, Normalize(), Shape::reverseOrientation, UniformSampleTriangle(), and v.


Member Data Documentation

int* Triangle::v [private]


The documentation for this class was generated from the following file:

Generated on Mon Jul 20 17:31:56 2009 for pbrt by  doxygen 1.5.6