Files
dusklight/src/dusk/touch_camera.cpp
T
Luke Street ad53af5c78 Touch controls (#2053)
* WIP touch controls

* Action icons

* Updates

* Don't mutate freeCamera config; allow switching between touch and controller cam

* Wow

* Fix build & add Skip button

* Fix build & add settings

* RCSS cleanup

* Dpad and fishing, might redo

* Add menu mouse controls

* More pointer & fix icons

* Optimizations & introduce layout system

* Update aurora

* Implement touch controls layout editor

* Cleanup & fixes

* Allow disabling mouse/touch in menus

* More fixes
2026-06-15 12:48:04 -06:00

27 lines
532 B
C++

#include "dusk/touch_camera.h"
namespace dusk::touch_camera {
namespace {
float s_yaw_dp = 0.0f;
float s_pitch_dp = 0.0f;
} // namespace
void add_delta(float yaw_dp, float pitch_dp) noexcept {
s_yaw_dp += yaw_dp;
s_pitch_dp += pitch_dp;
}
bool consume_delta(float& yaw_dp, float& pitch_dp) noexcept {
yaw_dp = s_yaw_dp;
pitch_dp = s_pitch_dp;
clear();
return yaw_dp != 0.0f || pitch_dp != 0.0f;
}
void clear() noexcept {
s_yaw_dp = 0.0f;
s_pitch_dp = 0.0f;
}
} // namespace dusk::touch_camera