Nori  24
WavefrontOBJ Class Reference

Loader for Wavefront OBJ triangle meshes. More...

Inheritance diagram for WavefrontOBJ:
Collaboration diagram for WavefrontOBJ:

Classes

struct  OBJVertex
 Vertex indices used by the OBJ format. More...
 
struct  OBJVertexHash
 Hash function for OBJVertex. More...
 

Public Member Functions

 WavefrontOBJ (const PropertyList &propList)
 
- Public Member Functions inherited from Mesh
virtual void activate () override
 Initialize internal data structures (called once by the XML parser)
 
virtual uint32_t getPrimitiveCount () const override
 Return the total number of triangles in this shape.
 
virtual BoundingBox3f getBoundingBox (uint32_t index) const override
 
virtual Point3f getCentroid (uint32_t index) const override
 
virtual bool rayIntersect (uint32_t index, const Ray3f &ray, float &u, float &v, float &t) const override
 Ray-triangle intersection test. More...
 
virtual void setHitInformation (uint32_t index, const Ray3f &ray, Intersection &its) const override
 Set intersection information: hit point, shading frame, UVs.
 
uint32_t getVertexCount () const
 Return the total number of vertices in this shape.
 
virtual void sampleSurface (ShapeQueryRecord &sRec, const Point2f &sample) const override
 Uniformly sample a position on the mesh with respect to surface area.
 
virtual float pdfSurface (const ShapeQueryRecord &sRec) const override
 Return the probability of sampling a point sRec.p by the sampleSurface() method (sRec.ref should be set before) sRec.n and sRec.pdf are ignored.
 
float surfaceArea (uint32_t index) const
 Return the surface area of the given triangle.
 
Point3f getInterpolatedVertex (uint32_t index, const Vector3f &bc) const
 
Normal3f getInterpolatedNormal (uint32_t index, const Vector3f &bc) const
 
const MatrixXf & getVertexPositions () const
 Return a pointer to the vertex positions.
 
const MatrixXf & getVertexNormals () const
 Return a pointer to the vertex normals (or nullptr if there are none)
 
const MatrixXf & getVertexTexCoords () const
 Return a pointer to the texture coordinates (or nullptr if there are none)
 
const MatrixXu & getIndices () const
 Return a pointer to the triangle vertex index list.
 
const std::string & getName () const
 Return the name of this mesh.
 
virtual std::string toString () const override
 Return a human-readable summary of this instance.
 
- Public Member Functions inherited from Shape
virtual ~Shape ()
 Release all memory.
 
virtual void addChild (NoriObject *child) override
 Add a child object to the current instance. More...
 
const BoundingBox3fgetBoundingBox () const
 
bool isEmitter () const
 Is this mesh an area emitter?
 
EmittergetEmitter ()
 Return a pointer to an attached area emitter instance.
 
const EmittergetEmitter () const
 Return a pointer to an attached area emitter instance (const version)
 
const BSDFgetBSDF () const
 Return a pointer to the BSDF associated with this mesh.
 
virtual EClassType getClassType () const override
 Return the type of object (i.e. Mesh/BSDF/etc.) provided by this instance.
 
- Public Member Functions inherited from NoriObject
virtual ~NoriObject ()
 Virtual destructor.
 
virtual void setParent (NoriObject *parent)
 Set the parent object. More...
 
void setIdName (const std::string &name)
 Allow to assign a name to the object.
 
const std::string & getIdName () const
 

Additional Inherited Members

- Public Types inherited from NoriObject
enum  EClassType {
  EScene = 0 , EMesh , ETexture , EBSDF ,
  EPhaseFunction , EEmitter , EMedium , ECamera ,
  EIntegrator , ESampler , ETest , EReconstructionFilter ,
  EClassTypeCount
}
 
- Static Public Member Functions inherited from NoriObject
static std::string classTypeName (EClassType type)
 Turn a class type into a human-readable string.
 
- Protected Member Functions inherited from Mesh
 Mesh ()
 Create an empty mesh.
 
- Protected Attributes inherited from Mesh
std::string m_name
 Identifying name.
 
MatrixXf m_V
 Vertex positions.
 
MatrixXf m_N
 Vertex normals.
 
MatrixXf m_UV
 Vertex texture coordinates.
 
MatrixXu m_F
 Faces.
 
DiscretePDF m_pdf
 
- Protected Attributes inherited from Shape
BSDFm_bsdf = nullptr
 BSDF of the surface.
 
Emitterm_emitter = nullptr
 Associated emitter, if any.
 
BoundingBox3f m_bbox
 Bounding box of the mesh.
 
- Protected Attributes inherited from NoriObject
std::string m_idname
 

Detailed Description

Loader for Wavefront OBJ triangle meshes.

Definition at line 30 of file obj.cpp.


The documentation for this class was generated from the following file: