Skip to content

Commit

Permalink
Smaller improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
tippesi committed Feb 15, 2024
1 parent 94f30f2 commit defeb03
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/editor/ui/windows/SceneWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ namespace Atlas::Editor::UI {
return;

ImGuiID dsID = ImGui::GetID(dockSpaceNameID.c_str());
auto viewport = ImGui::GetWindowViewport();

if (!ImGui::DockBuilderGetNode(dsID) || resetDockingLayout) {
ImGui::SetWindowSize(ImVec2(640, 480), ImGuiCond_FirstUseEver);

auto viewport = ImGui::GetWindowViewport();
ImGui::DockBuilderRemoveNode(dsID);
ImGui::DockBuilderAddNode(dsID, ImGuiDockNodeFlags_DockSpace);

Expand Down
14 changes: 10 additions & 4 deletions src/engine/input/Keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ namespace Atlas {

interpolatedLinearVelocity = glm::mix(interpolatedLinearVelocity, linearVelocity, progress);

auto velocity = interpolatedLinearVelocity * player.slowVelocity;

if (glm::length(velocity) > 0.0f)
Log::Warning("Velocity greater zero: " + std::to_string(glm::length(velocity)));
auto velocity = fast ? interpolatedLinearVelocity * player.fastVelocity :
interpolatedLinearVelocity * player.slowVelocity;

player.SetInputVelocity(velocity);
if (jump)
Expand Down Expand Up @@ -153,6 +151,14 @@ namespace Atlas {
if (event.keyCode == AE_KEY_SPACE && event.state == AE_BUTTON_RELEASED) {
jump = false;
}

if (event.keyCode == AE_KEY_LSHIFT && event.state == AE_BUTTON_PRESSED) {
fast = true;
}

if (event.keyCode == AE_KEY_LSHIFT && event.state == AE_BUTTON_RELEASED) {
fast = false;
}


}
Expand Down
1 change: 1 addition & 0 deletions src/engine/input/Keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ namespace Atlas {

vec3 movement = vec3(0.0f);
bool jump = false;
bool fast = false;

int32_t eventHandle = -1;

Expand Down
2 changes: 1 addition & 1 deletion src/engine/physics/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Atlas::Physics {
float mass = 75.0f;
float maxStrength = 100.0f;

float predictiveContactDistance = 0.01f;
float predictiveContactDistance = 0.1f;

float shapePadding = 0.02f;
vec3 shapeOffset;
Expand Down

0 comments on commit defeb03

Please sign in to comment.