#include <waldtrianglemesh.h>
Public Member Functions | |
WaldTriangle (const Transform &o2w, bool ro, WaldTriangleMesh *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 Types | |
enum | IntersectionType { DOMINANT_X, DOMINANT_Y, DOMINANT_Z, ORTHOGONAL_X, ORTHOGONAL_Y, ORTHOGONAL_Z, DEGENERATE } |
Private Attributes | |
WaldTriangleMesh * | mesh |
int * | v |
IntersectionType | intersectionType |
float | nu |
float | nv |
float | nd |
float | bnu |
float | bnv |
float | bnd |
float | cnu |
float | cnv |
float | cnd |
Vector | dpdu |
Vector | dpdv |
Normal | normalizedNormal |
Definition at line 60 of file waldtrianglemesh.h.
enum lux::WaldTriangle::IntersectionType [private] |
Definition at line 177 of file waldtrianglemesh.h.
WaldTriangle::WaldTriangle | ( | const Transform & | o2w, | |
bool | ro, | |||
WaldTriangleMesh * | m, | |||
int | n | |||
) |
Definition at line 99 of file waldtrianglemesh.cpp.
References bnd, bnu, bnv, cnd, cnu, cnv, lux::CoordinateSystem(), lux::Cross(), DEGENERATE, DOMINANT_X, DOMINANT_Y, DOMINANT_Z, lux::Dot(), dpdu, dpdv, GetUVs(), intersectionType, mesh, lux::WaldTriangleMesh::n, nd, lux::Normalize(), normalizedNormal, nu, nv, lux::Shape::ObjectToWorld, ORTHOGONAL_X, ORTHOGONAL_Y, ORTHOGONAL_Z, lux::WaldTriangleMesh::p, lux::Shape::reverseOrientation, lux::Shape::transformSwapsHandedness, v, lux::WaldTriangleMesh::vertexIndex, lux::Point::x, lux::Vector::x, lux::Point::y, lux::Vector::y, lux::Point::z, and lux::Vector::z.
float WaldTriangle::Area | ( | ) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 650 of file waldtrianglemesh.cpp.
References lux::Cross(), lux::Vector::Length(), mesh, lux::WaldTriangleMesh::p, and v.
virtual void lux::WaldTriangle::GetShadingGeometry | ( | const Transform & | obj2world, | |
const DifferentialGeometry & | dg, | |||
DifferentialGeometry * | dgShading | |||
) | const [inline, virtual] |
Reimplemented from lux::Shape.
Definition at line 90 of file waldtrianglemesh.h.
References lux::Cross(), lux::DifferentialGeometry::dpdu, lux::DifferentialGeometry::dpdx, lux::DifferentialGeometry::dpdy, lux::DifferentialGeometry::dudx, lux::DifferentialGeometry::dudy, lux::DifferentialGeometry::dvdx, lux::DifferentialGeometry::dvdy, GetUVs(), mesh, lux::WaldTriangleMesh::n, lux::DifferentialGeometry::nn, lux::Normalize(), lux::Shape::ObjectToWorld, lux::DifferentialGeometry::p, lux::WaldTriangleMesh::s, lux::DifferentialGeometry::shape, lux::SolveLinearSystem2x2(), lux::DifferentialGeometry::u, v, and lux::DifferentialGeometry::v.
void lux::WaldTriangle::GetUVs | ( | float | uv[3][2] | ) | const [inline] |
Definition at line 71 of file waldtrianglemesh.h.
References mesh, lux::WaldTriangleMesh::p, lux::WaldTriangleMesh::uvs, v, lux::Point::x, and lux::Point::y.
Referenced by GetShadingGeometry(), Intersect(), and WaldTriangle().
bool WaldTriangle::Intersect | ( | const Ray & | ray, | |
float * | tHit, | |||
DifferentialGeometry * | dg | |||
) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 287 of file waldtrianglemesh.cpp.
References bnd, bnu, bnv, cnd, cnu, cnv, lux::Ray::d, DEGENERATE, DOMINANT_X, DOMINANT_Y, DOMINANT_Z, dpdu, dpdv, GetUVs(), intersectionType, lux::Ray::maxt, nd, normalizedNormal, nu, nv, lux::Ray::o, ORTHOGONAL_X, ORTHOGONAL_Y, ORTHOGONAL_Z, lux::Point::x, lux::Vector::x, lux::Point::y, lux::Vector::y, lux::Point::z, and lux::Vector::z.
bool WaldTriangle::IntersectP | ( | const Ray & | ray | ) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 481 of file waldtrianglemesh.cpp.
References bnd, bnu, bnv, cnd, cnu, cnv, lux::Ray::d, DEGENERATE, DOMINANT_X, DOMINANT_Y, DOMINANT_Z, intersectionType, lux::Ray::maxt, nd, nu, nv, lux::Ray::o, ORTHOGONAL_X, ORTHOGONAL_Y, ORTHOGONAL_Z, lux::Point::x, lux::Vector::x, lux::Point::y, lux::Vector::y, lux::Point::z, and lux::Vector::z.
BBox WaldTriangle::ObjectBound | ( | ) | const [virtual] |
Implements lux::Shape.
Definition at line 270 of file waldtrianglemesh.cpp.
References mesh, lux::WaldTriangleMesh::p, lux::Union(), v, and lux::Shape::WorldToObject.
Reimplemented from lux::Shape.
Definition at line 658 of file waldtrianglemesh.cpp.
References mesh, normalizedNormal, blender::p, lux::WaldTriangleMesh::p, lux::UniformSampleTriangle(), and v.
BBox WaldTriangle::WorldBound | ( | ) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 279 of file waldtrianglemesh.cpp.
References mesh, lux::WaldTriangleMesh::p, lux::Union(), and v.
float lux::WaldTriangle::bnd [private] |
Definition at line 189 of file waldtrianglemesh.h.
Referenced by Intersect(), IntersectP(), and WaldTriangle().
float lux::WaldTriangle::bnu [private] |
Definition at line 189 of file waldtrianglemesh.h.
Referenced by Intersect(), IntersectP(), and WaldTriangle().
float lux::WaldTriangle::bnv [private] |
Definition at line 189 of file waldtrianglemesh.h.
Referenced by Intersect(), IntersectP(), and WaldTriangle().
float lux::WaldTriangle::cnd [private] |
Definition at line 190 of file waldtrianglemesh.h.
Referenced by Intersect(), IntersectP(), and WaldTriangle().
float lux::WaldTriangle::cnu [private] |
Definition at line 190 of file waldtrianglemesh.h.
Referenced by Intersect(), IntersectP(), and WaldTriangle().
float lux::WaldTriangle::cnv [private] |
Definition at line 190 of file waldtrianglemesh.h.
Referenced by Intersect(), IntersectP(), and WaldTriangle().
Vector lux::WaldTriangle::dpdu [private] |
Vector lux::WaldTriangle::dpdv [private] |
Definition at line 187 of file waldtrianglemesh.h.
Referenced by Intersect(), IntersectP(), and WaldTriangle().
WaldTriangleMesh* lux::WaldTriangle::mesh [private] |
Definition at line 173 of file waldtrianglemesh.h.
Referenced by Area(), GetShadingGeometry(), GetUVs(), ObjectBound(), Sample(), WaldTriangle(), and WorldBound().
float lux::WaldTriangle::nd [private] |
Definition at line 188 of file waldtrianglemesh.h.
Referenced by Intersect(), IntersectP(), and WaldTriangle().
Normal lux::WaldTriangle::normalizedNormal [private] |
Definition at line 194 of file waldtrianglemesh.h.
Referenced by Intersect(), Sample(), and WaldTriangle().
float lux::WaldTriangle::nu [private] |
Definition at line 188 of file waldtrianglemesh.h.
Referenced by Intersect(), IntersectP(), and WaldTriangle().
float lux::WaldTriangle::nv [private] |
Definition at line 188 of file waldtrianglemesh.h.
Referenced by Intersect(), IntersectP(), and WaldTriangle().
int* lux::WaldTriangle::v [private] |
Definition at line 174 of file waldtrianglemesh.h.
Referenced by Area(), GetShadingGeometry(), GetUVs(), ObjectBound(), Sample(), WaldTriangle(), and WorldBound().