lux::MeshWaldTriangle Class Reference

#include <mesh.h>

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

List of all members.

Public Member Functions

 MeshWaldTriangle (const Mesh *m, int n)
virtual ~MeshWaldTriangle ()
virtual bool Intersect (const Ray &ray, Intersection *isect) const
virtual bool IntersectP (const Ray &ray) const
virtual void Sample (float u1, float u2, float u3, DifferentialGeometry *dg) const
virtual bool isDegenerate () const

Private Types

enum  IntersectionType { DOMINANT_X, DOMINANT_Y, DOMINANT_Z, DEGENERATE }

Private Attributes

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

Detailed Description

Definition at line 164 of file mesh.h.


Member Enumeration Documentation

Enumerator:
DOMINANT_X 
DOMINANT_Y 
DOMINANT_Z 
DEGENERATE 

Definition at line 179 of file mesh.h.


Constructor & Destructor Documentation

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

Definition at line 168 of file mesh.h.


Member Function Documentation

bool MeshWaldTriangle::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::MeshBaryTriangle.

Definition at line 156 of file meshwaldtriangle.cpp.

References bnd, bnu, bnv, cnd, cnu, cnv, lux::Ray::d, lux::Intersection::dg, DOMINANT_X, DOMINANT_Y, DOMINANT_Z, dpdu, dpdv, lux::Shape::GetMaterial(), lux::MeshBaryTriangle::GetUVs(), intersectionType, lux::Ray::maxt, lux::MeshBaryTriangle::mesh, lux::Ray::mint, nd, normalizedNormal, nu, nv, lux::Ray::o, lux::Mesh::p, lux::Intersection::Set(), lux::DifferentialGeometry::triangleBaryCoords, lux::MeshBaryTriangle::v, lux::Shape::WorldToObject, lux::Vector::x, lux::Point::x, lux::Vector::y, lux::Point::y, lux::Vector::z, and lux::Point::z.

bool MeshWaldTriangle::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::MeshBaryTriangle.

Definition at line 238 of file meshwaldtriangle.cpp.

References bnd, bnu, bnv, cnd, cnu, cnv, lux::Ray::d, DOMINANT_X, DOMINANT_Y, DOMINANT_Z, intersectionType, lux::Ray::maxt, lux::Ray::mint, nd, nu, nv, lux::Ray::o, lux::Vector::x, lux::Point::x, lux::Vector::y, lux::Point::y, lux::Vector::z, and lux::Point::z.

bool MeshWaldTriangle::isDegenerate (  )  const [virtual]

Reimplemented from lux::MeshBaryTriangle.

Definition at line 318 of file meshwaldtriangle.cpp.

References DEGENERATE, and intersectionType.

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

void MeshWaldTriangle::Sample ( float  u1,
float  u2,
float  u3,
DifferentialGeometry dg 
) const [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::MeshBaryTriangle.

Definition at line 298 of file meshwaldtriangle.cpp.

References dpdu, lux::DifferentialGeometry::dpdu, dpdv, lux::DifferentialGeometry::dpdv, lux::MeshBaryTriangle::GetUVs(), lux::MeshBaryTriangle::mesh, lux::DifferentialGeometry::nn, normalizedNormal, lux::DifferentialGeometry::p, lux::Mesh::p, lux::DifferentialGeometry::u, lux::UniformSampleTriangle(), lux::DifferentialGeometry::v, and lux::MeshBaryTriangle::v.


Member Data Documentation

float lux::MeshWaldTriangle::bnd [private]

Definition at line 187 of file mesh.h.

Referenced by Intersect(), IntersectP(), and MeshWaldTriangle().

float lux::MeshWaldTriangle::bnu [private]

Definition at line 187 of file mesh.h.

Referenced by Intersect(), IntersectP(), and MeshWaldTriangle().

float lux::MeshWaldTriangle::bnv [private]

Definition at line 187 of file mesh.h.

Referenced by Intersect(), IntersectP(), and MeshWaldTriangle().

float lux::MeshWaldTriangle::cnd [private]

Definition at line 188 of file mesh.h.

Referenced by Intersect(), IntersectP(), and MeshWaldTriangle().

float lux::MeshWaldTriangle::cnu [private]

Definition at line 188 of file mesh.h.

Referenced by Intersect(), IntersectP(), and MeshWaldTriangle().

float lux::MeshWaldTriangle::cnv [private]

Definition at line 188 of file mesh.h.

Referenced by Intersect(), IntersectP(), and MeshWaldTriangle().

Definition at line 191 of file mesh.h.

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

Definition at line 191 of file mesh.h.

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

Definition at line 185 of file mesh.h.

Referenced by Intersect(), IntersectP(), isDegenerate(), and MeshWaldTriangle().

float lux::MeshWaldTriangle::nd [private]

Definition at line 186 of file mesh.h.

Referenced by Intersect(), IntersectP(), and MeshWaldTriangle().

Definition at line 192 of file mesh.h.

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

float lux::MeshWaldTriangle::nu [private]

Definition at line 186 of file mesh.h.

Referenced by Intersect(), IntersectP(), and MeshWaldTriangle().

float lux::MeshWaldTriangle::nv [private]

Definition at line 186 of file mesh.h.

Referenced by Intersect(), IntersectP(), and MeshWaldTriangle().


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