From b547de9cbbb34461786e915c22705605263b237a Mon Sep 17 00:00:00 2001 From: Foxar Date: Fri, 4 Dec 2020 16:50:25 +0100 Subject: [PATCH] Stretched water overlay to fullscreen, made it appear when camera's sugmerged, disabled the invalid rotation during submerging ( issue number #10 ), enlargened and fixed position of the island mesh. --- src/samples/dolphin/dolphin.cpp | 10 +++++----- src/samples/dolphin/objects/player.cpp | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/samples/dolphin/dolphin.cpp b/src/samples/dolphin/dolphin.cpp index 8b622b3..323d9f6 100755 --- a/src/samples/dolphin/dolphin.cpp +++ b/src/samples/dolphin/dolphin.cpp @@ -29,15 +29,15 @@ void Dolphin::onInit() engine->renderer->disableVSync(); printf("loading island..\n"); - island.loadDff("sunnyisl/", "sunnyisl", 1.0F, false); + island.loadDff("sunnyisl/", "sunnyisl", 5.0F, false); printf("Loaded..\n"); island.rotation.x = -1.6F; - island.position.set(0.0F, 10.0F, 20.0F); + island.position.set(0.0F, 60.0F, 20.0F); island.shouldBeBackfaceCulled = true; island.shouldBeFrustumCulled = false; printf("Loading water overlay...\n"); - waterOverlay.size.set(100.0F, 100.0F); + waterOverlay.size.set(640.0F, 480.0F); Texture *watOverlayTex = texRepo->add("2d/", "underwater_overlay", PNG); watOverlayTex->addLink(waterOverlay.getId()); printf("Loaded.\n"); @@ -98,6 +98,6 @@ void Dolphin::onUpdate() engine->renderer->draw(skybox); engine->renderer->draw(waterbox); engine->renderer->draw(player.mesh); - //if (player.mesh.position.y < WATER_LEVEL) - //engine->renderer->draw(waterOverlay); + if (camera.position.y < WATER_LEVEL) + engine->renderer->draw(waterOverlay); } diff --git a/src/samples/dolphin/objects/player.cpp b/src/samples/dolphin/objects/player.cpp index 207dfdc..09e49b6 100755 --- a/src/samples/dolphin/objects/player.cpp +++ b/src/samples/dolphin/objects/player.cpp @@ -65,13 +65,14 @@ void Player::update(Pad &t_pad) isJumping = true; else isJumping = false; - + /* if (lift < 0) mesh.rotation.y = 1; else if (lift > 0) mesh.rotation.y = -1; else mesh.rotation.y = 0; + */ if (velocity > 0 && mesh.getCurrentAnimationFrame() == 0) {