Skip to content

Commit

Permalink
add body model
Browse files Browse the repository at this point in the history
  • Loading branch information
fallahn committed Oct 10, 2024
1 parent f515c7b commit 0a8bee7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions libsocial/include/Social.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ source distribution.
//(player avatar data format changed 1153 -> 1160)
//(player avatar data format changed 1170 -> 1180)
//(course data changed 1180 -> 1181)
static constexpr std::uint16_t CURRENT_VER = 1182;
static constexpr std::uint16_t CURRENT_VER = 1190;
#ifdef __APPLE__
static const std::string StringVer("1.18.2 (macOS beta)");
static const std::string StringVer("1.19.0 (macOS beta)");
#else
static const std::string StringVer("1.18.2");
static const std::string StringVer("1.19.0");
#endif

struct HallEntry final
Expand Down
13 changes: 10 additions & 3 deletions samples/scratchpad/src/scrub/ScrubGameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@ void ScrubGameState::createScene()
m_ball.entity = entity;
}

if (md.loadFromFile("assets/arcade/scrub/models/body.cmt"))
{
auto entity = m_gameScene.createEntity();
entity.addComponent<cro::Transform>();
md.createModel(entity);
}

auto resize = [](cro::Camera& cam)
{
glm::vec2 size(cro::App::getWindow().getSize());
Expand All @@ -270,8 +277,8 @@ void ScrubGameState::createScene()
camera.getComponent<cro::Transform>().setPosition({ 0.f, 0.05f, 0.25f });
camera.getComponent<cro::Transform>().rotate(cro::Transform::X_AXIS, -0.1f);

m_gameScene.getSunlight().getComponent<cro::Transform>().rotate(cro::Transform::X_AXIS, -0.02f);
m_gameScene.getSunlight().getComponent<cro::Transform>().rotate(cro::Transform::Y_AXIS, -0.02f);
m_gameScene.getSunlight().getComponent<cro::Transform>().rotate(cro::Transform::X_AXIS, -1.2f);
m_gameScene.getSunlight().getComponent<cro::Transform>().rotate(cro::Transform::Y_AXIS, -0.6f);
}

void ScrubGameState::createUI()
Expand Down Expand Up @@ -330,7 +337,7 @@ float ScrubGameState::Handle::switchDirection(float d)

if (hasBall)
{
soap = std::max(1.f, soap * 0.95f);
soap = std::max(1.f, soap * 0.975f);
}
}
return ret;
Expand Down

0 comments on commit 0a8bee7

Please sign in to comment.