#include <trianglemesh.h>
Public Member Functions | |
Triangle (const Transform *o2w, const Transform *w2o, bool ro, TriangleMesh *m, int n) | |
BBox | ObjectBound () const |
BBox | WorldBound () const |
bool | Intersect (const Ray &ray, float *tHit, float *rayEpsilon, 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< TriangleMesh > | mesh |
int * | v |
Definition at line 63 of file trianglemesh.h.
Triangle::Triangle | ( | const Transform * | o2w, | |
const Transform * | w2o, | |||
bool | ro, | |||
TriangleMesh * | m, | |||
int | n | |||
) | [inline] |
Definition at line 66 of file trianglemesh.h.
float Triangle::Area | ( | ) | const [virtual] |
Reimplemented from Shape.
Definition at line 276 of file trianglemesh.cpp.
References Cross(), Vector::Length(), mesh, and v.
void Triangle::GetShadingGeometry | ( | const Transform & | obj2world, | |
const DifferentialGeometry & | dg, | |||
DifferentialGeometry * | dgShading | |||
) | const [virtual] |
Reimplemented from Shape.
Definition at line 285 of file trianglemesh.cpp.
References CoordinateSystem(), Cross(), DifferentialGeometry::dpdu, DifferentialGeometry::dpdx, DifferentialGeometry::dpdy, DifferentialGeometry::dudx, DifferentialGeometry::dudy, DifferentialGeometry::dvdx, DifferentialGeometry::dvdy, GetUVs(), Vector::LengthSquared(), mesh, DifferentialGeometry::nn, Normalize(), Shape::ObjectToWorld, DifferentialGeometry::p, DifferentialGeometry::shape, SolveLinearSystem2x2(), DifferentialGeometry::u, v, and DifferentialGeometry::v.
void Triangle::GetUVs | ( | float | uv[3][2] | ) | const [inline] |
Definition at line 78 of file trianglemesh.h.
Referenced by GetShadingGeometry(), Intersect(), and IntersectP().
bool Triangle::Intersect | ( | const Ray & | ray, | |
float * | tHit, | |||
float * | rayEpsilon, | |||
DifferentialGeometry * | dg | |||
) | const [virtual] |
Reimplemented from Shape.
Definition at line 119 of file trianglemesh.cpp.
References CoordinateSystem(), Cross(), Ray::d, Ray::depth, Dot(), GetUVs(), Ray::maxt, mesh, Normalize(), Ray::o, and v.
bool Triangle::IntersectP | ( | const Ray & | ray | ) | const [virtual] |
Reimplemented from Shape.
Definition at line 203 of file trianglemesh.cpp.
References CoordinateSystem(), Cross(), Ray::d, Ray::depth, Dot(), GetUVs(), Ray::maxt, mesh, Normalize(), Ray::o, and v.
BBox Triangle::ObjectBound | ( | ) | const [virtual] |
Implements Shape.
Definition at line 100 of file trianglemesh.cpp.
References mesh, Union(), v, and Shape::WorldToObject.
Reimplemented from Shape.
Definition at line 436 of file trianglemesh.cpp.
References Cross(), mesh, Normalize(), Shape::ReverseOrientation, UniformSampleTriangle(), and v.
BBox Triangle::WorldBound | ( | ) | const [virtual] |
Reference<TriangleMesh> Triangle::mesh [private] |
Definition at line 100 of file trianglemesh.h.
Referenced by Area(), GetShadingGeometry(), GetUVs(), Intersect(), IntersectP(), ObjectBound(), Sample(), Triangle(), and WorldBound().
int* Triangle::v [private] |
Definition at line 101 of file trianglemesh.h.
Referenced by Area(), GetShadingGeometry(), GetUVs(), Intersect(), IntersectP(), ObjectBound(), Sample(), Triangle(), and WorldBound().