Skip to content

Commit

Permalink
twisty handle
Browse files Browse the repository at this point in the history
  • Loading branch information
fallahn committed Oct 27, 2024
1 parent 91fbe6c commit d44f5ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion samples/golf/src/scrub/ScrubGameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ void ScrubGameState::createScene()
auto entity = m_gameScene.createEntity();
entity.addComponent<cro::Transform>();
md.createModel(entity);

//entity.getComponent<cro::Model>().setHidden(true);
rootNode.getComponent<cro::Transform>().addChild(entity.getComponent<cro::Transform>());
}

Expand Down Expand Up @@ -1289,6 +1289,9 @@ void ScrubGameState::handleCallback(cro::Entity e, float dt)
pos.y = cro::Util::Easing::easeOutSine(m_handle.progress) * -StrokeDistance;
e.getComponent<cro::Transform>().setPosition(pos);

const float rotation = m_handle.progress * cro::Util::Const::PI;
e.getComponent<cro::Transform>().setRotation(cro::Transform::Y_AXIS, rotation);

if (m_handle.progress == 0 || m_handle.progress == 1)
{
if (m_handle.speed != 0)
Expand Down
2 changes: 1 addition & 1 deletion samples/golf/src/scrub/ScrubGameState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d44f5ea

Please sign in to comment.