HDK
|
Classes | |
struct | texture_option_t |
struct | material_t |
struct | tag_t |
struct | index_t |
struct | mesh_t |
struct | path_t |
struct | shape_t |
struct | attrib_t |
struct | callback_t_ |
class | MaterialReader |
class | MaterialFileReader |
class | MaterialStreamReader |
Typedefs | |
typedef float | real_t |
typedef struct tinyobj::callback_t_ | callback_t |
Functions | |
bool | LoadObj (attrib_t *attrib, std::vector< shape_t > *shapes, std::vector< material_t > *materials, std::string *warn, std::string *err, const char *filename, const char *mtl_basedir=NULL, bool triangulate=true, bool default_vcols_fallback=true) |
bool | LoadObjWithCallback (std::istream &inStream, const callback_t &callback, void *user_data=NULL, MaterialReader *readMatFn=NULL, std::string *warn=NULL, std::string *err=NULL) |
bool | LoadObj (attrib_t *attrib, std::vector< shape_t > *shapes, std::vector< material_t > *materials, std::string *warn, std::string *err, std::istream *inStream, MaterialReader *readMatFn=NULL, bool triangulate=true, bool default_vcols_fallback=true) |
void | LoadMtl (std::map< std::string, int > *material_map, std::vector< material_t > *materials, std::istream *inStream, std::string *warning, std::string *err) |
Loads materials into std::map. More... | |
bool | ParseTextureNameAndOption (std::string *texname, texture_option_t *texopt, const char *linebuf, const bool is_bump) |
typedef struct tinyobj::callback_t_ tinyobj::callback_t |
typedef float tinyobj::real_t |
Definition at line 131 of file tiny_obj_loader.h.
Enumerator | |
---|---|
TEXTURE_TYPE_NONE | |
TEXTURE_TYPE_SPHERE | |
TEXTURE_TYPE_CUBE_TOP | |
TEXTURE_TYPE_CUBE_BOTTOM | |
TEXTURE_TYPE_CUBE_FRONT | |
TEXTURE_TYPE_CUBE_BACK | |
TEXTURE_TYPE_CUBE_LEFT | |
TEXTURE_TYPE_CUBE_RIGHT |
Definition at line 134 of file tiny_obj_loader.h.
void tinyobj::LoadMtl | ( | std::map< std::string, int > * | material_map, |
std::vector< material_t > * | materials, | ||
std::istream * | inStream, | ||
std::string * | warning, | ||
std::string * | err | ||
) |
Loads materials into std::map.
bool tinyobj::LoadObj | ( | attrib_t * | attrib, |
std::vector< shape_t > * | shapes, | ||
std::vector< material_t > * | materials, | ||
std::string * | warn, | ||
std::string * | err, | ||
const char * | filename, | ||
const char * | mtl_basedir = NULL , |
||
bool | triangulate = true , |
||
bool | default_vcols_fallback = true |
||
) |
Loads .obj from a file. 'attrib', 'shapes' and 'materials' will be filled with parsed shape data 'shapes' will be filled with parsed shape data Returns true when loading .obj become success. Returns warning message into warn
, and error message into err
'mtl_basedir' is optional, and used for base directory for .mtl file. In default(`NULL'), .mtl file is searched from an application's working directory. 'triangulate' is optional, and used whether triangulate polygon face in .obj or not. Option 'default_vcols_fallback' specifies whether vertex colors should always be defined, even if no colors are given (fallback to white).
bool tinyobj::LoadObj | ( | attrib_t * | attrib, |
std::vector< shape_t > * | shapes, | ||
std::vector< material_t > * | materials, | ||
std::string * | warn, | ||
std::string * | err, | ||
std::istream * | inStream, | ||
MaterialReader * | readMatFn = NULL , |
||
bool | triangulate = true , |
||
bool | default_vcols_fallback = true |
||
) |
Loads object from a std::istream, uses GetMtlIStreamFn to retrieve std::istream for materials. Returns true when loading .obj become success. Returns warning and error message into err
bool tinyobj::LoadObjWithCallback | ( | std::istream & | inStream, |
const callback_t & | callback, | ||
void * | user_data = NULL , |
||
MaterialReader * | readMatFn = NULL , |
||
std::string * | warn = NULL , |
||
std::string * | err = NULL |
||
) |
Loads .obj from a file with custom user callback. .mtl is loaded as usual and parsed material_t data will be passed to callback.mtllib_cb
. Returns true when loading .obj/.mtl become success. Returns warning message into warn
, and error message into err
See examples/callback_api/
for how to use this function.
bool tinyobj::ParseTextureNameAndOption | ( | std::string * | texname, |
texture_option_t * | texopt, | ||
const char * | linebuf, | ||
const bool | is_bump | ||
) |
Parse texture name and texture option for custom texture parameter through material::unknown_parameter
[out] | texname | Parsed texture name |
[out] | texopt | Parsed texopt |
[in] | linebuf | Input string |
[in] | is_bump | Is this texture bump/normal? |