vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
input_command.h
1#pragma once
2
3#include <array>
4#include <cstdint>
5
6#include <glm/gtc/quaternion.hpp>
7
8namespace Vkm::Engine {
9
16inline constexpr uint32_t MAX_INPUT_ACTIONS = 32;
17
26 uint32_t sequence = 0;
27 uint32_t tick = 0;
28
30 std::array<float, MAX_INPUT_ACTIONS> axis{};
31
32 uint32_t pressed = 0;
33 uint32_t released = 0;
34
35 static_assert(
36 MAX_INPUT_ACTIONS <= 32,
37 "pressed / released carry one bit per action in a uint32_t, "
38 "so an action past bit 31 has nowhere to be recorded"
39 );
40
47 glm::quat view{1.0f, 0.0f, 0.0f, 0.0f};
48};
49
50} // namespace Vkm::Engine
Everything one simulation tick was told to do, as a value.
Definition input_command.h:25
std::array< float, MAX_INPUT_ACTIONS > axis
Per-action value, -1..1, indexed by InputMap::indexOf.
Definition input_command.h:30
uint32_t pressed
Bit per action: became active since the last command.
Definition input_command.h:32
uint32_t sequence
Monotonic command number; what an ack names.
Definition input_command.h:26
glm::quat view
Where the player was looking when this input was taken.
Definition input_command.h:47
uint32_t tick
Simulation tick this command drives.
Definition input_command.h:27
uint32_t released
Bit per action: stopped being active since the last command.
Definition input_command.h:33