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 38 of file trianglemesh.cpp.


Constructor & Destructor Documentation

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

Definition at line 41 of file trianglemesh.cpp.

References mesh, and v.


Member Function Documentation

BBox Triangle::ObjectBound (  )  const [virtual]

Implements Shape.

Definition at line 185 of file trianglemesh.cpp.

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

BBox Triangle::WorldBound (  )  const [virtual]

Reimplemented from Shape.

Definition at line 193 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 200 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 266 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 302 of file trianglemesh.cpp.

References mesh, and v.

Referenced by GetShadingGeometry(), and Intersect().

float Triangle::Area (  )  const [virtual]

Reimplemented from Shape.

Definition at line 316 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]

Reimplemented from Shape.

Definition at line 58 of file trianglemesh.cpp.

References Cross(), DifferentialGeometry::dpdu, DifferentialGeometry::dpdx, DifferentialGeometry::dpdy, DifferentialGeometry::dudx, DifferentialGeometry::dudy, DifferentialGeometry::dvdx, DifferentialGeometry::dvdy, GetUVs(), mesh, DifferentialGeometry::nn, Normalize(), Shape::ObjectToWorld, DifferentialGeometry::p, DifferentialGeometry::shape, SolveLinearSystem2x2(), DifferentialGeometry::u, v, and DifferentialGeometry::v.

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

Reimplemented from Shape.

Definition at line 323 of file trianglemesh.cpp.

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


Member Data Documentation

Reference<TriangleMesh> Triangle::mesh [private]

Definition at line 124 of file trianglemesh.cpp.

Referenced by Area(), GetShadingGeometry(), GetUVs(), Intersect(), IntersectP(), ObjectBound(), Sample(), Triangle(), and WorldBound().

int* Triangle::v [private]

Definition at line 125 of file trianglemesh.cpp.

Referenced by Area(), GetShadingGeometry(), GetUVs(), Intersect(), IntersectP(), ObjectBound(), Sample(), Triangle(), and WorldBound().


The documentation for this class was generated from the following file:
Generated on Wed Sep 26 14:01:28 2007 for pbrt by  doxygen 1.5.1