Skip to content

Commit

Permalink
update scratchpad
Browse files Browse the repository at this point in the history
  • Loading branch information
fallahn committed Aug 4, 2023
1 parent e9953a3 commit 2b75528
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crogine.sln
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ Global
{64579103-DEC3-41E4-971F-9C0DF996BE8B}.Debug|ARM.ActiveCfg = Debug|Win32
{64579103-DEC3-41E4-971F-9C0DF996BE8B}.Debug|ARM64.ActiveCfg = Debug|Win32
{64579103-DEC3-41E4-971F-9C0DF996BE8B}.Debug|x64.ActiveCfg = Debug|x64
{64579103-DEC3-41E4-971F-9C0DF996BE8B}.Debug|x64.Build.0 = Debug|x64
{64579103-DEC3-41E4-971F-9C0DF996BE8B}.Debug|x86.ActiveCfg = Debug|Win32
{64579103-DEC3-41E4-971F-9C0DF996BE8B}.DebugASan|Any CPU.ActiveCfg = DebugASan|Win32
{64579103-DEC3-41E4-971F-9C0DF996BE8B}.DebugASan|ARM.ActiveCfg = DebugASan|Win32
Expand All @@ -290,7 +291,6 @@ Global
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|ARM.ActiveCfg = Debug|Win32
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|ARM64.ActiveCfg = Debug|Win32
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x64.ActiveCfg = DebugGNS|x64
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x64.Build.0 = DebugGNS|x64
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x86.ActiveCfg = Debug|Win32
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x86.Build.0 = Debug|Win32
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.DebugASan|Any CPU.ActiveCfg = DebugASan|Win32
Expand Down
16 changes: 14 additions & 2 deletions samples/scratchpad/src/gc/GcState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,18 @@ void GCState::createScene()
}
}

if (md.loadFromFile("assets/golf/models/stage.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());
cam.viewport = { 0.f, 0.f, 1.f, 1.f };
cam.setPerspective(70.f * cro::Util::Const::degToRad, size.x / size.y, 0.1f, 10.f);
cam.setPerspective(70.f * cro::Util::Const::degToRad, size.x / size.y, 0.1f, 20.f);
};

auto& cam = m_gameScene.getActiveCamera().getComponent<cro::Camera>();
Expand Down Expand Up @@ -244,7 +251,9 @@ void GCState::createScene()
}
}

float rotation = ((cro::Util::Const::PI * 0.5f) * cro::Util::Easing::easeInOutQuad(progress)) - (cro::Util::Const::PI * 0.25f);
constexpr float StartAngle = cro::Util::Const::PI * 0.4f;
constexpr float MaxRotation = cro::Util::Const::PI - (StartAngle * 2.f);
float rotation = (MaxRotation * cro::Util::Easing::easeInOutQuad(progress)) -(MaxRotation / 2.f);
axisEnt.getComponent<cro::Transform>().setRotation(cro::Transform::Y_AXIS, rotation);
};

Expand Down Expand Up @@ -305,6 +314,9 @@ void GCState::createScene()
setNextCam();
}
};


m_gameScene.getSunlight().getComponent<cro::Transform>().rotate(cro::Transform::X_AXIS, -0.4f);
}

void GCState::createUI()
Expand Down

0 comments on commit 2b75528

Please sign in to comment.