ads-game:: joystick control

This commit is contained in:
Zeno Rogue 2022-10-16 09:46:04 +02:00
parent 0c38c4ad68
commit 3c867a7ff0
1 changed files with 14 additions and 0 deletions

View File

@ -94,6 +94,20 @@ void apply_lorentz(transmatrix lor) {
}
ld read_movement() {
ld mdx = multi::axespressed[4]/30000.;
ld mdy = multi::axespressed[5]/30000.;
#if CAP_VR
if(vrhr::active()) {
mdy -= vrhr::vrgo_y;
mdx += vrhr::vrgo_x;
}
#endif
if(mdx || mdy) {
ang = atan2(mdy, mdx) / degree;
return hypot(mdx, mdy);
}
auto& a = multi::actionspressed;
bool left = a[16+1];
bool right = a[16+3];