Intial Commit of starworld

This commit is contained in:
MayaTheShy
2025-11-08 13:39:53 -05:00
commit 2fc3ecc876
3120 changed files with 34117 additions and 0 deletions

22
src/InputHandler.cpp Normal file
View File

@@ -0,0 +1,22 @@
#include "InputHandler.hpp"
#include "OverteClient.hpp"
#include "StardustBridge.hpp"
#include <algorithm>
#include <glm/glm.hpp>
void InputHandler::update(float /*dt*/) {
auto js = m_stardust.joystick();
// Apply radial dead zone.
float mag = glm::length(js);
if (mag < m_deadZone) {
js = {0.0f, 0.0f};
} else if (mag > 1.0f) {
js /= mag; // clamp
}
glm::vec3 vel{js.x * m_moveSpeed, 0.0f, js.y * m_moveSpeed};
m_overte.sendMovementInput(vel);
}