Loads Alias|Wavefront .OBJ file format.
More...
#include <ObjLoader.h>
List of all members.
Classes |
struct | Face |
struct | Group |
Public Member Functions |
| ObjLoader (std::shared_ptr< IStream > aStream, bool includeUVs=true) |
| ObjLoader (DataSourceRef dataSource, bool includeUVs=true) |
| ~ObjLoader () |
void | load (TriMesh *destTriMesh, boost::tribool loadNormals=boost::logic::indeterminate, boost::tribool loadTexCoords=boost::logic::indeterminate, bool optimizeVertices=true) |
void | load (size_t groupIndex, TriMesh *destTriMesh, boost::tribool loadNormals=boost::logic::indeterminate, boost::tribool loadTexCoords=boost::logic::indeterminate, bool optimizeVertices=true) |
Static Public Member Functions |
static void | write (DataTargetRef dataTarget, const TriMesh &mesh, bool writeNormals=true, bool writeUVs=true) |
| Writes a new OBJ file to dataTarget.
|
Detailed Description
Loads Alias|Wavefront .OBJ file format.
Currently does not support anything but polygonal data
Example usage:
Constructor & Destructor Documentation
cinder::ObjLoader::ObjLoader |
( |
std::shared_ptr< IStream > |
aStream, |
|
|
bool |
includeUVs = true |
|
) |
| |
Constructs and does the parsing of the file
- Parameters:
-
includeUVs | if false UV coordinates will be skipped, which can provide a faster load time |
cinder::ObjLoader::ObjLoader |
( |
DataSourceRef |
dataSource, |
|
|
bool |
includeUVs = true |
|
) |
| |
Constructs and does the parsing of the file
- Parameters:
-
includeUVs | if false UV coordinates will be skipped, which can provide a faster load time |
cinder::ObjLoader::~ObjLoader |
( |
) |
|
Member Function Documentation
void cinder::ObjLoader::load |
( |
TriMesh * |
destTriMesh, |
|
|
boost::tribool |
loadNormals = boost::logic::indeterminate , |
|
|
boost::tribool |
loadTexCoords = boost::logic::indeterminate , |
|
|
bool |
optimizeVertices = true |
|
) |
| |
Loads all the groups present in the file into a single TriMesh
- Parameters:
-
destTriMesh | the destination TriMesh, whose contents are cleared first |
loadNormals | should normals be loaded or generated if not present. Default determines from the contents of the file |
loadTexCoords | should 2D texture coordinates be loaded or set to zero if not present. Default determines from the contents of the file |
optimizeVertices | should the loader minimze the vertices by identifying shared vertices between faces. |
void cinder::ObjLoader::load |
( |
size_t |
groupIndex, |
|
|
TriMesh * |
destTriMesh, |
|
|
boost::tribool |
loadNormals = boost::logic::indeterminate , |
|
|
boost::tribool |
loadTexCoords = boost::logic::indeterminate , |
|
|
bool |
optimizeVertices = true |
|
) |
| |
Loads a particular group into a TriMesh
- Parameters:
-
loadNormals | should normals be loaded or generated if not present. Default determines from the contents of the file |
loadTexCoords | should 2D texture coordinates be loaded or set to zero if not present. Default determines from the contents of the file |
optimizeVertices | should the loader minimize the vertices by identifying shared vertices between faces. |
void cinder::ObjLoader::write |
( |
DataTargetRef |
dataTarget, |
|
|
const TriMesh & |
mesh, |
|
|
bool |
writeNormals = true , |
|
|
bool |
writeUVs = true |
|
) |
| [static] |
Writes a new OBJ file to dataTarget.
- Warning:
- - this method will be moved in the future
The documentation for this class was generated from the following files: