lux::MeshQuadrilateral Class Reference

#include <mesh.h>

Inheritance diagram for lux::MeshQuadrilateral:
[legend]
Collaboration diagram for lux::MeshQuadrilateral:
[legend]

List of all members.

Public Member Functions

 MeshQuadrilateral (const Mesh *m, int n)
virtual ~MeshQuadrilateral ()
virtual BBox ObjectBound () const
virtual BBox WorldBound () const
virtual bool CanIntersect () const
virtual bool Intersect (const Ray &ray, Intersection *isect) const
virtual bool IntersectP (const Ray &ray) const
virtual void GetShadingGeometry (const Transform &obj2world, const DifferentialGeometry &dg, DifferentialGeometry *dgShading) const
virtual bool CanSample () const
virtual float Area () const
virtual void Sample (float u1, float u2, float u3, DifferentialGeometry *dg) const
bool isDegenerate () const

Static Public Member Functions

static bool IsPlanar (const Point &p0, const Point &p1, const Point &p2, const Point &p3)
static bool IsDegenerate (const Point &p0, const Point &p1, const Point &p2, const Point &p3)
static bool IsConvex (const Point &p0, const Point &p1, const Point &p2, const Point &p3)

Private Member Functions

void GetUVs (float uv[4][2]) const

Static Private Member Functions

static int MajorAxis (const Vector &v)
static void ComputeV11BarycentricCoords (const Vector &e01, const Vector &e02, const Vector &e03, float *a11, float *b11)

Private Attributes

const Meshmesh
const intidx

Detailed Description

Definition at line 201 of file mesh.h.


Constructor & Destructor Documentation

MeshQuadrilateral::MeshQuadrilateral ( const Mesh m,
int  n 
)
virtual lux::MeshQuadrilateral::~MeshQuadrilateral (  )  [inline, virtual]

Definition at line 205 of file mesh.h.


Member Function Documentation

float MeshQuadrilateral::Area (  )  const [virtual]

Returns the area of this primitive.

Reimplemented from lux::Primitive.

Definition at line 435 of file meshquadrilateral.cpp.

References lux::Cross(), idx, lux::Vector::Length(), mesh, and lux::Mesh::p.

virtual bool lux::MeshQuadrilateral::CanIntersect (  )  const [inline, virtual]

Returns whether this primitive can be intersected.

Implements lux::Primitive.

Definition at line 210 of file mesh.h.

virtual bool lux::MeshQuadrilateral::CanSample (  )  const [inline, virtual]

Returns whether this primitive can be sampled.

Implements lux::Primitive.

Definition at line 218 of file mesh.h.

void MeshQuadrilateral::ComputeV11BarycentricCoords ( const Vector e01,
const Vector e02,
const Vector e03,
float *  a11,
float *  b11 
) [static, private]
void MeshQuadrilateral::GetShadingGeometry ( const Transform obj2world,
const DifferentialGeometry dg,
DifferentialGeometry dgShading 
) const [virtual]
void lux::MeshQuadrilateral::GetUVs ( float  uv[4][2]  )  const [inline, private]

Definition at line 260 of file mesh.h.

References idx, mesh, lux::Mesh::p, lux::Mesh::uvs, lux::Point::x, and lux::Point::y.

Referenced by GetShadingGeometry(), Intersect(), and Sample().

bool MeshQuadrilateral::Intersect ( const Ray r,
Intersection in 
) const [virtual]

Intersects this primitive with the given ray. If an intersection is found, the ray will (i.e. r.tmax) and all fields in the intersection info will be updated.

Parameters:
r The ray to intersect with this primitive.
in The destination of the intersection information.
Returns:
Whether an intersection was found.

Reimplemented from lux::Primitive.

Definition at line 271 of file meshquadrilateral.cpp.

