From d44f5ea476bb9e547e94adb0aba7ead69108280d Mon Sep 17 00:00:00 2001 From: fallahn Date: Sun, 27 Oct 2024 09:54:12 +0000 Subject: [PATCH] twisty handle --- samples/golf/src/scrub/ScrubGameState.cpp | 5 ++++- samples/golf/src/scrub/ScrubGameState.hpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/samples/golf/src/scrub/ScrubGameState.cpp b/samples/golf/src/scrub/ScrubGameState.cpp index 8cc33140c..af337a368 100644 --- a/samples/golf/src/scrub/ScrubGameState.cpp +++ b/samples/golf/src/scrub/ScrubGameState.cpp @@ -698,7 +698,7 @@ void ScrubGameState::createScene() auto entity = m_gameScene.createEntity(); entity.addComponent(); md.createModel(entity); - + //entity.getComponent().setHidden(true); rootNode.getComponent().addChild(entity.getComponent()); } @@ -1289,6 +1289,9 @@ void ScrubGameState::handleCallback(cro::Entity e, float dt) pos.y = cro::Util::Easing::easeOutSine(m_handle.progress) * -StrokeDistance; e.getComponent().setPosition(pos); + const float rotation = m_handle.progress * cro::Util::Const::PI; + e.getComponent().setRotation(cro::Transform::Y_AXIS, rotation); + if (m_handle.progress == 0 || m_handle.progress == 1) { if (m_handle.speed != 0) diff --git a/samples/golf/src/scrub/ScrubGameState.hpp b/samples/golf/src/scrub/ScrubGameState.hpp index 1197e46ef..caec9c8cc 100644 --- a/samples/golf/src/scrub/ScrubGameState.hpp +++ b/samples/golf/src/scrub/ScrubGameState.hpp @@ -199,7 +199,7 @@ class ScrubGameState final : public cro::State, public cro::GuiClient struct Score final { - float threshold = 80.f; //ball must be cleaner than this to score + float threshold = 40.f; //ball must be cleaner than this to score float remainingTime = 30.f; std::int32_t ballsWashed = 0;