#include <mesh.h>
Definition at line 29 of file mesh.h.
Mesh::Mesh | ( | const Transform & | o2w, | |
bool | ro, | |||
MeshAccelType | acceltype, | |||
int | nv, | |||
const Point * | P, | |||
const Normal * | N, | |||
const float * | UV, | |||
MeshTriangleType | tritype, | |||
int | trisCount, | |||
const int * | tris, | |||
MeshQuadType | quadtype, | |||
int | nquadsCount, | |||
const int * | quads, | |||
MeshSubdivType | subdivType, | |||
int | nsubdivlevels, | |||
boost::shared_ptr< Texture< float > > | displacementMap, | |||
float | displacementMapScale, | |||
float | displacementMapOffset, | |||
bool | displacementMapNormalSmooth, | |||
bool | displacementMapSharpBoundary | |||
) |
Definition at line 30 of file mesh.cpp.
References accelType, displacementMap, displacementMapNormalSmooth, displacementMapOffset, displacementMapScale, displacementMapSharpBoundary, lux::MeshQuadrilateral::IsPlanar(), LUX_INFO, LUX_NOERROR, luxError, cimg_library::cimg::max(), memcpy(), mustSubdivide, n, lux::Normalize(), nquads, nSubdivLevels, ntris, nverts, lux::Shape::ObjectToWorld, p, quadType, quadVertexIndex, subdivType, triType, triVertexIndex, and uvs.
Mesh::~Mesh | ( | ) | [virtual] |
Definition at line 183 of file mesh.cpp.
References n, p, quadVertexIndex, triVertexIndex, and uvs.
virtual bool lux::Mesh::CanIntersect | ( | ) | const [inline, virtual] |
Returns whether this primitive can be intersected.
Reimplemented from lux::Shape.
virtual bool lux::Mesh::CanSample | ( | ) | const [inline, virtual] |
Returns whether this primitive can be sampled.
Reimplemented from lux::Shape.
Shape * Mesh::CreateShape | ( | const Transform & | o2w, | |
bool | reverseOrientation, | |||
const ParamSet & | params | |||
) | [static] |
Definition at line 594 of file mesh.cpp.
References lux::ParamSet::FindFloat(), lux::ParamSet::FindInt(), lux::ParamSet::FindOneInt(), and lux::ParamSet::FindOneString().
BBox Mesh::ObjectBound | ( | ) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 192 of file mesh.cpp.
References nverts, p, lux::Union(), and lux::Shape::WorldToObject.
void Mesh::Refine | ( | vector< boost::shared_ptr< Primitive > > & | refined, | |
const PrimitiveRefinementHints & | refineHints, | |||
boost::shared_ptr< Primitive > | thisPtr | |||
) | [virtual] |
Refines this primitive to a number of primitives that are intersectable and satisfy all the given hints if possible. If this primitive should not be deallocated after refinement, it must make sure that one of the refined primitives has a shared pointer to this primitive (i.e. a copy of thisPtr)
refined | The destenation list for the result. | |
refineHints | The hints for the refinement. | |
thisPtr | The shared pointer to this primitive. |
Reimplemented from lux::Shape.
Definition at line 219 of file mesh.cpp.
References ACCEL_AUTO, ACCEL_BRUTEFORCE, ACCEL_GRID, ACCEL_KDTREE, ACCEL_NONE, ACCEL_QBVH, accelType, displacementMap, displacementMapNormalSmooth, displacementMapOffset, displacementMapScale, displacementMapSharpBoundary, lux::PrimitiveRefinementHints::forSampling, lux::MeshQuadrilateral::isDegenerate(), lux::MeshBaryTriangle::isDegenerate(), lux::MeshWaldTriangle::isDegenerate(), LUX_CONSISTENCY, LUX_DEBUG, LUX_ERROR, LUX_NOERROR, luxError, lux::MakeAccelerator(), memcpy(), MeshBaryTriangle, MeshQuadrilateral, MeshWaldTriangle, mustSubdivide, n, lux::Normalize(), nquads, nSubdivLevels, ntris, nverts, lux::Shape::ObjectToWorld, p, QUAD_QUADRILATERAL, quadType, lux::LoopSubdiv::Refine(), lux::Shape::reverseOrientation, SUBDIV_LOOP, subdivType, cimg_library::cimg::swap(), TRI_AUTO, TRI_BARY, TRI_WALD, triType, triVertexIndex, and uvs.
BBox Mesh::WorldBound | ( | ) | const [virtual] |
Returns the world bounds of this primitive.
Reimplemented from lux::Shape.
Definition at line 200 of file mesh.cpp.
References nverts, p, and lux::Union().
friend class MeshBaryTriangle [friend] |
friend class MeshQuadrilateral [friend] |
friend class MeshWaldTriangle [friend] |
MeshAccelType lux::Mesh::accelType [protected] |
boost::shared_ptr<Texture<float> > lux::Mesh::displacementMap [protected] |
bool lux::Mesh::displacementMapNormalSmooth [protected] |
float lux::Mesh::displacementMapOffset [protected] |
float lux::Mesh::displacementMapScale [protected] |
bool lux::Mesh::displacementMapSharpBoundary [protected] |
bool lux::Mesh::mustSubdivide [protected] |
Normal* lux::Mesh::n [protected] |
Definition at line 83 of file mesh.h.
Referenced by lux::MeshQuadrilateral::GetShadingGeometry(), lux::MeshBaryTriangle::GetShadingGeometry(), lux::MeshQuadrilateral::Intersect(), Mesh(), Refine(), and ~Mesh().
int lux::Mesh::nquads [protected] |
int lux::Mesh::nSubdivLevels [protected] |
int lux::Mesh::ntris [protected] |
int lux::Mesh::nverts [protected] |
Definition at line 81 of file mesh.h.
Referenced by Mesh(), ObjectBound(), Refine(), and WorldBound().
Point* lux::Mesh::p [protected] |
Definition at line 82 of file mesh.h.
Referenced by lux::MeshQuadrilateral::Area(), lux::MeshBaryTriangle::Area(), lux::MeshBaryTriangle::GetP(), lux::MeshQuadrilateral::GetUVs(), lux::MeshWaldTriangle::Intersect(), lux::MeshQuadrilateral::Intersect(), lux::MeshBaryTriangle::Intersect(), lux::MeshBaryTriangle::IntersectP(), Mesh(), lux::MeshQuadrilateral::MeshQuadrilateral(), lux::MeshWaldTriangle::MeshWaldTriangle(), lux::MeshQuadrilateral::ObjectBound(), lux::MeshBaryTriangle::ObjectBound(), ObjectBound(), Refine(), lux::MeshWaldTriangle::Sample(), lux::MeshBaryTriangle::Sample(), lux::MeshQuadrilateral::Sample(), lux::MeshQuadrilateral::WorldBound(), lux::MeshBaryTriangle::WorldBound(), WorldBound(), and ~Mesh().
MeshQuadType lux::Mesh::quadType [protected] |
int* lux::Mesh::quadVertexIndex [protected] |
MeshSubdivType lux::Mesh::subdivType [protected] |
MeshTriangleType lux::Mesh::triType [protected] |
int* lux::Mesh::triVertexIndex [protected] |
float* lux::Mesh::uvs [protected] |
Definition at line 84 of file mesh.h.
Referenced by lux::MeshQuadrilateral::GetShadingGeometry(), lux::MeshQuadrilateral::GetUVs(), lux::MeshBaryTriangle::GetUVs(), Mesh(), Refine(), and ~Mesh().