#include <quadrilateral.h>
Public Member Functions | |
Quadrilateral (const Transform &o2w, bool ro, QuadMesh *m, int *indices) | |
virtual | ~Quadrilateral () |
virtual BBox | ObjectBound () const |
virtual BBox | WorldBound () const |
virtual bool | Intersect (const Ray &ray, float *tHit, DifferentialGeometry *dg) const |
virtual bool | IntersectP (const Ray &ray) const |
void | GetUVs (float uv[4][2]) const |
virtual float | Area () const |
virtual Point | Sample (float u1, float u2, float u3, Normal *Ns) const |
Private Attributes | |
int * | idx |
QuadMesh * | mesh |
Definition at line 64 of file quadrilateral.h.
Definition at line 46 of file quadrilateral.cpp.
Quadrilateral::~Quadrilateral | ( | ) | [virtual] |
Definition at line 53 of file quadrilateral.cpp.
float Quadrilateral::Area | ( | ) | const [virtual] |
Returns the area of this primitive.
Reimplemented from lux::Primitive.
Definition at line 238 of file quadrilateral.cpp.
References lux::Cross(), idx, lux::Vector::Length(), mesh, and lux::QuadMesh::p.
Referenced by lux::Quad::Area().
void lux::Quadrilateral::GetUVs | ( | float | uv[4][2] | ) | const [inline] |
Definition at line 74 of file quadrilateral.h.
References idx, mesh, and lux::QuadMesh::uvs.
Referenced by Intersect().
bool Quadrilateral::Intersect | ( | const Ray & | ray, | |
float * | tHit, | |||
DifferentialGeometry * | dg | |||
) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 75 of file quadrilateral.cpp.
References lux::CoordinateSystem(), lux::Cross(), lux::Ray::d, lux::Dot(), GetUVs(), idx, lux::Invert3x3(), MajorAxis(), lux::Ray::maxt, mesh, lux::Normalize(), lux::Ray::o, lux::QuadMesh::p, Quadratic(), lux::Vector::x, lux::Vector::y, and lux::Vector::z.
Referenced by lux::Quad::Intersect(), and IntersectP().
bool Quadrilateral::IntersectP | ( | const Ray & | r | ) | const [virtual] |
Tests for intersection of this primitive with the given ray.
r | The ray to intersect with this primitive. |
Reimplemented from lux::Primitive.
Definition at line 230 of file quadrilateral.cpp.
References Intersect().
Referenced by lux::Quad::IntersectP().
BBox Quadrilateral::ObjectBound | ( | ) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 56 of file quadrilateral.cpp.
References idx, mesh, lux::QuadMesh::p, lux::Union(), and lux::Shape::WorldToObject.
Referenced by lux::Quad::ObjectBound().
virtual Point lux::Quadrilateral::Sample | ( | float | u1, | |
float | u2, | |||
float | u3, | |||
Normal * | Ns | |||
) | const [inline, virtual] |
Reimplemented from lux::Shape.
Definition at line 104 of file quadrilateral.h.
References lux::Cross(), idx, mesh, lux::Normalize(), lux::QuadMesh::p, p, and lux::Shape::reverseOrientation.
Referenced by lux::Quad::Sample().
BBox Quadrilateral::WorldBound | ( | ) | const [virtual] |
Returns the world bounds of this primitive.
Reimplemented from lux::Shape.
Definition at line 66 of file quadrilateral.cpp.
References idx, mesh, lux::QuadMesh::p, and lux::Union().
Referenced by lux::Quad::WorldBound().
int* lux::Quadrilateral::idx [private] |
Definition at line 125 of file quadrilateral.h.
Referenced by Area(), GetUVs(), Intersect(), ObjectBound(), Quadrilateral(), Sample(), and WorldBound().
QuadMesh* lux::Quadrilateral::mesh [private] |
Definition at line 126 of file quadrilateral.h.
Referenced by Area(), GetUVs(), Intersect(), ObjectBound(), Quadrilateral(), Sample(), and WorldBound().