dynamic mover

This commit is contained in:
Erin Catto 2026-10-20 23:33:18 -07:00
commit f0b1ed2fca
29 changed files with 3078 additions and 432 deletions

View file

@ -11,6 +11,7 @@
// Fed from the host event loop; read with the KEY_* aliases in gfx/keycodes.h.
bool IsKeyDown( int key );
void SetKeyDown( int key, bool down );
void ClearKeysDown();
// Key action passed to Keyboard, matching the old GLFW press/release values so
// sample code reads naturally without leaking sokol_app event types.
@ -20,6 +21,17 @@ enum
ACTION_PRESS = 1,
};
// Character input relative to the camera. Throttle x is forward and y is right.
struct MoverInput
{
b3Vec3 forward;
b3Vec3 right;
b3Vec2 throttle;
bool jump;
bool sprint;
bool walk;
};
struct SampleContext
{
void Save();
@ -211,6 +223,9 @@ public:
void ToggleThirdPerson();
// WASD, space, shift and ctrl, active only in third person so the free camera keeps its keys.
MoverInput GetMoverInput() const;
B3_PRINTF_FORMAT( 2, 3 )
void DrawTextLine( const char* text, ... );
void ResetProfile();