added skybox and multitexture feature in .obj

This commit is contained in:
Sandro Sobczyński
2020-10-28 16:19:24 +01:00
parent bde819903b
commit 18e00f8e17
9 changed files with 142 additions and 87 deletions
+3 -5
View File
@@ -88,8 +88,8 @@ void Ari::onInit()
islandAddons->shouldBeFrustumCulled = false;
skybox = new Mesh();
Vector3 skyboxPos = Vector3(0.0F, 0.0F, 0.0F);
skybox->loadObj("skybox/", "skybox.obj", skyboxPos, 100.0F);
Vector3 skyboxPos = Vector3(0.0F, 10.0F, 0.0F);
skybox->loadObj("skybox/", "skybox.obj", skyboxPos, 80.0F);
skybox->shouldBeFrustumCulled = true;
waterFloors = new Mesh *[WATER_TILES_COUNT];
@@ -114,8 +114,6 @@ void Ari::onInit()
}
}
u32 currentTexI = 0;
void Ari::initBulb()
{
bulb.intensity = 15;
@@ -130,7 +128,7 @@ void Ari::onUpdate()
engine.renderer->draw(skybox);
engine.renderer->draw(island);
engine.renderer->draw(islandAddons);
engine.renderer->draw(&player->mesh);
// engine.renderer->draw(&player->mesh);
for (u8 i = 0; i < WATER_TILES_COUNT; i++)
engine.renderer->draw(waterFloors[i]); // TODO
}
+5 -5
View File
@@ -26,12 +26,12 @@ Player::Player()
this->gravity = 0.1F;
this->lift = -1.0F;
Vector3 initPos = Vector3(0.0F, 8.0F, 0.0F);
this->mesh.loadMD2("ari/", "ari.md2", initPos, 0.0001F);
this->mesh.shouldBeBackfaceCulled = true;
this->mesh.shouldBeFrustumCulled = false;
// this->mesh.loadMD2("ari/", "ari.md2", initPos, 0.0001F);
// this->mesh.shouldBeBackfaceCulled = true;
// this->mesh.shouldBeFrustumCulled = false;
// this->mesh.shouldBeLighted = true;
this->mesh.setAnimSpeed(0.05F);
this->mesh.playAnimation(0, 1);
// this->mesh.setAnimSpeed(0.05F);
// this->mesh.playAnimation(0, 1);
PRINT_LOG("Player object created!");
}