Sfoglia il codice sorgente

input: do not let the joystick override the keyboard.

legacy
Sam Hocevar sam 12 anni fa
parent
commit
45bab95127
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +2
    -2
      src/camera.cpp

+ 2
- 2
src/camera.cpp Vedi File

@@ -71,8 +71,8 @@ void Camera::TickGame(float seconds)
stick = Input::TrackStick();
if (stick && stick->GetAxisCount() >= 2)
{
rightleft = 2.f * stick->GetAxis(0) * std::abs(stick->GetAxis(0));
updown = -2.f * stick->GetAxis(1) * std::abs(stick->GetAxis(1));
rightleft += 2.f * stick->GetAxis(0) * std::abs(stick->GetAxis(0));
updown += -2.f * stick->GetAxis(1) * std::abs(stick->GetAxis(1));
}

m_position += vec3(rightleft, pgupdown, -updown) * 200.f * seconds;


Caricamento…
Annulla
Salva