Merge branch 'master' into M22075
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 299 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 30 KiB |
|
@ -3596,7 +3596,14 @@ void Application::setPreferAvatarFingerOverStylus(bool value) {
|
|||
|
||||
void Application::setPreferredCursor(const QString& cursorName) {
|
||||
qCDebug(interfaceapp) << "setPreferredCursor" << cursorName;
|
||||
_preferredCursor.set(cursorName.isEmpty() ? DEFAULT_CURSOR_NAME : cursorName);
|
||||
|
||||
if (_displayPlugin && _displayPlugin->isHmd()) {
|
||||
_preferredCursor.set(cursorName.isEmpty() ? DEFAULT_CURSOR_NAME : cursorName);
|
||||
}
|
||||
else {
|
||||
_preferredCursor.set(cursorName.isEmpty() ? Cursor::Manager::getIconName(Cursor::Icon::SYSTEM) : cursorName);
|
||||
}
|
||||
|
||||
showCursor(Cursor::Manager::lookupIcon(_preferredCursor.get()));
|
||||
}
|
||||
|
||||
|
@ -5046,7 +5053,7 @@ void Application::idle() {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
checkChangeCursor();
|
||||
|
||||
#if !defined(DISABLE_QML)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
//
|
||||
// HMDScriptingInterface.h
|
||||
// interface/src/scripting
|
||||
//
|
||||
|
@ -25,7 +25,7 @@ class QScriptEngine;
|
|||
#include <QReadWriteLock>
|
||||
|
||||
/**jsdoc
|
||||
* The HMD API provides access to the HMD used in VR display mode.
|
||||
* The <code>HMD</code> API provides access to the HMD used in VR display mode.
|
||||
*
|
||||
* @namespace HMD
|
||||
*
|
||||
|
@ -87,7 +87,7 @@ class HMDScriptingInterface : public AbstractHMDScriptingInterface, public Depen
|
|||
public:
|
||||
|
||||
/**jsdoc
|
||||
* Calculate the intersection of a ray with the HUD overlay.
|
||||
* Calculates the intersection of a ray with the HUD overlay.
|
||||
* @function HMD.calculateRayUICollisionPoint
|
||||
* @param {Vec3} position - The origin of the ray.
|
||||
* @param {Vec3} direction - The direction of the ray.
|
||||
|
@ -115,7 +115,7 @@ public:
|
|||
glm::vec3 calculateParabolaUICollisionPoint(const glm::vec3& position, const glm::vec3& velocity, const glm::vec3& acceleration, float& parabolicDistance) const;
|
||||
|
||||
/**jsdoc
|
||||
* Get the 2D HUD overlay coordinates of a 3D point on the HUD overlay.
|
||||
* Gets the 2D HUD overlay coordinates of a 3D point on the HUD overlay.
|
||||
* 2D HUD overlay coordinates are pixels with the origin at the top left of the overlay.
|
||||
* @function HMD.overlayFromWorldPoint
|
||||
* @param {Vec3} position - The point on the HUD overlay in world coordinates.
|
||||
|
@ -141,7 +141,7 @@ public:
|
|||
Q_INVOKABLE glm::vec2 overlayFromWorldPoint(const glm::vec3& position) const;
|
||||
|
||||
/**jsdoc
|
||||
* Get the 3D world coordinates of a 2D point on the HUD overlay.
|
||||
* Gets the 3D world coordinates of a 2D point on the HUD overlay.
|
||||
* 2D HUD overlay coordinates are pixels with the origin at the top left of the overlay.
|
||||
* @function HMD.worldPointFromOverlay
|
||||
* @param {Vec2} coordinates - The point on the HUD overlay in HUD coordinates.
|
||||
|
@ -150,7 +150,7 @@ public:
|
|||
Q_INVOKABLE glm::vec3 worldPointFromOverlay(const glm::vec2& overlay) const;
|
||||
|
||||
/**jsdoc
|
||||
* Get the 2D point on the HUD overlay represented by given spherical coordinates.
|
||||
* Gets the 2D point on the HUD overlay represented by given spherical coordinates.
|
||||
* 2D HUD overlay coordinates are pixels with the origin at the top left of the overlay.
|
||||
* Spherical coordinates are polar coordinates in radians with <code>{ x: 0, y: 0 }</code> being the center of the HUD
|
||||
* overlay.
|
||||
|
@ -161,7 +161,7 @@ public:
|
|||
Q_INVOKABLE glm::vec2 sphericalToOverlay(const glm::vec2 & sphericalPos) const;
|
||||
|
||||
/**jsdoc
|
||||
* Get the spherical coordinates of a 2D point on the HUD overlay.
|
||||
* Gets the spherical coordinates of a 2D point on the HUD overlay.
|
||||
* 2D HUD overlay coordinates are pixels with the origin at the top left of the overlay.
|
||||
* Spherical coordinates are polar coordinates in radians with <code>{ x: 0, y: 0 }</code> being the center of the HUD
|
||||
* overlay.
|
||||
|
@ -172,21 +172,21 @@ public:
|
|||
Q_INVOKABLE glm::vec2 overlayToSpherical(const glm::vec2 & overlayPos) const;
|
||||
|
||||
/**jsdoc
|
||||
* Recenter the HMD HUD to the current HMD position and orientation.
|
||||
* Recenters the HMD HUD to the current HMD position and orientation.
|
||||
* @function HMD.centerUI
|
||||
*/
|
||||
Q_INVOKABLE void centerUI();
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* Get the name of the HMD audio input device.
|
||||
* Gets the name of the HMD audio input device.
|
||||
* @function HMD.preferredAudioInput
|
||||
* @returns {string} The name of the HMD audio input device if in HMD mode, otherwise an empty string.
|
||||
*/
|
||||
Q_INVOKABLE QString preferredAudioInput() const;
|
||||
|
||||
/**jsdoc
|
||||
* Get the name of the HMD audio output device.
|
||||
* Gets the name of the HMD audio output device.
|
||||
* @function HMD.preferredAudioOutput
|
||||
* @returns {string} The name of the HMD audio output device if in HMD mode, otherwise an empty string.
|
||||
*/
|
||||
|
@ -194,10 +194,10 @@ public:
|
|||
|
||||
|
||||
/**jsdoc
|
||||
* Check whether there is an HMD available.
|
||||
* Checks whether there is an HMD available.
|
||||
* @function HMD.isHMDAvailable
|
||||
* @param {string} [name=""] - The name of the HMD to check for, e.g., <code>"Oculus Rift"</code>. The name is the same as
|
||||
* may be displayed in Interface's "Display" menu. If no name is specified then any HMD matches.
|
||||
* may be displayed in Interface's "Display" menu. If no name is specified, then any HMD matches.
|
||||
* @returns {boolean} <code>true</code> if an HMD of the specified <code>name</code> is available, otherwise
|
||||
* <code>false</code>.
|
||||
* @example <caption>Report on HMD availability.</caption>
|
||||
|
@ -208,10 +208,10 @@ public:
|
|||
Q_INVOKABLE bool isHMDAvailable(const QString& name = "");
|
||||
|
||||
/**jsdoc
|
||||
* Check whether there is an HMD head controller available.
|
||||
* Checks whether there is an HMD head controller available.
|
||||
* @function HMD.isHeadControllerAvailable
|
||||
* @param {string} [name=""] - The name of the HMD head controller to check for, e.g., <code>"Oculus"</code>. If no name is
|
||||
* specified then any HMD head controller matches.
|
||||
* specified, then any HMD head controller matches.
|
||||
* @returns {boolean} <code>true</code> if an HMD head controller of the specified <code>name</code> is available,
|
||||
* otherwise <code>false</code>.
|
||||
* @example <caption>Report HMD head controller availability.</caption>
|
||||
|
@ -222,10 +222,10 @@ public:
|
|||
Q_INVOKABLE bool isHeadControllerAvailable(const QString& name = "");
|
||||
|
||||
/**jsdoc
|
||||
* Check whether there are HMD hand controllers available.
|
||||
* Checks whether there are HMD hand controllers available.
|
||||
* @function HMD.isHandControllerAvailable
|
||||
* @param {string} [name=""] - The name of the HMD hand controller to check for, e.g., <code>"Oculus"</code>. If no name is
|
||||
* specified then any HMD hand controller matches.
|
||||
* specified, then any HMD hand controller matches.
|
||||
* @returns {boolean} <code>true</code> if an HMD hand controller of the specified <code>name</code> is available,
|
||||
* otherwise <code>false</code>.
|
||||
* @example <caption>Report HMD hand controller availability.</caption>
|
||||
|
@ -236,7 +236,7 @@ public:
|
|||
Q_INVOKABLE bool isHandControllerAvailable(const QString& name = "");
|
||||
|
||||
/**jsdoc
|
||||
* Check whether there are specific HMD controllers available.
|
||||
* Checks whether there are specific HMD controllers available.
|
||||
* @function HMD.isSubdeviceContainingNameAvailable
|
||||
* @param {string} name - The name of the HMD controller to check for, e.g., <code>"OculusTouch"</code>.
|
||||
* @returns {boolean} <code>true</code> if an HMD controller with a name containing the specified <code>name</code> is
|
||||
|
@ -248,7 +248,7 @@ public:
|
|||
Q_INVOKABLE bool isSubdeviceContainingNameAvailable(const QString& name);
|
||||
|
||||
/**jsdoc
|
||||
* Signal that models of the HMD hand controllers being used should be displayed. The models are displayed at their actual,
|
||||
* Signals that models of the HMD hand controllers being used should be displayed. The models are displayed at their actual,
|
||||
* real-world locations.
|
||||
* @function HMD.requestShowHandControllers
|
||||
* @example <caption>Show your hand controllers for 10 seconds.</caption>
|
||||
|
@ -260,14 +260,14 @@ public:
|
|||
Q_INVOKABLE void requestShowHandControllers();
|
||||
|
||||
/**jsdoc
|
||||
* Signal that it is no longer necessary to display models of the HMD hand controllers being used. If no other scripts
|
||||
* Signals that it is no longer necessary to display models of the HMD hand controllers being used. If no other scripts
|
||||
* want the models displayed then they are no longer displayed.
|
||||
* @function HMD.requestHideHandControllers
|
||||
*/
|
||||
Q_INVOKABLE void requestHideHandControllers();
|
||||
|
||||
/**jsdoc
|
||||
* Check whether any script wants models of the HMD hand controllers displayed. Requests are made and canceled using
|
||||
* Checks whether any script wants models of the HMD hand controllers displayed. Requests are made and canceled using
|
||||
* {@link HMD.requestShowHandControllers|requestShowHandControllers} and
|
||||
* {@link HMD.requestHideHandControllers|requestHideHandControllers}.
|
||||
* @function HMD.shouldShowHandControllers
|
||||
|
@ -292,8 +292,8 @@ public:
|
|||
|
||||
|
||||
/**jsdoc
|
||||
* Suppress the activation of the HMD-provided keyboard, if any. Successful calls should be balanced with a call to
|
||||
* {@link HMD.unspressKeyboard|unspressKeyboard} within a reasonable amount of time.
|
||||
* Suppresses the activation of the HMD-provided keyboard, if any. Successful calls should be balanced with a call to
|
||||
* {@link HMD.unsuppressKeyboard|unsuppressKeyboard} within a reasonable amount of time.
|
||||
* @function HMD.suppressKeyboard
|
||||
* @returns {boolean} <code>true</code> if the current HMD provides a keyboard and it was successfully suppressed (e.g., it
|
||||
* isn't being displayed), otherwise <code>false</code>.
|
||||
|
@ -307,14 +307,14 @@ public:
|
|||
Q_INVOKABLE bool suppressKeyboard();
|
||||
|
||||
/**jsdoc
|
||||
* Unsuppress the activation of the HMD-provided keyboard, if any.
|
||||
* Unsuppresses the activation of the HMD-provided keyboard, if any.
|
||||
* @function HMD.unsuppressKeyboard
|
||||
*/
|
||||
/// Enable the keyboard following a suppressKeyboard call
|
||||
Q_INVOKABLE void unsuppressKeyboard();
|
||||
|
||||
/**jsdoc
|
||||
* Check whether the HMD-provided keyboard, if any, is visible.
|
||||
* Checks whether the HMD-provided keyboard, if any, is visible.
|
||||
* @function HMD.isKeyboardVisible
|
||||
* @returns {boolean} <code>true</code> if the current HMD provides a keyboard and it is visible, otherwise
|
||||
* <code>false</code>.
|
||||
|
@ -377,7 +377,19 @@ signals:
|
|||
|
||||
public:
|
||||
HMDScriptingInterface();
|
||||
|
||||
/**jsdoc
|
||||
* Gets the position on the HUD overlay that your HMD is looking at, in HUD coordinates.
|
||||
* @function HMD.getHUDLookAtPosition2D
|
||||
* @returns {Vec2} The position on the HUD overlay that your HMD is looking at, in pixels.
|
||||
*/
|
||||
static QScriptValue getHUDLookAtPosition2D(QScriptContext* context, QScriptEngine* engine);
|
||||
|
||||
/**jsdoc
|
||||
* Gets the position on the HUD overlay that your HMD is looking at, in world coordinates.
|
||||
* @function HMD.getHUDLookAtPosition3D
|
||||
* @returns {Vec3} The position on the HUD overlay the your HMD is looking at, in world coordinates.
|
||||
*/
|
||||
static QScriptValue getHUDLookAtPosition3D(QScriptContext* context, QScriptEngine* engine);
|
||||
|
||||
bool isMounted() const override;
|
||||
|
|
|
@ -18,18 +18,15 @@
|
|||
class MenuItemProperties;
|
||||
|
||||
/**jsdoc
|
||||
* The Menu API provides access to the menu that is displayed at the top of the window
|
||||
* on a user's desktop and in the tablet when the "MENU" button is pressed.
|
||||
*
|
||||
* <p />
|
||||
* The <code>Menu</code> API provides access to the menu that is displayed at the top of the window on a user's desktop and in
|
||||
* the tablet when the "MENU" button is pressed.
|
||||
*
|
||||
* <h3>Groupings</h3>
|
||||
*
|
||||
* A "grouping" provides a way to group a set of menus or menu items together so
|
||||
* that they can all be set visible or invisible as a group.
|
||||
* There are two available groups: <code>"Advanced"</code> and <code>"Developer"</code>.
|
||||
* These groupings can be toggled in the "Settings" menu.
|
||||
* If a menu item doesn't belong to a group it is always displayed.
|
||||
* <p>A "grouping" provides a way to group a set of menus or menu items together so that they can all be set visible or invisible
|
||||
* as a group.</p> There is currently only one available group: <code>"Developer"</code>. This grouping can be toggled in the
|
||||
* "Settings" menu.</p>
|
||||
* <p>If a menu item doesn't belong to a group, it is always displayed.</p>
|
||||
*
|
||||
* @namespace Menu
|
||||
*
|
||||
|
@ -60,22 +57,23 @@ private slots:
|
|||
|
||||
public slots:
|
||||
/**jsdoc
|
||||
* Add a new top-level menu.
|
||||
* Adds a new top-level menu.
|
||||
* @function Menu.addMenu
|
||||
* @param {string} menuName - Name that will be displayed for the menu. Nested menus can be described using the ">" symbol.
|
||||
* @param {string} menuName - Name that will be displayed for the menu. Nested menus can be specified using the
|
||||
* <code>">"</code> character.
|
||||
* @param {string} [grouping] - Name of the grouping, if any, to add this menu to.
|
||||
*
|
||||
* @example <caption>Add a menu and a nested submenu.</caption>
|
||||
* Menu.addMenu("Test Menu");
|
||||
* Menu.addMenu("Test Menu > Test Sub Menu");
|
||||
*
|
||||
* @example <caption>Add a menu to the Settings menu that is only visible if Settings > Advanced is enabled.</caption>
|
||||
* Menu.addMenu("Settings > Test Grouping Menu", "Advanced");
|
||||
* @example <caption>Add a menu to the Settings menu that is only visible if Settings > Developer is enabled.</caption>
|
||||
* Menu.addMenu("Settings > Test Grouping Menu", "Developer");
|
||||
*/
|
||||
void addMenu(const QString& menuName, const QString& grouping = QString());
|
||||
|
||||
/**jsdoc
|
||||
* Remove a top-level menu.
|
||||
* Removes a top-level menu.
|
||||
* @function Menu.removeMenu
|
||||
* @param {string} menuName - Name of the menu to remove.
|
||||
* @example <caption>Remove a menu and nested submenu.</caption>
|
||||
|
@ -85,9 +83,9 @@ public slots:
|
|||
void removeMenu(const QString& menuName);
|
||||
|
||||
/**jsdoc
|
||||
* Check whether a top-level menu exists.
|
||||
* Checks whether a top-level menu exists.
|
||||
* @function Menu.menuExists
|
||||
* @param {string} menuName - Name of the menu to check for existence.
|
||||
* @param {string} menuName - Name of the menu to check exists.
|
||||
* @returns {boolean} <code>true</code> if the menu exists, otherwise <code>false</code>.
|
||||
* @example <caption>Check if the "Developer" menu exists.</caption>
|
||||
* if (Menu.menuExists("Developer")) {
|
||||
|
@ -97,46 +95,45 @@ public slots:
|
|||
bool menuExists(const QString& menuName);
|
||||
|
||||
/**jsdoc
|
||||
* Add a separator with an unclickable label below it. The separator will be placed at the bottom of the menu.
|
||||
* If you want to add a separator at a specific point in the menu, use {@link Menu.addMenuItem} with
|
||||
* {@link Menu.MenuItemProperties} instead.
|
||||
* Adds a separator with an unclickable label below it. The separator will be placed at the bottom of the menu. To add a
|
||||
* separator at a specific point in the menu, use {@link Menu.addMenuItem} with {@link Menu.MenuItemProperties} instead.
|
||||
* @function Menu.addSeparator
|
||||
* @param {string} menuName - Name of the menu to add a separator to.
|
||||
* @param {string} menuName - Name of the menu to add the separator to.
|
||||
* @param {string} separatorName - Name of the separator that will be displayed as the label below the separator line.
|
||||
* @example <caption>Add a separator.</caption>
|
||||
* Menu.addSeparator("Developer","Test Separator");
|
||||
* Menu.addSeparator("Developer", "Test Separator");
|
||||
*/
|
||||
void addSeparator(const QString& menuName, const QString& separatorName);
|
||||
|
||||
/**jsdoc
|
||||
* Remove a separator from a menu.
|
||||
* Removes a separator from a menu.
|
||||
* @function Menu.removeSeparator
|
||||
* @param {string} menuName - Name of the menu to remove the separator from.
|
||||
* @param {string} separatorName - Name of the separator to remove.
|
||||
* @example <caption>Remove a separator.</caption>
|
||||
* Menu.removeSeparator("Developer","Test Separator");
|
||||
* Menu.removeSeparator("Developer", "Test Separator");
|
||||
*/
|
||||
void removeSeparator(const QString& menuName, const QString& separatorName);
|
||||
|
||||
/**jsdoc
|
||||
* Add a new menu item to a menu.
|
||||
* Adds a new menu item to a menu. The menu item is specified using {@link Menu.MenuItemProperties}.
|
||||
* @function Menu.addMenuItem
|
||||
* @param {Menu.MenuItemProperties} properties - Properties of the menu item to create.
|
||||
* @example <caption>Add a menu item using {@link Menu.MenuItemProperties}.</caption>
|
||||
* @example <caption>Add a menu item at a particular position in the "Developer" menu.</caption>
|
||||
* Menu.addMenuItem({
|
||||
* menuName: "Developer",
|
||||
* menuItemName: "Test",
|
||||
* afterItem: "Log",
|
||||
* shortcutKey: "Ctrl+Shift+T",
|
||||
* grouping: "Advanced"
|
||||
* shortcutKey: "Ctrl+Shift+T"
|
||||
* });
|
||||
*/
|
||||
void addMenuItem(const MenuItemProperties& properties);
|
||||
|
||||
/**jsdoc
|
||||
* Add a new menu item to a menu. The new item is added at the end of the menu.
|
||||
* Adds a new menu item to a menu. The new item is added at the end of the menu.
|
||||
* @function Menu.addMenuItem
|
||||
* @param {string} menuName - Name of the menu to add a menu item to.
|
||||
* @variation 0
|
||||
* @param {string} menuName - Name of the menu to add the menu item to.
|
||||
* @param {string} menuItem - Name of the menu item. This is what will be displayed in the menu.
|
||||
* @param {string} [shortcutKey] A shortcut key that can be used to trigger the menu item.
|
||||
* @example <caption>Add a menu item to the end of the "Developer" menu.</caption>
|
||||
|
@ -146,16 +143,17 @@ public slots:
|
|||
void addMenuItem(const QString& menuName, const QString& menuitem);
|
||||
|
||||
/**jsdoc
|
||||
* Remove a menu item from a menu.
|
||||
* Removes a menu item from a menu.
|
||||
* @function Menu.removeMenuItem
|
||||
* @param {string} menuName - Name of the menu to remove a menu item from.
|
||||
* @param {string} menuItem - Name of the menu item to remove.
|
||||
* @example <caption>Remove a menu item from the "Developer" menu.</caption>
|
||||
* Menu.removeMenuItem("Developer", "Test");
|
||||
*/
|
||||
void removeMenuItem(const QString& menuName, const QString& menuitem);
|
||||
|
||||
/**jsdoc
|
||||
* Check if a menu item exists.
|
||||
* Checks whether a menu item exists.
|
||||
* @function Menu.menuItemExists
|
||||
* @param {string} menuName - Name of the menu that the menu item is in.
|
||||
* @param {string} menuItem - Name of the menu item to check for existence of.
|
||||
|
@ -168,66 +166,66 @@ public slots:
|
|||
bool menuItemExists(const QString& menuName, const QString& menuitem);
|
||||
|
||||
/**jsdoc
|
||||
* Check whether a checkable menu item is checked.
|
||||
* Checks whether a checkable menu item is checked.
|
||||
* @function Menu.isOptionChecked
|
||||
* @param {string} menuOption - The name of the menu item.
|
||||
* @returns {boolean} <code>true</code> if the option is checked, otherwise <code>false</code>.
|
||||
* @example <caption>Report whether the Settings > Advanced menu item is turned on.</caption>
|
||||
* print(Menu.isOptionChecked("Advanced Menus")); // true or false
|
||||
* @example <caption>Report whether the Settings > Developer menu item is turned on.</caption>
|
||||
* print("Developer menu showing: " + Menu.isOptionChecked("Developer Menu"));
|
||||
*/
|
||||
bool isOptionChecked(const QString& menuOption);
|
||||
|
||||
/**jsdoc
|
||||
* Set a checkable menu item as checked or unchecked.
|
||||
* Sets a checkable menu item as checked or unchecked.
|
||||
* @function Menu.setIsOptionChecked
|
||||
* @param {string} menuOption - The name of the menu item to modify.
|
||||
* @param {boolean} isChecked - If <code>true</code>, the menu item will be checked, otherwise it will not be checked.
|
||||
* @example <caption>Turn on Settings > Advanced Menus.</caption>
|
||||
* Menu.setIsOptionChecked("Advanced Menus", true);
|
||||
* print(Menu.isOptionChecked("Advanced Menus")); // true
|
||||
* @example <caption>Turn on Settings > Developer Menu.</caption>
|
||||
* Menu.setIsOptionChecked("Developer Menu", true);
|
||||
* print("Developer menu showing: " + Menu.isOptionChecked("Developer Menu"));
|
||||
*/
|
||||
void setIsOptionChecked(const QString& menuOption, bool isChecked);
|
||||
|
||||
/**jsdoc
|
||||
* Trigger the menu item as if the user clicked on it.
|
||||
* Triggers a menu item as if the user clicked on it.
|
||||
* @function Menu.triggerOption
|
||||
* @param {string} menuOption - The name of the menu item to trigger.
|
||||
* @example <caption>Open the help window.</caption>
|
||||
* Menu.triggerOption('Help...');
|
||||
* @example <caption>Open the Asset Browser dialog.</caption>
|
||||
* Menu.triggerOption('Asset Browser');
|
||||
*/
|
||||
void triggerOption(const QString& menuOption);
|
||||
|
||||
/**jsdoc
|
||||
* Check whether a menu or menu item is enabled. If disabled, the item is grayed out and unusable.
|
||||
* Checks whether a menu or menu item is enabled. If disabled, the item is grayed out and unusable.
|
||||
* Menus are enabled by default.
|
||||
* @function Menu.isMenuEnabled
|
||||
* @param {string} menuName The name of the menu or menu item to check.
|
||||
* @returns {boolean} <code>true</code> if the menu is enabled, otherwise <code>false</code>.
|
||||
* @example <caption>Report with the Settings > Advanced Menus menu item is enabled.</caption>
|
||||
* print(Menu.isMenuEnabled("Settings > Advanced Menus")); // true or false
|
||||
* @example <caption>Report whether the Settings > Developer Menu item is enabled.</caption>
|
||||
* print("Developer Menu item enabled: " + Menu.isMenuEnabled("Settings > Developer Menu"));
|
||||
*/
|
||||
bool isMenuEnabled(const QString& menuName);
|
||||
|
||||
/**jsdoc
|
||||
* Set a menu or menu item to be enabled or disabled. If disabled, the item is grayed out and unusable.
|
||||
* Sets a menu or menu item to be enabled or disabled. If disabled, the item is grayed out and unusable.
|
||||
* @function Menu.setMenuEnabled
|
||||
* @param {string} menuName - The name of the menu or menu item to modify.
|
||||
* @param {boolean} isEnabled - If <code>true</code>, the menu will be enabled, otherwise it will be disabled.
|
||||
* @example <caption>Disable the Settings > Advanced Menus menu item.</caption>
|
||||
* Menu.setMenuEnabled("Settings > Advanced Menus", false);
|
||||
* print(Menu.isMenuEnabled("Settings > Advanced Menus")); // false
|
||||
* @example <caption>Disable the Settings > Developer Menu item.</caption>
|
||||
* Menu.setMenuEnabled("Settings > Developer Menu", false);
|
||||
* print("Developer Menu item enabled: " + Menu.isMenuEnabled("Settings > Developer Menu"));
|
||||
*/
|
||||
void setMenuEnabled(const QString& menuName, bool isEnabled);
|
||||
|
||||
signals:
|
||||
/**jsdoc
|
||||
* Triggered when a menu item is clicked (or triggered by {@link Menu.triggerOption}).
|
||||
* Triggered when a menu item is clicked or triggered by {@link Menu.triggerOption}.
|
||||
* @function Menu.menuItemEvent
|
||||
* @param {string} menuItem - Name of the menu item that was clicked.
|
||||
* @param {string} menuItem - Name of the menu item that was clicked or triggered.
|
||||
* @returns {Signal}
|
||||
* @example <caption>Detect menu item events.</caption>
|
||||
* function onMenuItemEvent(menuItem) {
|
||||
* print("You clicked on " + menuItem);
|
||||
* print("Menu item clicked: " + menuItem);
|
||||
* }
|
||||
*
|
||||
* Menu.menuItemEvent.connect(onMenuItemEvent);
|
||||
|
|
|
@ -1428,7 +1428,7 @@ int Avatar::getJointIndex(const QString& name) const {
|
|||
|
||||
withValidJointIndicesCache([&]() {
|
||||
if (_modelJointIndicesCache.contains(name)) {
|
||||
result = _modelJointIndicesCache[name] - 1;
|
||||
result = _modelJointIndicesCache.value(name) - 1;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
|
@ -1439,9 +1439,7 @@ QStringList Avatar::getJointNames() const {
|
|||
withValidJointIndicesCache([&]() {
|
||||
// find out how large the vector needs to be
|
||||
int maxJointIndex = -1;
|
||||
QHashIterator<QString, int> k(_modelJointIndicesCache);
|
||||
while (k.hasNext()) {
|
||||
k.next();
|
||||
for (auto k = _modelJointIndicesCache.constBegin(); k != _modelJointIndicesCache.constEnd(); k++) {
|
||||
int index = k.value();
|
||||
if (index > maxJointIndex) {
|
||||
maxJointIndex = index;
|
||||
|
@ -1450,9 +1448,7 @@ QStringList Avatar::getJointNames() const {
|
|||
// iterate through the hash and put joint names
|
||||
// into the vector at their indices
|
||||
QVector<QString> resultVector(maxJointIndex+1);
|
||||
QHashIterator<QString, int> i(_modelJointIndicesCache);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
for (auto i = _modelJointIndicesCache.constBegin(); i != _modelJointIndicesCache.constEnd(); i++) {
|
||||
int index = i.value();
|
||||
resultVector[index] = i.key();
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ void SkeletonModel::simulate(float deltaTime, bool fullUpdate) {
|
|||
Parent::simulate(deltaTime, fullUpdate);
|
||||
}
|
||||
|
||||
// FIXME: This texture loading logic should probably live in Avatar, to mirror RenderableModelEntityItem and ModelOverlay,
|
||||
// FIXME: This texture loading logic should probably live in Avatar, to mirror RenderableModelEntityItem,
|
||||
// but Avatars don't get updates in the same way
|
||||
if (!_texturesLoaded && getGeometry() && getGeometry()->areTexturesLoaded()) {
|
||||
_texturesLoaded = true;
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <gpu/gl/GLBackend.h>
|
||||
#include <GeometryCache.h>
|
||||
|
||||
#include <CursorManager.h>
|
||||
#include <FramebufferCache.h>
|
||||
#include <shared/NsightHelpers.h>
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
|
@ -182,6 +183,9 @@ public:
|
|||
continue;
|
||||
}
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
_context->makeCurrent();
|
||||
#endif
|
||||
// Execute the frame and present it to the display device.
|
||||
{
|
||||
PROFILE_RANGE(render, "PluginPresent")
|
||||
|
@ -190,6 +194,10 @@ public:
|
|||
gl::globalRelease(false);
|
||||
CHECK_GL_ERROR();
|
||||
}
|
||||
#if defined(Q_OS_MAC)
|
||||
_context->doneCurrent();
|
||||
#endif
|
||||
|
||||
_refreshRateController->sleepThreadIfNeeded(this, currentPlugin->isHmd());
|
||||
}
|
||||
|
||||
|
@ -674,11 +682,14 @@ void OpenGLDisplayPlugin::compositeLayers() {
|
|||
compositeExtra();
|
||||
}
|
||||
|
||||
// Draw the pointer last so it's on top of everything
|
||||
auto compositorHelper = DependencyManager::get<CompositorHelper>();
|
||||
if (compositorHelper->getReticleVisible()) {
|
||||
PROFILE_RANGE_EX(render_detail, "compositePointer", 0xff0077ff, (uint64_t)presentCount())
|
||||
auto& cursorManager = Cursor::Manager::instance();
|
||||
if (isHmd() || cursorManager.getCursor()->getIcon() == Cursor::RETICLE) {
|
||||
auto compositorHelper = DependencyManager::get<CompositorHelper>();
|
||||
// Draw the pointer last so it's on top of everything
|
||||
if (compositorHelper->getReticleVisible()) {
|
||||
PROFILE_RANGE_EX(render_detail, "compositePointer", 0xff0077ff, (uint64_t)presentCount())
|
||||
compositePointer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -237,9 +237,11 @@ void CauterizedModel::updateRenderItems() {
|
|||
if (useDualQuaternionSkinning) {
|
||||
data.updateClusterBuffer(meshState.clusterDualQuaternions,
|
||||
cauterizedMeshState.clusterDualQuaternions);
|
||||
data.computeAdjustedLocalBound(meshState.clusterDualQuaternions);
|
||||
} else {
|
||||
data.updateClusterBuffer(meshState.clusterMatrices,
|
||||
cauterizedMeshState.clusterMatrices);
|
||||
data.computeAdjustedLocalBound(meshState.clusterMatrices);
|
||||
}
|
||||
|
||||
Transform renderTransform = modelTransform;
|
||||
|
|
|
@ -450,9 +450,9 @@ void ModelMeshPartPayload::render(RenderArgs* args) {
|
|||
void ModelMeshPartPayload::computeAdjustedLocalBound(const std::vector<glm::mat4>& clusterMatrices) {
|
||||
_adjustedLocalBound = _localBound;
|
||||
if (clusterMatrices.size() > 0) {
|
||||
_adjustedLocalBound.transform(clusterMatrices[0]);
|
||||
_adjustedLocalBound.transform(clusterMatrices.back());
|
||||
|
||||
for (int i = 1; i < (int)clusterMatrices.size(); ++i) {
|
||||
for (int i = 0; i < (int)clusterMatrices.size() - 1; ++i) {
|
||||
AABox clusterBound = _localBound;
|
||||
clusterBound.transform(clusterMatrices[i]);
|
||||
_adjustedLocalBound += clusterBound;
|
||||
|
@ -463,12 +463,12 @@ void ModelMeshPartPayload::computeAdjustedLocalBound(const std::vector<glm::mat4
|
|||
void ModelMeshPartPayload::computeAdjustedLocalBound(const std::vector<Model::TransformDualQuaternion>& clusterDualQuaternions) {
|
||||
_adjustedLocalBound = _localBound;
|
||||
if (clusterDualQuaternions.size() > 0) {
|
||||
Transform rootTransform(clusterDualQuaternions[0].getRotation(),
|
||||
clusterDualQuaternions[0].getScale(),
|
||||
clusterDualQuaternions[0].getTranslation());
|
||||
Transform rootTransform(clusterDualQuaternions.back().getRotation(),
|
||||
clusterDualQuaternions.back().getScale(),
|
||||
clusterDualQuaternions.back().getTranslation());
|
||||
_adjustedLocalBound.transform(rootTransform);
|
||||
|
||||
for (int i = 1; i < (int)clusterDualQuaternions.size(); ++i) {
|
||||
for (int i = 0; i < (int)clusterDualQuaternions.size() - 1; ++i) {
|
||||
AABox clusterBound = _localBound;
|
||||
Transform transform(clusterDualQuaternions[i].getRotation(),
|
||||
clusterDualQuaternions[i].getScale(),
|
||||
|
|
|
@ -241,8 +241,10 @@ void Model::updateRenderItems() {
|
|||
invalidatePayloadShapeKey, primitiveMode, renderItemKeyGlobalFlags, cauterized](ModelMeshPartPayload& data) {
|
||||
if (useDualQuaternionSkinning) {
|
||||
data.updateClusterBuffer(meshState.clusterDualQuaternions);
|
||||
data.computeAdjustedLocalBound(meshState.clusterDualQuaternions);
|
||||
} else {
|
||||
data.updateClusterBuffer(meshState.clusterMatrices);
|
||||
data.computeAdjustedLocalBound(meshState.clusterMatrices);
|
||||
}
|
||||
|
||||
Transform renderTransform = modelTransform;
|
||||
|
@ -1367,8 +1369,6 @@ void Model::simulate(float deltaTime, bool fullUpdate) {
|
|||
// update the world space transforms for all joints
|
||||
glm::mat4 parentTransform = glm::scale(_scale) * glm::translate(_offset);
|
||||
updateRig(deltaTime, parentTransform);
|
||||
|
||||
computeMeshPartLocalBounds();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1379,17 +1379,6 @@ void Model::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
|||
_rig.updateAnimations(deltaTime, parentTransform, rigToWorldTransform);
|
||||
}
|
||||
|
||||
void Model::computeMeshPartLocalBounds() {
|
||||
for (auto& part : _modelMeshRenderItems) {
|
||||
const Model::MeshState& state = _meshStates.at(part->_meshIndex);
|
||||
if (_useDualQuaternionSkinning) {
|
||||
part->computeAdjustedLocalBound(state.clusterDualQuaternions);
|
||||
} else {
|
||||
part->computeAdjustedLocalBound(state.clusterMatrices);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// virtual
|
||||
void Model::updateClusterMatrices() {
|
||||
DETAILED_PERFORMANCE_TIMER("Model::updateClusterMatrices");
|
||||
|
|
|
@ -427,7 +427,6 @@ protected:
|
|||
void setScaleInternal(const glm::vec3& scale);
|
||||
void snapToRegistrationPoint();
|
||||
|
||||
void computeMeshPartLocalBounds();
|
||||
virtual void updateRig(float deltaTime, glm::mat4 parentTransform);
|
||||
|
||||
/// Allow sub classes to force invalidating the bboxes
|
||||
|
|
|
@ -53,22 +53,22 @@ QScriptValue menuItemPropertiesToScriptValue(QScriptEngine* engine, const MenuIt
|
|||
/**jsdoc
|
||||
* A set of properties that can be passed to {@link Menu.addMenuItem} to create a new menu item.
|
||||
*
|
||||
* If none of <code>position</code>, <code>beforeItem</code>, <code>afterItem</code>, or <code>grouping</code> are specified,
|
||||
* the menu item will be placed at the end of the menu.
|
||||
* If none of the properties, <code>position</code>, <code>beforeItem</code>, <code>afterItem</code>, or <code>grouping</code>
|
||||
* are specified, the menu item will be placed at the end of the menu.
|
||||
*
|
||||
* @typedef {object} Menu.MenuItemProperties
|
||||
* @property {string} menuName Name of the menu. Nested menus can be described using the ">" symbol.
|
||||
* @property {string} menuItemName Name of the menu item.
|
||||
* @property {boolean} [isCheckable=false] Whether or not the menu item is checkable.
|
||||
* @property {boolean} [isChecked=false] Whether or not the menu item is checked.
|
||||
* @property {boolean} [isSeparator=false] Whether or not the menu item is a separator.
|
||||
* @property {string} [shortcutKey] A shortcut key that triggers the menu item.
|
||||
* @property {KeyEvent} [shortcutKeyEvent] A {@link KeyEvent} that specifies a key that triggers the menu item.
|
||||
* @property {number} [position] The position to place the new menu item. An integer number with <code>0</code> being the first
|
||||
* @property {string} menuName - Name of the menu. Nested menus can be described using the ">" character.
|
||||
* @property {string} menuItemName - Name of the menu item.
|
||||
* @property {boolean} [isCheckable=false] - Whether or not the menu item is checkable.
|
||||
* @property {boolean} [isChecked=false] - Whether or not the menu item is checked.
|
||||
* @property {boolean} [isSeparator=false] - Whether or not the menu item is a separator.
|
||||
* @property {string} [shortcutKey] - A shortcut key that triggers the menu item.
|
||||
* @property {KeyEvent} [shortcutKeyEvent] - A {@link KeyEvent} that specifies a key that triggers the menu item.
|
||||
* @property {number} [position] - The position to place the new menu item. An integer number with <code>0</code> being the first
|
||||
* menu item.
|
||||
* @property {string} [beforeItem] The name of the menu item to place this menu item before.
|
||||
* @property {string} [afterItem] The name of the menu item to place this menu item after.
|
||||
* @property {string} [grouping] The name of grouping to add this menu item to.
|
||||
* @property {string} [beforeItem] - The name of the menu item to place this menu item before.
|
||||
* @property {string} [afterItem] - The name of the menu item to place this menu item after.
|
||||
* @property {string} [grouping] - The name of grouping to add this menu item to.
|
||||
*/
|
||||
void menuItemPropertiesFromScriptValue(const QScriptValue& object, MenuItemProperties& properties) {
|
||||
properties.menuName = object.property("menuName").toVariant().toString();
|
||||
|
|
|
@ -55,8 +55,16 @@ QWindow* MainWindow::findMainWindow() {
|
|||
void MainWindow::restoreGeometry() {
|
||||
// Did not use setGeometry() on purpose,
|
||||
// see http://doc.qt.io/qt-5/qsettings.html#restoring-the-state-of-a-gui-application
|
||||
QRect geometry = _windowGeometry.get(qApp->desktop()->availableGeometry());
|
||||
QRect windowGeometry = qApp->desktop()->availableGeometry();
|
||||
#if defined(Q_OS_MAC)
|
||||
windowGeometry.setSize((windowGeometry.size() * 0.5f));
|
||||
#endif
|
||||
QRect geometry = _windowGeometry.get(windowGeometry);
|
||||
#if defined(Q_OS_MAC)
|
||||
move(geometry.center());
|
||||
#else
|
||||
move(geometry.topLeft());
|
||||
#endif
|
||||
resize(geometry.size());
|
||||
|
||||
// Restore to maximized or full screen after restoring to windowed so that going windowed goes to good position and sizes.
|
||||
|
|
|
@ -203,7 +203,7 @@ function setAwayProperties() {
|
|||
if (!wasMuted) {
|
||||
Audio.muted = !Audio.muted;
|
||||
}
|
||||
MyAvatar.setEnableMeshVisible(false); // just for our own display, without changing point of view
|
||||
MyAvatar.setEnableMeshVisible(false); // just for our own display, without changing point of view
|
||||
playAwayAnimation(); // animation is still seen by others
|
||||
showOverlay();
|
||||
|
||||
|
@ -223,8 +223,8 @@ function setAwayProperties() {
|
|||
|
||||
function setActiveProperties() {
|
||||
isAway = false;
|
||||
if (!wasMuted) {
|
||||
Audio.muted = !Audio.muted;
|
||||
if (Audio.muted && !wasMuted) {
|
||||
Audio.muted = false;
|
||||
}
|
||||
MyAvatar.setEnableMeshVisible(true); // IWBNI we respected Developer->Avatar->Draw Mesh setting.
|
||||
stopAwayAnimation();
|
||||
|
@ -254,7 +254,7 @@ function setActiveProperties() {
|
|||
}
|
||||
|
||||
function maybeGoActive(event) {
|
||||
if (event.isAutoRepeat) { // isAutoRepeat is true when held down (or when Windows feels like it)
|
||||
if (event.isAutoRepeat) { // isAutoRepeat is true when held down (or when Windows feels like it)
|
||||
return;
|
||||
}
|
||||
if (!isAway && (event.text === 'ESC')) {
|
||||
|
@ -314,6 +314,13 @@ function setEnabled(value) {
|
|||
isEnabled = value;
|
||||
}
|
||||
|
||||
function checkAudioToggled() {
|
||||
if (isAway && !Audio.muted) {
|
||||
goActive();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var CHANNEL_AWAY_ENABLE = "Hifi-Away-Enable";
|
||||
var handleMessage = function(channel, message, sender) {
|
||||
if (channel === CHANNEL_AWAY_ENABLE && sender === MyAvatar.sessionUUID) {
|
||||
|
@ -324,9 +331,10 @@ var handleMessage = function(channel, message, sender) {
|
|||
Messages.subscribe(CHANNEL_AWAY_ENABLE);
|
||||
Messages.messageReceived.connect(handleMessage);
|
||||
|
||||
var maybeIntervalTimer = Script.setInterval(function(){
|
||||
var maybeIntervalTimer = Script.setInterval(function() {
|
||||
maybeMoveOverlay();
|
||||
maybeGoAway();
|
||||
checkAudioToggled();
|
||||
}, BASIC_TIMER_INTERVAL);
|
||||
|
||||
|
||||
|
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 51 KiB |
36
tools/ci-scripts/hifi_backtrace_post.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
# Parameters:
|
||||
# 1 - $BACKTRACE_UPLOAD_TOKEN
|
||||
# 2 - $SYMBOLS_ARCHIVE
|
||||
# 3 - $RELEASE_NUMBER
|
||||
#
|
||||
import sys
|
||||
import urllib.request
|
||||
import urllib.parse
|
||||
|
||||
print("Running python script to upload to BackTrace")
|
||||
|
||||
post_headers = {}
|
||||
post_headers['Content-Type'] = 'application/json'
|
||||
post_headers['Expect'] = ''
|
||||
|
||||
post_url = 'https://highfidelity.sp.backtrace.io:6098/post?format=symbols&token=' + sys.argv[1] + '&upload_file=' + sys.argv[2] + '&tag=' + sys.argv[3]
|
||||
|
||||
try:
|
||||
post_data = open(sys.argv[2], 'rb')
|
||||
except:
|
||||
print('file ' + sys.argv[2] + ' not found')
|
||||
exit(1)
|
||||
|
||||
try:
|
||||
post_request = urllib.request.Request(post_url, post_data, post_headers)
|
||||
except:
|
||||
print('urllib.request.Request failed')
|
||||
exit(1)
|
||||
|
||||
try:
|
||||
post_response = urllib.request.urlopen(post_request)
|
||||
except:
|
||||
print('urllib.request.urlopen failed')
|
||||
exit(1)
|
||||
|
||||
print("Upload to BackTrace completed without errors")
|