mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:17:40 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into workload
This commit is contained in:
commit
1cd662acdb
12 changed files with 78 additions and 45 deletions
8
BUILD.md
8
BUILD.md
|
@ -1,7 +1,7 @@
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
|
||||||
- [cmake](https://cmake.org/download/): 3.9
|
- [cmake](https://cmake.org/download/): 3.9
|
||||||
- [Qt](https://www.qt.io/download-open-source): 5.9.1
|
- [Qt](https://www.qt.io/download-open-source): 5.10.1
|
||||||
- [OpenSSL](https://www.openssl.org/): Use the latest available 1.0 version (**NOT** 1.1) of OpenSSL to avoid security vulnerabilities.
|
- [OpenSSL](https://www.openssl.org/): Use the latest available 1.0 version (**NOT** 1.1) of OpenSSL to avoid security vulnerabilities.
|
||||||
- [VHACD](https://github.com/virneo/v-hacd)(clone this repository)(Optional)
|
- [VHACD](https://github.com/virneo/v-hacd)(clone this repository)(Optional)
|
||||||
|
|
||||||
|
@ -46,8 +46,8 @@ This can either be entered directly into your shell session before you build or
|
||||||
|
|
||||||
The path it needs to be set to will depend on where and how Qt5 was installed. e.g.
|
The path it needs to be set to will depend on where and how Qt5 was installed. e.g.
|
||||||
|
|
||||||
export QT_CMAKE_PREFIX_PATH=/usr/local/qt/5.6.2/clang_64/lib/cmake/
|
export QT_CMAKE_PREFIX_PATH=/usr/local/qt/5.10.1/clang_64/lib/cmake/
|
||||||
export QT_CMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.6.2/lib/cmake
|
export QT_CMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.10.1/lib/cmake
|
||||||
export QT_CMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake
|
export QT_CMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake
|
||||||
|
|
||||||
#### Generating build files
|
#### Generating build files
|
||||||
|
@ -66,7 +66,7 @@ Any variables that need to be set for CMake to find dependencies can be set as E
|
||||||
|
|
||||||
For example, to pass the QT_CMAKE_PREFIX_PATH variable during build file generation:
|
For example, to pass the QT_CMAKE_PREFIX_PATH variable during build file generation:
|
||||||
|
|
||||||
cmake .. -DQT_CMAKE_PREFIX_PATH=/usr/local/qt/5.6.2/lib/cmake
|
cmake .. -DQT_CMAKE_PREFIX_PATH=/usr/local/qt/5.10.1/lib/cmake
|
||||||
|
|
||||||
#### Finding Dependencies
|
#### Finding Dependencies
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@ Should you choose not to install Qt5 via a package manager that handles dependen
|
||||||
|
|
||||||
Install qt:
|
Install qt:
|
||||||
```bash
|
```bash
|
||||||
wget http://debian.highfidelity.com/pool/h/hi/hifi-qt5.6.1_5.6.1_amd64.deb
|
wget http://debian.highfidelity.com/pool/h/hi/hifi-qt5.10.1_5.10.1_amd64.deb
|
||||||
sudo dpkg -i hifi-qt5.6.1_5.6.1_amd64.deb
|
sudo dpkg -i hifi-qt5.10.1_5.10.1_amd64.deb
|
||||||
```
|
```
|
||||||
|
|
||||||
Install build dependencies:
|
Install build dependencies:
|
||||||
|
@ -66,7 +66,7 @@ cd hifi/build
|
||||||
|
|
||||||
Prepare makefiles:
|
Prepare makefiles:
|
||||||
```bash
|
```bash
|
||||||
cmake -DQT_CMAKE_PREFIX_PATH=/usr/local/Qt5.6.1/5.6/gcc_64/lib/cmake ..
|
cmake -DQT_CMAKE_PREFIX_PATH=/usr/local/Qt5.10.1/5.10/gcc_64/lib/cmake ..
|
||||||
```
|
```
|
||||||
|
|
||||||
Start compilation and get a cup of coffee:
|
Start compilation and get a cup of coffee:
|
||||||
|
@ -74,7 +74,7 @@ Start compilation and get a cup of coffee:
|
||||||
make domain-server assignment-client interface
|
make domain-server assignment-client interface
|
||||||
```
|
```
|
||||||
|
|
||||||
In a server does not make sense to compile interface
|
In a server does not make sense to compile interface
|
||||||
|
|
||||||
### Running the software
|
### Running the software
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ Note that this uses the version from the homebrew formula at the time of this wr
|
||||||
Assuming you've installed Qt using the homebrew instructions above, you'll need to set QT_CMAKE_PREFIX_PATH so CMake can find your installations.
|
Assuming you've installed Qt using the homebrew instructions above, you'll need to set QT_CMAKE_PREFIX_PATH so CMake can find your installations.
|
||||||
For Qt installed via homebrew, set QT_CMAKE_PREFIX_PATH:
|
For Qt installed via homebrew, set QT_CMAKE_PREFIX_PATH:
|
||||||
|
|
||||||
export QT_CMAKE_PREFIX_PATH=/usr/local/Cellar/qt/5.9.1/lib/cmake
|
export QT_CMAKE_PREFIX_PATH=/usr/local/Cellar/qt/5.10.1/lib/cmake
|
||||||
|
|
||||||
Note that this uses the version from the homebrew formula at the time of this writing, and the version in the path will likely change.
|
Note that this uses the version from the homebrew formula at the time of this writing, and the version in the path will likely change.
|
||||||
|
|
||||||
|
|
20
BUILD_WIN.md
20
BUILD_WIN.md
|
@ -1,13 +1,13 @@
|
||||||
This is a stand-alone guide for creating your first High Fidelity build for Windows 64-bit.
|
This is a stand-alone guide for creating your first High Fidelity build for Windows 64-bit.
|
||||||
|
|
||||||
## Building High Fidelity
|
## Building High Fidelity
|
||||||
Note: We are now using Visual Studio 2017 and Qt 5.9.1. If you are upgrading from Visual Studio 2013 and Qt 5.6.2, do a clean uninstall of those versions before going through this guide.
|
Note: We are now using Visual Studio 2017 and Qt 5.10.1. If you are upgrading from Visual Studio 2013 and Qt 5.6.2, do a clean uninstall of those versions before going through this guide.
|
||||||
|
|
||||||
Note: The prerequisites will require about 10 GB of space on your drive. You will also need a system with at least 8GB of main memory.
|
Note: The prerequisites will require about 10 GB of space on your drive. You will also need a system with at least 8GB of main memory.
|
||||||
|
|
||||||
### Step 1. Visual Studio 2017
|
### Step 1. Visual Studio 2017
|
||||||
|
|
||||||
If you don’t have Community or Professional edition of Visual Studio 2017, download [Visual Studio Community 2017](https://www.visualstudio.com/downloads/).
|
If you don’t have Community or Professional edition of Visual Studio 2017, download [Visual Studio Community 2017](https://www.visualstudio.com/downloads/).
|
||||||
|
|
||||||
When selecting components, check "Desktop development with C++." Also check "Windows 8.1 SDK and UCRT SDK" and "VC++ 2015.3 v140 toolset (x86,x64)" on the Summary toolbar on the right.
|
When selecting components, check "Desktop development with C++." Also check "Windows 8.1 SDK and UCRT SDK" and "VC++ 2015.3 v140 toolset (x86,x64)" on the Summary toolbar on the right.
|
||||||
|
|
||||||
|
@ -17,15 +17,15 @@ Download and install the latest version of CMake 3.9. Download the file named w
|
||||||
|
|
||||||
### Step 3. Installing Qt
|
### Step 3. Installing Qt
|
||||||
|
|
||||||
Download and install the [Qt Online Installer](https://www.qt.io/download-open-source/?hsCtaTracking=f977210e-de67-475f-a32b-65cec207fd03%7Cd62710cd-e1db-46aa-8d4d-2f1c1ffdacea). While installing, you only need to have the following components checked under Qt 5.9.1: "msvc2017 64-bit", "Qt WebEngine", and "Qt Script (Deprecated)".
|
Download and install the [Qt Online Installer](https://www.qt.io/download-open-source/?hsCtaTracking=f977210e-de67-475f-a32b-65cec207fd03%7Cd62710cd-e1db-46aa-8d4d-2f1c1ffdacea). While installing, you only need to have the following components checked under Qt 5.10.1: "msvc2017 64-bit", "Qt WebEngine", and "Qt Script (Deprecated)".
|
||||||
|
|
||||||
Note: Installing the Sources is optional but recommended if you have room for them (~2GB).
|
Note: Installing the Sources is optional but recommended if you have room for them (~2GB).
|
||||||
|
|
||||||
### Step 4. Setting Qt Environment Variable
|
### Step 4. Setting Qt Environment Variable
|
||||||
|
|
||||||
Go to `Control Panel > System > Advanced System Settings > Environment Variables > New...` (or search “Environment Variables” in Start Search).
|
Go to `Control Panel > System > Advanced System Settings > Environment Variables > New...` (or search “Environment Variables” in Start Search).
|
||||||
* Set "Variable name": `QT_CMAKE_PREFIX_PATH`
|
* Set "Variable name": `QT_CMAKE_PREFIX_PATH`
|
||||||
* Set "Variable value": `C:\Qt\5.9.1\msvc2017_64\lib\cmake`
|
* Set "Variable value": `C:\Qt\5.10.1\msvc2017_64\lib\cmake`
|
||||||
|
|
||||||
### Step 5. Installing [vcpkg](https://github.com/Microsoft/vcpkg)
|
### Step 5. Installing [vcpkg](https://github.com/Microsoft/vcpkg)
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ Go to `Control Panel > System > Advanced System Settings > Environment Variables
|
||||||
|
|
||||||
* In the vcpkg directory, install the 64 bit OpenSSL package with the command `vcpkg install openssl:x64-windows`
|
* In the vcpkg directory, install the 64 bit OpenSSL package with the command `vcpkg install openssl:x64-windows`
|
||||||
* Once the build completes you should have a file `ssl.h` in `${VCPKG_ROOT}/installed/x64-windows/include/openssl`
|
* Once the build completes you should have a file `ssl.h` in `${VCPKG_ROOT}/installed/x64-windows/include/openssl`
|
||||||
|
|
||||||
### Step 7. Running CMake to Generate Build Files
|
### Step 7. Running CMake to Generate Build Files
|
||||||
|
|
||||||
Run Command Prompt from Start and run the following commands:
|
Run Command Prompt from Start and run the following commands:
|
||||||
|
@ -49,7 +49,7 @@ mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake .. -G "Visual Studio 15 Win64"
|
cmake .. -G "Visual Studio 15 Win64"
|
||||||
```
|
```
|
||||||
|
|
||||||
Where `%HIFI_DIR%` is the directory for the highfidelity repository.
|
Where `%HIFI_DIR%` is the directory for the highfidelity repository.
|
||||||
|
|
||||||
### Step 8. Making a Build
|
### Step 8. Making a Build
|
||||||
|
@ -74,10 +74,10 @@ Note: You can also run Interface by launching it from command line or File Explo
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
For any problems after Step #7, first try this:
|
For any problems after Step #7, first try this:
|
||||||
* Delete your locally cloned copy of the highfidelity repository
|
* Delete your locally cloned copy of the highfidelity repository
|
||||||
* Restart your computer
|
* Restart your computer
|
||||||
* Redownload the [repository](https://github.com/highfidelity/hifi)
|
* Redownload the [repository](https://github.com/highfidelity/hifi)
|
||||||
* Restart directions from Step #7
|
* Restart directions from Step #7
|
||||||
|
|
||||||
#### CMake gives you the same error message repeatedly after the build fails
|
#### CMake gives you the same error message repeatedly after the build fails
|
||||||
|
@ -90,4 +90,4 @@ Remove `CMakeCache.txt` found in the `%HIFI_DIR%\build` directory. Verify that
|
||||||
|
|
||||||
#### Qt is throwing an error
|
#### Qt is throwing an error
|
||||||
|
|
||||||
Make sure you have the correct version (5.9.1) installed and `QT_CMAKE_PREFIX_PATH` environment variable is set correctly.
|
Make sure you have the correct version (5.10.1) installed and `QT_CMAKE_PREFIX_PATH` environment variable is set correctly.
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#
|
#
|
||||||
# Created by Bradley Austin Davis on 2017/09/02
|
# Created by Bradley Austin Davis on 2017/09/02
|
||||||
# Copyright 2013-2017 High Fidelity, Inc.
|
# Copyright 2013-2017 High Fidelity, Inc.
|
||||||
#
|
#
|
||||||
# Distributed under the Apache License, Version 2.0.
|
# Distributed under the Apache License, Version 2.0.
|
||||||
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
#
|
#
|
||||||
|
|
||||||
# Construct a default QT location from a root path, a version and an architecture
|
# Construct a default QT location from a root path, a version and an architecture
|
||||||
function(calculate_default_qt_dir _RESULT_NAME)
|
function(calculate_default_qt_dir _RESULT_NAME)
|
||||||
|
@ -27,7 +27,7 @@ function(calculate_default_qt_dir _RESULT_NAME)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_from_env(QT_ROOT QT_ROOT ${QT_DEFAULT_ROOT})
|
set_from_env(QT_ROOT QT_ROOT ${QT_DEFAULT_ROOT})
|
||||||
set_from_env(QT_VERSION QT_VERSION "5.9.1")
|
set_from_env(QT_VERSION QT_VERSION "5.10.1")
|
||||||
set_from_env(QT_ARCH QT_ARCH ${QT_DEFAULT_ARCH})
|
set_from_env(QT_ARCH QT_ARCH ${QT_DEFAULT_ARCH})
|
||||||
|
|
||||||
set(${_RESULT_NAME} "${QT_ROOT}/${QT_VERSION}/${QT_ARCH}" PARENT_SCOPE)
|
set(${_RESULT_NAME} "${QT_ROOT}/${QT_VERSION}/${QT_ARCH}" PARENT_SCOPE)
|
||||||
|
@ -60,11 +60,11 @@ macro(setup_qt)
|
||||||
#if (NOT EXISTS "${QT_DIR}/include/QtCore/QtGlobal")
|
#if (NOT EXISTS "${QT_DIR}/include/QtCore/QtGlobal")
|
||||||
# message(FATAL_ERROR "Unable to locate Qt includes in ${QT_DIR}")
|
# message(FATAL_ERROR "Unable to locate Qt includes in ${QT_DIR}")
|
||||||
#endif()
|
#endif()
|
||||||
|
|
||||||
if (NOT EXISTS "${QT_CMAKE_PREFIX_PATH}/Qt5Core/Qt5CoreConfig.cmake")
|
if (NOT EXISTS "${QT_CMAKE_PREFIX_PATH}/Qt5Core/Qt5CoreConfig.cmake")
|
||||||
message(FATAL_ERROR "Unable to locate Qt cmake config in ${QT_CMAKE_PREFIX_PATH}")
|
message(FATAL_ERROR "Unable to locate Qt cmake config in ${QT_CMAKE_PREFIX_PATH}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "The Qt build in use is: \"${QT_DIR}\"")
|
message(STATUS "The Qt build in use is: \"${QT_DIR}\"")
|
||||||
|
|
||||||
# Instruct CMake to run moc automatically when needed.
|
# Instruct CMake to run moc automatically when needed.
|
||||||
|
@ -72,7 +72,7 @@ macro(setup_qt)
|
||||||
|
|
||||||
# Instruct CMake to run rcc automatically when needed
|
# Instruct CMake to run rcc automatically when needed
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
add_paths_to_fixup_libs("${QT_DIR}/bin")
|
add_paths_to_fixup_libs("${QT_DIR}/bin")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
@ -324,6 +324,18 @@ FocusScope {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hideDesktopWindows() {
|
||||||
|
for (var index = 0; index < desktop.visibleChildren.length; index++) {
|
||||||
|
var child = desktop.visibleChildren[index];
|
||||||
|
if (child.topLevelWindow && child.hasOwnProperty("modality")) {
|
||||||
|
var TOOLBAR_NAME = "com.highfidelity.interface.toolbar.system"
|
||||||
|
if (child.objectName !== TOOLBAR_NAME) {
|
||||||
|
child.setShown(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setPinned(newPinned) {
|
function setPinned(newPinned) {
|
||||||
pinned = newPinned
|
pinned = newPinned
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,8 +225,8 @@
|
||||||
#ifdef DEBUG_EVENT_QUEUE
|
#ifdef DEBUG_EVENT_QUEUE
|
||||||
// This is a HACK that uses private headers included with the qt source distrubution.
|
// This is a HACK that uses private headers included with the qt source distrubution.
|
||||||
// To use this feature you need to add these directores to your include path:
|
// To use this feature you need to add these directores to your include path:
|
||||||
// E:/Qt/5.9.1/Src/qtbase/include/QtCore/5.9.1/QtCore
|
// E:/Qt/5.10.1/Src/qtbase/include/QtCore/5.10.1/QtCore
|
||||||
// E:/Qt/5.9.1/Src/qtbase/include/QtCore/5.9.1
|
// E:/Qt/5.10.1/Src/qtbase/include/QtCore/5.10.1
|
||||||
#define QT_BOOTSTRAPPED
|
#define QT_BOOTSTRAPPED
|
||||||
#include <private/qthread_p.h>
|
#include <private/qthread_p.h>
|
||||||
#include <private/qobject_p.h>
|
#include <private/qobject_p.h>
|
||||||
|
@ -2038,7 +2038,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
});
|
});
|
||||||
|
|
||||||
_snapshotSound = DependencyManager::get<SoundCache>()->getSound(PathUtils::resourcesUrl("sounds/snap.wav"));
|
_snapshotSound = DependencyManager::get<SoundCache>()->getSound(PathUtils::resourcesUrl("sounds/snap.wav"));
|
||||||
|
|
||||||
QVariant testProperty = property(hifi::properties::TEST);
|
QVariant testProperty = property(hifi::properties::TEST);
|
||||||
qDebug() << testProperty;
|
qDebug() << testProperty;
|
||||||
if (testProperty.isValid()) {
|
if (testProperty.isValid()) {
|
||||||
|
@ -6590,7 +6590,7 @@ void Application::addAssetToWorldFromURL(QString url) {
|
||||||
} else {
|
} else {
|
||||||
filename.remove(".zip");
|
filename.remove(".zip");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets()) {
|
if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets()) {
|
||||||
|
@ -6764,7 +6764,7 @@ void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, Q
|
||||||
addAssetToWorldError(filenameFromPath(filePath), errorInfo);
|
addAssetToWorldError(filenameFromPath(filePath), errorInfo);
|
||||||
} else {
|
} else {
|
||||||
// to prevent files that aren't models or texture files from being loaded into world automatically
|
// to prevent files that aren't models or texture files from being loaded into world automatically
|
||||||
if ((filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION)) ||
|
if ((filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION)) ||
|
||||||
((filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) &&
|
((filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) &&
|
||||||
((!isBlocks) && (!isZip)))) {
|
((!isBlocks) && (!isZip)))) {
|
||||||
addAssetToWorldAddEntity(filePath, mapping);
|
addAssetToWorldAddEntity(filePath, mapping);
|
||||||
|
@ -7413,8 +7413,8 @@ bool Application::isThrottleRendering() const {
|
||||||
bool Application::hasFocus() const {
|
bool Application::hasFocus() const {
|
||||||
bool result = (QApplication::activeWindow() != nullptr);
|
bool result = (QApplication::activeWindow() != nullptr);
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
// On Windows, QWidget::activateWindow() - as called in setFocus() - makes the application's taskbar icon flash but doesn't
|
// On Windows, QWidget::activateWindow() - as called in setFocus() - makes the application's taskbar icon flash but doesn't
|
||||||
// take user focus away from their current window. So also check whether the application is the user's current foreground
|
// take user focus away from their current window. So also check whether the application is the user's current foreground
|
||||||
// window.
|
// window.
|
||||||
result = result && (HWND)QApplication::activeWindow()->winId() == GetForegroundWindow();
|
result = result && (HWND)QApplication::activeWindow()->winId() == GetForegroundWindow();
|
||||||
#endif
|
#endif
|
||||||
|
@ -7422,7 +7422,7 @@ bool Application::hasFocus() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::setFocus() {
|
void Application::setFocus() {
|
||||||
// Note: Windows doesn't allow a user focus to be taken away from another application. Instead, it changes the color of and
|
// Note: Windows doesn't allow a user focus to be taken away from another application. Instead, it changes the color of and
|
||||||
// flashes the taskbar icon.
|
// flashes the taskbar icon.
|
||||||
auto window = qApp->getWindow();
|
auto window = qApp->getWindow();
|
||||||
window->activateWindow();
|
window->activateWindow();
|
||||||
|
@ -7663,7 +7663,7 @@ void Application::updateDisplayMode() {
|
||||||
menu->setIsOptionChecked(MenuOption::FirstPerson, true);
|
menu->setIsOptionChecked(MenuOption::FirstPerson, true);
|
||||||
cameraMenuChanged();
|
cameraMenuChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the mirror camera option from menu if in HMD mode
|
// Remove the mirror camera option from menu if in HMD mode
|
||||||
auto mirrorAction = menu->getActionForOption(MenuOption::FullscreenMirror);
|
auto mirrorAction = menu->getActionForOption(MenuOption::FullscreenMirror);
|
||||||
mirrorAction->setVisible(!isHmd);
|
mirrorAction->setVisible(!isHmd);
|
||||||
|
|
|
@ -2058,24 +2058,34 @@ static const QString JSON_AVATAR_ENTITIES = QStringLiteral("attachedEntities");
|
||||||
static const QString JSON_AVATAR_SCALE = QStringLiteral("scale");
|
static const QString JSON_AVATAR_SCALE = QStringLiteral("scale");
|
||||||
static const QString JSON_AVATAR_VERSION = QStringLiteral("version");
|
static const QString JSON_AVATAR_VERSION = QStringLiteral("version");
|
||||||
|
|
||||||
static const int JSON_AVATAR_JOINT_ROTATIONS_IN_RELATIVE_FRAME_VERSION = 0;
|
enum class JsonAvatarFrameVersion : int {
|
||||||
static const int JSON_AVATAR_JOINT_ROTATIONS_IN_ABSOLUTE_FRAME_VERSION = 1;
|
JointRotationsInRelativeFrame = 0,
|
||||||
|
JointRotationsInAbsoluteFrame,
|
||||||
|
JointDefaultPoseBits
|
||||||
|
};
|
||||||
|
|
||||||
QJsonValue toJsonValue(const JointData& joint) {
|
QJsonValue toJsonValue(const JointData& joint) {
|
||||||
QJsonArray result;
|
QJsonArray result;
|
||||||
result.push_back(toJsonValue(joint.rotation));
|
result.push_back(toJsonValue(joint.rotation));
|
||||||
result.push_back(toJsonValue(joint.translation));
|
result.push_back(toJsonValue(joint.translation));
|
||||||
|
result.push_back(QJsonValue(joint.rotationIsDefaultPose));
|
||||||
|
result.push_back(QJsonValue(joint.translationIsDefaultPose));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
JointData jointDataFromJsonValue(const QJsonValue& json) {
|
JointData jointDataFromJsonValue(int version, const QJsonValue& json) {
|
||||||
JointData result;
|
JointData result;
|
||||||
if (json.isArray()) {
|
if (json.isArray()) {
|
||||||
QJsonArray array = json.toArray();
|
QJsonArray array = json.toArray();
|
||||||
result.rotation = quatFromJsonValue(array[0]);
|
result.rotation = quatFromJsonValue(array[0]);
|
||||||
result.rotationIsDefaultPose = false;
|
|
||||||
result.translation = vec3FromJsonValue(array[1]);
|
result.translation = vec3FromJsonValue(array[1]);
|
||||||
result.translationIsDefaultPose = false;
|
if (version >= (int)JsonAvatarFrameVersion::JointDefaultPoseBits) {
|
||||||
|
result.rotationIsDefaultPose = array[2].toBool();
|
||||||
|
result.translationIsDefaultPose = array[3].toBool();
|
||||||
|
} else {
|
||||||
|
result.rotationIsDefaultPose = false;
|
||||||
|
result.translationIsDefaultPose = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -2083,7 +2093,7 @@ JointData jointDataFromJsonValue(const QJsonValue& json) {
|
||||||
QJsonObject AvatarData::toJson() const {
|
QJsonObject AvatarData::toJson() const {
|
||||||
QJsonObject root;
|
QJsonObject root;
|
||||||
|
|
||||||
root[JSON_AVATAR_VERSION] = JSON_AVATAR_JOINT_ROTATIONS_IN_ABSOLUTE_FRAME_VERSION;
|
root[JSON_AVATAR_VERSION] = (int)JsonAvatarFrameVersion::JointDefaultPoseBits;
|
||||||
|
|
||||||
if (!getSkeletonModelURL().isEmpty()) {
|
if (!getSkeletonModelURL().isEmpty()) {
|
||||||
root[JSON_AVATAR_BODY_MODEL] = getSkeletonModelURL().toString();
|
root[JSON_AVATAR_BODY_MODEL] = getSkeletonModelURL().toString();
|
||||||
|
@ -2158,7 +2168,7 @@ void AvatarData::fromJson(const QJsonObject& json, bool useFrameSkeleton) {
|
||||||
version = json[JSON_AVATAR_VERSION].toInt();
|
version = json[JSON_AVATAR_VERSION].toInt();
|
||||||
} else {
|
} else {
|
||||||
// initial data did not have a version field.
|
// initial data did not have a version field.
|
||||||
version = JSON_AVATAR_JOINT_ROTATIONS_IN_RELATIVE_FRAME_VERSION;
|
version = (int)JsonAvatarFrameVersion::JointRotationsInRelativeFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (json.contains(JSON_AVATAR_BODY_MODEL)) {
|
if (json.contains(JSON_AVATAR_BODY_MODEL)) {
|
||||||
|
@ -2235,7 +2245,7 @@ void AvatarData::fromJson(const QJsonObject& json, bool useFrameSkeleton) {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (json.contains(JSON_AVATAR_JOINT_ARRAY)) {
|
if (json.contains(JSON_AVATAR_JOINT_ARRAY)) {
|
||||||
if (version == JSON_AVATAR_JOINT_ROTATIONS_IN_RELATIVE_FRAME_VERSION) {
|
if (version == (int)JsonAvatarFrameVersion::JointRotationsInRelativeFrame) {
|
||||||
// because we don't have the full joint hierarchy skeleton of the model,
|
// because we don't have the full joint hierarchy skeleton of the model,
|
||||||
// we can't properly convert from relative rotations into absolute rotations.
|
// we can't properly convert from relative rotations into absolute rotations.
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
|
@ -2247,7 +2257,7 @@ void AvatarData::fromJson(const QJsonObject& json, bool useFrameSkeleton) {
|
||||||
QJsonArray jointArrayJson = json[JSON_AVATAR_JOINT_ARRAY].toArray();
|
QJsonArray jointArrayJson = json[JSON_AVATAR_JOINT_ARRAY].toArray();
|
||||||
jointArray.reserve(jointArrayJson.size());
|
jointArray.reserve(jointArrayJson.size());
|
||||||
for (const auto& jointJson : jointArrayJson) {
|
for (const auto& jointJson : jointArrayJson) {
|
||||||
auto joint = jointDataFromJsonValue(jointJson);
|
auto joint = jointDataFromJsonValue(version, jointJson);
|
||||||
jointArray.push_back(joint);
|
jointArray.push_back(joint);
|
||||||
}
|
}
|
||||||
setRawJointData(jointArray);
|
setRawJointData(jointArray);
|
||||||
|
@ -2558,4 +2568,4 @@ void AvatarEntityMapFromScriptValue(const QScriptValue& object, AvatarEntityMap&
|
||||||
|
|
||||||
value[EntityID] = binaryEntityProperties;
|
value[EntityID] = binaryEntityProperties;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,6 +154,13 @@ void OffscreenUi::show(const QUrl& url, const QString& name, std::function<void(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OffscreenUi::hideDesktopWindows() {
|
||||||
|
if (QThread::currentThread() != thread()) {
|
||||||
|
BLOCKING_INVOKE_METHOD(this, "hideDesktopWindows");
|
||||||
|
}
|
||||||
|
QMetaObject::invokeMethod(_desktop, "hideDesktopWindows");
|
||||||
|
}
|
||||||
|
|
||||||
void OffscreenUi::toggle(const QUrl& url, const QString& name, std::function<void(QQmlContext*, QObject*)> f) {
|
void OffscreenUi::toggle(const QUrl& url, const QString& name, std::function<void(QQmlContext*, QObject*)> f) {
|
||||||
QQuickItem* item = getRootItem()->findChild<QQuickItem*>(name);
|
QQuickItem* item = getRootItem()->findChild<QQuickItem*>(name);
|
||||||
if (!item) {
|
if (!item) {
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
void createDesktop(const QUrl& url);
|
void createDesktop(const QUrl& url);
|
||||||
void show(const QUrl& url, const QString& name, std::function<void(QQmlContext*, QObject*)> f = [](QQmlContext*, QObject*) {});
|
void show(const QUrl& url, const QString& name, std::function<void(QQmlContext*, QObject*)> f = [](QQmlContext*, QObject*) {});
|
||||||
void hide(const QString& name);
|
void hide(const QString& name);
|
||||||
|
void hideDesktopWindows();
|
||||||
bool isVisible(const QString& name);
|
bool isVisible(const QString& name);
|
||||||
void toggle(const QUrl& url, const QString& name, std::function<void(QQmlContext*, QObject*)> f = [](QQmlContext*, QObject*) {});
|
void toggle(const QUrl& url, const QString& name, std::function<void(QQmlContext*, QObject*)> f = [](QQmlContext*, QObject*) {});
|
||||||
bool shouldSwallowShortcut(QEvent* event);
|
bool shouldSwallowShortcut(QEvent* event);
|
||||||
|
|
|
@ -387,6 +387,8 @@ void TabletProxy::setToolbarMode(bool toolbarMode) {
|
||||||
offscreenUi->hide("RunningScripts");
|
offscreenUi->hide("RunningScripts");
|
||||||
_showRunningScripts = true;
|
_showRunningScripts = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
offscreenUi->hideDesktopWindows();
|
||||||
// destroy desktop window
|
// destroy desktop window
|
||||||
if (_desktopWindow) {
|
if (_desktopWindow) {
|
||||||
_desktopWindow->deleteLater();
|
_desktopWindow->deleteLater();
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
//
|
//
|
||||||
// Grab's physically moveable entities with the mouse, by applying a spring force.
|
// Grab's physically moveable entities with the mouse, by applying a spring force.
|
||||||
//
|
//
|
||||||
// Updated November 22, 2016 by Philip Rosedale: Add distance attenuation of grab effect
|
// Updated November 22, 2016 by Philip Rosedale: Add distance attenuation of grab effect
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -444,6 +444,7 @@ Grabber.prototype.releaseEvent = function(event) {
|
||||||
this.actionID = null;
|
this.actionID = null;
|
||||||
|
|
||||||
Pointers.setRenderState(this.mouseRayEntities, "");
|
Pointers.setRenderState(this.mouseRayEntities, "");
|
||||||
|
Pointers.setLockEndUUID(this.mouseRayEntities, null, false);
|
||||||
|
|
||||||
var args = "mouse";
|
var args = "mouse";
|
||||||
Entities.callEntityMethod(this.entityID, "releaseGrab", args);
|
Entities.callEntityMethod(this.entityID, "releaseGrab", args);
|
||||||
|
|
Loading…
Reference in a new issue