| 3949 | } |
| 3950 | |
| 3951 | bool Scene::onKeyEvent(const KeyboardEvent& keyEvent) |
| 3952 | { |
| 3953 | if (keyEvent.type == KeyboardEvent::Type::KeyPressed) |
| 3954 | { |
| 3955 | if (keyEvent.mods == Input::ModifierFlags::None) |
| 3956 | { |
| 3957 | if (keyEvent.key == Input::Key::F3) |
| 3958 | { |
| 3959 | addViewpoint(); |
| 3960 | return true; |
| 3961 | } |
| 3962 | } |
| 3963 | // DEMO21, but I think it makes sense, to have these controls |
| 3964 | else if (keyEvent.key == Input::Key::C || keyEvent.key == Input::Key::F7) |
| 3965 | { |
| 3966 | // Force camera animation on. |
| 3967 | auto camera = mCameras[mSelectedCamera]; |
| 3968 | camera->setIsAnimated(true); |
| 3969 | return true; |
| 3970 | } |
| 3971 | else if (keyEvent.key == Input::Key::F8) |
| 3972 | { |
| 3973 | auto camera = mCameras[mSelectedCamera]; |
| 3974 | } |
| 3975 | } |
| 3976 | if (mCameraControlsEnabled) |
| 3977 | { |
| 3978 | // DEMO21, but I think it makes sense, if the camera did anything, stop the animation for it. |
| 3979 | if (mpCamCtrl->onKeyEvent(keyEvent)) |
| 3980 | { |
| 3981 | auto& camera = mCameras[mSelectedCamera]; |
| 3982 | camera->setIsAnimated(false); |
| 3983 | return true; |
| 3984 | } |
| 3985 | } |
| 3986 | |
| 3987 | return false; |
| 3988 | } |
| 3989 | |
| 3990 | bool Scene::onGamepadEvent(const GamepadEvent& gamepadEvent) |
| 3991 | { |
no outgoing calls