Loads Alias|Wavefront .OBJ file format.
More...
#include <ObjLoader.h>
|
| ObjLoader (std::shared_ptr< IStreamCinder > aStream, bool includeUVs=true) |
|
| ObjLoader (DataSourceRef dataSource, bool includeUVs=true) |
|
| ObjLoader (DataSourceRef dataSource, DataSourceRef materialSource, 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) |
|
size_t | getNumGroups () const |
| Returns the total number of groups. More...
|
|
const std::vector< Group > & | getGroups () const |
| Returns a vector<> of the Groups in the OBJ. More...
|
|
Loads Alias|Wavefront .OBJ file format.
Currently does not support anything but polygonal data
Example usage:
cinder::ObjLoader::ObjLoader |
( |
std::shared_ptr< IStreamCinder > |
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 |
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 |
( |
| ) |
|
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
size_t cinder::ObjLoader::getNumGroups |
( |
| ) |
const |
Returns the total number of groups.
const std::vector<Group>& cinder::ObjLoader::getGroups |
( |
| ) |
const |
Returns a vector<> of the Groups in the OBJ.
The documentation for this class was generated from the following files: