|
GameApi 28
Library used by GameApi Builder tool
|
#include <tiny_gltf.h>
Public Member Functions | |
| TinyGLTF () | |
| ~TinyGLTF () | |
| bool | LoadASCIIFromFile (Model *model, std::string *err, std::string *warn, const std::string &filename, unsigned int check_sections=REQUIRE_VERSION) |
| bool | LoadASCIIFromString (Model *model, std::string *err, std::string *warn, const char *str, const unsigned int length, const std::string &base_dir, unsigned int check_sections=REQUIRE_VERSION) |
| bool | LoadBinaryFromFile (Model *model, std::string *err, std::string *warn, const std::string &filename, unsigned int check_sections=REQUIRE_VERSION) |
| bool | LoadBinaryFromMemory (Model *model, std::string *err, std::string *warn, const unsigned char *bytes, const unsigned int length, const std::string &base_dir="", unsigned int check_sections=REQUIRE_VERSION) |
| bool | WriteGltfSceneToStream (Model *model, std::ostream &stream, bool prettyPrint, bool writeBinary) |
| bool | WriteGltfSceneToFile (Model *model, const std::string &filename, bool embedImages, bool embedBuffers, bool prettyPrint, bool writeBinary) |
| void | SetImageLoader (LoadImageDataFunction LoadImageData, void *user_data) |
| void | RemoveImageLoader () |
| void | SetImageWriter (WriteImageDataFunction WriteImageData, void *user_data) |
| void | SetFsCallbacks (FsCallbacks callbacks) |
| void | SetSerializeDefaultValues (const bool enabled) |
| bool | GetSerializeDefaultValues () const |
| void | SetStoreOriginalJSONForExtrasAndExtensions (const bool enabled) |
| bool | GetStoreOriginalJSONForExtrasAndExtensions () const |
| void | SetPreserveImageChannels (bool onoff) |
| bool | GetPreserveImageChannels () const |
glTF Parser/Serialier context.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool tinygltf::TinyGLTF::LoadASCIIFromFile | ( | Model * | model, |
| std::string * | err, | ||
| std::string * | warn, | ||
| const std::string & | filename, | ||
| unsigned int | check_sections = REQUIRE_VERSION ) |
Loads glTF ASCII asset from a file. Set warning message to warn for example it fails to load asserts. Returns false and set error string to err if there's an error.
| bool tinygltf::TinyGLTF::LoadASCIIFromString | ( | Model * | model, |
| std::string * | err, | ||
| std::string * | warn, | ||
| const char * | str, | ||
| const unsigned int | length, | ||
| const std::string & | base_dir, | ||
| unsigned int | check_sections = REQUIRE_VERSION ) |
Loads glTF ASCII asset from string(memory). length = strlen(str); Set warning message to warn for example it fails to load asserts. Returns false and set error string to err if there's an error.

| bool tinygltf::TinyGLTF::LoadBinaryFromFile | ( | Model * | model, |
| std::string * | err, | ||
| std::string * | warn, | ||
| const std::string & | filename, | ||
| unsigned int | check_sections = REQUIRE_VERSION ) |
Loads glTF binary asset from a file. Set warning message to warn for example it fails to load asserts. Returns false and set error string to err if there's an error.
| bool tinygltf::TinyGLTF::LoadBinaryFromMemory | ( | Model * | model, |
| std::string * | err, | ||
| std::string * | warn, | ||
| const unsigned char * | bytes, | ||
| const unsigned int | length, | ||
| const std::string & | base_dir = "", | ||
| unsigned int | check_sections = REQUIRE_VERSION ) |
Loads glTF binary asset from memory. length = strlen(str); Set warning message to warn for example it fails to load asserts. Returns false and set error string to err if there's an error.

| void tinygltf::TinyGLTF::RemoveImageLoader | ( | ) |
Unset(remove) callback of loading image data
| void tinygltf::TinyGLTF::SetFsCallbacks | ( | FsCallbacks | callbacks | ) |
Set callbacks to use for filesystem (fs) access and their user data
| void tinygltf::TinyGLTF::SetImageLoader | ( | LoadImageDataFunction | LoadImageData, |
| void * | user_data ) |
Set callback to use for loading image data
| void tinygltf::TinyGLTF::SetImageWriter | ( | WriteImageDataFunction | WriteImageData, |
| void * | user_data ) |
Set callback to use for writing image data
|
inline |
Specify whether preserve image channales when loading images or not. (Not effective when the user suppy their own LoadImageData callbacks)
|
inline |
Set serializing default values(default = false). When true, default values are force serialized to .glTF. This may be helpfull if you want to serialize a full description of glTF data.
TODO(LTE): Supply parsing option as function arguments to LoadASCIIFromFile() and others, not by a class method
|
inline |
Store original JSON string for extras and extensions. This feature will be useful when the user want to reconstruct custom data structure from JSON string.
| bool tinygltf::TinyGLTF::WriteGltfSceneToFile | ( | Model * | model, |
| const std::string & | filename, | ||
| bool | embedImages, | ||
| bool | embedBuffers, | ||
| bool | prettyPrint, | ||
| bool | writeBinary ) |
Write glTF to file.

| bool tinygltf::TinyGLTF::WriteGltfSceneToStream | ( | Model * | model, |
| std::ostream & | stream, | ||
| bool | prettyPrint, | ||
| bool | writeBinary ) |
Write glTF to stream, buffers and images will be embeded
