# Conflicts: # CMakeLists.txt # README.md # cmake/externals/glad32es/CMakeLists.txt # cmake/externals/glad41/CMakeLists.txt # cmake/externals/glad45/CMakeLists.txt # cmake/externals/polyvox/CMakeLists.txt # cmake/externals/quazip/CMakeLists.txt # cmake/externals/vhacd/CMakeLists.txt # cmake/init.cmake # cmake/ports/hifi-deps/CONTROL # cmake/ports/sdl2/CONTROL # cmake/ports/sdl2/disable-hidapi-for-uwp.patch # cmake/ports/sdl2/enable-winrt-cmake.patch # cmake/ports/sdl2/fix-arm64-headers.patch # cmake/ports/sdl2/fix-x86-windows.patch # cmake/ports/sdl2/portfile.cmake # cmake/ports/sdl2/vcpkg-cmake-wrapper.cmake # cmake/ports/tbb/portfile.cmake # hifi_vcpkg.py # interface/src/avatar/MyAvatar.h # libraries/avatars-renderer/src/avatars-renderer/Avatar.h # libraries/avatars/src/AvatarData.h # libraries/entities-renderer/src/RenderableEntityItem.h # libraries/entities/src/EntityItem.cpp # libraries/entities/src/EntityItem.h # libraries/fbx/src/GLTFSerializer.cpp # libraries/graphics-scripting/src/graphics-scripting/Forward.h # libraries/networking/src/AddressManager.cpp # libraries/networking/src/DomainHandler.h # libraries/procedural/src/procedural/ProceduralMaterialCache.cpp # libraries/render-utils/src/HighlightEffect.cpp # libraries/render-utils/src/MeshPartPayload.cpp # libraries/render-utils/src/Model.cpp # libraries/render-utils/src/RenderShadowTask.cpp # libraries/script-engine/src/WebSocketClass.cpp
Showing the changes to interface/src/Application.cpp (1 of 403 files). Show all
Unified · Split
| @@ -185,6 +185,7 @@ · 184 unmodified lines | ||
| 185 | 185 | #include "scripting/AssetMappingsScriptingInterface.h" |
| 186 | 186 | #include "scripting/ClipboardScriptingInterface.h" |
| 187 | 187 | #include "scripting/DesktopScriptingInterface.h" |
| 188 | +#include "scripting/ScreenshareScriptingInterface.h" | |
| 188 | 189 | #include "scripting/AccountServicesScriptingInterface.h" |
| 189 | 190 | #include "scripting/HMDScriptingInterface.h" |
| 190 | 191 | #include "scripting/MenuScriptingInterface.h" |
| @@ -664,10 +665,17 @@ private: · 473 unmodified lines | ||
| 664 | 665 | * </thead> |
| 665 | 666 | * <tbody> |
| 666 | 667 | * <tr><td><code>CameraFirstPerson</code></td><td>number</td><td>number</td><td>The camera is in first-person mode. |
| 667 | − * </td></tr> | |
| 668 | + * <em>Legacy first person camera mode.</em></td></tr> | |
| 669 | + * <tr><td><code>CameraFirstPersonLookAt</code></td><td>number</td><td>number</td><td>The camera is in first-person mode. | |
| 670 | + * <em>Default first person camera mode.</em></td></tr> | |
| 668 | 671 | * <tr><td><code>CameraThirdPerson</code></td><td>number</td><td>number</td><td>The camera is in third-person mode. |
| 669 | − * </td></tr> | |
| 670 | − * <tr><td><code>CameraFSM</code></td><td>number</td><td>number</td><td>The camera is in full screen mirror mode.</td></tr> | |
| 672 | + * <em>Legacy third person camera mode.</em></td></tr> | |
| 673 | + * <tr><td><code>CameraLookAt</code></td><td>number</td><td>number</td><td>The camera is in third-person mode. | |
| 674 | + * <em>Default third person camera mode.</em></td></tr> | |
| 675 | + * <tr><td><code>CameraFSM</code></td><td>number</td><td>number</td><td>The camera is in full screen mirror mode. | |
| 676 | + * <em>Legacy "look at myself" behavior.</em></td></tr> | |
| 677 | + * <tr><td><code>CameraSelfie</code></td><td>number</td><td>number</td><td>The camera is in selfie mode. | |
| 678 | + * <em>Default "look at myself" camera mode.</em></td></tr> | |
| 671 | 679 | * <tr><td><code>CameraIndependent</code></td><td>number</td><td>number</td><td>The camera is in independent mode.</td></tr> |
| 672 | 680 | * <tr><td><code>CameraEntity</code></td><td>number</td><td>number</td><td>The camera is in entity mode.</td></tr> |
| 673 | 681 | * <tr><td><code>InHMD</code></td><td>number</td><td>number</td><td>The user is in HMD mode.</td></tr> |
| @@ -939,6 +947,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 265 unmodified lines | ||
| 939 | 947 | DependencyManager::set<KeyboardScriptingInterface>(); |
| 940 | 948 | DependencyManager::set<GrabManager>(); |
| 941 | 949 | DependencyManager::set<AvatarPackager>(); |
| 950 | + DependencyManager::set<ScreenshareScriptingInterface>(); | |
| 942 | 951 | PlatformHelper::setup(); |
| 943 | 952 | |
| 944 | 953 | QObject::connect(PlatformHelper::instance(), &PlatformHelper::systemWillWake, [] { |
| @@ -2908,6 +2917,7 @@ Application::~Application() { · 1963 unmodified lines | ||
| 2908 | 2917 | DependencyManager::destroy<SoundCache>(); |
| 2909 | 2918 | DependencyManager::destroy<OctreeStatsProvider>(); |
| 2910 | 2919 | DependencyManager::destroy<GeometryCache>(); |
| 2920 | + DependencyManager::destroy<ScreenshareScriptingInterface>(); | |
| 2911 | 2921 | |
| 2912 | 2922 | DependencyManager::get<ResourceManager>()->cleanup(); |
| 2913 | 2923 | |
| @@ -3401,6 +3411,10 @@ void Application::initializeUi() { · 487 unmodified lines | ||
| 3401 | 3411 | |
| 3402 | 3412 | |
| 3403 | 3413 | setIsInterstitialMode(true); |
| 3414 | + | |
| 3415 | +#if defined(DISABLE_QML) && defined(Q_OS_LINUX) | |
| 3416 | + resumeAfterLoginDialogActionTaken(); | |
| 3417 | +#endif | |
| 3404 | 3418 | } |
| 3405 | 3419 | |
| 3406 | 3420 | |
| @@ -3439,7 +3453,7 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { · 32 unmodified lines | ||
| 3439 | 3453 | surfaceContext->setContextProperty("Users", DependencyManager::get<UsersScriptingInterface>().data()); |
| 3440 | 3454 | |
| 3441 | 3455 | surfaceContext->setContextProperty("UserActivityLogger", DependencyManager::get<UserActivityLoggerScriptingInterface>().data()); |
| 3442 | − | |
| 3456 | + surfaceContext->setContextProperty("Screenshare", DependencyManager::get<ScreenshareScriptingInterface>().data()); | |
| 3443 | 3457 | surfaceContext->setContextProperty("Camera", &_myCamera); |
| 3444 | 3458 | |
| 3445 | 3459 | #if defined(Q_OS_MAC) || defined(Q_OS_WIN) |
| @@ -3545,6 +3559,7 @@ void Application::userKickConfirmation(const QUuid& nodeID) { · 99 unmodified lines | ||
| 3545 | 3559 | } |
| 3546 | 3560 | |
| 3547 | 3561 | void Application::setupQmlSurface(QQmlContext* surfaceContext, bool setAdditionalContextProperties) { |
| 3562 | + surfaceContext->setContextProperty("Screenshare", DependencyManager::get<ScreenshareScriptingInterface>().data()); | |
| 3548 | 3563 | surfaceContext->setContextProperty("Users", DependencyManager::get<UsersScriptingInterface>().data()); |
| 3549 | 3564 | surfaceContext->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data()); |
| 3550 | 3565 | surfaceContext->setContextProperty("UserActivityLogger", DependencyManager::get<UserActivityLoggerScriptingInterface>().data()); |
| @@ -4880,6 +4895,9 @@ void Application::touchEndEvent(QTouchEvent* event) { · 1329 unmodified lines | ||
| 4880 | 4895 | } |
| 4881 | 4896 | |
| 4882 | 4897 | void Application::touchGestureEvent(QGestureEvent* event) { |
| 4898 | + if (_keyboardMouseDevice->isActive()) { | |
| 4899 | + _keyboardMouseDevice->touchGestureEvent(event); | |
| 4900 | + } | |
| 4883 | 4901 | if (_touchscreenDevice && _touchscreenDevice->isActive()) { |
| 4884 | 4902 | _touchscreenDevice->touchGestureEvent(event); |
| 4885 | 4903 | } |
| @@ -5670,6 +5688,7 @@ void Application::resumeAfterLoginDialogActionTaken() { · 784 unmodified lines | ||
| 5670 | 5688 | return; |
| 5671 | 5689 | } |
| 5672 | 5690 | |
| 5691 | +#if !defined(DISABLE_QML) | |
| 5673 | 5692 | if (!isHMDMode() && getDesktopTabletBecomesToolbarSetting()) { |
| 5674 | 5693 | auto toolbar = DependencyManager::get<ToolbarScriptingInterface>()->getToolbar("com.highfidelity.interface.toolbar.system"); |
| 5675 | 5694 | toolbar->writeProperty("visible", true); |
| @@ -5679,6 +5698,7 @@ void Application::resumeAfterLoginDialogActionTaken() { · 3 unmodified lines | ||
| 5679 | 5698 | } |
| 5680 | 5699 | |
| 5681 | 5700 | updateSystemTabletMode(); |
| 5701 | +#endif | |
| 5682 | 5702 | |
| 5683 | 5703 | { |
| 5684 | 5704 | auto userInputMapper = DependencyManager::get<UserInputMapper>(); |
| @@ -5829,12 +5849,7 @@ void Application::centerUI() { · 144 unmodified lines | ||
| 5829 | 5849 | |
| 5830 | 5850 | void Application::cycleCamera() { |
| 5831 | 5851 | auto menu = Menu::getInstance(); |
| 5832 | − if (menu->isOptionChecked(MenuOption::FullscreenMirror)) { | |
| 5833 | − | |
| 5834 | − menu->setIsOptionChecked(MenuOption::FullscreenMirror, false); | |
| 5835 | − menu->setIsOptionChecked(MenuOption::FirstPersonLookAt, true); | |
| 5836 | − | |
| 5837 | − } else if (menu->isOptionChecked(MenuOption::FirstPersonLookAt)) { | |
| 5852 | + if (menu->isOptionChecked(MenuOption::FirstPersonLookAt)) { | |
| 5838 | 5853 | |
| 5839 | 5854 | menu->setIsOptionChecked(MenuOption::FirstPersonLookAt, false); |
| 5840 | 5855 | menu->setIsOptionChecked(MenuOption::LookAtCamera, true); |
| @@ -5842,12 +5857,16 @@ void Application::cycleCamera() { · 1 unmodified line | ||
| 5842 | 5857 | } else if (menu->isOptionChecked(MenuOption::LookAtCamera)) { |
| 5843 | 5858 | |
| 5844 | 5859 | menu->setIsOptionChecked(MenuOption::LookAtCamera, false); |
| 5845 | − menu->setIsOptionChecked(MenuOption::SelfieCamera, true); | |
| 5860 | + if (menu->getActionForOption(MenuOption::SelfieCamera)->isVisible()) { | |
| 5861 | + menu->setIsOptionChecked(MenuOption::SelfieCamera, true); | |
| 5862 | + } else { | |
| 5863 | + menu->setIsOptionChecked(MenuOption::FirstPersonLookAt, true); | |
| 5864 | + } | |
| 5846 | 5865 | |
| 5847 | 5866 | } else if (menu->isOptionChecked(MenuOption::SelfieCamera)) { |
| 5848 | 5867 | |
| 5849 | 5868 | menu->setIsOptionChecked(MenuOption::SelfieCamera, false); |
| 5850 | − menu->setIsOptionChecked(MenuOption::FullscreenMirror, true); | |
| 5869 | + menu->setIsOptionChecked(MenuOption::FirstPersonLookAt, true); | |
| 5851 | 5870 | |
| 5852 | 5871 | } |
| 5853 | 5872 | cameraMenuChanged(); // handle the menu change |
| @@ -6273,7 +6292,7 @@ void Application::update(float deltaTime) { · 419 unmodified lines | ||
| 6273 | 6292 | myAvatar->setDriveKey(MyAvatar::TRANSLATE_Z, -1.0f * userInputMapper->getActionState(controller::Action::TRANSLATE_Z)); |
| 6274 | 6293 | myAvatar->setDriveKey(MyAvatar::TRANSLATE_Y, userInputMapper->getActionState(controller::Action::TRANSLATE_Y)); |
| 6275 | 6294 | myAvatar->setDriveKey(MyAvatar::TRANSLATE_X, userInputMapper->getActionState(controller::Action::TRANSLATE_X)); |
| 6276 | − if (deltaTime > FLT_EPSILON) { | |
| 6295 | + if (deltaTime > FLT_EPSILON && userInputMapper->getActionState(controller::Action::TRANSLATE_CAMERA_Z) == 0.0f) { | |
| 6277 | 6296 | myAvatar->setDriveKey(MyAvatar::PITCH, -1.0f * userInputMapper->getActionState(controller::Action::PITCH)); |
| 6278 | 6297 | myAvatar->setDriveKey(MyAvatar::YAW, -1.0f * userInputMapper->getActionState(controller::Action::YAW)); |
| 6279 | 6298 | myAvatar->setDriveKey(MyAvatar::DELTA_PITCH, -1.0f * userInputMapper->getActionState(controller::Action::DELTA_PITCH)); |
| @@ -7329,6 +7348,7 @@ void Application::registerScriptEngineWithApplicationServices(const ScriptEngine · 1049 unmodified lines | ||
| 7329 | 7348 | scriptEngine->registerGlobalObject("AvatarList", DependencyManager::get<AvatarManager>().data()); |
| 7330 | 7349 | |
| 7331 | 7350 | scriptEngine->registerGlobalObject("Camera", &_myCamera); |
| 7351 | + scriptEngine->registerGlobalObject("Screenshare", DependencyManager::get<ScreenshareScriptingInterface>().data()); | |
| 7332 | 7352 | |
| 7333 | 7353 | #if defined(Q_OS_MAC) || defined(Q_OS_WIN) |
| 7334 | 7354 | scriptEngine->registerGlobalObject("SpeechRecognizer", DependencyManager::get<SpeechRecognizer>().data()); |