24 using std::make_unique;
26 using std::unique_ptr;
90 inline static int main(
int argc,
char** argv) {
97 return importTModelApplication->run(argc, argv,
"Import TModel Application",
nullptr, Application::WINDOW_HINT_INVISIBLE);
103 unique_ptr<Prototype> prototype;
106 auto model = unique_ptr<Model>(
116 auto pathName = FileSystem::getInstance()->getPathName(
tModelFileName);
117 auto fileName = FileSystem::getInstance()->getFileName(
tModelFileName);
118 auto fileNameWithoutExtension = StringTools::substring(fileName, 0, fileName.rfind(
'.'));
119 prototype = make_unique<Prototype>(
121 Prototype_Type::MODEL,
122 fileNameWithoutExtension,
123 fileNameWithoutExtension,
124 pathName +
"/" + fileName,
131 prototype = unique_ptr<Prototype>(
132 PrototypeReader::read(
139 prototype->setModel(model.release());
142 GenerateConvexMeshes::removeConvexMeshes(prototype.get());
145 Console::println(
"Loading convex mesh bounding volumes model: " +
bvsModelFileName);
146 vector<vector<uint8_t>> convexMeshTMsData;
147 if (GenerateConvexMeshes::generateConvexMeshes(
149 GenerateConvexMeshes::MODE_IMPORT,
153 convexMeshTMsData) ==
true) {
154 for (
const auto& convexMeshTMData: convexMeshTMsData) {
157 auto prototypeBoundingVolume = make_unique<PrototypeBoundingVolume>(prototype.get());
158 prototypeBoundingVolume->setupConvexMesh(convexMeshTMData);
159 prototype->addBoundingVolume(prototypeBoundingVolume.release());
161 Console::println(
string(
"An error occurred: ") + exception.what());
168 PrototypeWriter::write(
175 Console::println(
"An error occurred: " +
string(exception.what()));
177 Application::exit(0);
181 Engine::getInstance()->dispose();
185 Engine::getInstance()->initialize();
188 void reshape(int32_t width, int32_t height)
override {
189 Engine::getInstance()->reshape(width, height);
197 int main(
int argc,
char** argv)
199 Console::println(
string(
"importtmodel ") + Version::getVersion());
200 Console::println(Version::getCopyright());
203 Console::println(
"Usage: importtmodel [--no-texture-compression] model.tmodel modelfile.ext [bvs-model.ext]");
204 Application::exit(1);
Application base class, please make sure to allocate application on heap to have correct application ...
Representation of a 3D model.
Prototype bounding volume definition.
File system singleton class.
int main(int argc, char **argv)
std::exception Exception
Exception base class.
#define FORBID_CLASS_COPY(CLASS)