References lux::DifferentialGeometry::AdjustNormal(), ComputeV11BarycentricCoords(), lux::CoordinateSystem(), lux::Cross(), lux::Ray::d, lux::Intersection::dg, lux::Dot(), lux::Shape::GetMaterial(), GetUVs(), idx, lux::Invert3x3(), lux::Ray::maxt, mesh, lux::Mesh::n, lux::Normalize(), lux::Ray::o, lux::Shape::ObjectToWorld, lux::Mesh::p, Quadratic(), lux::Shape::reverseOrientation, lux::Intersection::Set(), lux::Shape::transformSwapsHandedness, lux::Shape::WorldToObject, lux::Vector::x, lux::Vector::y, and lux::Vector::z.

Referenced by IntersectP().

bool MeshQuadrilateral::IntersectP ( const Ray r  )  const [virtual]

Tests for intersection of this primitive with the given ray.

Parameters:
r The ray to intersect with this primitive.
Returns:
Whether an intersection was found.

Reimplemented from lux::Primitive.

Definition at line 431 of file meshquadrilateral.cpp.

References Intersect().

bool MeshQuadrilateral::IsConvex ( const Point p0,
const Point p1,
const Point p2,
const Point p3 
) [static]

Definition at line 73 of file meshquadrilateral.cpp.

References lux::Cross(), lux::Dot(), lux::Normalize(), lux::Vector::x, and lux::Vector::z.

Referenced by MeshQuadrilateral().

bool MeshQuadrilateral::IsDegenerate ( const Point p0,
const Point p1,
const Point p2,
const Point p3 
) [static]

Definition at line 29 of file meshquadrilateral.cpp.

References lux::Vector::Length().

Referenced by MeshQuadrilateral().

bool lux::MeshQuadrilateral::isDegenerate (  )  const [inline]

Definition at line 247 of file mesh.h.

Referenced by lux::Mesh::Refine().

bool MeshQuadrilateral::IsPlanar ( const Point p0,
const Point p1,
const Point p2,
const Point p3 
) [static]

Definition at line 46 of file meshquadrilateral.cpp.

References lux::Cross(), lux::Dot(), lux::Vector::Length(), and p.

Referenced by lux::Mesh::Mesh(), and MeshQuadrilateral().

int MeshQuadrilateral::MajorAxis ( const Vector v  )  [static, private]

Definition at line 136 of file meshquadrilateral.cpp.

References lux::Vector::x, lux::Vector::y, and lux::Vector::z.

Referenced by ComputeV11BarycentricCoords().

BBox MeshQuadrilateral::ObjectBound (  )  const [virtual]

Definition at line 242 of file meshquadrilateral.cpp.

References idx, mesh, lux::Mesh::p, lux::Union(), and lux::Shape::WorldToObject.

virtual void lux::MeshQuadrilateral::Sample ( float  u1,
float  u2,
float  u3,
DifferentialGeometry dg 
) const [inline, virtual]

Samples a point on this primitive. Only the p, nn, dpdu, dpdv, u and v need to be calculated.

Parameters:
u1 The point coordinate in the first dimension.
u2 The point coordinate in the second dimension.
u3 The subprimitive to sample.
dg The destination to store the sampled point in.

Reimplemented from lux::Primitive.

Definition at line 220 of file mesh.h.

References lux::CoordinateSystem(), lux::Cross(), lux::DifferentialGeometry::dpdu, lux::DifferentialGeometry::dpdv, GetUVs(), idx, mesh, lux::DifferentialGeometry::nn, lux::Normalize(), lux::DifferentialGeometry::p, lux::Mesh::p, lux::Shape::reverseOrientation, lux::Shape::transformSwapsHandedness, lux::DifferentialGeometry::u, and lux::DifferentialGeometry::v.

BBox MeshQuadrilateral::WorldBound (  )  const [virtual]

Returns the world bounds of this primitive.

Implements lux::Primitive.

Definition at line 257 of file meshquadrilateral.cpp.

References idx, mesh, lux::Mesh::p, and lux::Union().

Referenced by GetShadingGeometry().


Member Data Documentation

const int* lux::MeshQuadrilateral::idx [private]

The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208