mesh refactor 3

This commit is contained in:
h4570
2022-08-10 21:58:32 +02:00
parent 10e0f52d44
commit 0a2d19b2d0
26 changed files with 321 additions and 356 deletions
+7 -8
View File
@@ -14,24 +14,23 @@
using Tyra::FileUtils;
using Tyra::ObjLoader;
using Tyra::ObjLoaderOptions;
namespace Demo {
Skybox::Skybox(TextureRepository* repo) {
ObjLoader loader;
ObjLoaderOptions objOptions;
objOptions.flipUVs = true;
objOptions.scale = 100.0F;
auto* data = loader.load(FileUtils::fromCwd("game/models/skybox/skybox.obj"),
1, 100.0F, true);
objOptions);
data->normalsEnabled = false;
mesh = new StaticMesh(*data);
delete data;
for (u32 i = 0; i < mesh->getMaterialsCount(); i++) {
auto* material = mesh->getMaterial(i);
material->color.r = 16.0F;
material->color.g = 16.0F;
material->color.b = 16.0F;
}
repo->addByMesh(mesh, FileUtils::fromCwd("game/models/skybox/"), "png");
allocateOptions();