14#include <glm/trigonometric.hpp>
36 SDL_GetRelativeMouseState(&mdx, &mdy);
43 snap.
yaw -= mdx * mouseSensitivity;
46 snap.
yaw = std::remainder(snap.
yaw, glm::radians(360.0f));
49 snap.
pitch = std::clamp(snap.
pitch + mdy * mouseSensitivity, -glm::radians(89.0f), glm::radians(89.0f));
62 const bool*
const kKeys = SDL_GetKeyboardState(
nullptr);
65 snap.
forward = kKeys[SDL_SCANCODE_W];
66 snap.
back = kKeys[SDL_SCANCODE_S];
67 snap.
left = kKeys[SDL_SCANCODE_A];
68 snap.
right = kKeys[SDL_SCANCODE_D];
69 snap.
jump = kKeys[SDL_SCANCODE_SPACE];
70 snap.
crouch = kKeys[SDL_SCANCODE_LCTRL];
71 snap.
sprint = kKeys[SDL_SCANCODE_LSHIFT];
72 snap.
grapple = kKeys[SDL_SCANCODE_E];
85 const bool*
const kKeys = SDL_GetKeyboardState(
nullptr);
86 const SDL_MouseButtonFlags mouse = SDL_GetMouseState(
nullptr,
nullptr);
90 (mouse & SDL_BUTTON_LMASK) != 0;
95 snap.
reload = kKeys[SDL_SCANCODE_R];
Marker component identifying the locally controlled player entity.
Shared ECS registry type alias for the game engine.
entt::registry Registry
Shared ECS registry type alias.
Definition Registry.hpp:11
Client-only input sampling system — split into two halves so mouse look can run every iterate() (smoo...
Definition InputSampleSystem.hpp:20
void runInputSample(Registry ®istry, float mouseSensitivity=0.001f)
Legacy combined sampler — calls both runMouseLook and runMovementKeys.
Definition InputSampleSystem.hpp:102
void runWeaponKeys(Registry ®istry)
Sample keyboard state into the weapon flags.
Definition InputSampleSystem.hpp:83
void runMouseLook(Registry ®istry, float mouseSensitivity)
Sample mouse delta and accumulate into yaw / pitch.
Definition InputSampleSystem.hpp:32
void runMovementKeys(Registry ®istry)
Sample keyboard state into the movement flags.
Definition InputSampleSystem.hpp:60
Marker component that tags exactly one entity per client as the locally controlled player.
Definition LocalPlayer.hpp:12