Files
dusklight/src/dusk/touch_camera.cpp
T
jdflyer cfadf7607a Various Mirror Mode Fixes (#2149)
* Various Mirror Mode Fixes

* Avoid mutating mArrowPos2DX

---------

Co-authored-by: Luke Street <luke@street.dev>
2026-06-28 22:42:52 -06:00

30 lines
609 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 {
if (getSettings().game.enableMirrorMode) {
yaw_dp *= -1.0;
}
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