| 65 | } |
| 66 | |
| 67 | void CameraInputSystem::generateCameraInput() |
| 68 | { |
| 69 | sim::SecondsD dt = 0; |
| 70 | std::swap(mDtWallClock, dt); |
| 71 | |
| 72 | InputDevicePtr keyboard = getFirstKeyboard(*mInputPlatform); |
| 73 | |
| 74 | mInput.forwardSpeed = getAxisValueOrDefault(mAxes, CameraInputAxisType::Forward, 0.f); |
| 75 | mInput.rightSpeed = getAxisValueOrDefault(mAxes, CameraInputAxisType::Right, 0.f); |
| 76 | |
| 77 | if (dt > 0) |
| 78 | { |
| 79 | mInput.yawRate /= dt; |
| 80 | mInput.tiltRate /= dt; |
| 81 | mInput.zoomRate /= dt; |
| 82 | } |
| 83 | else |
| 84 | { |
| 85 | mInput.yawRate = 0; |
| 86 | mInput.tiltRate = 0; |
| 87 | mInput.zoomRate = 0; |
| 88 | } |
| 89 | |
| 90 | mInput.modifier1Pressed = keyboard ? keyboard->isButtonPressed(KC_LSHIFT) : false; |
| 91 | mInput.modifier2Pressed = keyboard ? keyboard->isButtonPressed(KC_LCONTROL) : false; |
| 92 | |
| 93 | cameraInputGenerated(mInput); |
| 94 | |
| 95 | mInput = sim::CameraController::Input::zero(); |
| 96 | } |
| 97 | |
| 98 | void CameraInputSystem::onEvent(const Event &evt) |
| 99 | { |
nothing calls this directly
no test coverage detected