21 using std::make_unique;
23 using std::unique_ptr;
40 vector<string> ModelReader::extensions = {
"dae",
"glb",
"gltf",
"tm",
"tmodel"};
42 const vector<string>& ModelReader::getModelExtensions() {
49 if (StringTools::endsWith(StringTools::toLowerCase(fileName),
".dae") ==
true) {
52 if (StringTools::endsWith(StringTools::toLowerCase(fileName),
".glb") ==
true) {
55 if (StringTools::endsWith(StringTools::toLowerCase(fileName),
".gltf") ==
true) {
58 if (StringTools::endsWith(StringTools::toLowerCase(fileName),
".tm") ==
true) {
59 return TMReader::read(pathName, fileName, useBC7TextureCompression);
61 if (StringTools::endsWith(StringTools::toLowerCase(fileName),
".tmodel") ==
true) {
62 unique_ptr<Prototype> prototype(PrototypeReader::read(pathName, fileName));
63 if (prototype !=
nullptr && prototype->getModel() !=
nullptr) {
64 auto model = prototype->unsetModel();
73 Console::println(
"ModelReader::read(): Could not read model: " + pathName +
"/" + fileName +
": " + exception.what());
Collada DAE model reader.
static Model * read(const string &pathName, const string &fileName, bool useBC7TextureCompression=true)
Reads Collada DAE file.
static Model * read(const string &pathName, const string &fileName, bool useBC7TextureCompression=true)
Reads GLTF file.
static STATIC_DLL_IMPEXT vector< string > extensions
static Model * read(const string &pathName, const string &fileName, bool useBC7TextureCompression=true)
Reads a model.
static Model * read(const string &pathName, const string &fileName, bool useBC7TextureCompression=true)
TDME model format reader.
Representation of a 3D model.
File system singleton class.
std::exception Exception
Exception base class.