15 #ifndef hifi_Application_h
16 #define hifi_Application_h
18 #include <QtWidgets/QApplication>
20 #include <AbstractScriptingServicesInterface.h>
21 #include <AbstractUriHandler.h>
22 #include <AbstractViewStateInterface.h>
23 #include <AvatarHashMap.h>
24 #include <EntityEditPacketSender.h>
25 #include <ModerationFlags.h>
26 #include <OctreeQuery.h>
27 #include <PhysicsEngine.h>
28 #include <ShapeManager.h>
29 #include <TouchEvent.h>
30 #include <ui-plugins/PluginContainer.h>
32 #include "avatar/MyAvatar.h"
33 #include "ConnectionMonitor.h"
34 #include "CursorManager.h"
35 #include "FancyCamera.h"
36 #include "graphics/GraphicsEngine.h"
37 #include "LoginStateManager.h"
38 #include "octree/OctreePacketProcessor.h"
39 #include "PerformanceManager.h"
40 #include "RefreshRateManager.h"
41 #include "scripting/DialogsManagerScriptingInterface.h"
42 #include "ui/ApplicationOverlay.h"
43 #include "ui/OverlayConductor.h"
44 #include "ui/overlays/Overlays.h"
45 #include "VisionSqueeze.h"
46 #include "workload/GameWorkload.h"
53 class CompositorHelper;
54 class ControllerScriptingInterface;
55 class DiscordPresence;
56 class EntityScriptServerLogDialog;
59 class KeyboardMouseDevice;
62 class ModalDialogListener;
64 class TouchscreenDevice;
65 class TouchscreenVirtualPadDevice;
66 class QCommandLineParser;
71 namespace controller {
72 class StateController;
79 #define qApp (static_cast<Application*>(QCoreApplication::instance()))
81 class Application :
public QApplication,
84 public AbstractUriHandler,
85 public PluginContainer
91 int& argc,
char** argv,
92 QElapsedTimer& startup_time
105 void initialize(
const QCommandLineParser &parser);
107 MainWindow* getWindow()
const {
return _window; }
108 virtual QThread* getMainThread()
override {
return thread(); }
110 bool isAboutToQuit()
const {
return _aboutToQuit; }
111 bool isServerlessMode()
const;
112 bool isInterstitialMode()
const {
return _interstitialMode; }
113 bool failedToConnectToEntityServer()
const {
return _failedToConnectToEntityServer; }
115 void setPreviousSessionCrashed(
bool value) { _previousSessionCrashed = value; }
118 Q_INVOKABLE QString getUserAgent();
120 PerformanceManager& getPerformanceManager() {
return _performanceManager; }
121 RefreshRateManager& getRefreshRateManager() {
return _refreshRateManager; }
122 float getGameLoopRate()
const {
return _gameLoopCounter.rate(); }
125 FileLogger* getLogger()
const {
return _logger; }
128 bool getUseDiscordPresence()
const {
return _useDiscordPresence.get(); }
129 void setUseDiscordPresence(
bool enable);
131 QString getPreviousScriptLocation() {
return _previousScriptLocation.get(); }
132 void setPreviousScriptLocation(
const QString& previousScriptLocation) { _previousScriptLocation.set(previousScriptLocation); }
134 void replaceDomainContent(
const QString& url,
const QString& itemName);
136 void openDirectory(
const QString& path);
138 void overrideEntry() { _overrideEntry =
true; }
139 void forceDisplayName(
const QString& displayName) { getMyAvatar()->setDisplayName(displayName); }
140 void forceLoginWithTokens(
const QString& tokens);
141 void setConfigFileURL(
const QString& fileUrl);
143 void loadAvatarScripts(
const QVector<QString>& urls);
144 void unloadAvatarScripts();
146 Q_INVOKABLE
void copyToClipboard(
const QString& text);
148 Q_INVOKABLE
void setMinimumGPUTextureMemStabilityCount(
int stabilityCount) { _minimumGPUTextureMemSizeStabilityCount = stabilityCount; }
150 virtual ControllerScriptingInterface* getControllerScriptingInterface() {
return _controllerScriptingInterface; }
154 VisionSqueeze& getVisionSqueeze() {
return _visionSqueeze; }
158 virtual ui::Menu* getPrimaryMenu()
override;
159 virtual void showDisplayPluginsTools(
bool show)
override;
161 virtual GLWidget* getPrimaryWidget()
override;
163 virtual VKWidget* getPrimaryWidget()
override;
165 virtual MainWindow* getPrimaryWindow()
override;
166 virtual QOpenGLContext* getPrimaryContext()
override;
167 virtual bool isForeground()
const override;
169 bool hasFocus()
const;
173 void showCursor(
const Cursor::Icon& cursor);
175 Overlays& getOverlays() {
return _overlays; }
176 ApplicationOverlay& getApplicationOverlay() {
return *_applicationOverlay; }
177 const ApplicationOverlay& getApplicationOverlay()
const {
return *_applicationOverlay; }
178 CompositorHelper& getApplicationCompositor()
const;
180 virtual PickRay computePickRay(
float x,
float y)
const override;
182 static void setupQmlSurface(QQmlContext* surfaceContext,
bool setAdditionalContextProperties);
184 float getHMDTabletScale() {
return _hmdTabletScale.get(); }
185 void setHMDTabletScale(
float hmdTabletScale) { _hmdTabletScale.set(hmdTabletScale); }
186 float getDesktopTabletScale() {
return _desktopTabletScale.get(); }
187 void setDesktopTabletScale(
float desktopTabletScale) { _desktopTabletScale.set(desktopTabletScale); }
189 bool getDesktopTabletBecomesToolbarSetting() {
return _desktopTabletBecomesToolbarSetting.get(); }
190 void setDesktopTabletBecomesToolbarSetting(
bool value);
191 bool getHmdTabletBecomesToolbarSetting() {
return _hmdTabletBecomesToolbarSetting.get(); }
192 void setHmdTabletBecomesToolbarSetting(
bool value);
194 bool getLogWindowOnTopSetting() {
return _keepLogWindowOnTop.get(); }
195 void setLogWindowOnTopSetting(
bool keepOnTop) { _keepLogWindowOnTop.set(keepOnTop); }
196 bool getPreferStylusOverLaser() {
return _preferStylusOverLaserSetting.get(); }
197 void setPreferStylusOverLaser(
bool value) { _preferStylusOverLaserSetting.set(value); }
198 bool getPreferAvatarFingerOverStylus() {
return _preferAvatarFingerOverStylusSetting.get(); }
199 void setPreferAvatarFingerOverStylus(
bool value) { _preferAvatarFingerOverStylusSetting.set(value); }
201 void setMouseCaptureVR(
bool value);
202 bool getMouseCaptureVR();
204 bool getMiniTabletEnabled() {
return _miniTabletEnabledSetting.get(); }
205 void setMiniTabletEnabled(
bool enabled);
207 float getSettingConstrainToolbarPosition() {
return _constrainToolbarPosition.get(); }
208 void setSettingConstrainToolbarPosition(
bool setting);
210 float getAwayStateWhenFocusLostInVREnabled() {
return _awayStateWhenFocusLostInVREnabled.get(); }
211 void setAwayStateWhenFocusLostInVREnabled(
bool setting);
213 QUuid getTabletScreenID()
const;
214 QUuid getTabletHomeButtonID()
const;
215 QUuid getTabletFrameID()
const;
216 QVector<QUuid> getTabletIDs()
const;
218 void confirmConnectWithoutAvatarEntities();
220 bool getLoginDialogPoppedUp()
const {
return _loginDialogPoppedUp; }
221 void createLoginDialog();
222 void updateLoginDialogPosition();
224 void createAvatarInputsBar();
225 void destroyAvatarInputsBar();
238 void initializePluginManager(
const QCommandLineParser& parser);
240 virtual void requestReset()
override { resetSensors(
false); }
241 virtual bool makeRenderingContextCurrent()
override {
return true; }
243 static void shutdownPlugins();
245 void initializeDisplayPlugins();
246 virtual DisplayPluginPointer getActiveDisplayPlugin()
const override;
247 void setActiveDisplayPlugin(
const QString& pluginName);
249 glm::uvec2 getUiSize()
const;
250 QRect getRecommendedHUDRect()
const;
251 glm::vec2 getDeviceSize()
const;
252 bool isThrottleRendering()
const;
253 float getTargetRenderFrameRate()
const;
256 bool hasRiftControllers();
257 bool hasViveControllers();
262 virtual bool isHMDMode()
const override;
263 glm::mat4 getHMDSensorPose()
const;
264 glm::mat4 getEyeOffset(
int eye)
const;
265 glm::mat4 getEyeProjection(
int eye)
const;
270 void initializeRenderEngine();
275 glm::uvec2 getCanvasSize()
const;
276 float getRenderResolutionScale()
const;
278 render::ScenePointer getMain3DScene()
override {
return _graphicsEngine->getRenderScene(); }
279 render::EnginePointer getRenderEngine()
override {
return _graphicsEngine->getRenderEngine(); }
280 gpu::ContextPointer getGPUContext()
const {
return _graphicsEngine->getGPUContext(); }
281 float getRenderLoopRate()
const {
return _graphicsEngine->getRenderLoopRate(); }
285 bool notify(QObject*, QEvent*)
override;
286 bool event(QEvent* event)
override;
287 bool eventFilter(QObject*
object, QEvent* event)
override;
289 void postLambdaEvent(
const std::function<
void()>& f)
override;
290 void sendLambdaEvent(
const std::function<
void()>& f)
override;
291 virtual void pushPostUpdateLambda(
void* key,
const std::function<
void()>& func)
override;
295 Camera& getCamera() {
return _myCamera; }
296 const Camera& getCamera()
const {
return _myCamera; }
298 void copyViewFrustum(ViewFrustum& viewOut)
const;
302 void copyDisplayViewFrustum(ViewFrustum& viewOut)
const;
304 void updateCamera(
RenderArgs& renderArgs,
float deltaTime);
305 void updateSecondaryCameraViewFrustum();
307 const ConicalViewFrustums& getConicalViews()
const override {
return _conicalViews; }
309 float getFieldOfView() {
return _fieldOfView.get(); }
310 void setFieldOfView(
float fov);
312 bool getCameraClippingEnabled() {
return _cameraClippingEnabled.get(); }
313 void setCameraClippingEnabled(
bool enabled);
315 void updateMyAvatarLookAtPosition(
float deltaTime);
319 QSharedPointer<EntityTreeRenderer> getEntities()
const {
return DependencyManager::get<EntityTreeRenderer>(); }
320 EntityTreePointer getEntityClipboard()
const {
return _entityClipboard; }
322 std::shared_ptr<EntityEditPacketSender> getEntityEditPacketSender() {
return _entityEditSender; }
324 void setMaxOctreePacketsPerSecond(
int maxOctreePPS);
325 int getMaxOctreePacketsPerSecond()
const {
return _maxOctreePPS; }
326 bool isMissingSequenceNumbers() {
return _isMissingSequenceNumbers; }
332 virtual bool canAcceptURL(
const QString& url)
const override;
333 virtual bool acceptURL(
const QString& url,
bool defaultUpload =
false)
override;
337 bool isPhysicsEnabled()
const {
return _physicsEnabled; }
338 PhysicsEnginePointer getPhysicsEngine() {
return _physicsEngine; }
339 const GameWorkload& getGameWorkload()
const {
return _gameWorkload; }
341 float getNumCollisionObjects()
const {
return _physicsEngine ? _physicsEngine->getNumCollisionObjects() : 0; }
342 void saveNextPhysicsStats(QString filename) { _physicsEngine->saveNextPhysicsStats(filename); }
346 virtual glm::vec3 getAvatarPosition()
const override {
return getMyAvatar()->getWorldPosition(); }
348 void clearAvatarOverrideUrl() { _avatarOverrideUrl = QUrl(); _saveAvatarOverrideUrl =
false; }
349 QUrl getAvatarOverrideUrl() {
return _avatarOverrideUrl; }
350 bool getSaveAvatarOverrideUrl() {
return _saveAvatarOverrideUrl; }
352 int getOtherAvatarsReplicaCount() {
return DependencyManager::get<AvatarHashMap>()->getReplicaCount(); }
353 void setOtherAvatarsReplicaCount(
int count) { DependencyManager::get<AvatarHashMap>()->setReplicaCount(count); }
357 using SnapshotOperator = std::tuple<std::function<void(
const QImage&)>, float,
bool>;
358 void addSnapshotOperator(
const SnapshotOperator& snapshotOperator);
359 bool takeSnapshotOperators(std::queue<SnapshotOperator>& snapshotOperators);
361 void takeSnapshot(
bool notify,
bool includeAnimated =
false,
float aspectRatio = 0.0f,
const QString& filename = QString());
362 void takeSecondaryCameraSnapshot(
const bool& notify,
const QString& filename = QString());
363 void takeSecondaryCamera360Snapshot(
const glm::vec3& cameraPosition,
364 const bool& cubemapOutputFormat,
366 const QString& filename = QString());
367 void shareSnapshot(
const QString& filename,
const QUrl& href = QUrl(
""));
370 #if defined(Q_OS_ANDROID)
371 void beforeEnterBackground();
372 void enterBackground();
373 void enterForeground();
374 void toggleAwayMode();
378 void svoImportRequested(
const QString& url);
380 void fullAvatarURLChanged(
const QString& newValue,
const QString& modelName);
382 void beforeAboutToQuit();
383 void activeDisplayPluginChanged();
385 void uploadRequest(QString path);
387 void interstitialModeChanged(
bool isInInterstitialMode);
389 void loginDialogFocusEnabled();
390 void loginDialogFocusDisabled();
392 void miniTabletEnabledChanged(
bool enabled);
393 void awayStateWhenFocusLostInVRChanged(
bool enabled);
395 void darkThemePreferenceChanged(
bool useDarkTheme);
396 void menuBarVisibilityChanged(
bool visible);
399 void updateThreadPoolCount()
const;
401 static void gotoTutorial();
402 void goToErrorDomainURL(QUrl errorDomainURL);
403 void handleLocalServerConnection()
const;
404 void readArgumentsFromLocalSocket()
const;
405 void showUrlHandler(
const QUrl& url);
407 #if (PR_BUILD || DEV_BUILD)
408 void sendWrongProtocolVersionsSignature(
bool checked) { ::sendWrongProtocolVersionsSignature(checked); }
411 void hmdVisibleChanged(
bool visible);
413 void reloadResourceCaches();
415 void updateHeartbeat()
const;
417 static void deadlockApplication();
418 static void unresponsiveApplication();
419 void crashOnShutdown();
421 void rotationModeChanged()
const;
423 void setIsServerlessMode(
bool serverlessDomain);
424 std::map<QString, QString> prepareServerlessDomainContents(QUrl domainURL, QByteArray data);
426 void loadServerlessDomain(QUrl domainURL);
427 void loadErrorDomain(QUrl domainURL);
428 void setIsInterstitialMode(
bool interstitialMode);
430 void updateVerboseLogging();
432 void setCachebustRequire();
434 QString getGraphicsCardType();
435 bool gpuTextureMemSizeStable();
437 Q_INVOKABLE SharedSoundPointer getSampleSound()
const {
return _sampleSound; }
439 static void runTests();
442 void showDialog(
const QUrl& widgetUrl,
const QUrl& tabletUrl,
const QString& name)
const;
443 Q_INVOKABLE
void loadDialog();
444 Q_INVOKABLE
void loadScriptURLDialog()
const;
445 void toggleLogDialog();
446 void recreateLogWindow(
int);
447 void toggleEntityScriptServerLogDialog();
448 Q_INVOKABLE
void showAssetServerWidget(QString filePath =
"");
449 Q_INVOKABLE
void loadAddAvatarBookmarkDialog()
const;
450 Q_INVOKABLE
void loadAvatarBrowser()
const;
452 void showLoginScreen();
453 static void showHelp();
455 void updateSystemTabletMode();
457 void captureMouseChanged(
bool captureMouse);
458 void toggleOverlays();
459 void setOverlaysVisible(
bool visible);
460 Q_INVOKABLE
void centerUI() { _overlayConductor.centerUI(); }
462 void addAssetToWorldMessageClose();
464 void loadLODToolsDialog();
465 void loadEntityStatisticsDialog();
466 void loadDomainConnectionDialog();
467 void showScriptLogs();
469 const QString getPreferredCursor()
const {
return _preferredCursor.get(); }
470 void setPreferredCursor(
const QString& cursor);
472 bool getDarkThemePreference()
const {
return _darkTheme.get(); }
473 void setDarkThemePreference(
bool value);
475 bool getMenuBarVisible()
const {
return _menuBarVisible.get(); }
476 void setMenuBarVisible(
bool visible);
487 Q_INVOKABLE
void showVRKeyboardForHudUI(
bool show);
491 void resetSensors(
bool andReload =
false);
495 QVector<EntityItemID> pasteEntities(
const QString& entityHostType,
float x,
float y,
float z);
496 bool exportEntities(
const QString& filename,
const QVector<QUuid>& entityIDs,
const glm::vec3* givenOffset =
nullptr,
const QVariantMap& options = QVariantMap());
497 bool exportEntities(
const QString& filename,
float x,
float y,
float z,
float scale,
const QVariantMap& options = QVariantMap());
498 bool importEntities(
const QString& url,
const bool isObservable =
true,
const qint64 callerId = -1);
500 void setKeyboardFocusHighlight(
const glm::vec3& position,
const glm::quat& rotation,
const glm::vec3& dimensions);
501 QUuid getKeyboardFocusEntity()
const {
return _keyboardFocusedEntity.get(); }
502 void setKeyboardFocusEntity(
const QUuid&
id);
506 void addAssetToWorldFromURL(QString url);
507 void addAssetToWorldFromURLRequestFinished();
508 void addAssetToWorld(QString filePath, QString zipFile,
bool isZip =
false);
509 void addAssetToWorldUnzipFailure(QString filePath);
510 void addAssetToWorldWithNewMapping(QString filePath, QString mapping,
int copy,
bool isZip =
false);
511 void addAssetToWorldUpload(QString filePath, QString mapping,
bool isZip =
false);
512 void addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash,
bool isZip =
false);
513 void addAssetToWorldAddEntity(QString filePath, QString mapping);
515 void handleUnzip(QString sourceFile, QStringList destinationFile,
bool autoAdd,
bool isZip);
519 static void packageModel();
524 void cameraModeChanged();
525 void cameraMenuChanged();
527 void changeViewAsNeeded(
float boomLength);
531 void resetPhysicsReadyInformation();
535 void onAboutToQuit();
537 void loadSettings(
const QCommandLineParser& parser);
538 void saveSettings()
const;
539 void setFailedToConnectToEntityServer() { _failedToConnectToEntityServer =
true; }
541 bool acceptSnapshot(
const QString& urlString);
543 void setSessionUUID(
const QUuid& sessionUUID)
const;
545 void domainURLChanged(QUrl domainURL);
546 void domainConnectionRefused(
const QString& reasonMessage,
int reason,
const QString& extraInfo);
548 void updateWindowTitle()
const;
549 void nodeAdded(SharedNodePointer node);
550 void nodeActivated(SharedNodePointer node);
551 void nodeKilled(SharedNodePointer node);
553 void handleSandboxStatus(QNetworkReply* reply);
557 void onDesktopRootItemCreated(QQuickItem* qmlContext);
558 void onDesktopRootContextCreated(QQmlContext* qmlContext);
561 void notifyPacketVersionMismatch();
563 bool askToSetAvatarUrl(
const QString& url);
564 bool askToLoadScript(
const QString& scriptFilenameOrURL);
565 bool askToReplaceDomainContent(
const QString& url);
567 void onDismissedLoginDialog();
571 void clearDomainOctreeDetails(
bool clearAll =
true);
572 void resettingDomain();
576 void onPresent(quint32 frameCount);
578 void activeChanged(Qt::ApplicationState state);
579 void windowMinimizedChanged(
bool minimized);
583 void updateDisplayMode();
584 void switchDisplayMode();
585 void setDisplayPlugin(DisplayPluginPointer newPlugin);
589 void addAssetToWorldCheckModelSize();
590 void onAssetToWorldMessageBoxClosed();
591 void addAssetToWorldInfoTimeout();
592 void addAssetToWorldErrorTimeout();
596 void setShowBulletWireframe(
bool value) { _physicsEngine->setShowBulletWireframe(value); }
597 void setShowBulletAABBs(
bool value) { _physicsEngine->setShowBulletAABBs(value); }
598 void setShowBulletContactPoints(
bool value) { _physicsEngine->setShowBulletContactPoints(value); }
599 void setShowBulletConstraints(
bool value) { _physicsEngine->setShowBulletConstraints(value); }
600 void setShowBulletConstraintLimits(
bool value) { _physicsEngine->setShowBulletConstraintLimits(value); }
602 void setShowTrackedObjects(
bool value) { _showTrackedObjects = value; }
605 void cleanupBeforeQuit();
608 void update(
float deltaTime);
609 void updateLOD(
float deltaTime)
const;
610 void updateThreads(
float deltaTime);
612 void userKickConfirmation(
const QUuid& nodeID,
unsigned int banFlags = ModerationFlags::getDefaultBanFlags());
617 void setupSignalsAndOperators();
622 void pauseUntilLoginDetermined();
623 void resumeAfterLoginDialogActionTaken();
625 static QSharedPointer<OffscreenUi> getOffscreenUI();
627 void updateDialogs(
float deltaTime)
const;
629 void maybeToggleMenuVisible(QMouseEvent* event)
const;
630 void toggleTabletUI(
bool shouldOpen =
false)
const;
632 bool shouldCaptureMouse()
const;
633 void checkChangeCursor();
635 void addAssetToWorldInfo(QString modelName, QString infoText);
636 void addAssetToWorldInfoClear(QString modelName);
637 void addAssetToWorldInfoDone(QString modelName);
638 void addAssetToWorldError(QString modelName, QString errorText);
642 void resizeEvent(QResizeEvent* size) { resizeGL(); }
644 void keyPressEvent(QKeyEvent* event);
645 void keyReleaseEvent(QKeyEvent* event);
647 void focusOutEvent(QFocusEvent* event);
648 void synthesizeKeyReleasEvents();
650 void mouseMoveEvent(QMouseEvent* event);
651 void mousePressEvent(QMouseEvent* event);
652 void mouseDoublePressEvent(QMouseEvent* event);
653 void mouseReleaseEvent(QMouseEvent* event);
655 void touchBeginEvent(QTouchEvent* event);
656 void touchEndEvent(QTouchEvent* event);
657 void touchUpdateEvent(QTouchEvent* event);
658 void touchGestureEvent(QGestureEvent* event);
660 void wheelEvent(QWheelEvent* event)
const;
661 void dropEvent(QDropEvent* event);
662 static void dragEnterEvent(QDragEnterEvent* event) {
event->acceptProposedAction(); }
664 bool handleInputMethodEventForFocusedEntity(QEvent* event);
665 bool handleKeyEventForFocusedEntity(QEvent* event);
666 bool handleFileOpenEvent(QFileOpenEvent* event);
668 void processDriverBlocklistReply(
const QString& fullDriverToTest,
const QString& os,
const QString& vendor,
const QString& renderer,
const QString& api,
669 const QString& driver);
673 void queryOctree(
NodeType_t serverType, PacketType packetType);
675 int sendNackPackets();
679 void updateRenderArgs(
float deltaTime);
683 void startHMDStandBySession();
684 void endHMDSession();
688 bool importJSONFromURL(
const QString& urlString);
689 bool importSVOFromURL(
const QString& urlString);
690 bool importFromZIP(
const QString& filePath);
691 bool importImage(
const QString& urlString);
695 std::shared_ptr<MyAvatar> getMyAvatar()
const;
696 void checkSkeleton()
const;
702 void tryToEnablePhysics();
709 QWidget *_vkWindowWrapper;
714 bool _isMenuInitialized;
716 bool _startUpFinished {
false };
717 bool _quitWhenFinished {
false };
718 bool _crashOnShutdown {
false };
719 bool _aboutToQuit {
false };
720 bool _previousSessionCrashed {
false };
723 bool _overrideEntry {
false };
724 bool _settingsLoaded {
false };
726 bool _domainLoadingInProgress {
false };
727 bool _interstitialMode {
false };
728 bool _interstitialModeEnabled {
false };
730 PerformanceManager _performanceManager;
731 RefreshRateManager _refreshRateManager;
732 GameWorkload _gameWorkload;
734 ConnectionMonitor _connectionMonitor;
737 FileLogger* _logger {
nullptr };
740 QElapsedTimer& _sessionRunTimer;
741 QElapsedTimer _lastTimeUpdated;
742 QTimer _locationUpdateTimer;
743 QTimer _minimizedWindowTimer;
745 RateCounter<500> _gameLoopCounter;
747 using SteadyClock = std::chrono::steady_clock;
748 using TimePoint = SteadyClock::time_point;
749 TimePoint _queryExpiry;
751 quint64 _lastNackTime;
752 quint64 _lastSendDownstreamAudioStats;
754 bool _notifiedPacketVersionMismatchThisDomain {
false };
756 QDir _defaultScriptsLocation;
758 bool _overrideDefaultScriptsLocation;
760 qint64 _gpuTextureMemSizeStabilityCount { 0 };
761 qint64 _gpuTextureMemSizeAtLastCheck { 0 };
762 int _minimumGPUTextureMemSizeStabilityCount { 30 };
764 SharedSoundPointer _sampleSound {
nullptr };
766 VisionSqueeze _visionSqueeze;
768 DiscordPresence* _discordPresence {
nullptr };
778 GLCanvas* _primaryWidget{
nullptr };
780 VKCanvas* _primaryWidget{
nullptr };
784 std::shared_ptr<ApplicationOverlay> _applicationOverlay;
785 OverlayConductor _overlayConductor;
787 mutable QRecursiveMutex _changeCursorLock;
788 Qt::CursorShape _desiredCursor { Qt::BlankCursor };
789 bool _cursorNeedsChanging {
false };
790 bool _useSystemCursor {
false };
792 DialogsManagerScriptingInterface* _dialogsManagerScriptingInterface;
794 QPointer<LogDialog> _logDialog;
795 QPointer<EntityScriptServerLogDialog> _entityScriptServerLogDialog;
796 ModalDialogListener* _confirmConnectWithoutAvatarEntitiesDialog {
nullptr };
798 QUuid _loginDialogID;
799 QUuid _avatarInputsBarID;
800 LoginStateManager _loginStateManager;
802 QQuickItem* _addAssetToWorldMessageBox {
nullptr };
803 QStringList _addAssetToWorldInfoKeys;
804 QStringList _addAssetToWorldInfoMessages;
805 QTimer _addAssetToWorldInfoTimer;
806 QTimer _addAssetToWorldErrorTimer;
810 bool _loginDialogPoppedUp {
false };
811 bool _developerMenuVisible {
false };
812 bool _noLoginSuggestion {
false };
814 bool _resumeAfterLoginDialogActionTaken_WasPostponed {
false };
815 bool _resumeAfterLoginDialogActionTaken_SafeToRun {
false };
817 bool _isForeground {
true };
835 void updateThemeColors();
839 DisplayPluginPointer _displayPlugin;
840 mutable std::mutex _displayPluginLock;
842 std::shared_ptr<controller::StateController> _applicationStateDevice;
843 std::shared_ptr<KeyboardMouseDevice> _keyboardMouseDevice;
844 std::shared_ptr<TouchscreenDevice> _touchscreenDevice;
845 std::shared_ptr<TouchscreenVirtualPadDevice> _touchscreenVirtualPadDevice;
846 bool _keyboardDeviceHasFocus {
true };
848 ControllerScriptingInterface* _controllerScriptingInterface {
nullptr };
850 DisplayPluginPointer _autoSwitchDisplayModeSupportedHMDPlugin {
nullptr };
851 QString _autoSwitchDisplayModeSupportedHMDPluginName;
852 bool _previousHMDWornStatus {
false };
856 QHash<int, QKeyEvent> _keysPressed;
858 quint64 _lastAcceptedKeyPress { 0 };
860 ThreadSafeValueCache<EntityItemID> _keyboardFocusedEntity;
862 bool _reticleClickPressed {
false };
863 bool _keyboardFocusWaitingOnRenderable {
false };
865 bool _captureMouse {
false };
866 bool _ignoreMouseMove {
false };
867 QPointF _mouseCaptureTarget { NAN, NAN };
869 std::map<
void*, std::function<void()>> _postUpdateLambdas;
870 std::mutex _postUpdateLambdasLock;
872 std::atomic<bool> _pendingIdleEvent {
true };
876 EntityTreePointer _entityClipboard;
878 std::shared_ptr<OctreePacketProcessor> _octreeProcessor;
879 std::shared_ptr<EntityEditPacketSender> _entityEditSender;
880 OctreeQuery _octreeQuery {
true };
881 bool _enableProcessOctreeThread {
true };
883 uint32_t _fullSceneCounterAtLastPhysicsCheck { 0 };
885 mutable QTimer _entityServerConnectionTimer;
887 QUuid _keyboardFocusHighlightID;
889 bool _failedToConnectToEntityServer {
false };
890 bool _isMissingSequenceNumbers {
false };
893 int _maxOctreePPS { DEFAULT_MAX_OCTREE_PPS };
897 typedef bool (Application::*AcceptURLMethod)(
const QString&);
898 static const std::vector<std::pair<QString, AcceptURLMethod>> _acceptedExtensions;
900 QTimer _addAssetToWorldResizeTimer;
901 QHash<QUuid, int> _addAssetToWorldResizeList;
905 FancyCamera _myCamera;
907 CameraMode _previousCameraMode;
908 glm::vec3 _thirdPersonHMDCameraBoom { 0.0f, 0.0f, -1.0f };
909 bool _thirdPersonHMDCameraBoomValid {
true };
910 float _scaleMirror { 1.0f };
911 float _mirrorYawOffset { 0.0f };
912 float _raiseMirror { 0.0f };
914 mutable QRecursiveMutex _viewMutex;
915 ViewFrustum _viewFrustum;
916 ViewFrustum _displayViewFrustum;
918 ConicalViewFrustums _conicalViews;
919 ConicalViewFrustums _lastQueriedViews;
924 bool _prevCameraClippingEnabled {
false };
925 unsigned int _cameraClippingRayPickID;
929 std::shared_ptr<GraphicsEngine> _graphicsEngine;
930 glm::uvec2 _renderResolution;
933 bool _isGLInitialized {
false };
937 QString _previousAvatarSkeletonModel;
938 float _previousAvatarTargetScale;
940 QUrl _avatarOverrideUrl;
941 bool _saveAvatarOverrideUrl {
false };
945 ShapeManager _shapeManager;
946 PhysicalEntitySimulationPointer _entitySimulation;
947 PhysicsEnginePointer _physicsEngine;
949 bool _physicsEnabled {
false };
953 bool _waitForServerlessToBeSet {
true };
955 bool _showTrackedObjects {
false };
956 bool _prevShowTrackedObjects {
false };
960 std::mutex _snapshotMutex;
961 std::queue<SnapshotOperator> _snapshotOperators;
962 bool _hasPrimarySnapshot {
false };
quint8 NodeType_t
An 8-bit value identifying the type of a node - domain server, audio mixer, etc.
Definition: NodeType.h:22
Interface provided by Application to other objects that need access to scripting services of the appl...
Definition: AbstractScriptingServicesInterface.h:26
virtual void registerScriptEngineWithApplicationServices(ScriptManagerPointer &scriptEngine)=0
Registers application specific services with a script engine.
Interface provided by Application to other objects that need access to the current view state details...
Definition: AbstractViewStateInterface.h:31
The ArchiveDownloadInterface API provides some facilities for working with the file system.
Definition: ArchiveDownloadInterface.h:27
customized canvas that simply forwards requests/events to the singleton application
Definition: GLCanvas.h:18
Definition: OctreeSceneStats.h:274
Definition: OctreePacketProcessor.h:25
Represents a display or device event to the scripting engine. Exposed as TouchEvent
Definition: TouchEvent.h:30
customized canvas that simply forwards requests/events to the singleton application
Definition: VKCanvas.h:22