Merge branch 'vircadia:master' into master

This commit is contained in:
Alezia Kurdis 2021-05-11 21:39:50 -04:00
commit 24b0f85d2a
146 changed files with 5865 additions and 2817 deletions

View file

@ -35,7 +35,7 @@ jobs:
include:
- os: ubuntu-18.04
build_type: full
apt-dependencies: mesa-common-dev libegl1 libglvnd-dev libdouble-conversion1 libpulse0
apt-dependencies: mesa-common-dev libegl1 libglvnd-dev libdouble-conversion1 libpulse0 libsnappy1v5 libwebpdemux2 libwebpmux3
fail-fast: false
runs-on: ${{matrix.os}}
steps:
@ -50,6 +50,7 @@ jobs:
echo "UPLOAD_PREFIX=master" >> $GITHUB_ENV
echo ::set-output name=github_sha_short::`echo $GIT_COMMIT | cut -c1-7`
echo "JOB_NAME=build (${{matrix.os}}, ${{matrix.build_type}})" >> $GITHUB_ENV
echo "APP_TARGET_NAME=$APP_NAME" >> $GITHUB_ENV
# Linux build variables
if [[ "${{ matrix.os }}" = "ubuntu-"* ]]; then
echo "PYTHON_EXEC=python3" >> $GITHUB_ENV
@ -65,6 +66,7 @@ jobs:
echo "INSTALLER_EXT=dmg" >> $GITHUB_ENV
echo "CMAKE_EXTRA=-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -G Xcode" >> $GITHUB_ENV
echo "::set-output name=symbols_archive::${BUILD_NUMBER}-${{ matrix.build_type }}-mac-symbols.zip"
echo "APP_TARGET_NAME=Vircadia" >> $GITHUB_ENV
fi
# Windows build variables
if [ "${{ matrix.os }}" = "windows-latest" ]; then
@ -126,7 +128,7 @@ jobs:
- name: Build application
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target $APP_NAME $CMAKE_BUILD_EXTRA
run: cmake --build . --config $BUILD_TYPE --target $APP_TARGET_NAME $CMAKE_BUILD_EXTRA
- name: Build domain server
working-directory: ${{runner.workspace}}/build
shell: bash

View file

@ -36,9 +36,11 @@ jobs:
build_type: full
- os: macOS-latest
build_type: full
- os: macOS-latest
build_type: client
- os: ubuntu-18.04
build_type: full
apt-dependencies: mesa-common-dev libegl1 libglvnd-dev libdouble-conversion1 libpulse0
apt-dependencies: mesa-common-dev libegl1 libglvnd-dev libdouble-conversion1 libpulse0 libsnappy1v5 libwebpdemux2 libwebpmux3
- os: ubuntu-18.04
build_type: android
apt-dependencies: mesa-common-dev libegl1 libglvnd-dev libdouble-conversion1 libpulse0
@ -52,25 +54,39 @@ jobs:
run: |
echo ::set-output name=github_sha_short::`echo $GIT_COMMIT | cut -c1-7`
echo "JOB_NAME=build (${{matrix.os}}, ${{matrix.build_type}})" >> $GITHUB_ENV
echo "APP_TARGET_NAME=$APP_NAME" >> $GITHUB_ENV
# Linux build variables
if [[ "${{ matrix.os }}" = "ubuntu-"* ]]; then
echo "PYTHON_EXEC=python3" >> $GITHUB_ENV
echo "INSTALLER_EXT=*" >> $GITHUB_ENV
echo "CMAKE_BUILD_EXTRA=-- -j3" >> $GITHUB_ENV
echo "CMAKE_EXTRA=-DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV
if [ "${{ matrix.build_type }}" = "full" ]; then
echo "CMAKE_EXTRA=-DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV
else
echo "CMAKE_EXTRA=-DCLIENT_ONLY=1 -DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV
fi
fi
# Mac build variables
if [ "${{ matrix.os }}" = "macOS-latest" ]; then
echo "PYTHON_EXEC=python3" >> $GITHUB_ENV
echo "INSTALLER_EXT=dmg" >> $GITHUB_ENV
echo "CMAKE_EXTRA=-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -G Xcode" >> $GITHUB_ENV
if [ "${{ matrix.build_type }}" = "full" ]; then
echo "CMAKE_EXTRA=-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -G Xcode" >> $GITHUB_ENV
else
echo "CMAKE_EXTRA=-DCLIENT_ONLY=1 -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -G Xcode" >> $GITHUB_ENV
fi
echo "APP_TARGET_NAME=Vircadia" >> $GITHUB_ENV
fi
# Windows build variables
if [ "${{ matrix.os }}" = "windows-latest" ]; then
echo "PYTHON_EXEC=python" >> $GITHUB_ENV
echo "INSTALLER_EXT=exe" >> $GITHUB_ENV
echo "CMAKE_EXTRA=-A x64" >> $GITHUB_ENV
if [ "${{ matrix.build_type }}" = "full" ]; then
echo "CMAKE_EXTRA=-A x64" >> $GITHUB_ENV
else
echo "CMAKE_EXTRA=-A x64 -DCLIENT_ONLY=1" >> $GITHUB_ENV
fi
fi
# Android + Quest build variables
if [[ "${{ matrix.build_type }}" == "android" ]]; then
@ -86,9 +102,13 @@ jobs:
echo "${{ steps.buildenv1.outputs.symbols_archive }}"
echo "GIT_COMMIT_SHORT=${{ steps.buildenv1.outputs.github_sha_short }}" >> $GITHUB_ENV
if [[ "${{ matrix.build_type }}" != "android" ]]; then
echo "ARTIFACT_PATTERN=Vircadia-PR${{ github.event.number }}-*.$INSTALLER_EXT" >> $GITHUB_ENV
# Build type variables
echo "INSTALLER=Vircadia-$RELEASE_NUMBER-$GIT_COMMIT_SHORT.$INSTALLER_EXT" >> $GITHUB_ENV
if [ "${{ matrix.build_type }}" = "full" ]; then
echo "ARTIFACT_PATTERN=Vircadia-PR${{ github.event.number }}-*.$INSTALLER_EXT" >> $GITHUB_ENV
echo "INSTALLER=Vircadia-$RELEASE_NUMBER-$GIT_COMMIT_SHORT.$INSTALLER_EXT" >> $GITHUB_ENV
else
echo "ARTIFACT_PATTERN=Vircadia-Interface-PR${{ github.event.number }}-*.$INSTALLER_EXT" >> $GITHUB_ENV
echo "INSTALLER=Vircadia-Interface-$RELEASE_NUMBER-$GIT_COMMIT_SHORT.$INSTALLER_EXT" >> $GITHUB_ENV
fi
else
echo "ARTIFACT_PATTERN=*.$INSTALLER_EXT" >> $GITHUB_ENV
fi
@ -124,7 +144,7 @@ jobs:
if: matrix.build_type == 'full' || matrix.build_type == 'client'
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target $APP_NAME $CMAKE_BUILD_EXTRA
run: cmake --build . --config $BUILD_TYPE --target $APP_TARGET_NAME $CMAKE_BUILD_EXTRA
- name: Build Domain Server
if: matrix.build_type == 'full'
working-directory: ${{runner.workspace}}/build
@ -136,7 +156,7 @@ jobs:
shell: bash
run: cmake --build . --config $BUILD_TYPE --target assignment-client $CMAKE_BUILD_EXTRA
- name: Build Console
if: matrix.build_type == 'full'
if: matrix.build_type == 'full' || matrix.os == 'windows-latest'
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target packaged-server-console $CMAKE_BUILD_EXTRA

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "vircadia-web"]
path = vircadia-web
url = ../vircadia-web.git

102
BUILD.md
View file

@ -1,76 +1,100 @@
# General Build Information
*Last Updated on December 21, 2020*
*Last Updated on March 8, 2021*
### OS Specific Build Guides
## OS Specific Build Guides
* [Build Windows](BUILD_WIN.md) - complete instructions for Windows.
* [Build Linux](BUILD_LINUX.md) - additional instructions for Linux.
* [Build OSX](BUILD_OSX.md) - additional instructions for OS X.
* [Build Android](BUILD_ANDROID.md) - additional instructions for Android.
### Dependencies
- [git](https://git-scm.com/downloads): >= 1.6
- [CMake](https://cmake.org/download/): 3.9
## Dependencies
- [git](https://git-scm.com/downloads): >= 1.6
- [CMake](https://cmake.org/download/): 3.9 (or greater up to 3.18.x)
- [Python](https://www.python.org/downloads/): 3.6 or higher
- [Node.JS](https://nodejs.org/en/): >= 12.13.1 LTS
- Used to build the Screen Sharing executable.
### CMake External Project Dependencies
## CMake External Project Dependencies
These dependencies need not be installed manually. They are automatically downloaded on the platforms where they are required.
- [Bullet Physics Engine](https://github.com/bulletphysics/bullet3/releases): 2.83
- [glm](https://glm.g-truc.net/0.9.8/index.html): 0.9.8
- [Oculus SDK](https://developer.oculus.com/downloads/): 1.11 (Windows) / 0.5 (Mac)
- [OpenVR](https://github.com/ValveSoftware/openvr): 1.11.11 (Windows, Linux)
- [Polyvox](http://www.volumesoffun.com/): 0.2.1
- [QuaZip](https://sourceforge.net/projects/quazip/files/quazip/): 0.7.3
- [SDL2](https://www.libsdl.org/download-2.0.php): 2.0.3
- [Intel Threading Building Blocks](https://www.threadingbuildingblocks.org/): 4.3
- [vcpkg](https://github.com/hifi-archive/vcpkg):
- [VHACD](https://github.com/virneo/v-hacd)
- [zlib](http://www.zlib.net/): 1.28 (Win32 only)
- [nvtt](https://github.com/hifi-archive/nvidia-texture-tools): 2.1.1 (customized)
- [Bullet Physics Engine](https://github.com/bulletphysics/bullet3/releases): 2.83
- [glm](https://glm.g-truc.net/0.9.8/index.html): 0.9.8
- [Oculus SDK](https://developer.oculus.com/downloads/): 1.11 (Windows) / 0.5 (Mac)
- [OpenVR](https://github.com/ValveSoftware/openvr): 1.11.11 (Windows, Linux)
- [Polyvox](http://www.volumesoffun.com/): 0.2.1
- [QuaZip](https://sourceforge.net/projects/quazip/files/quazip/): 0.7.3
- [SDL2](https://www.libsdl.org/download-2.0.php): 2.0.3
- [Intel Threading Building Blocks](https://www.threadingbuildingblocks.org/): 4.3
- [vcpkg](https://github.com/hifi-archive/vcpkg):
- [VHACD](https://github.com/virneo/v-hacd)
- [zlib](http://www.zlib.net/): 1.28 (Win32 only)
- [nvtt](https://github.com/hifi-archive/nvidia-texture-tools): 2.1.1 (customized)
The above dependencies will be downloaded, built, linked and included automatically by CMake where we require them. The CMakeLists files that handle grabbing each of the following external dependencies can be found in the [cmake/externals folder](cmake/externals). The resulting downloads, source files and binaries will be placed in the `build/ext` folder in each of the subfolders for each external project.
These are not placed in your normal build tree when doing an out of source build so that they do not need to be re-downloaded and re-compiled every time the CMake build folder is cleared. Should you want to force a re-download and re-compile of a specific external, you can simply remove that directory from the appropriate subfolder in `build/ext`. Should you want to force a re-download and re-compile of all externals, just remove the `build/ext` folder.
#### CMake
### CMake
Vircadia uses CMake to generate build files and project files for your platform.
#### Qt
### Qt
CMake will download Qt 5.12.3 using vcpkg.
CMake will download Qt 5.15.2 using vcpkg.
To override this (i.e. use an installed Qt configuration - you will need to set a QT_CMAKE_PREFIX_PATH environment variable pointing to your Qt **lib/cmake** folder.
This can either be entered directly into your shell session before you build or in your shell profile (e.g.: ~/.bash_profile, ~/.bashrc, ~/.zshrc - this depends on your shell and environment). The path it needs to be set to will depend on where and how Qt5 was installed. e.g.
To override this - i.e., use an installed Qt configuration - you need to set a QT_CMAKE_PREFIX_PATH environment variable pointing to your Qt **lib/cmake** folder.
This can either be entered directly into your shell session before you build or in your shell profile (e.g.: ~/.bash_profile, ~/.bashrc, ~/.zshrc - this depends on your shell and environment). The path it needs to be set to will depend on where and how Qt5 was installed.
For example, under Linux:
```bash
export QT_CMAKE_PREFIX_PATH=/usr/local/Qt5.12.3/gcc_64/lib/cmake
export QT_CMAKE_PREFIX_PATH=/usr/local/qt/5.12.3/clang_64/lib/cmake/
export QT_CMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.12.3/lib/cmake
export QT_CMAKE_PREFIX_PATH=/usr/local/Qt5.15.2/gcc_64/lib/cmake
export QT_CMAKE_PREFIX_PATH=/usr/local/qt/5.15.2/clang_64/lib/cmake/
export QT_CMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.15.2/lib/cmake
export QT_CMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake
```
#### VCPKG
For example, under Windows:
set QT_CMAKE_PREFIX_PATH=C:\Qt\5.15.2\msvc2019_64\lib\cmake
For example, under OSX:
export QT_CMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.15.2/lib/cmake
Note: You only need the following components checked under Qt 5.15.2 (select the "Custom Installation" option):
"MSVC 2019 64-bit", "Qt WebEngine", and "Qt Script (Deprecated)".
Note: Installing the sources is optional but recommended if you have room for them (~3GB). You may also want the Qt debug
information files (~7GB).
Note: Installing Qt Creator is optional but recommended if you will be editing QML files.
### VCPKG
Vircadia uses vcpkg to download and build dependencies.
You do not need to install vcpkg.
Building the dependencies can be lengthy and the resulting files will be stored in your OS temp directory.
However, those files can potentially get cleaned up by the OS, so in order to avoid this and having to redo the lengthy build step, you can set the following environment variable:
However, those files can potentially get cleaned up by the OS, so in order to avoid this and having to redo the lengthy build step, you can set an environment variable.
Linux:
```bash
export HIFI_VCPKG_BASE=/path/to/directory
```
Windows:
```bash
set HIFI_VCPKG_BASE=/path/to/directory
```
Where `/path/to/directory` is the path to a directory where you wish the build files to get stored.
#### Generating Build Files
### Generating Build Files
##### Possible Environment Variables
#### Possible Environment Variables
```text
// The URL to post the dump to.
@ -109,7 +133,7 @@ USE_STABLE_GLOBAL_SERVICES=1
BUILD_GLOBAL_SERVICES=STABLE
```
##### Generate Files
#### Generate Files
Create a build directory in the root of your checkout and then run the CMake build from there. This will keep the rest of the directory clean.
@ -121,7 +145,7 @@ cmake ..
If CMake gives you the same error message repeatedly after the build fails, try removing `CMakeCache.txt`.
##### Generating a release/debug only vcpkg build
#### Generating a release/debug only vcpkg build
In order to generate a release or debug only vcpkg package, you could use the use the `VCPKG_BUILD_TYPE` define in your CMake generate command. Building a release only vcpkg can drastically decrease the total build time.
@ -133,7 +157,7 @@ For debug only vcpkg:
`cmake .. -DVCPKG_BUILD_TYPE=debug`
#### Variables
### Variables
Any variables that need to be set for CMake to find dependencies can be set as ENV variables in your shell profile, or passed directly to CMake with a `-D` flag appended to the `cmake ..` command.
@ -143,7 +167,7 @@ For example, to pass the QT_CMAKE_PREFIX_PATH variable (if not using the vcpkg'e
cmake .. -DQT_CMAKE_PREFIX_PATH=/usr/local/qt/5.12.3/lib/cmake
```
#### Finding Dependencies
### Finding Dependencies
The following applies for dependencies we do not grab via CMake ExternalProject (OpenSSL is an example), or for dependencies you have opted not to grab as a CMake ExternalProject (via -DUSE_LOCAL_$NAME=0). The list of dependencies we grab by default as external projects can be found in [the CMake External Project Dependencies section](#cmake-external-project-dependencies).
@ -155,9 +179,9 @@ In the examples below the variable $NAME would be replaced by the name of the de
* $NAME_ROOT_DIR - set this variable in your ENV
* HIFI_LIB_DIR - set this variable in your ENV to your Vircadia lib folder, should contain a folder '$name'
### Optional Components
## Optional Components
#### Build Options
### Build Options
The following build options can be used when running CMake
@ -168,12 +192,12 @@ The following build options can be used when running CMake
* CLIENT_ONLY // Will package only the Interface
* SERVER_ONLY // Will package only the Server
#### Developer Build Options
### Developer Build Options
* USE_GLES
* DISABLE_UI
#### Devices
### Devices
You can support external input/output devices such as Leap Motion, MIDI, and more by adding each individual SDK in the visible building path. Refer to the readme file available in each device folder in [interface/external/](interface/external) for the detailed explanation of the requirements to use the device.

View file

@ -1,10 +1,10 @@
# Build OSX
*Last Updated on August 26, 2020*
*Last Updated on January 16, 2021*
Please read the [general build guide](BUILD.md) for information on dependencies required for all platforms. Only macOS specific instructions are found in this document.
### Homebrew
## Homebrew
[Homebrew](https://brew.sh/) is an excellent package manager for macOS. It makes install of some Vircadia dependencies very simple.
@ -12,12 +12,14 @@ Please read the [general build guide](BUILD.md) for information on dependencies
brew install cmake openssl npm
```
### Python 3
Note: cmake versions > 3.18.x have known problems building Vircadia, so alternatively you can download cmake 3.18.4 (or earlier versions) from [Github](https://github.com/Kitware/CMake/releases).
## Python 3
Download an install Python 3.6.6 or higher from [here](https://www.python.org/downloads/).
Execute the `Update Shell Profile.command` script that is provided with the installer.
### OSX SDK
## OSX SDK
You will need version `10.12` of the OSX SDK for building, otherwise you may have crashing or other unintended issues due to the deprecation of OpenGL on OSX. You can get that SDK from [here](https://github.com/phracker/MacOSX-SDKs). You must copy it in to your Xcode SDK directory, e.g.
@ -25,14 +27,14 @@ You will need version `10.12` of the OSX SDK for building, otherwise you may hav
cp -rp ~/Downloads/MacOSX10.12.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
```
### OpenSSL
## OpenSSL
Assuming you've installed OpenSSL using the homebrew instructions above, you'll need to set OPENSSL_ROOT_DIR so CMake can find your installations.
For OpenSSL installed via homebrew, set OPENSSL_ROOT_DIR via
`export OPENSSL_ROOT_DIR=/usr/local/opt/openssl`
or by appending `-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl` to `cmake`
### Xcode
## Xcode
You can ask CMake to generate Xcode project files instead of Unix Makefiles using the `-G Xcode` parameter after CMake. You will need to select the Xcode installation in the terminal first if you have not done so already.
@ -48,14 +50,14 @@ After running CMake, you will have the make files or Xcode project file necessar
If the build completes successfully, you will have built targets for all components located in the `build/${target_name}/Debug` directories.
### make
## make
If you build with make rather than Xcode, you can append `-j4` for assigning more threads. The number indicates the number of threads, e.g. 4.
To package the installation, you can simply run `make package` afterwards.
### FAQ
## FAQ
1. **Problem:** Running the scheme `interface.app` from Xcode causes a crash for Interface related to `libgl`
1. **Cause:** The target `gl` generates a binary called `libgl`. A macOS `libGL.framework` item gets loaded instead by Xcode.
1. **Cause:** The target `gl` generates a binary called `libgl`. A macOS `libGL.framework` item gets loaded instead by Xcode.
1. **Solution:** In the Xcode target settings for `libgl`, set the version to 1.0.0

View file

@ -1,40 +1,35 @@
# Build Windows
*Last Updated on May 17, 2020*
*Last Updated on 15 Apr 2021*
This is a stand-alone guide for creating your first Vircadia build for Windows 64-bit.
This is a stand-alone guide for creating your first Vircadia build for Windows 64-bit.
Note: We are now using Visual Studio 2017 or 2019 and Qt 5.12.3.
If you are upgrading from previous versions, do a clean uninstall of those versions before going through this guide.
Note: We are now using Visual Studio 2019 and Qt 5.15.2.
If you are upgrading from previous versions, 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.**
### Step 1. Visual Studio & Python 3.x
## Step 1. Visual Studio & Python 3.x
If you dont have Community or Professional edition of Visual Studio, download [Visual Studio Community 2019](https://visualstudio.microsoft.com/vs/). If you have Visual Studio 2017, you are not required to download Visual Studio 2019.
If you don't have Community or Professional edition of Visual Studio 2019, download [Visual Studio Community 2019](https://visualstudio.microsoft.com/vs/). If you have Visual Studio 2017, you need to download Visual Studio 2019.
When selecting components, check "Desktop development with C++".
When selecting components, check "Desktop development with C++".
If you do not already have a Python 3.x development environment installed and want to install it with Visual Studio, check "Python Development". If you already have Visual Studio installed and need to add Python, open the "Add or remove programs" control panel and find the "Microsoft Visual Studio Installer". Select it and click "Modify". In the installer, select "Modify" again, then check "Python Development" and allow the installer to apply the changes.
On the right on the Summary toolbar, select the following components based on your Visual Studio version.
### Visual Studio 2019
#### If you're installing Visual Studio 2017
* Windows 8.1 SDK and UCRT SDK
* VC++ 2015.3 v14.00 (v140) toolset for desktop
#### If you're installing Visual Studio 2019
On the right on the Summary toolbar, select the following components.
* MSVC v142 - VS 2019 C++ X64/x86 build tools
* MSVC v141 - VS 2017 C++ x64/x86 build tools
* MSVC v140 - VS 2015 C++ build tools (v14.00)
### Step 1a. Alternate Python
## Step 1a. Alternate Python
If you do not wish to use the Python installation bundled with Visual Studio, you can download the installer from [here](https://www.python.org/downloads/). Ensure that you get version 3.6.6 or higher.
### Step 2. Python Dependencies
## Step 2. Python Dependencies
In an administrator command-line that can access Python's pip you will need to run the following command:
@ -42,52 +37,68 @@ In an administrator command-line that can access Python's pip you will need to r
If you do not use an administrator command-line, you will get errors.
### Step 3. Installing CMake
## Step 3. Installing CMake
Download and install the latest version of CMake 3.15.
Download and install the latest version of CMake 3.15.
* Note that earlier versions of CMake will work, but there is a specific bug related to the interaction of Visual Studio 2019 and CMake versions prior to 3.15 that will cause Visual Studio to rebuild far more than it needs to on every build
Download the file named win64-x64 Installer from the [CMake Website](https://cmake.org/download/). You can access the installer on this [3.15 Version page](https://cmake.org/files/v3.15/). During installation, make sure to check "Add CMake to system PATH for all users" when prompted.
### Step 4. Node.JS and NPM
## Step 4. Node.JS and NPM
Install version 10.15.0 LTS (or greater) of [Node.JS and NPM](<https://nodejs.org/en/download/>).
### Step 5. Create VCPKG environment variable
## Step 5. (Optional) Install Qt
If you would like to compile Qt instead of using the precompiled package provided during CMake, you can do so now. Install version 5.12.3 of [Qt](<https://www.qt.io/download-open-source>), as well as the following packages:
* Qt 5.15.2
* MSVC 2019 64-bit
* Qt WebEngine
* Qt Script (Deprecated)
For convenience, you may also want the "Qt Debug Information" and "Sources" packages.
You'll need to create the environment variable that CMake uses to find your system's Qt install.
To create this variable:
* Navigate to 'Edit the System Environment Variables' through the Start menu.
* Click on 'Environment Variables'
* Select 'New'
* Set "Variable name" to `QT_CMAKE_PREFIX_PATH`
* Set "Variable value" to `%QT_INSTALL_DIR%\5.15.2\msvc2019_64\lib\cmake`, where `%QT_INSTALL_DIR%` is the directory you specified for Qt's installation. The default is `C:\Qt`.
## Step 6. Create VCPKG environment variable
In the next step, you will use CMake to build Vircadia. By default, the CMake process builds dependency files in Windows' `%TEMP%` directory, which is periodically cleared by the operating system. To prevent you from having to re-build the dependencies in the event that Windows clears that directory, we recommend that you create a `HIFI_VCPKG_BASE` environment variable linked to a directory somewhere on your machine. That directory will contain all dependency files until you manually remove them.
To create this variable:
* Naviagte to 'Edit the System Environment Variables' Through the start menu.
* Navigate to 'Edit the System Environment Variables' Through the Start menu.
* Click on 'Environment Variables'
* Select 'New'
* Select 'New'
* Set "Variable name" to `HIFI_VCPKG_BASE`
* Set "Variable value" to any directory that you have control over.
Additionally, if you have Visual Studio 2019 installed and _only_ Visual Studio 2019 (i.e. you do not have Visual Studio 2017 installed) you must add an additional environment variable `HIFI_VCPKG_BOOTSTRAP` that will fix a bug in our `vcpkg` pre-build step.
Additionally, if you have Visual Studio 2019 installed and _only_ Visual Studio 2019 (i.e., you do not have Visual Studio 2017 installed) you must add an additional environment variable `HIFI_VCPKG_BOOTSTRAP` that will fix a bug in our `vcpkg` pre-build step.
To create this variable:
* Naviagte to 'Edit the System Environment Variables' Through the start menu.
* Navigate to 'Edit the System Environment Variables' through the Start menu.
* Click on 'Environment Variables'
* Select 'New'
* Select 'New'
* Set "Variable name" to `HIFI_VCPKG_BOOTSTRAP`
* Set "Variable value" to `1`
### Step 6. Running CMake to Generate Build Files
## Step 7. Running CMake to Generate Build Files
Run Command Prompt from Start and run the following commands:
`cd "%VIRCADIA_DIR%"`
`mkdir build`
`cd build`
Run Command Prompt from Start and run the following commands:
`cd "%VIRCADIA_DIR%"`
`mkdir build`
`cd build`
#### If you're using Visual Studio 2017,
Run `cmake .. -G "Visual Studio 15 Win64"`.
#### If you're using Visual Studio 2019,
### Visual Studio 2019
Run `cmake .. -G "Visual Studio 16 2019" -A x64`.
Where `%VIRCADIA_DIR%` is the directory for the Vircadia repository.
### Step 7. Making a Build
## Step 8. Making a Build
Open `%VIRCADIA_DIR%\build\vircadia.sln` using Visual Studio.
@ -95,7 +106,7 @@ Change the Solution Configuration (menu ribbon under the menu bar, next to the g
Run from the menu bar `Build > Build Solution`.
### Step 8. Testing Interface
## Step 9. Testing Interface
Create another environment variable (see Step #3)
* Set "Variable name": `_NO_DEBUG_HEAP`
@ -103,24 +114,24 @@ Create another environment variable (see Step #3)
Restart Visual Studio again.
In Visual Studio, right+click "interface" under the Apps folder in Solution Explorer and select "Set as Startup Project". Run from the menu bar `Debug > Start Debugging`.
In Visual Studio, right-click "interface" under the Apps folder in Solution Explorer and select "Set as Startup Project". Run from the menu bar `Debug > Start Debugging`.
Now, you should have a full build of Vircadia and be able to run the Interface using Visual Studio.
Note: You can also run Interface by launching it from command line or File Explorer from `%VIRCADIA_DIR%\build\interface\Release\interface.exe`
## Troubleshooting
# Troubleshooting
For any problems after Step #7, first try this:
* Delete your locally cloned copy of the Vircadia repository
* Restart your computer
* Redownload the [repository](https://github.com/vircadia/vircadia)
* Restart directions from Step #7
For any problems after Step #7, first try this:
* Delete your locally cloned copy of the Vircadia repository
* Restart your computer
* Redownload the [repository](https://github.com/vircadia/vircadia)
* 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
Remove `CMakeCache.txt` found in the `%VIRCADIA_DIR%\build` directory.
#### CMake can't find OpenSSL
## CMake can't find OpenSSL
Remove `CMakeCache.txt` found in the `%VIRCADIA_DIR%\build` directory. Verify that your HIFI_VCPKG_BASE environment variable is set and pointing to the correct location. Verify that the file `${HIFI_VCPKG_BASE}/installed/x64-windows/include/openssl/ssl.h` exists.

View file

@ -41,8 +41,15 @@ endif()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/_env/EXTERNAL_BUILD_ASSETS.txt" "${EXTERNAL_BUILD_ASSETS}")
MESSAGE(STATUS "EXTERNAL_BUILD_ASSETS: ${EXTERNAL_BUILD_ASSETS}")
# read USE_GLES enviroment variable and sets it as GLES option
# TODO still gets overwritten by "use GLES on linux aarch64"
set(GLES_OPTION "$ENV{USE_GLES}")
# use GLES on linux aarch64
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(GLES_OPTION ON)
endif()
# Will affect VCPKG dependencies
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/_env/USE_GLES.txt" "${GLES_OPTION}")
MESSAGE(STATUS "GLES_OPTION: ${GLES_OPTION}")
@ -125,6 +132,15 @@ else()
set(MOBILE 0)
endif()
set(SCREENSHARE 0)
if (WIN32)
set(SCREENSHARE 1)
endif()
if (APPLE AND NOT CLIENT_ONLY)
# Don't include Screenshare in OSX client-only builds.
set(SCREENSHARE 1)
endif()
# Use default time server if none defined in environment
set_from_env(TIMESERVER_URL TIMESERVER_URL "http://timestamp.comodoca.com?td=sha256")
@ -187,7 +203,7 @@ else ()
set(PLATFORM_QT_COMPONENTS WebEngine Xml)
endif ()
if (USE_GLES AND (NOT ANDROID))
if (USE_GLES AND (NOT ANDROID AND NOT UNIX))
set(DISABLE_QML_OPTION ON)
endif()
@ -258,12 +274,18 @@ add_custom_target(cmake SOURCES ${CMAKE_SRC})
GroupSources("cmake")
unset(CMAKE_SRC)
file(GLOB_RECURSE JS_SRC scripts/*.js unpublishedScripts/*.js)
file(GLOB_RECURSE JS_SRC scripts/*.* unpublishedScripts/*.*)
add_custom_target(js SOURCES ${JS_SRC})
GroupSources("scripts")
GroupSources("unpublishedScripts")
unset(JS_SRC)
file(GLOB_RECURSE WEB_APP_SRC vircadia-web/*.*)
list(FILTER WEB_APP_SRC EXCLUDE REGEX "vircadia-web/(dist|node_modules|public)/*" )
add_custom_target(vircadia-web SOURCES ${WEB_APP_SRC})
GroupSources("vircadia-web")
unset(WEB_APP_SRC)
set_packaging_parameters()
# Locate the required Qt build on the filesystem
@ -316,8 +338,11 @@ endif()
if (BUILD_CLIENT)
add_subdirectory(interface)
add_subdirectory(screenshare)
set_target_properties(interface PROPERTIES FOLDER "Apps")
if (APPLE)
set_target_properties(Vircadia PROPERTIES FOLDER "Apps")
else()
set_target_properties(interface PROPERTIES FOLDER "Apps")
endif()
option(USE_SIXENSE "Build Interface with sixense library/plugin" OFF)
endif()
@ -327,6 +352,10 @@ if (BUILD_CLIENT OR BUILD_SERVER)
add_subdirectory(server-console)
endif()
if (SCREENSHARE)
add_subdirectory(screenshare)
endif()
# BUILD_TOOLS option will be handled inside the tools's CMakeLists.txt because 'scribe' tool is required for build anyway
add_subdirectory(tools)

View file

@ -1,33 +1,44 @@
# Vircadia (Codename Athena)
<p align="center"><a href="https://vircadia.com/"><img src="interface/resources/images/vircadia-banner.svg" alt="Vircadia - Codename Athena" width="350"/></a></p>
<h3 align="center"><a href="https://vircadia.com/">Website</a> | <a href="https://discordapp.com/invite/Pvx2vke">Discord</a> | <a href="https://vircadia.com/download-vircadia/">Download</a></h3>
<p align="center"><a href="CONTRIBUTING.md"><img alt="GitHub contributors" src="https://img.shields.io/github/contributors/vircadia/vircadia"></a> <a href="https://github.com/vircadia/vircadia/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/vircadia/vircadia"></a> <a href="https://github.com/vircadia/vircadia/network"><img alt="GitHub forks" src="https://img.shields.io/github/forks/vircadia/vircadia"></a> <a href="https://www.apache.org/licenses/LICENSE-2.0"><img alt="Apache 2.0" src="https://img.shields.io/badge/license-Apache--2.0-%230A7BBB?style=flat"></a> <a href="https://discordapp.com/invite/Pvx2vke"><img alt="Discord" src="https://img.shields.io/discord/564926326025224212?style=flat"></a></p>
### What is this?
Vircadia™ is a 3D social software project seeking to incrementally bring about a truly free and open metaverse, in desktop and XR.
Vircadia™ is a 3D social software project seeking to incrementally bring about a truly free and open metaverse.
### [Website](https://vircadia.com/) | [Discord](https://discordapp.com/invite/Pvx2vke) | [Download](https://vircadia.com/download-vircadia/)
* Desktop and VR use
* Hundreds of users simultaneously
* Full-body avatars
* FBX, glTF, and OBJ support
* JavaScript scripting engine
* 16km^3 world space in a server
* Fully self-hosted
* Apache 2.0
### Releases
[View Releases here](https://github.com/vircadia/vircadia/releases/)
### How to build the Interface
### How to deploy a Server
- [For Windows and Linux](https://vircadia.com/deploy-a-server/)
### Building
#### How to build the Interface
- [For Windows](https://github.com/vircadia/vircadia/blob/master/BUILD_WIN.md)
- [For Mac](https://github.com/vircadia/vircadia/blob/master/BUILD_OSX.md)
- [For Linux](https://github.com/vircadia/vircadia/blob/master/BUILD_LINUX.md)
- [For Linux - Vircadia Builder](https://github.com/vircadia/vircadia-builder)
### How to deploy a Server
- [For Windows and Linux](https://vircadia.com/deploy-a-server/)
### How to build a Server
#### How to build a Server
- [For Windows](https://github.com/vircadia/vircadia/blob/master/BUILD_WIN.md)
- [For Linux](https://github.com/vircadia/vircadia/blob/master/BUILD_LINUX.md)
- [For Linux - Vircadia Builder](https://github.com/vircadia/vircadia-builder)
### How to generate an Installer
#### How to generate an Installer
- [For Windows - Interface & Server](https://github.com/vircadia/vircadia/blob/master/INSTALLER.md)
- [For Mac - Interface](https://github.com/vircadia/vircadia/blob/master/INSTALLER.md#os-x)
@ -45,10 +56,11 @@ Vircadia consists of many projects and codebases with its unifying structure's g
- The Interface (Codename Athena) - You are here!
- The Server (Codename Athena) - You are also here!
- The UI Framework (Codename Nyx) - Codebase coming soon.
- [The Metaverse (Codename Iamus)](https://github.com/vircadia/Iamus/)
- [The Metaverse Dashboard (Codename Iamus)](https://github.com/vircadia/project-iamus-dashboard/)
- [The Launcher (Codename Pantheon)](https://github.com/vircadia/pantheon-launcher/)
- [The Web Interface (Codename Aether)](https://github.com/vircadia/vircadia-web/)
- [The Web SDK (Codename Ananke)](https://github.com/vircadia/vircadia-web-sdk/)
- [The Metaverse Server (Codename Iamus)](https://github.com/vircadia/Iamus/)
- [The Metaverse Server Dashboard (Codename Iamus)](https://github.com/vircadia/project-iamus-dashboard/)
- [The Launcher (Codename Pantheon)](https://github.com/vircadia/pantheon-launcher/) - Currently Windows only.
#### Child Projects
- [Vircadia Builder for Linux](https://github.com/vircadia/vircadia-builder/)

View file

@ -1,6 +1,6 @@
set(TARGET_NAME native-lib)
setup_hifi_library()
link_hifi_libraries(shared task networking gl gpu qml image fbx hfm render-utils physics entities octree ${PLATFORM_GL_BACKEND})
link_hifi_libraries(shared task networking gl gpu qml image model-serializers hfm render-utils physics entities octree ${PLATFORM_GL_BACKEND})
target_opengl()
target_bullet()

View file

@ -2,7 +2,7 @@ set(TARGET_NAME questInterface)
setup_hifi_library()
link_hifi_libraries(
shared task networking qml
image fbx hfm render-utils physics entities octree
image model-serializers hfm render-utils physics entities octree
oculusMobile oculusMobilePlugin
gl gpu ${PLATFORM_GL_BACKEND}
)

View file

@ -8,10 +8,11 @@ if (APPLE)
endif ()
setup_memory_debugger()
setup_thread_debugger()
# link in the shared libraries
link_hifi_libraries(
audio avatars octree gpu graphics shaders fbx hfm entities
audio avatars octree gpu graphics shaders model-serializers hfm entities
networking animation recording shared script-engine embedded-webserver
controllers physics plugins midi image
material-networking model-networking ktx shaders

View file

@ -54,7 +54,7 @@ elseif(APPLE)
LOG 1
)
elseif(NOT ANDROID)
elseif(NOT ANDROID AND NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
# FIXME need to account for different architectures
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/redistributable_bin/linux64/libsteam_api.so CACHE STRING INTERNAL)

View file

@ -96,19 +96,23 @@ macro(GENERATE_INSTALLERS)
set(CPACK_PACKAGING_INSTALL_PREFIX /)
set(CPACK_OSX_PACKAGE_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET})
# make sure a High Fidelity directory exists, in case this hits prior to other installs
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DMG_SUBFOLDER_NAME}\")")
# Create folder if used.
if (NOT INTERFACE_INSTALL_DIR STREQUAL ".")
# make sure a High Fidelity directory exists, in case this hits prior to other installs
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DMG_SUBFOLDER_NAME}\")")
# add the resource file to the Icon file inside the folder
install(CODE
"execute_process(COMMAND Rez -append ${DMG_SUBFOLDER_ICON} -o \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME}/Icon\\r)"
)
# add the resource file to the Icon file inside the folder
install(CODE
"execute_process(COMMAND Rez -append ${DMG_SUBFOLDER_ICON} -o \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME}/Icon\\r)"
)
# modify the folder to use that custom icon
install(CODE "execute_process(COMMAND SetFile -a C \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME})")
# modify the folder to use that custom icon
install(CODE "execute_process(COMMAND SetFile -a C \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME})")
# hide the special Icon? file
install(CODE "execute_process(COMMAND SetFile -a V \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME}/Icon\\r)")
endif ()
# hide the special Icon? file
install(CODE "execute_process(COMMAND SetFile -a V \${CMAKE_INSTALL_PREFIX}/${ESCAPED_DMG_SUBFOLDER_NAME}/Icon\\r)")
endif ()
# configure a cpack properties file for custom variables in template

View file

@ -26,5 +26,6 @@ function(LINK_HIFI_LIBRARIES)
endforeach()
setup_memory_debugger()
setup_thread_debugger()
endfunction()

View file

@ -3,6 +3,7 @@
#
# Created by Stephen Birarda on 1/15/16.
# Copyright 2014 High Fidelity, Inc.
# Copyright 2020 Vircadia contributors.
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@ -19,13 +20,13 @@ macro(manually_install_openssl_for_qt)
find_package(OpenSSL REQUIRED)
install(
FILES "${VCPKG_INSTALL_ROOT}/bin/ssleay32.dll"
FILES "${VCPKG_INSTALL_ROOT}/bin/libcrypto-1_1-x64.dll"
DESTINATION ${TARGET_INSTALL_DIR}
COMPONENT ${TARGET_INSTALL_COMPONENT}
)
install(
FILES "${VCPKG_INSTALL_ROOT}/bin/libeay32.dll"
FILES "${VCPKG_INSTALL_ROOT}/bin/libssl-1_1-x64.dll"
DESTINATION ${TARGET_INSTALL_DIR}
COMPONENT ${TARGET_INSTALL_COMPONENT}
)

View file

@ -9,29 +9,42 @@
macro(SETUP_MEMORY_DEBUGGER)
if ("$ENV{VIRCADIA_MEMORY_DEBUGGING}")
if (VIRCADIA_THREAD_DEBUGGING)
message(FATAL_ERROR "Thread debugging and memory debugging can't be enabled at the same time." )
endif()
SET( VIRCADIA_MEMORY_DEBUGGING true )
endif ()
if (VIRCADIA_MEMORY_DEBUGGING)
if (UNIX)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# for clang on Linux
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address -fsanitize=leak -fsanitize-recover=address")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address -fsanitize=leak -fsanitize-recover=address")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address -fsanitize=leak -fsanitize-recover=address")
else ()
# for gcc on Linux
# For some reason, using -fstack-protector results in this error:
# usr/bin/ld: ../../libraries/audio/libaudio.so: undefined reference to `FIR_1x4_AVX512(float*, float*, float*, float*, float*, float (*) [64], int)'
# The '-DSTACK_PROTECTOR' argument below disables the usage of this function in the code. This should be fine as it only works on the latest Intel hardware,
# and is an optimization that should make no functional difference.
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fsanitize=address -fsanitize=leak -U_FORTIFY_SOURCE -DSTACK_PROTECTOR -fstack-protector-strong -fno-omit-frame-pointer")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address -fsanitize=leak ")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address -fsanitize=leak")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address -fsanitize-recover=address")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address -fsanitize-recover=address")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address -fsanitize-recover=address")
if (UNIX)
# Only supported on Linux and OSX
# https://clang.llvm.org/docs/LeakSanitizer.html
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=leak")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=leak")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=leak")
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
# for gcc
# For some reason, using -fstack-protector results in this error:
# usr/bin/ld: ../../libraries/audio/libaudio.so: undefined reference to `FIR_1x4_AVX512(float*, float*, float*, float*, float*, float (*) [64], int)'
# The '-DSTACK_PROTECTOR' argument below disables the usage of this function in the code. This should be fine as it only works on the latest Intel hardware,
# and is an optimization that should make no functional difference.
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fsanitize=address -fsanitize=leak -U_FORTIFY_SOURCE -DSTACK_PROTECTOR -fstack-protector-strong -fno-omit-frame-pointer")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address -fsanitize=leak ")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address -fsanitize=leak")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# https://docs.microsoft.com/en-us/cpp/sanitizers/asan?view=msvc-160
# Supported experimentally starting from VS2019 v16.4, and officially from v16.9.
# UBSan and leak detection don't seem to be implemented yet.
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address /Zi")
else()
message(FATAL_ERROR "Memory debugging is not supported on this platform." )
message(FATAL_ERROR "Memory debugging is not supported on this compiler.")
endif()
endif ()
endmacro(SETUP_MEMORY_DEBUGGER)

View file

@ -38,6 +38,12 @@ macro(SET_PACKAGING_PARAMETERS)
set(CLIENT_COMPONENT client)
set(SERVER_COMPONENT server)
if (APPLE)
set(INTERFACE_BUNDLE_NAME "Vircadia")
else()
set(INTERFACE_BUNDLE_NAME "interface")
endif()
if (RELEASE_TYPE STREQUAL "PRODUCTION")
set(DEPLOY_PACKAGE TRUE)
set(PRODUCTION_BUILD 1)
@ -45,7 +51,6 @@ macro(SET_PACKAGING_PARAMETERS)
set(BUILD_ORGANIZATION "Vircadia")
set(HIGH_FIDELITY_PROTOCOL "hifi")
set(HIGH_FIDELITY_APP_PROTOCOL "hifiapp")
set(INTERFACE_BUNDLE_NAME "interface")
set(INTERFACE_ICON_PREFIX "interface")
# add definition for this release type
@ -68,7 +73,6 @@ macro(SET_PACKAGING_PARAMETERS)
set(PR_BUILD 1)
set(BUILD_VERSION "PR${RELEASE_NUMBER}")
set(BUILD_ORGANIZATION "Vircadia - PR${RELEASE_NUMBER}")
set(INTERFACE_BUNDLE_NAME "interface")
set(INTERFACE_ICON_PREFIX "interface-beta")
# add definition for this release type
@ -77,7 +81,6 @@ macro(SET_PACKAGING_PARAMETERS)
set(DEV_BUILD 1)
set(BUILD_VERSION "dev")
set(BUILD_ORGANIZATION "Vircadia - ${BUILD_VERSION}")
set(INTERFACE_BUNDLE_NAME "interface")
set(INTERFACE_ICON_PREFIX "interface-beta")
# add definition for this release type
@ -85,7 +88,11 @@ macro(SET_PACKAGING_PARAMETERS)
endif ()
set(NITPICK_BUNDLE_NAME "nitpick")
set(NITPICK_ICON_PREFIX "nitpick")
if (RELEASE_TYPE STREQUAL "PRODUCTION")
set(NITPICK_ICON_PREFIX "nitpick")
else ()
set(NITPICK_ICON_PREFIX "nitpick-beta")
endif ()
string(TIMESTAMP BUILD_TIME "%d/%m/%Y")
@ -125,10 +132,10 @@ macro(SET_PACKAGING_PARAMETERS)
set(DMG_SUBFOLDER_ICON "${HF_CMAKE_DIR}/installer/install-folder.rsrc")
set(CONSOLE_INSTALL_DIR ${DMG_SUBFOLDER_NAME})
set(INTERFACE_INSTALL_DIR ${DMG_SUBFOLDER_NAME})
set(SCREENSHARE_INSTALL_DIR ${DMG_SUBFOLDER_NAME})
set(NITPICK_INSTALL_DIR ${DMG_SUBFOLDER_NAME})
set(CONSOLE_INSTALL_DIR ".")
set(INTERFACE_INSTALL_DIR ".")
set(SCREENSHARE_INSTALL_DIR ".")
set(NITPICK_INSTALL_DIR ".")
if (CLIENT_ONLY)
set(CONSOLE_EXEC_NAME "Console.app")
@ -147,7 +154,7 @@ macro(SET_PACKAGING_PARAMETERS)
set(SCREENSHARE_APP_CONTENTS "${SCREENSHARE_INSTALL_APP_PATH}/Contents")
set(INTERFACE_INSTALL_APP_PATH "${CONSOLE_INSTALL_DIR}/${INTERFACE_BUNDLE_NAME}.app")
set(INTERFACE_INSTALL_APP_PATH "${INTERFACE_INSTALL_DIR}/${INTERFACE_BUNDLE_NAME}.app")
set(INTERFACE_ICON_FILENAME "${INTERFACE_ICON_PREFIX}.icns")
set(NITPICK_ICON_FILENAME "${NITPICK_ICON_PREFIX}.icns")
else ()

View file

@ -11,7 +11,11 @@ macro(SETUP_HIFI_CLIENT_SERVER_PLUGIN)
setup_hifi_library()
if (BUILD_CLIENT)
add_dependencies(interface ${TARGET_NAME})
if (APPLE)
add_dependencies(Vircadia ${TARGET_NAME})
else()
add_dependencies(interface ${TARGET_NAME})
endif()
endif()
if (BUILD_SERVER)

View file

@ -30,7 +30,7 @@ macro(SETUP_HIFI_LIBRARY)
foreach(SRC ${AVX2_SRCS})
if (WIN32)
set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS /arch:AVX2)
elseif (APPLE OR (UNIX AND NOT ANDROID))
elseif (APPLE OR (UNIX AND NOT ANDROID AND NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64"))
set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS "-mavx2 -mfma")
endif()
endforeach()
@ -53,6 +53,7 @@ macro(SETUP_HIFI_LIBRARY)
endforeach()
setup_memory_debugger()
setup_thread_debugger()
# create a library and set the property so it can be referenced later
if (${${TARGET_NAME}_SHARED})

View file

@ -9,7 +9,11 @@ macro(SETUP_HIFI_PLUGIN)
set(${TARGET_NAME}_SHARED 1)
setup_hifi_library(${ARGV})
if (BUILD_CLIENT)
add_dependencies(interface ${TARGET_NAME})
if (APPLE)
add_dependencies(Vircadia ${TARGET_NAME})
else()
add_dependencies(interface ${TARGET_NAME})
endif()
endif()
target_link_libraries(${TARGET_NAME} ${CMAKE_THREAD_LIBS_INIT})
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Plugins")

View file

@ -18,7 +18,7 @@ endfunction()
function(calculate_qt5_version result _QT_DIR)
# All Qt5 packages have little "private" include directories named with the actual Qt version such as:
# .../include/QtCore/5.12.3/QtCore/private
# .../include/QtCore/5.15.2/QtCore/private
# Sometimes we need to include these private headers for debug hackery.
# Hence we find one of these directories and pick apart its path to determine the actual QT_VERSION.
if (APPLE)

View file

@ -0,0 +1,36 @@
#
# MemoryDebugger.cmake
#
# Copyright 2021 Vircadia Contributors
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
macro(SETUP_THREAD_DEBUGGER)
if ("$ENV{VIRCADIA_THREAD_DEBUGGING}")
if (VIRCADIA_MEMORY_DEBUGGING )
message(FATAL_ERROR "Thread debugging and memory debugging can't be enabled at the same time." )
endif ()
SET(VIRCADIA_THREAD_DEBUGGING true)
endif ()
if (VIRCADIA_THREAD_DEBUGGING)
if (UNIX)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# for clang on Linux
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer")
SET(CMAKE_EXE_LINKER_FLAGS "-fsanitize=thread ${CMAKE_EXE_LINKER_FLAGS}")
SET(CMAKE_SHARED_LINKER_FLAGS "-fsanitize=thread ${CMAKE_EXE_LINKER_FLAGS}")
else ()
# for gcc on Linux
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer")
SET(CMAKE_EXE_LINKER_FLAGS " -fsanitize=thread ${CMAKE_EXE_LINKER_FLAGS}")
SET(CMAKE_SHARED_LINKER_FLAGS "-fsanitize=thread ${CMAKE_EXE_LINKER_FLAGS}")
endif()
else()
message(FATAL_ERROR "Thread debugging is not supported on this platform.")
endif()
endif ()
endmacro(SETUP_THREAD_DEBUGGER)

View file

@ -1,4 +1,4 @@
Source: hifi-client-deps
Version: 0.1
Description: Collected dependencies for High Fidelity applications
Build-Depends: hifi-deps, aristo (windows), glslang, liblo (windows), nlohmann-json, openvr (linux|windows), quazip (!android), sdl2 (!android), spirv-cross (!android), spirv-tools (!android), sranipal (windows), vulkanmemoryallocator
Build-Depends: hifi-deps, aristo (windows), glslang, liblo (windows), nlohmann-json, openvr ((linux&!arm)|windows), quazip (!android), sdl2 (!android), spirv-cross (!android), spirv-tools (!android), sranipal (windows), vulkanmemoryallocator

View file

@ -0,0 +1,37 @@
commit 8909ba06ea1893a6e028836fbade28fd115ee1cc
Author: Julian Groß <julian.g@posteo.de>
Date: Wed Feb 17 04:51:49 2021 +0100
Enable building on aarch64 according to https://github.com/castano/nvidia-texture-tools/pull/309 and https://github.com/castano/nvidia-texture-tools/pull/322
diff --git a/src/nvcore/Debug.cpp b/src/nvcore/Debug.cpp
index 9ab4525..e335f97 100644
--- a/src/nvcore/Debug.cpp
+++ b/src/nvcore/Debug.cpp
@@ -1008,6 +1008,13 @@ void debug::dumpInfo()
#endif
}
+static va_list getEmptyVAList(va_list list, ...)
+{
+ va_start(list, list);
+ va_end(list);
+ return list;
+}
+
/// Dump callstack using the specified handler.
void debug::dumpCallstack(MessageHandler *messageHandler, int callstackLevelsToSkip /*= 0*/)
{
@@ -1020,8 +1027,11 @@ void debug::dumpCallstack(MessageHandler *messageHandler, int callstackLevelsToS
Array<const char *> lines;
writeStackTrace(trace, size, callstackLevelsToSkip + 1, lines); // + 1 to skip the call to dumpCallstack
+ va_list empty;
+ empty = getEmptyVAList(empty);
+
for (uint i = 0; i < lines.count(); i++) {
- messageHandler->log(lines[i], NULL);
+ messageHandler->log(lines[i], empty);
delete lines[i];
}
}

View file

@ -0,0 +1,25 @@
From 84dc6af45b1176a2b82d089239665cb3dc1584de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julian=20Gro=C3=9F?= <firedefender1@googlemail.com>
Date: Wed, 23 Dec 2020 07:33:39 +0100
Subject: [PATCH] Hack: remove #include <sys/sysctl.h> to build on
linux-aarch64
---
src/nvthread/nvthread.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/nvthread/nvthread.cpp b/src/nvthread/nvthread.cpp
index 2b3abe6..cec9f4f 100644
--- a/src/nvthread/nvthread.cpp
+++ b/src/nvthread/nvthread.cpp
@@ -11,7 +11,6 @@
#include <unistd.h>
#elif NV_OS_UNIX
#include <sys/types.h>
-#include <sys/sysctl.h>
#include <unistd.h>
#elif NV_OS_DARWIN
#import <stdio.h>
--
2.17.1

View file

@ -15,6 +15,13 @@ vcpkg_from_github(
HEAD_REF master
)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-Build-on-aarch64.patch" "${CMAKE_CURRENT_LIST_DIR}/0002-Hack-remove-include-sysctl.h-to-build-on-linux-a.patch"
)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS

View file

@ -1,3 +1,3 @@
Source: openssl-windows
Version: 1.0.2p-1
Version: 1.1.1h
Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.

View file

@ -1,13 +0,0 @@
diff --git a/Configure b/Configure
index c98107a..77ad9d3 100644
--- a/Configure
+++ b/Configure
@@ -972,7 +972,7 @@ PROCESS_ARGS:
}
elsif (/^--with-zlib-include=(.*)$/)
{
- $withargs{"zlib-include"}="-I$1";
+ $withargs{"zlib-include"}="-I\"$1\"";
}
elsif (/^--with-fipsdir=(.*)$/)
{

View file

@ -1,25 +0,0 @@
diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl
index dba96cb..5722f6e 100644
--- a/util/pl/VC-32.pl
+++ b/util/pl/VC-32.pl
@@ -154,9 +154,17 @@ else
$cflags=$opt_cflags.$base_cflags;
}
-# generate symbols.pdb unconditionally
-$app_cflag.=" /Zi /Fd\$(TMP_D)/app";
-$lib_cflag.=" /Zi /Fd\$(TMP_D)/lib";
+# generate symbols.pdb when building dlls and embed symbols when building static libs
+if ($shlib)
+ {
+ $app_cflag.=" /Zi /Fd\$(TMP_D)/app.pdb";
+ $lib_cflag.=" /Zi /Fd\$(TMP_D)/lib.pdb";
+ }
+else
+ {
+ $app_cflag.=" /Z7";
+ $lib_cflag.=" /Z7";
+ }
$lflags.=" /debug";
$obj='.obj';

View file

@ -1,23 +0,0 @@
diff --git a/crypto/cversion.c b/crypto/cversion.c
index bfff699..17b7912 100644
--- a/crypto/cversion.c
+++ b/crypto/cversion.c
@@ -56,6 +56,9 @@
* [including the GNU Public Licence.]
*/
+#define STRINGIFY2(x) #x
+#define STRINGIFY(x) STRINGIFY2(x)
+
#include "cryptlib.h"
#ifndef NO_WINDOWS_BRAINDEATH
@@ -79,7 +82,7 @@ const char *SSLeay_version(int t)
}
if (t == SSLEAY_CFLAGS) {
#ifdef CFLAGS
- return (CFLAGS);
+ return STRINGIFY(CFLAGS);
#else
return ("compiler: information not available");
#endif

View file

@ -3,7 +3,7 @@ if(VCPKG_CMAKE_SYSTEM_NAME)
endif()
include(vcpkg_common_functions)
set(OPENSSL_VERSION 1.0.2p)
set(OPENSSL_VERSION 1.1.1h)
set(MASTER_COPY_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-${OPENSSL_VERSION})
vcpkg_find_acquire_program(PERL)
@ -12,18 +12,12 @@ get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}")
vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE
URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.0.2/openssl-${OPENSSL_VERSION}.tar.gz"
URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz"
FILENAME "openssl-${OPENSSL_VERSION}.tar.gz"
SHA512 958c5a7c3324bbdc8f07dfb13e11329d9a1b4452c07cf41fbd2d42b5fe29c95679332a3476d24c2dc2b88be16e4a24744aba675a05a388c0905756c77a8a2f16
SHA512 da50fd99325841ed7a4367d9251c771ce505a443a73b327d8a46b2c6a7d2ea99e43551a164efc86f8743b22c2bdb0020bf24a9cbd445e9d68868b2dc1d34033a
)
vcpkg_extract_source_archive(${OPENSSL_SOURCE_ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${MASTER_COPY_SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/ConfigureIncludeQuotesFix.patch
${CMAKE_CURRENT_LIST_DIR}/STRINGIFYPatch.patch
${CMAKE_CURRENT_LIST_DIR}/EmbedSymbolsInStaticLibsZ7.patch
)
vcpkg_find_acquire_program(NASM)
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
@ -40,39 +34,26 @@ set(CONFIGURE_COMMAND ${PERL} Configure
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(OPENSSL_ARCH VC-WIN32)
set(OPENSSL_DO "ms\\do_nasm.bat")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(OPENSSL_ARCH VC-WIN64A)
set(OPENSSL_DO "ms\\do_win64a.bat")
else()
message(FATAL_ERROR "Unsupported target architecture: ${VCPKG_TARGET_ARCHITECTURE}")
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(OPENSSL_MAKEFILE "ms\\ntdll.mak")
else()
set(OPENSSL_MAKEFILE "ms\\nt.mak")
endif()
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
message(STATUS "Configure ${TARGET_TRIPLET}-rel")
file(COPY ${MASTER_COPY_SOURCE_PATH} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/openssl-${OPENSSL_VERSION})
set(OPENSSLDIR_RELEASE ${CURRENT_PACKAGES_DIR})
message(STATUS "Configure ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
COMMAND ${CONFIGURE_COMMAND} ${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_RELEASE}" "--openssldir=${OPENSSLDIR_RELEASE}" -FS
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
LOGNAME configure-perl-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE}-rel
)
vcpkg_execute_required_process(
COMMAND ${OPENSSL_DO}
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
LOGNAME configure-do-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE}-rel
)
message(STATUS "Configure ${TARGET_TRIPLET}-rel done")
message(STATUS "Build ${TARGET_TRIPLET}-rel")
@ -80,16 +61,16 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
# This is ok; we just do as much work as we can in parallel first, then follow up with a single-threaded build.
make_directory(${SOURCE_PATH_RELEASE}/inc32/openssl)
execute_process(
COMMAND ${JOM} -k -j $ENV{NUMBER_OF_PROCESSORS} -f ${OPENSSL_MAKEFILE}
COMMAND ${JOM} -k -j $ENV{NUMBER_OF_PROCESSORS}
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-out.log
ERROR_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-err.log
)
vcpkg_execute_required_process(
COMMAND nmake -f ${OPENSSL_MAKEFILE} install
COMMAND nmake install
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
LOGNAME build-${TARGET_TRIPLET}-rel-1)
LOGNAME build-${TARGET_TRIPLET}-rel-1
)
message(STATUS "Build ${TARGET_TRIPLET}-rel done")
endif()
@ -101,39 +82,46 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
set(OPENSSLDIR_DEBUG ${CURRENT_PACKAGES_DIR}/debug)
vcpkg_execute_required_process(
COMMAND ${CONFIGURE_COMMAND} debug-${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_DEBUG}" "--openssldir=${OPENSSLDIR_DEBUG}" -FS
COMMAND ${CONFIGURE_COMMAND} ${OPENSSL_ARCH} --debug "--prefix=${OPENSSLDIR_DEBUG}" "--openssldir=${OPENSSLDIR_DEBUG}" -FS
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
LOGNAME configure-perl-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE}-dbg
)
vcpkg_execute_required_process(
COMMAND ${OPENSSL_DO}
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
LOGNAME configure-do-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE}-dbg
)
message(STATUS "Configure ${TARGET_TRIPLET}-dbg done")
message(STATUS "Build ${TARGET_TRIPLET}-dbg")
make_directory(${SOURCE_PATH_DEBUG}/inc32/openssl)
execute_process(
COMMAND ${JOM} -k -j $ENV{NUMBER_OF_PROCESSORS} -f ${OPENSSL_MAKEFILE}
COMMAND ${JOM} -k -j $ENV{NUMBER_OF_PROCESSORS}
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-out.log
ERROR_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-err.log
)
vcpkg_execute_required_process(
COMMAND nmake -f ${OPENSSL_MAKEFILE} install
COMMAND nmake install
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
LOGNAME build-${TARGET_TRIPLET}-dbg-1)
LOGNAME build-${TARGET_TRIPLET}-dbg-1
)
message(STATUS "Build ${TARGET_TRIPLET}-dbg done")
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/certs)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/engines-1_1)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/private)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/certs)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/engines-1_1)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/private)
file(REMOVE
${CURRENT_PACKAGES_DIR}/debug/bin/openssl.exe
${CURRENT_PACKAGES_DIR}/debug/openssl.cnf
${CURRENT_PACKAGES_DIR}/openssl.cnf
${CURRENT_PACKAGES_DIR}/openssl.cnf.dist
${CURRENT_PACKAGES_DIR}/ct_log_list.cnf
${CURRENT_PACKAGES_DIR}/ct_log_list.cnf.dist
${CURRENT_PACKAGES_DIR}/debug/openssl.cnf
${CURRENT_PACKAGES_DIR}/debug/openssl.cnf.dist
${CURRENT_PACKAGES_DIR}/debug/ct_log_list.cnf
${CURRENT_PACKAGES_DIR}/debug/ct_log_list.cnf.dist
${CURRENT_PACKAGES_DIR}/debug/bin/openssl.exe
)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/openssl/)
@ -147,14 +135,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/)
endif()
file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" _contents)
string(REPLACE "<winsock.h>" "<winsock2.h>" _contents "${_contents}")
file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" "${_contents}")
file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" _contents)
string(REPLACE "# include <windows.h>" "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include <windows.h>" _contents "${_contents}")
file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" "${_contents}")
vcpkg_copy_pdbs()
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})

View file

@ -15,6 +15,7 @@ if (APPLE)
endif ()
setup_memory_debugger()
setup_thread_debugger()
# TODO: find a solution that will handle web file changes in resources on windows without a re-build.
# Currently the resources are only copied on post-build. If one is changed but the domain-server is not, they will

View file

@ -661,7 +661,7 @@ bool DomainServer::isPacketVerified(const udt::Packet& packet) {
// if this is a mismatching connect packet, we can't simply drop it on the floor
// send back a packet to the interface that tells them we refuse connection for a mismatch
if (headerType == PacketType::DomainConnectRequest
if ((headerType == PacketType::DomainConnectRequest || headerType == PacketType::DomainConnectRequestPending)
&& headerVersion != versionForPacketType(PacketType::DomainConnectRequest)) {
DomainGatekeeper::sendProtocolMismatchConnectionDenial(packet.getSenderSockAddr());
}
@ -807,6 +807,8 @@ void DomainServer::setupNodeListAndAssignments() {
// register the gatekeeper for the packets it needs to receive
packetReceiver.registerListener(PacketType::DomainConnectRequest,
PacketReceiver::makeUnsourcedListenerReference<DomainGatekeeper>(&_gatekeeper, &DomainGatekeeper::processConnectRequestPacket));
packetReceiver.registerListener(PacketType::DomainConnectRequestPending,
PacketReceiver::makeUnsourcedListenerReference<DomainGatekeeper>(&_gatekeeper, &DomainGatekeeper::processConnectRequestPacket));
packetReceiver.registerListener(PacketType::ICEPing,
PacketReceiver::makeUnsourcedListenerReference<DomainGatekeeper>(&_gatekeeper, &DomainGatekeeper::processICEPingPacket));
packetReceiver.registerListener(PacketType::ICEPingReply,

View file

@ -27,7 +27,7 @@ endif()
def __init__(self, args):
self.args = args
self.configFilePath = os.path.join(args.build_root, 'qt.cmake')
self.version = os.getenv('VIRCADIA_USE_QT_VERSION', '5.12.3')
self.version = os.getenv('VIRCADIA_USE_QT_VERSION', '5.15.2')
self.assets_url = hifi_utils.readEnviromentVariableFromFile(args.build_root, 'EXTERNAL_BUILD_ASSETS')
@ -53,36 +53,71 @@ endif()
# OS dependent information
system = platform.system()
cpu_architecture = platform.machine()
if 'Windows' == system:
self.qtUrl = self.assets_url + '/dependencies/vcpkg/qt5-install-5.12.3-windows3.tar.gz%3FversionId=5ADqP0M0j5ZfimUHrx4zJld6vYceHEsI'
self.qtUrl = self.assets_url + '/dependencies/vcpkg/qt5-install-5.15.2-windows.tar.gz'
elif 'Darwin' == system:
self.qtUrl = self.assets_url + '/dependencies/vcpkg/qt5-install-5.12.3-macos.tar.gz%3FversionId=bLAgnoJ8IMKpqv8NFDcAu8hsyQy3Rwwz'
self.qtUrl = self.assets_url + '/dependencies/vcpkg/qt5-install-5.15.2-macos.tar.gz'
elif 'Linux' == system:
import distro
dist = distro.linux_distribution()
if distro.id() == 'ubuntu':
u_major = int( distro.major_version() )
u_minor = int( distro.minor_version() )
if 'x86_64' == cpu_architecture:
if distro.id() == 'ubuntu':
u_major = int( distro.major_version() )
u_minor = int( distro.minor_version() )
if u_major == 16:
self.qtUrl = self.assets_url + '/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04-with-symbols.tar.gz'
elif u_major == 18:
self.qtUrl = self.assets_url + '/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz'
elif u_major == 19 and u_minor == 10:
self.qtUrl = self.assets_url + '/dependencies/vcpkg/qt5-install-5.12.6-ubuntu-19.10.tar.xz'
elif u_major > 19:
print("We don't support " + distro.name(pretty=True) + " yet. Perhaps consider helping us out?")
raise Exception('LINUX DISTRO IS NOT SUPPORTED YET!!!')
if u_major == 18:
self.qtUrl = self.assets_url + '/dependencies/vcpkg/qt5-install-5.15.2-ubuntu-18.04-amd64.tar.xz'
elif u_major > 19:
print("We don't support " + distro.name(pretty=True) + " yet. Perhaps consider helping us out?")
raise Exception('LINUX DISTRO IS NOT SUPPORTED YET!!!')
else:
print("Sorry, " + distro.name(pretty=True) + " is old and won't be officially supported. Please consider upgrading.");
raise Exception('UNKNOWN LINUX DISTRO VERSION!!!')
else:
print("Sorry, " + distro.name(pretty=True) + " is old and won't be officially supported. Please consider upgrading.");
raise Exception('UNKNOWN LINUX DISTRO VERSION!!!')
print("Sorry, " + distro.name(pretty=True) + " is not supported on x86_64. Please consider helping us out.")
print("It's also possible to build Qt for your distribution, please see the documentation at:")
print("https://github.com/vircadia/vircadia/tree/master/tools/qt-builder")
raise Exception('UNKNOWN LINUX VERSION!!!')
elif 'aarch64' == cpu_architecture:
if distro.id() == 'ubuntu':
u_major = int( distro.major_version() )
u_minor = int( distro.minor_version() )
if u_major == 18:
self.qtUrl = 'http://motofckr9k.ddns.net/vircadia_packages/qt5-install-5.15.2-ubuntu-18.04-aarch64_test.tar.xz'
elif u_major > 19:
print("We don't support " + distro.name(pretty=True) + " on aarch64 yet. Perhaps consider helping us out?")
raise Exception('LINUX DISTRO IS NOT SUPPORTED YET!!!')
else:
print("Sorry, " + distro.name(pretty=True) + " is old and won't be officially supported. Please consider upgrading.");
raise Exception('UNKNOWN LINUX DISTRO VERSION!!!')
elif distro.id() == 'debian':
u_major = int( distro.major_version() )
u_minor = int( distro.minor_version() )
if u_major == 10:
#self.qtUrl = self.assets_url + '/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04-with-symbols.tar.gz'
print("We don't support " + distro.name(pretty=True) + " on aarch64 yet. Perhaps consider helping us out?")
raise Exception('LINUX DISTRO IS NOT SUPPORTED YET!!!')
elif u_major > 10:
print("We don't support " + distro.name(pretty=True) + " on aarch64 yet. Perhaps consider helping us out?")
raise Exception('LINUX DISTRO IS NOT SUPPORTED YET!!!')
else:
print("Sorry, " + distro.name(pretty=True) + " is old and won't be officially supported. Please consider upgrading.");
raise Exception('UNKNOWN LINUX DISTRO VERSION!!!')
else:
print("Sorry, " + distro.name(pretty=True) + " is not supported on aarch64. Please consider helping us out.")
print("It's also possible to build Qt for your distribution, please see the documentation at:")
print("https://github.com/vircadia/vircadia/tree/master/tools/qt-builder")
raise Exception('UNKNOWN LINUX VERSION!!!')
else:
print("Sorry, " + distro.name(pretty=True) + " is not supported. Please consider helping us out.")
print("It's also possible to build Qt for your distribution, please see the documentation at:")
print("https://github.com/vircadia/vircadia/tree/master/tools/qt-builder")
raise Exception('UNKNOWN LINUX VERSION!!!')
raise Exception('UNKNOWN CPU ARCHITECTURE!!!')
else:
print("System : " + platform.system())
print("Architecture: " + platform.architecture())

View file

@ -44,13 +44,14 @@ endif()
self.assets_url = self.readVar('EXTERNAL_BUILD_ASSETS')
# The noClean flag indicates we're doing weird dependency maintenance stuff
# i.e. we've got an explicit checkout of vcpkg and we don't want the script to
# do stuff it might otherwise do. It typically indicates that we're using our
# i.e. we've got an explicit checkout of vcpkg and we don't want the script to
# do stuff it might otherwise do. It typically indicates that we're using our
# own git checkout of vcpkg and manually managing it
self.noClean = False
# OS dependent information
system = platform.system()
machine = platform.machine()
if 'HIFI_VCPKG_PATH' in os.environ:
self.path = os.environ['HIFI_VCPKG_PATH']
@ -105,6 +106,12 @@ endif()
self.bootstrapEnv['CXXFLAGS'] = '-D_CTERMID_H_'
if usePrebuilt:
self.prebuiltArchive = self.assets_url + "/dependencies/vcpkg/builds/vcpkg-osx.tgz%3FversionId=6JrIMTdvpBF3MAsjA92BMkO79Psjzs6Z"
elif 'Linux' == system and 'aarch64' == machine:
self.exe = os.path.join(self.path, 'vcpkg')
self.bootstrapCmds = [ os.path.join(self.path, 'bootstrap-vcpkg.sh'), '-disableMetrics' ]
self.vcpkgUrl = 'http://motofckr9k.ddns.net/vircadia_packages/vcpkg-2020.11-1_arm64.tar.xz'
self.vcpkgHash = 'f39fa1c34d2ba820954b8ce4acc05e3d0ce5fa5efe5440516ba910ff222c85c658ba4bbfc92b3fa6cbb594f99be115cda69ebe44ed38d4d3988058fb1faefbb3'
self.hostTriplet = 'arm64-linux'
else:
self.exe = os.path.join(self.path, 'vcpkg')
self.bootstrapCmds = [ os.path.join(self.path, 'bootstrap-vcpkg.sh'), '-disableMetrics' ]

View file

@ -19,6 +19,7 @@ endif ()
include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
setup_memory_debugger()
setup_thread_debugger()
# append OpenSSL to our list of libraries to link
target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES})

View file

@ -1,4 +1,10 @@
set(TARGET_NAME interface)
if (APPLE)
# Make the OSX DMG app be Vircadia.app.
set(TARGET_NAME Vircadia)
else()
set(TARGET_NAME interface)
endif()
project(${TARGET_NAME})
file(GLOB_RECURSE QML_SRC resources/qml/*.qml resources/qml/*.js)
@ -47,6 +53,7 @@ add_custom_target(resources ALL DEPENDS ${GENERATE_QRC_DEPENDS})
set(OPTIONAL_EXTERNALS "LeapMotion")
setup_memory_debugger()
setup_thread_debugger()
foreach(EXTERNAL ${OPTIONAL_EXTERNALS})
string(TOUPPER ${EXTERNAL} ${EXTERNAL}_UPPERCASE)
@ -191,9 +198,12 @@ if (BUILD_TOOLS AND NPM_EXECUTABLE)
endif()
if (WIN32 OR APPLE)
add_dependencies(${TARGET_NAME} resources screenshare)
add_dependencies(${TARGET_NAME} resources)
endif()
if (SCREENSHARE)
add_dependencies(${TARGET_NAME} screenshare)
endif()
if (WIN32)
# These are external plugins, but we need to do the 'add dependency' here so that their
@ -218,7 +228,7 @@ endif()
# link required hifi libraries
link_hifi_libraries(
shared workload task octree ktx gpu gl procedural graphics graphics-scripting render
pointers recording hfm fbx networking material-networking
pointers recording hfm model-serializers networking material-networking
model-networking model-baker entities avatars
audio audio-client animation script-engine physics
render-utils entities-renderer avatars-renderer ui qml auto-updater midi
@ -299,7 +309,7 @@ target_link_libraries(
${PLATFORM_QT_LIBRARIES}
)
if (UNIX AND NOT ANDROID)
if (UNIX AND NOT ANDROID AND NOT VIRCADIA_THREAD_DEBUGGING)
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
# Linux
target_link_libraries(${TARGET_NAME} pthread atomic)
@ -333,10 +343,6 @@ if (APPLE)
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${CMAKE_SOURCE_DIR}/scripts"
"${RESOURCES_DEV_DIR}/scripts"
# copy screenshare app to the resource folder
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${CMAKE_CURRENT_BINARY_DIR}/../screenshare/hifi-screenshare-darwin-x64/hifi-screenshare.app"
"${RESOURCES_DEV_DIR}/hifi-screenshare.app"
# copy JSDoc files beside the executable
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${CMAKE_SOURCE_DIR}/tools/jsdoc/out"
@ -363,6 +369,15 @@ if (APPLE)
"${RESOURCES_DEV_DIR}/serverless/redirect.json"
)
if (SCREENSHARE)
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
# copy screenshare app to the resource folder
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${CMAKE_CURRENT_BINARY_DIR}/../screenshare/hifi-screenshare-darwin-x64/hifi-screenshare.app"
"${RESOURCES_DEV_DIR}/hifi-screenshare.app"
)
endif()
# call the fixup_interface macro to add required bundling commands for installation
fixup_interface()

View file

@ -73,9 +73,9 @@ SpinBox {
}
}
stepSize: realStepSize * factor
to : realTo*factor
from : realFrom*factor
stepSize: Math.round(realStepSize * factor)
to : Math.round(realTo*factor)
from : Math.round(realFrom*factor)
font.family: "Fira Sans SemiBold"
font.pixelSize: hifi.fontSizes.textFieldInput
@ -97,11 +97,11 @@ SpinBox {
}
textFromValue: function(value, locale) {
return parseFloat(value / factor).toFixed(decimals);
return (value / factor).toFixed(decimals);
}
valueFromText: function(text, locale) {
return Number.fromLocaleString(locale, text) * factor;
return Math.round(Number.fromLocaleString(locale, text) * factor);
}

View file

@ -51,6 +51,7 @@ Preference {
decimals: preference.decimals
minimumValue: preference.min
maximumValue: preference.max
realStepSize: preference.step
width: 100
anchors {
verticalCenter: parent.verticalCenter

View file

@ -76,6 +76,7 @@ Preference {
realValue: preference.value
minimumValue: preference.min
maximumValue: preference.max
realStepSize: preference.step
width: 100
onValueChanged: {
slider.value = realValue;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,59 @@
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// 2020 Silverfish.
//material sequencer, put on a material entity (server script) to make it iterate through discrete steps of X UV offset.
/*UserData:
{
"verticalOffset": 0,
"segments": 16,
"updateInterval": 250
}
*/
(function() {
var DEFAULT_VERTICAL_OFFSET = 0.0;
var DEFAULT_HORIZONTAL_SPEED = 1;
var DEFAULT_UPDATE_INTERVAL = 1000;
var DEFAULT_SEGMENTS = 16;
var self = this;
var _entityID;
this.preload = function(entityID) {
_entityID = entityID;
var verticalOffset = DEFAULT_VERTICAL_OFFSET;
var updateInterval = DEFAULT_UPDATE_INTERVAL;
var moveDistance = 1 / DEFAULT_SEGMENTS;
var verticalOffset = DEFAULT_VERTICAL_OFFSET;
var oldPosition = 0;
var currentPosition = 0;
var userData = JSON.parse(Entities.getEntityProperties(_entityID, ["userData"]).userData);
if (userData !== undefined) {
if (userData.segments !== undefined) {
moveDistance = 1 / userData.segments;
}
if (userData.verticalOffset !== undefined) {
verticalOffset = userData.verticalOffset;
}
if (userData.updateInterval !== undefined) {
updateInterval = userData.updateInterval;
}
}
self.intervalID = Script.setInterval(function() {
if(currentPosition >= 1){
currentPosition = 0;
oldPosition = 0;
}
Entities.editEntity(_entityID, { materialMappingPos: { x: currentPosition, y: verticalOffset}});
// print("current Pos: " + currentPosition);
currentPosition = oldPosition + moveDistance;
oldPosition = currentPosition;
}, updateInterval);
};
this.unload = function() {
Script.clearInterval(self.intervalID);
}
});

View file

@ -0,0 +1,182 @@
//
// mirrorClient.js
//
// Created by Patrick Manalich
// Edited by Rebecca Stankus on 8/30/17.
// Edited by David Back on 11/17/17.
// Edited by Anna Brewer on 7/12/19.
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
// Attach `mirrorClient.js` to a box entity whose z dimension is very small,
// and whose x and y dimensions are up to you. See comments in `mirrorReflection.js`
// for more information about the mirror on/off zone.
"use strict";
(function () { // BEGIN LOCAL SCOPE
// VARIABLES
/* globals utils, Render */
var _this = this;
var MAX_MIRROR_RESOLUTION_SIDE_PX = 960; // The max pixel resolution of the long side of the mirror
var ZERO_ROT = { w: 1, x: 0, y: 0, z: 0 }; // Constant quaternion for a rotation of 0
var FAR_CLIP_DISTANCE = 16; // The far clip distance for the spectator camera when the mirror is on
var mirrorLocalEntityID = false; // The entity ID of the local entity that displays the mirror reflection
var mirrorLocalEntityRunning; // True if mirror local entity is reflecting, false otherwise
var mirrorLocalEntityOffset = 0.01; // The distance between the center of the mirror and the mirror local entity
var spectatorCameraConfig = Render.getConfig("SecondaryCamera"); // Render configuration for the spectator camera
var lastDimensions = { x: 0, y: 0 }; // The previous dimensions of the mirror
var previousFarClipDistance; // Store the specator camera's previous far clip distance that we override for the mirror
// LOCAL FUNCTIONS
function isPositionInsideBox(position, boxProperties) {
var localPosition = Vec3.multiplyQbyV(Quat.inverse(boxProperties.rotation),
Vec3.subtract(MyAvatar.position, boxProperties.position));
var halfDimensions = Vec3.multiply(boxProperties.dimensions, 0.5);
return -halfDimensions.x <= localPosition.x &&
halfDimensions.x >= localPosition.x &&
-halfDimensions.y <= localPosition.y &&
halfDimensions.y >= localPosition.y &&
-halfDimensions.z <= localPosition.z &&
halfDimensions.z >= localPosition.z;
}
// When x or y dimensions of the mirror change - reset the resolution of the
// spectator camera and edit the mirror local entity to adjust for the new dimensions
function updateMirrorDimensions(forceUpdate) {
if (!mirrorLocalEntityID) {
return;
}
if (mirrorLocalEntityRunning) {
var newDimensions = Entities.getEntityProperties(_this.entityID, 'dimensions').dimensions;
if (forceUpdate === true || (newDimensions.x != lastDimensions.x || newDimensions.y != lastDimensions.y)) {
var mirrorResolution = _this.calculateMirrorResolution(newDimensions);
spectatorCameraConfig.resetSizeSpectatorCamera(mirrorResolution.x, mirrorResolution.y);
Entities.editEntity(mirrorLocalEntityID, {
dimensions: {
x: (Math.max(newDimensions.x, newDimensions.y)),
y: (Math.max(newDimensions.x, newDimensions.y)),
z: 0
}
});
}
lastDimensions = newDimensions;
}
}
// Takes in an mirror scalar number which is used for the index of "halfDimSigns" that is needed to adjust the mirror
// local entity's position. Deletes and re-adds the mirror local entity so the url and position are updated.
function createMirrorLocalEntity() {
if (mirrorLocalEntityID) {
Entities.deleteEntity(mirrorLocalEntityID);
mirrorLocalEntityID = false;
}
if (mirrorLocalEntityRunning) {
mirrorLocalEntityID = Entities.addEntity({
type: "Image",
name: "mirrorLocalEntity",
imageURL: "resource://spectatorCameraFrame",
emissive: true,
parentID: _this.entityID,
alpha: 1,
localPosition: {
x: 0,
y: 0,
z: mirrorLocalEntityOffset
},
localRotation: Quat.fromPitchYawRollDegrees(0, 0, 180),
isVisibleInSecondaryCamera: false
}, "local");
updateMirrorDimensions(true);
}
}
_this.calculateMirrorResolution = function(entityDimensions) {
var mirrorResolutionX, mirrorResolutionY;
if (entityDimensions.x > entityDimensions.y) {
mirrorResolutionX = MAX_MIRROR_RESOLUTION_SIDE_PX;
mirrorResolutionY = Math.round(mirrorResolutionX * entityDimensions.y / entityDimensions.x);
} else {
mirrorResolutionY = MAX_MIRROR_RESOLUTION_SIDE_PX;
mirrorResolutionX = Math.round(mirrorResolutionY * entityDimensions.x / entityDimensions.y);
}
var resolution = {
"x": mirrorResolutionX,
"y": mirrorResolutionY
};
return resolution;
};
// Sets up spectator camera to render the mirror, calls 'createMirrorLocalEntity' once to set up
// mirror local entity, then connects 'updateMirrorDimensions' to update dimension changes
_this.mirrorLocalEntityOn = function(onPreload) {
if (!mirrorLocalEntityRunning) {
if (!spectatorCameraConfig.attachedEntityId) {
mirrorLocalEntityRunning = true;
spectatorCameraConfig.mirrorProjection = true;
spectatorCameraConfig.attachedEntityId = _this.entityID;
previousFarClipDistance = spectatorCameraConfig.farClipPlaneDistance;
spectatorCameraConfig.farClipPlaneDistance = FAR_CLIP_DISTANCE;
var entityProperties = Entities.getEntityProperties(_this.entityID, ['dimensions']);
var mirrorEntityDimensions = entityProperties.dimensions;
var initialResolution = _this.calculateMirrorResolution(mirrorEntityDimensions);
spectatorCameraConfig.resetSizeSpectatorCamera(initialResolution.x, initialResolution.y);
spectatorCameraConfig.enableSecondaryCameraRenderConfigs(true);
createMirrorLocalEntity();
Script.update.connect(updateMirrorDimensions);
} else {
print("Cannot turn on mirror if spectator camera is already in use");
}
}
};
// Resets spectator camera, deletes the mirror local entity, and disconnects 'updateMirrorDimensions'
_this.mirrorLocalEntityOff = function() {
if (mirrorLocalEntityRunning) {
spectatorCameraConfig.enableSecondaryCameraRenderConfigs(false);
spectatorCameraConfig.mirrorProjection = false;
spectatorCameraConfig.attachedEntityId = null;
spectatorCameraConfig.farClipPlaneDistance = previousFarClipDistance;
if (mirrorLocalEntityID) {
Entities.deleteEntity(mirrorLocalEntityID);
mirrorLocalEntityID = false;
}
Script.update.disconnect(updateMirrorDimensions);
mirrorLocalEntityRunning = false;
}
};
// ENTITY FUNCTIONS
_this.preload = function(entityID) {
_this.entityID = entityID;
mirrorlocalEntityRunning = false;
// If avatar is already inside the mirror zone at the time preload is called then turn on the mirror
var children = Entities.getChildrenIDs(_this.entityID);
var childZero = Entities.getEntityProperties(children[0]);
if (isPositionInsideBox(MyAvatar.position, {
position: childZero.position,
rotation: childZero.rotation,
dimensions: childZero.dimensions
})) {
_this.mirrorLocalEntityOn(true);
}
};
// Turn off mirror on unload
_this.unload = function(entityID) {
_this.mirrorLocalEntityOff();
};
});

View file

@ -0,0 +1,32 @@
//
// mirrorReflection.js
//
// Created by Rebecca Stankus on 8/30/17.
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
// Attach `mirrorReflection.js` to a zone entity that is parented to
// the box entity whose Script is `mirrorClient.js`.
// When a user enters this zone, the mirror will turn on.
// When a user leaves this zone, the mirror will turn off.
(function () {
var mirrorID, reflectionAreaID;
// get id of reflection area and mirror
this.preload = function(entityID) {
reflectionAreaID = entityID;
mirrorID = Entities.getEntityProperties(reflectionAreaID, 'parentID').parentID;
};
// when avatar enters reflection area, begin reflecting
this.enterEntity = function(entityID){
Entities.callEntityMethod(mirrorID, 'mirrorLocalEntityOn');
};
// when avatar leaves reflection area, stop reflecting
this.leaveEntity = function (entityID) {
Entities.callEntityMethod(mirrorID, 'mirrorLocalEntityOff');
};
});

View file

@ -0,0 +1,47 @@
//
// portal.js
// Created by Zach Fox on 2019-05-23
// Copyright 2019 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
(function () {
var Portal = function() {};
Portal.prototype = {
enterEntity: function (id) {
var properties = Entities.getEntityProperties(id, ["userData"]);
var userData;
try {
userData = JSON.parse(properties.userData);
} catch (e) {
console.error("Error parsing userData: ", e);
}
if (userData) {
if (userData.destination) {
var destination = userData.destination;
if (userData.destination.indexOf("bookmark:") > -1) {
var bookmarkName = userData.destination.replace("bookmark:", "");
destination = LocationBookmarks.getAddress(bookmarkName);
}
Window.location = destination;
} else {
console.log("Please specify `destination` inside this entity's `userData`!");
return;
}
} else {
console.log("Please specify this entity's `userData`! See README.md for instructions.");
return;
}
}
};
return new Portal();
});

View file

@ -0,0 +1,202 @@
/* eslint-disable no-magic-numbers */
//
// soundEmitter.js
//
// Created by Zach Fox on 2019-07-05
// Copyright High Fidelity 2019
//
// Licensed under the Apache 2.0 License
// See accompanying license file or http://apache.org/
//
(function() {
var that;
var SOUND_EMITTER_UPDATE_INTERVAL_MS = 500;
var DEFAULT_AUDIO_INJECTOR_OPTIONS = {
"position": {
"x": 0,
"y": 0,
"z": 0
},
"volume": 0.5,
"loop": false,
"localOnly": false
};
var SoundEmitter = function() {
that = this;
that.entityID = false;
that.soundObjectURL = false;
that.soundObject = false;
that.audioInjector = false;
that.audioInjectorOptions = DEFAULT_AUDIO_INJECTOR_OPTIONS;
that.signalsConnected = {};
that.soundEmitterUpdateInterval = false;
};
SoundEmitter.prototype = {
preload: function(entityID) {
that.entityID = entityID;
var properties = Entities.getEntityProperties(that.entityID, ["userData"]);
var userData;
try {
userData = JSON.parse(properties.userData);
} catch (e) {
console.error("Error parsing userData: ", e);
}
if (userData) {
if (userData.soundURL && userData.soundURL.length > 0) {
that.handleNewSoundURL(userData.soundURL);
} else {
console.log("Please specify this entity's `userData`! See README.md for instructions.");
return;
}
} else {
console.log("Please specify this entity's `userData`! See README.md for instructions.");
return;
}
},
clearCurrentSoundData: function() {
that.soundObjectURL = false;
if (that.signalsConnected["soundObjectReady"]) {
that.soundObject.ready.disconnect(that.updateSoundEmitter);
that.signalsConnected["soundObjectReady"] = false;
}
that.soundObject = false;
if (that.audioInjector) {
if (that.audioInjector.playing) {
that.audioInjector.stop();
}
that.audioInjector = false;
}
that.audioInjectorOptions = DEFAULT_AUDIO_INJECTOR_OPTIONS;
if (that.soundEmitterUpdateInterval) {
Script.clearInterval(that.soundEmitterUpdateInterval);
that.soundEmitterUpdateInterval = false;
}
},
unload: function() {
that.clearCurrentSoundData();
},
handleNewSoundURL: function(newSoundURL) {
that.clearCurrentSoundData();
that.soundObjectURL = newSoundURL;
that.soundObject = SoundCache.getSound(that.soundObjectURL);
if (that.soundObject.downloaded) {
that.updateSoundEmitter();
} else {
that.soundObject.ready.connect(that.updateSoundEmitter);
that.signalsConnected["soundObjectReady"] = true;
}
},
positionChanged: function(newPos) {
return (newPos.x !== that.audioInjectorOptions.position.x ||
newPos.y !== that.audioInjectorOptions.position.y ||
newPos.z !== that.audioInjectorOptions.position.z);
},
updateSoundEmitter: function() {
var properties = Entities.getEntityProperties(that.entityID, ["userData", "position", "script", "serverScripts"]);
var userData;
try {
userData = JSON.parse(properties.userData);
} catch (e) {
console.error("Error parsing userData: ", e);
}
var optionsChanged = false;
var shouldRestartPlayback = false;
var newPosition = properties.position;
if (userData) {
if (userData.soundURL && userData.soundURL.length > 0 && userData.soundURL !== that.soundObjectURL) {
console.log("Sound Emitter: User put a new sound URL into `userData`! Resetting...");
that.handleNewSoundURL(userData.soundURL);
return;
}
if (typeof(userData.volume) !== "undefined" && !isNaN(userData.volume) && userData.volume !== that.audioInjectorOptions.volume) {
optionsChanged = true;
that.audioInjectorOptions.volume = userData.volume;
}
if (typeof(userData.shouldLoop) !== "undefined" && userData.shouldLoop !== that.audioInjectorOptions.shouldLoop) {
optionsChanged = true;
if (!that.audioInjectorOptions.loop && userData.shouldLoop && that.audioInjector && !that.audioInjector.playing) {
shouldRestartPlayback = true;
}
that.audioInjectorOptions.loop = userData.shouldLoop;
}
if (typeof(userData.positionOverride) !== "undefined" && !isNaN(userData.positionOverride.x) &&
!isNaN(userData.positionOverride.y) && !isNaN(userData.positionOverride.z)) {
newPosition = userData.positionOverride;
}
} else {
console.log("Please specify this entity's `userData`! See README.md for instructions.");
that.clearCurrentSoundData();
return;
}
var localOnly = that.audioInjectorOptions.localOnly;
// If this script is attached as a client entity script...
if (properties.script.indexOf("soundEmitter.js") > -1) {
// ... Make sure that the audio injector IS local only.
localOnly = true;
// Else if this script is attached as a client server script...
} else if (properties.serverScripts.indexOf("soundEmitter.js") > -1) {
// ... Make sure that the audio injector IS NOT local only.
localOnly = false;
}
if (localOnly !== that.audioInjectorOptions.localOnly) {
optionsChanged = true;
that.audioInjectorOptions.localOnly = localOnly;
}
if (that.positionChanged(newPosition)) {
optionsChanged = true;
that.audioInjectorOptions["position"] = newPosition;
}
if (!that.audioInjector || shouldRestartPlayback) {
that.audioInjector = Audio.playSound(that.soundObject, that.audioInjectorOptions);
} else if (optionsChanged) {
that.audioInjector.setOptions(that.audioInjectorOptions);
}
if (!that.soundEmitterUpdateInterval) {
that.soundEmitterUpdateInterval = Script.setInterval(that.updateSoundEmitter, SOUND_EMITTER_UPDATE_INTERVAL_MS);
}
}
};
return new SoundEmitter();
});

View file

@ -0,0 +1,77 @@
'use strict';
//
// wizardLoader.js
//
// Created by Kalila L. on Feb 19 2021.
// Copyright 2021 Vircadia contributors.
//
// This script is used to load the onboarding wizard at the location of the entity it's on.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
(function() {
var CONFIG_WIZARD_WEB_URL = 'https://cdn-1.vircadia.com/us-e-1/DomainContent/Tutorial/Apps/configWizard/dist/index.html';
var loaderEntityID;
var configWizardEntityID;
function onWebAppEventReceived(sendingEntityID, event) {
if (sendingEntityID === configWizardEntityID) {
var eventJSON = JSON.parse(event);
if (eventJSON.command === 'first-run-wizard-ready') {
var objectToSend = {
command: 'script-to-web-initialize',
data: {
performancePreset: Performance.getPerformancePreset(),
refreshRateProfile: Performance.getRefreshRateProfile(),
displayName: MyAvatar.displayName
}
};
Entities.emitScriptEvent(configWizardEntityID, JSON.stringify(objectToSend));
}
if (eventJSON.command === 'complete-wizard') {
Performance.setPerformancePreset(eventJSON.data.performancePreset);
Performance.setRefreshRateProfile(eventJSON.data.refreshRateProfile);
MyAvatar.displayName = eventJSON.data.displayName;
Entities.deleteEntity(configWizardEntityID);
Entities.webEventReceived.disconnect(onWebAppEventReceived);
}
}
}
this.preload = function (entityID) {
loaderEntityID = entityID;
var loaderEntityProps = Entities.getEntityProperties(loaderEntityID, ['position', 'rotation']);
configWizardEntityID = Entities.addEntity({
type: 'Web',
sourceUrl: CONFIG_WIZARD_WEB_URL,
maxFPS: 60,
dpi: 20,
useBackground: false,
grab: {
grabbable: false
},
position: loaderEntityProps.position,
rotation: loaderEntityProps.rotation,
dimensions: { x: 1.4, y: 0.75, z: 0 }
}, 'local');
Entities.webEventReceived.connect(onWebAppEventReceived);
}
this.unload = function () {
if (configWizardEntityID) {
Entities.deleteEntity(configWizardEntityID);
Entities.webEventReceived.disconnect(onWebAppEventReceived);
}
}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1011,7 +1011,7 @@ const bool DEFAULT_HMD_TABLET_BECOMES_TOOLBAR = false;
const bool DEFAULT_PREFER_STYLUS_OVER_LASER = false;
const bool DEFAULT_PREFER_AVATAR_FINGER_OVER_STYLUS = false;
const QString DEFAULT_CURSOR_NAME = "DEFAULT";
const bool DEFAULT_MINI_TABLET_ENABLED = true;
const bool DEFAULT_MINI_TABLET_ENABLED = false;
const bool DEFAULT_AWAY_STATE_WHEN_FOCUS_LOST_IN_VR_ENABLED = true;
QSharedPointer<OffscreenUi> getOffscreenUI() {

View file

@ -4,6 +4,7 @@
//
// Created by Clement on 1/16/15.
// Copyright 2015 High Fidelity, Inc.
// Copyright 2021 Vircadia contributors.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@ -19,8 +20,12 @@
#include "ui/DialogsManager.h"
#include "InterfaceLogging.h"
Setting::Handle<int> desktopWorldDetailQuality("desktopWorldDetailQuality", (int)DEFAULT_WORLD_DETAIL_QUALITY);
Setting::Handle<int> hmdWorldDetailQuality("hmdWorldDetailQuality", (int)DEFAULT_WORLD_DETAIL_QUALITY);
const QString LOD_SETTINGS_PREFIX { "lodManager/" };
Setting::Handle<bool> automaticLODAdjust(LOD_SETTINGS_PREFIX + "automaticLODAdjust", (bool)DEFAULT_LOD_AUTO_ADJUST);
Setting::Handle<float> lodHalfAngle(LOD_SETTINGS_PREFIX + "lodHalfAngle", (float)getHalfAngleFromVisibilityDistance(DEFAULT_VISIBILITY_DISTANCE_FOR_UNIT_ELEMENT));
Setting::Handle<int> desktopWorldDetailQuality(LOD_SETTINGS_PREFIX + "desktopWorldDetailQuality", (int)DEFAULT_WORLD_DETAIL_QUALITY);
Setting::Handle<int> hmdWorldDetailQuality(LOD_SETTINGS_PREFIX + "hmdWorldDetailQuality", (int)DEFAULT_WORLD_DETAIL_QUALITY);
LODManager::LODManager() {
}
@ -188,12 +193,14 @@ void LODManager::setVisibilityDistance(float distance) {
// Maintain behavior with deprecated _boundaryLevelAdjust property
float userDistance = distance / powf(2.0f, _boundaryLevelAdjust);
_lodHalfAngle = getHalfAngleFromVisibilityDistance(userDistance);
saveSettings();
}
void LODManager::setLODAngleDeg(float lodAngle) {
auto newLODAngleDeg = std::max(0.001f, std::min(lodAngle, 90.f));
auto newLODHalfAngle = glm::radians(newLODAngleDeg * 0.5f);
_lodHalfAngle = newLODHalfAngle;
saveSettings();
}
void LODManager::setSmoothScale(float t) {
@ -244,6 +251,7 @@ void LODManager::resetLODAdjust() {
void LODManager::setAutomaticLODAdjust(bool value) {
std::lock_guard<std::mutex> { _automaticLODLock };
_automaticLODAdjust = value;
saveSettings();
emit autoLODChanged();
}
@ -330,14 +338,19 @@ void LODManager::loadSettings() {
if (qApp->property(hifi::properties::OCULUS_STORE).toBool() && firstRun.get()) {
hmdQuality = WORLD_DETAIL_HIGH;
}
_automaticLODAdjust = automaticLODAdjust.get();
_lodHalfAngle = lodHalfAngle.get();
setWorldDetailQuality(desktopQuality, false);
setWorldDetailQuality(hmdQuality, true);
}
void LODManager::saveSettings() {
automaticLODAdjust.set((bool)_automaticLODAdjust);
desktopWorldDetailQuality.set((int)_desktopWorldDetailQuality);
hmdWorldDetailQuality.set((int)_hmdWorldDetailQuality);
lodHalfAngle.set((float)_lodHalfAngle);
}
const float MIN_DECREASE_FPS = 0.5f;
@ -405,6 +418,7 @@ void LODManager::setWorldDetailQuality(WorldDetailQuality quality, bool isHMDMod
void LODManager::setWorldDetailQuality(WorldDetailQuality quality) {
setWorldDetailQuality(quality, qApp->isHMDMode());
saveSettings();
emit worldDetailQualityChanged();
}

View file

@ -4,6 +4,7 @@
//
// Created by Clement on 1/16/15.
// Copyright 2015 High Fidelity, Inc.
// Copyright 2021 Vircadia contributors.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@ -44,10 +45,12 @@ enum WorldDetailQuality {
};
Q_DECLARE_METATYPE(WorldDetailQuality);
const bool DEFAULT_LOD_AUTO_ADJUST = false; // true for auto, false for manual.
#ifdef Q_OS_ANDROID
const float LOD_DEFAULT_QUALITY_LEVEL = 0.2f; // default quality level setting is High (lower framerate)
const float DEFAULT_LOD_QUALITY_LEVEL = 0.2f; // default quality level setting is High (lower framerate)
#else
const float LOD_DEFAULT_QUALITY_LEVEL = 0.5f; // default quality level setting is Mid
const float DEFAULT_LOD_QUALITY_LEVEL = 0.5f; // default quality level setting is Mid
#endif
#ifdef Q_OS_ANDROID
@ -255,7 +258,6 @@ public:
*/
Q_INVOKABLE float getLODTargetFPS() const;
float getPresentTime() const { return _presentTime; }
float getEngineRunTime() const { return _engineRunTime; }
float getBatchTime() const { return _batchTime; }
@ -351,7 +353,7 @@ private:
void setWorldDetailQuality(WorldDetailQuality quality, bool isHMDMode);
std::mutex _automaticLODLock;
bool _automaticLODAdjust = true;
bool _automaticLODAdjust = DEFAULT_LOD_AUTO_ADJUST;
float _presentTime{ 0.0f }; // msec
float _engineRunTime{ 0.0f }; // msec
@ -362,7 +364,7 @@ private:
float _smoothScale{ 10.0f }; // smooth is evaluated over 10 times longer than now
float _smoothRenderTime{ 0.0f }; // msec
float _lodQualityLevel{ LOD_DEFAULT_QUALITY_LEVEL };
float _lodQualityLevel{ DEFAULT_LOD_QUALITY_LEVEL };
WorldDetailQuality _desktopWorldDetailQuality { DEFAULT_WORLD_DETAIL_QUALITY };
WorldDetailQuality _hmdWorldDetailQuality { DEFAULT_WORLD_DETAIL_QUALITY };

View file

@ -362,10 +362,10 @@ void setupPreferences() {
auto getter = [myAvatar]()->float { return qApp->getCamera().getSensitivity(); };
auto setter = [myAvatar](float value) { qApp->getCamera().setSensitivity(value); };
auto preference = new SpinnerSliderPreference(VR_MOVEMENT, "Camera Sensitivity", getter, setter);
preference->setMin(0.01f);
preference->setMin(0.1f);
preference->setMax(5.0f);
preference->setStep(0.1f);
preference->setDecimals(2);
preference->setDecimals(1);
preferences->addPreference(preference);
}
{
@ -385,7 +385,7 @@ void setupPreferences() {
preference->setMin(6.0f);
preference->setMax(30.0f);
preference->setStep(1);
preference->setDecimals(2);
preference->setDecimals(0);
preferences->addPreference(preference);
}
{
@ -465,8 +465,8 @@ void setupPreferences() {
auto preference = new SpinnerPreference(VR_MOVEMENT, "User real-world height (meters)", getter, setter);
preference->setMin(1.0f);
preference->setMax(2.2f);
preference->setDecimals(3);
preference->setStep(0.001f);
preference->setDecimals(2);
preference->setStep(0.01f);
preferences->addPreference(preference);
}
@ -478,7 +478,7 @@ void setupPreferences() {
preference->setMin(1.0f);
preference->setMax(360.0f);
preference->setStep(1);
preference->setDecimals(1);
preference->setDecimals(0);
preferences->addPreference(preference);
}
{
@ -488,7 +488,7 @@ void setupPreferences() {
preference->setMin(1.0f);
preference->setMax(360.0f);
preference->setStep(1);
preference->setDecimals(1);
preference->setDecimals(0);
preferences->addPreference(preference);
}

View file

@ -47,7 +47,7 @@
const QString FILENAME_PATH_FORMAT = "vircadia-snap-by-%1-on-%2.jpg";
const QString DATETIME_FORMAT = "yyyy-MM-dd_hh-mm-ss";
const QString SNAPSHOTS_DIRECTORY = "Snapshots";
const QString URL = "highfidelity_url";
const QString URL = "vircadia_url";
static const int SNAPSHOT_360_TIMER_INTERVAL = 350;
static const QList<QString> SUPPORTED_IMAGE_FORMATS = { "jpg", "jpeg", "png" };

View file

@ -1,6 +1,6 @@
set(TARGET_NAME animation)
setup_hifi_library(Network Script)
link_hifi_libraries(shared graphics fbx)
link_hifi_libraries(shared graphics model-serializers)
include_hifi_library_headers(networking)
include_hifi_library_headers(gpu)
include_hifi_library_headers(hfm)

View file

@ -4,7 +4,7 @@ link_hifi_libraries(shared shaders gpu graphics animation material-networking mo
include_hifi_library_headers(avatars)
include_hifi_library_headers(networking)
include_hifi_library_headers(hfm)
include_hifi_library_headers(fbx)
include_hifi_library_headers(model-serializers)
include_hifi_library_headers(recording)
include_hifi_library_headers(ktx)
include_hifi_library_headers(procedural)

View file

@ -1,7 +1,7 @@
set(TARGET_NAME baking)
setup_hifi_library(Concurrent)
link_hifi_libraries(shared shaders graphics networking procedural graphics-scripting ktx image fbx model-baker task)
link_hifi_libraries(shared shaders graphics networking procedural graphics-scripting ktx image model-serializers model-baker task)
include_hifi_library_headers(gpu)
include_hifi_library_headers(hfm)
include_hifi_library_headers(material-networking)
include_hifi_library_headers(material-networking)

View file

@ -7,7 +7,7 @@ include_hifi_library_headers(model-networking)
include_hifi_library_headers(networking)
include_hifi_library_headers(graphics)
include_hifi_library_headers(hfm)
include_hifi_library_headers(fbx)
include_hifi_library_headers(model-serializers)
include_hifi_library_headers(image)
include_hifi_library_headers(ktx)
include_hifi_library_headers(render)

View file

@ -9,7 +9,7 @@ include_hifi_library_headers(audio)
include_hifi_library_headers(physics)
include_hifi_library_headers(animation)
include_hifi_library_headers(hfm)
include_hifi_library_headers(fbx)
include_hifi_library_headers(model-serializers)
include_hifi_library_headers(entities)
include_hifi_library_headers(avatars)
include_hifi_library_headers(controllers)

View file

@ -1,8 +1,8 @@
set(TARGET_NAME entities)
setup_hifi_library(Network Script)
target_include_directories(${TARGET_NAME} PRIVATE "${OPENSSL_INCLUDE_DIR}")
target_include_directories(${TARGET_NAME} PRIVATE "${OPENSSL_INCLUDE_DIR}")
include_hifi_library_headers(hfm)
include_hifi_library_headers(fbx)
include_hifi_library_headers(model-serializers)
include_hifi_library_headers(gpu)
include_hifi_library_headers(image)
include_hifi_library_headers(ktx)

View file

@ -1,9 +1,9 @@
set(TARGET_NAME gpu-gl)
setup_hifi_library(Concurrent)
link_hifi_libraries(shared gl gpu gpu-gl-common shaders)
if (UNIX)
if (UNIX AND NOT VIRCADIA_THREAD_DEBUGGING)
target_link_libraries(${TARGET_NAME} pthread)
endif(UNIX)
endif(UNIX AND NOT VIRCADIA_THREAD_DEBUGGING)
GroupSources("src")
set(OpenGL_GL_PREFERENCE "LEGACY")

View file

@ -1,4 +1,4 @@
set(TARGET_NAME graphics-scripting)
setup_hifi_library()
link_hifi_libraries(shared networking graphics fbx image material-networking model-networking script-engine)
link_hifi_libraries(shared networking graphics model-serializers image material-networking model-networking script-engine)
include_hifi_library_headers(gpu)

View file

@ -1,9 +1,9 @@
set(TARGET_NAME model-networking)
setup_hifi_library()
link_hifi_libraries(shared shaders networking graphics fbx procedural model-baker)
link_hifi_libraries(shared shaders networking graphics model-serializers procedural model-baker)
include_hifi_library_headers(hfm)
include_hifi_library_headers(task)
include_hifi_library_headers(gpu)
include_hifi_library_headers(image)
include_hifi_library_headers(ktx)
include_hifi_library_headers(material-networking)
include_hifi_library_headers(material-networking)

View file

@ -1,4 +1,4 @@
set(TARGET_NAME fbx)
set(TARGET_NAME model-serializers)
setup_hifi_library()
link_hifi_libraries(shared graphics networking image hfm)

View file

@ -1,6 +1,6 @@
//
// FBX.h
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Ryan Huffman on 9/5/17.
// Copyright 2017 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXSerializer.cpp
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Andrzej Kapolka on 9/18/13.
// Copyright 2013 High Fidelity, Inc.
@ -404,7 +404,7 @@ HFMModel* FBXSerializer::extractHFMModel(const hifi::VariantHash& mapping, const
QVector<ExtractedBlendshape> blendshapes;
QHash<QString, FBXModel> fbxModels;
QHash<QString, Cluster> clusters;
QHash<QString, Cluster> clusters;
QHash<QString, AnimationCurve> animationCurves;
QHash<QString, QString> typeFlags;
@ -1236,7 +1236,7 @@ HFMModel* FBXSerializer::extractHFMModel(const hifi::VariantHash& mapping, const
// models with clusters must be parented to the cluster top
// Unless the model is a root node.
bool isARootNode = !modelIDs.contains(_connectionParentMap.value(fbxModel.key()));
if (!isARootNode) {
if (!isARootNode) {
foreach(const QString& deformerID, _connectionChildMap.values(fbxModel.key())) {
foreach(const QString& clusterID, _connectionChildMap.values(deformerID)) {
if (!clusters.contains(clusterID)) {

View file

@ -1,6 +1,6 @@
//
// FBXSerializer.h
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Andrzej Kapolka on 9/18/13.
// Copyright 2013 High Fidelity, Inc.
@ -69,7 +69,7 @@ public:
useMaterial(true),
isDefault(true)
{}
TextureParam(const TextureParam& src) :
cropping(src.cropping),
UVSet(src.UVSet),
@ -81,7 +81,7 @@ public:
useMaterial(src.useMaterial),
isDefault(src.isDefault)
{}
};
class MaterialParam {

View file

@ -1,6 +1,6 @@
//
// FBXSerializer_Material.cpp
// interface/src/fbx
// libraries/model-serializers/src
//
// Created by Sam Gateau on 8/27/2015.
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXSerializer_Mesh.cpp
// interface/src/fbx
// libraries/model-serializers/src
//
// Created by Sam Gateau on 8/27/2015.
// Copyright 2015 High Fidelity, Inc.
@ -106,7 +106,7 @@ void appendIndex(MeshData& data, QVector<int>& indices, int index, bool deduplic
}
Vertex vertex;
vertex.originalIndex = vertexIndex;
glm::vec3 position;
if (vertexIndex < data.vertices.size()) {
position = data.vertices.at(vertexIndex);
@ -114,7 +114,7 @@ void appendIndex(MeshData& data, QVector<int>& indices, int index, bool deduplic
glm::vec3 normal;
int normalIndex = data.normalsByVertex ? vertexIndex : index;
if (data.normalIndices.isEmpty()) {
if (data.normalIndices.isEmpty()) {
if (normalIndex < data.normals.size()) {
normal = data.normals.at(normalIndex);
}
@ -130,7 +130,7 @@ void appendIndex(MeshData& data, QVector<int>& indices, int index, bool deduplic
bool hasColors = (data.colors.size() > 0);
if (hasColors) {
int colorIndex = data.colorsByVertex ? vertexIndex : index;
if (data.colorIndices.isEmpty()) {
if (data.colorIndices.isEmpty()) {
if (colorIndex < data.colors.size()) {
color = data.colors.at(colorIndex);
}
@ -152,7 +152,7 @@ void appendIndex(MeshData& data, QVector<int>& indices, int index, bool deduplic
vertex.texCoord = data.texCoords.at(texCoordIndex);
}
}
bool hasMoreTexcoords = (data.attributes.size() > 1);
if (hasMoreTexcoords) {
if (data.attributes[1].texCoordIndices.empty()) {
@ -222,7 +222,7 @@ ExtractedMesh FBXSerializer::extractMesh(const FBXNode& object, unsigned int& me
} else if (subdata.name == "MappingInformationType" && subdata.properties.at(0) == BY_VERTICE) {
data.normalsByVertex = true;
} else if (subdata.name == "ReferenceInformationType" && subdata.properties.at(0) == INDEX_TO_DIRECT) {
indexToDirect = true;
}
@ -242,7 +242,7 @@ ExtractedMesh FBXSerializer::extractMesh(const FBXNode& object, unsigned int& me
} else if (subdata.name == "MappingInformationType" && subdata.properties.at(0) == BY_VERTICE) {
data.colorsByVertex = true;
} else if (subdata.name == "ReferenceInformationType" && subdata.properties.at(0) == INDEX_TO_DIRECT) {
indexToDirect = true;
}
@ -264,7 +264,7 @@ ExtractedMesh FBXSerializer::extractMesh(const FBXNode& object, unsigned int& me
qCDebug(modelformat) << "LayerElementColor has an average value of 0.0f... let's forget it.";
}
#endif
} else if (child.name == "LayerElementUV") {
if (child.properties.at(0).toInt() == 0) {
AttributeData attrib;
@ -278,7 +278,7 @@ ExtractedMesh FBXSerializer::extractMesh(const FBXNode& object, unsigned int& me
attrib.texCoordIndices = getIntVector(subdata);
} else if (subdata.name == "Name") {
attrib.name = subdata.properties.at(0).toString();
}
}
#if defined(DEBUG_FBXSERIALIZER)
else {
int unknown = 0;
@ -579,6 +579,6 @@ ExtractedMesh FBXSerializer::extractMesh(const FBXNode& object, unsigned int& me
}
}
}
return data.extracted;
}

View file

@ -1,6 +1,6 @@
//
// FBXSerializer_Node.cpp
// interface/src/fbx
// libraries/model-serializers/src
//
// Created by Sam Gateau on 8/27/2015.
// Copyright 2015 High Fidelity, Inc.
@ -183,7 +183,7 @@ FBXNode parseBinaryFBXNode(QDataStream& in, int& position, bool has64BitPosition
// FBX 2016 and beyond uses 64bit positions in the node headers, pre-2016 used 32bit values
// our code generally doesn't care about the size that much, so we will use 64bit values
// from here on out, but if the file is an older format we read the stream into temp 32bit
// from here on out, but if the file is an older format we read the stream into temp 32bit
// values and then assign to our actual 64bit values.
if (has64BitPositions) {
in >> endOffset;
@ -335,8 +335,8 @@ FBXNode parseTextFBXNode(Tokenizer& tokenizer) {
if ((token = tokenizer.nextToken()) == ':') {
tokenizer.ungetChar(':');
tokenizer.pushBackToken(Tokenizer::DATUM_TOKEN);
return node;
return node;
} else {
tokenizer.pushBackToken(token);
node.properties.append(datum);

View file

@ -1,6 +1,6 @@
//
// FBXToJSON.cpp
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Simon Walton on 5/4/2018.
// Copyright 2018 High Fidelity, Inc.
@ -61,7 +61,7 @@ FBXToJSON& FBXToJSON::operator<<(const FBXNode& fbxNode) {
case QMetaType::QByteArray:
*this << '"' << stringEscape(prop.toByteArray().toStdString()) << '"';
break;
default:
if (prop.canConvert<QVector<float>>()) {
*this << prop.value<QVector<float>>();
@ -95,7 +95,7 @@ FBXToJSON& FBXToJSON::operator<<(const FBXNode& fbxNode) {
string FBXToJSON::stringEscape(const string& in) {
string out;
out.reserve(in.length());
for (unsigned char inChar: in) {
if (inChar == '"') {
out.append(R"(\")");

View file

@ -1,6 +1,6 @@
//
// FBXToJSON.h
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Simon Walton on 5/4/2018.
// Copyright 2018 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXWriter.cpp
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Ryan Huffman on 9/5/17.
// Copyright 2017 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXWriter.h
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Ryan Huffman on 9/5/17.
// Copyright 2017 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// GLTFSerializer.cpp
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Luis Cuenca on 8/30/17.
// Copyright 2017 High Fidelity, Inc.
@ -148,7 +148,7 @@ bool GLTFSerializer::getObjectArrayVal(const QJsonObject& object, const QString&
}
hifi::ByteArray GLTFSerializer::setGLBChunks(const hifi::ByteArray& data) {
int byte = 4;
int byte = 4;
int jsonStart = data.indexOf("JSON", Qt::CaseSensitive);
int binStart = data.indexOf("BIN", Qt::CaseSensitive);
int jsonLength, binLength;
@ -271,7 +271,7 @@ bool GLTFSerializer::setAsset(const QJsonObject& object) {
QJsonObject jsAsset;
bool isAssetDefined = getObjectVal(object, "asset", jsAsset, _file.defined);
if (isAssetDefined) {
if (!getStringVal(jsAsset, "version", _file.asset.version,
if (!getStringVal(jsAsset, "version", _file.asset.version,
_file.asset.defined) || _file.asset.version != "2.0") {
return false;
}
@ -318,7 +318,7 @@ GLTFAccessor::GLTFAccessorSparse GLTFSerializer::createAccessorSparse(const QJso
bool GLTFSerializer::addAccessor(const QJsonObject& object) {
GLTFAccessor accessor;
getIntVal(object, "bufferView", accessor.bufferView, accessor.defined);
getIntVal(object, "byteOffset", accessor.byteOffset, accessor.defined);
getIntVal(object, "componentType", accessor.componentType, accessor.defined);
@ -344,7 +344,7 @@ bool GLTFSerializer::addAccessor(const QJsonObject& object) {
bool GLTFSerializer::addAnimation(const QJsonObject& object) {
GLTFAnimation animation;
QJsonArray channels;
if (getObjectArrayVal(object, "channels", channels, animation.defined)) {
foreach(const QJsonValue & v, channels) {
@ -355,7 +355,7 @@ bool GLTFSerializer::addAnimation(const QJsonObject& object) {
if (getObjectVal(v.toObject(), "target", jsChannel, channel.defined)) {
getIntVal(jsChannel, "node", channel.target.node, channel.target.defined);
getIntVal(jsChannel, "path", channel.target.path, channel.target.defined);
}
}
}
}
}
@ -374,7 +374,7 @@ bool GLTFSerializer::addAnimation(const QJsonObject& object) {
}
}
}
_file.animations.push_back(animation);
return true;
@ -382,20 +382,20 @@ bool GLTFSerializer::addAnimation(const QJsonObject& object) {
bool GLTFSerializer::addBufferView(const QJsonObject& object) {
GLTFBufferView bufferview;
getIntVal(object, "buffer", bufferview.buffer, bufferview.defined);
getIntVal(object, "byteLength", bufferview.byteLength, bufferview.defined);
getIntVal(object, "byteOffset", bufferview.byteOffset, bufferview.defined);
getIntVal(object, "target", bufferview.target, bufferview.defined);
_file.bufferviews.push_back(bufferview);
return true;
}
bool GLTFSerializer::addBuffer(const QJsonObject& object) {
GLTFBuffer buffer;
getIntVal(object, "byteLength", buffer.byteLength, buffer.defined);
if (_url.path().endsWith("glb")) {
@ -411,13 +411,13 @@ bool GLTFSerializer::addBuffer(const QJsonObject& object) {
}
}
_file.buffers.push_back(buffer);
return true;
}
bool GLTFSerializer::addCamera(const QJsonObject& object) {
GLTFCamera camera;
QJsonObject jsPerspective;
QJsonObject jsOrthographic;
QString type;
@ -437,15 +437,15 @@ bool GLTFSerializer::addCamera(const QJsonObject& object) {
} else if (getStringVal(object, "type", type, camera.defined)) {
camera.type = getCameraType(type);
}
_file.cameras.push_back(camera);
return true;
}
bool GLTFSerializer::addImage(const QJsonObject& object) {
GLTFImage image;
QString mime;
getStringVal(object, "uri", image.uri, image.defined);
if (image.uri.contains("data:image/png;base64,")) {
@ -455,9 +455,9 @@ bool GLTFSerializer::addImage(const QJsonObject& object) {
}
if (getStringVal(object, "mimeType", mime, image.defined)) {
image.mimeType = getImageMimeType(mime);
}
}
getIntVal(object, "bufferView", image.bufferView, image.defined);
_file.images.push_back(image);
return true;
@ -489,20 +489,20 @@ bool GLTFSerializer::addMaterial(const QJsonObject& object) {
getDoubleVal(object, "alphaCutoff", material.alphaCutoff, material.defined);
QJsonObject jsMetallicRoughness;
if (getObjectVal(object, "pbrMetallicRoughness", jsMetallicRoughness, material.defined)) {
getDoubleArrayVal(jsMetallicRoughness, "baseColorFactor",
material.pbrMetallicRoughness.baseColorFactor,
getDoubleArrayVal(jsMetallicRoughness, "baseColorFactor",
material.pbrMetallicRoughness.baseColorFactor,
material.pbrMetallicRoughness.defined);
getIndexFromObject(jsMetallicRoughness, "baseColorTexture",
material.pbrMetallicRoughness.baseColorTexture,
getIndexFromObject(jsMetallicRoughness, "baseColorTexture",
material.pbrMetallicRoughness.baseColorTexture,
material.pbrMetallicRoughness.defined);
getDoubleVal(jsMetallicRoughness, "metallicFactor",
material.pbrMetallicRoughness.metallicFactor,
getDoubleVal(jsMetallicRoughness, "metallicFactor",
material.pbrMetallicRoughness.metallicFactor,
material.pbrMetallicRoughness.defined);
getDoubleVal(jsMetallicRoughness, "roughnessFactor",
material.pbrMetallicRoughness.roughnessFactor,
getDoubleVal(jsMetallicRoughness, "roughnessFactor",
material.pbrMetallicRoughness.roughnessFactor,
material.pbrMetallicRoughness.defined);
getIndexFromObject(jsMetallicRoughness, "metallicRoughnessTexture",
material.pbrMetallicRoughness.metallicRoughnessTexture,
getIndexFromObject(jsMetallicRoughness, "metallicRoughnessTexture",
material.pbrMetallicRoughness.metallicRoughnessTexture,
material.pbrMetallicRoughness.defined);
}
_file.materials.push_back(material);
@ -524,7 +524,7 @@ bool GLTFSerializer::addMesh(const QJsonObject& object) {
getIntVal(jsPrimitive, "mode", primitive.mode, primitive.defined);
getIntVal(jsPrimitive, "indices", primitive.indices, primitive.defined);
getIntVal(jsPrimitive, "material", primitive.material, primitive.defined);
QJsonObject jsAttributes;
if (getObjectVal(jsPrimitive, "attributes", jsAttributes, primitive.defined)) {
QStringList attrKeys = jsAttributes.keys();
@ -550,7 +550,7 @@ bool GLTFSerializer::addMesh(const QJsonObject& object) {
primitive.targets.push_back(target);
}
}
}
}
mesh.primitives.push_back(primitive);
}
}
@ -561,8 +561,8 @@ bool GLTFSerializer::addMesh(const QJsonObject& object) {
if (getObjectVal(object, "extras", jsExtras, mesh.defined)) {
QJsonArray jsTargetNames;
if (getObjectArrayVal(jsExtras, "targetNames", jsTargetNames, extras.defined)) {
foreach (const QJsonValue& tarName, jsTargetNames) {
extras.targetNames.push_back(tarName.toString());
foreach (const QJsonValue& tarName, jsTargetNames) {
extras.targetNames.push_back(tarName.toString());
}
}
mesh.extras = extras;
@ -575,7 +575,7 @@ bool GLTFSerializer::addMesh(const QJsonObject& object) {
bool GLTFSerializer::addNode(const QJsonObject& object) {
GLTFNode node;
getStringVal(object, "name", node.name, node.defined);
getIntVal(object, "camera", node.camera, node.defined);
getIntVal(object, "mesh", node.mesh, node.defined);
@ -630,10 +630,10 @@ bool GLTFSerializer::addSkin(const QJsonObject& object) {
}
bool GLTFSerializer::addTexture(const QJsonObject& object) {
GLTFTexture texture;
GLTFTexture texture;
getIntVal(object, "sampler", texture.sampler, texture.defined);
getIntVal(object, "source", texture.source, texture.defined);
_file.textures.push_back(texture);
return true;
@ -646,8 +646,8 @@ bool GLTFSerializer::parseGLTF(const hifi::ByteArray& data) {
if (_url.path().endsWith("glb") && data.indexOf("glTF") == 0 && data.contains("JSON")) {
jsonChunk = setGLBChunks(data);
}
}
QJsonDocument d = QJsonDocument::fromJson(jsonChunk);
QJsonObject jsFile = d.object();
@ -769,7 +769,7 @@ bool GLTFSerializer::parseGLTF(const hifi::ByteArray& data) {
}
}
}
}
}
return success;
}
@ -789,13 +789,13 @@ glm::mat4 GLTFSerializer::getModelTransform(const GLTFNode& node) {
s = glm::scale(s, scale);
tmat = s * tmat;
}
if (node.defined["rotation"] && node.rotation.size() == 4) {
//quat(x,y,z,w) to quat(w,x,y,z)
glm::quat rotquat = glm::quat(node.rotation[3], node.rotation[0], node.rotation[1], node.rotation[2]);
tmat = glm::mat4_cast(rotquat) * tmat;
}
if (node.defined["translation"] && node.translation.size() == 3) {
glm::vec3 trans = glm::vec3(node.translation[0], node.translation[1], node.translation[2]);
glm::mat4 t = glm::mat4(1.0);
@ -842,7 +842,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
sortedNodes.push_back(nodecount);
++nodecount;
}
// Build transforms
nodecount = 0;
@ -965,8 +965,8 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
std::vector<float>& value = inverseBindValues[s];
int matrixCount = 16 * matrixIndex;
jointInverseBindTransforms[jointIndex] =
glm::mat4(value[matrixCount], value[matrixCount + 1], value[matrixCount + 2], value[matrixCount + 3],
value[matrixCount + 4], value[matrixCount + 5], value[matrixCount + 6], value[matrixCount + 7],
glm::mat4(value[matrixCount], value[matrixCount + 1], value[matrixCount + 2], value[matrixCount + 3],
value[matrixCount + 4], value[matrixCount + 5], value[matrixCount + 6], value[matrixCount + 7],
value[matrixCount + 8], value[matrixCount + 9], value[matrixCount + 10], value[matrixCount + 11],
value[matrixCount + 12], value[matrixCount + 13], value[matrixCount + 14], value[matrixCount + 15]);
} else {
@ -1008,7 +1008,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
setHFMMaterial(hfmMaterial, _file.materials[i]);
}
// Build meshes
nodecount = 0;
hfmModel.meshExtents.reset();
@ -1061,7 +1061,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
qWarning(modelformat) << "Indices accessor index is out of bounds for model " << _url;
continue;
}
GLTFAccessor& indicesAccessor = _file.accessors[indicesAccessorIdx];
// Buffers
@ -1404,7 +1404,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
if (colors.size() == partVerticesCount * colorStride) {
for (int n = 0; n < colors.size(); n += colorStride) {
mesh.colors.push_back(glm::vec3(colors[n], colors[n + 1], colors[n + 2]));
mesh.colors.push_back(ColorUtils::tosRGBVec3(glm::vec3(colors[n], colors[n + 1], colors[n + 2])));
}
} else {
if (meshAttributes.contains("COLOR_0")) {
@ -1550,7 +1550,6 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
typedef QPair<int, float> WeightedIndex;
hifi::VariantHash blendshapeMappings = mapping.value("bs").toHash();
QMultiHash<QString, WeightedIndex> blendshapeIndices;
for (int i = 0;; ++i) {
auto blendshapeName = QString(BLENDSHAPE_NAMES[i]);
if (blendshapeName.isEmpty()) {
@ -1561,7 +1560,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
// Use blendshape from mapping.
foreach(const QVariant& mapping, mappings) {
auto blendshapeMapping = mapping.toList();
blendshapeIndices.insert(blendshapeMapping.at(0).toString(),
blendshapeIndices.insert(blendshapeMapping.at(0).toString(),
WeightedIndex(i, blendshapeMapping.at(1).toFloat()));
}
} else {
@ -1572,6 +1571,32 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
}
}
// If an FST isn't being used and the model is likely from ReadyPlayerMe, add blendshape synonyms.
auto fileTargetNames = _file.meshes[node.mesh].extras.targetNames;
bool likelyReadyPlayerMeFile =
fileTargetNames.contains("browOuterUpLeft")
&& fileTargetNames.contains("browInnerUp")
&& fileTargetNames.contains("browDownLeft")
&& fileTargetNames.contains("eyeBlinkLeft")
&& fileTargetNames.contains("eyeWideLeft")
&& fileTargetNames.contains("mouthLeft")
&& fileTargetNames.contains("viseme_O")
&& fileTargetNames.contains("mouthShrugLower");
if (blendshapeMappings.count() == 0 && likelyReadyPlayerMeFile) {
QHash<QString, QPair<QString, float>>::const_iterator synonym
= READYPLAYERME_BLENDSHAPES_MAP.constBegin();
while (synonym != READYPLAYERME_BLENDSHAPES_MAP.constEnd()) {
if (fileTargetNames.contains(synonym.key())) {
auto blendshape = BLENDSHAPE_LOOKUP_MAP.find(synonym.value().first);
if (blendshape != BLENDSHAPE_LOOKUP_MAP.end()) {
blendshapeIndices.insert(synonym.key(),
WeightedIndex(blendshape.value(), synonym.value().second));
}
}
++synonym;
}
}
// Create blendshapes.
if (!blendshapeIndices.isEmpty()) {
mesh.blendshapes.resize((int)Blendshapes::BlendshapeCount);
@ -1627,7 +1652,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
glm::vec3 transformedVertex = glm::vec3(globalTransforms[nodeIndex] * glm::vec4(vertex, 1.0f));
mesh.meshExtents.addPoint(transformedVertex);
hfmModel.meshExtents.addPoint(transformedVertex);
}
}
}
// Mesh extents must be at least a minimum size, in particular for blendshapes to work on planar meshes.
@ -1664,7 +1689,7 @@ std::unique_ptr<hfm::Serializer::Factory> GLTFSerializer::getFactory() const {
HFMModel::Pointer GLTFSerializer::read(const hifi::ByteArray& data, const hifi::VariantHash& mapping, const hifi::URL& url) {
_url = url;
// Normalize url for local files
hifi::URL normalizeUrl = DependencyManager::get<ResourceManager>()->normalizeURL(_url);
if (normalizeUrl.scheme().isEmpty() || (normalizeUrl.scheme() == "file")) {
@ -1699,7 +1724,7 @@ bool GLTFSerializer::readBinary(const QString& url, hifi::ByteArray& outdata) {
hifi::URL binaryUrl = _url.resolved(url);
std::tie<bool, hifi::ByteArray>(success, outdata) = requestData(binaryUrl);
}
return success;
}
@ -1732,7 +1757,7 @@ std::tuple<bool, hifi::ByteArray> GLTFSerializer::requestData(hifi::URL& url) {
}
hifi::ByteArray GLTFSerializer::requestEmbeddedData(const QString& url) {
QString binaryUrl = url.split(",")[1];
QString binaryUrl = url.split(",")[1];
return binaryUrl.isEmpty() ? hifi::ByteArray() : QByteArray::fromBase64(binaryUrl.toUtf8());
}
@ -1764,7 +1789,7 @@ QNetworkReply* GLTFSerializer::request(hifi::URL& url, bool isTest) {
HFMTexture GLTFSerializer::getHFMTexture(const GLTFTexture& texture) {
HFMTexture fbxtex = HFMTexture();
fbxtex.texcoordSet = 0;
if (texture.defined["source"]) {
QString url = _file.images[texture.source].uri;
@ -1775,7 +1800,7 @@ HFMTexture GLTFSerializer::getHFMTexture(const GLTFTexture& texture) {
if (_url.path().endsWith("glb") && !_glbBinary.isEmpty()) {
int bufferView = _file.images[texture.source].bufferView;
GLTFBufferView& imagesBufferview = _file.bufferviews[bufferView];
int offset = imagesBufferview.byteOffset;
int length = imagesBufferview.byteLength;
@ -1785,7 +1810,7 @@ HFMTexture GLTFSerializer::getHFMTexture(const GLTFTexture& texture) {
}
if (url.contains("data:image/jpeg;base64,") || url.contains("data:image/png;base64,")) {
fbxtex.content = requestEmbeddedData(url);
fbxtex.content = requestEmbeddedData(url);
}
}
return fbxtex;
@ -1815,12 +1840,12 @@ void GLTFSerializer::setHFMMaterial(HFMMaterial& hfmMat, const GLTFMaterial& mat
hfmMat.emissiveTexture = getHFMTexture(_file.textures[material.emissiveTexture]);
hfmMat.useEmissiveMap = true;
}
if (material.defined["normalTexture"]) {
hfmMat.normalTexture = getHFMTexture(_file.textures[material.normalTexture]);
hfmMat.useNormalMap = true;
}
if (material.defined["occlusionTexture"]) {
hfmMat.occlusionTexture = getHFMTexture(_file.textures[material.occlusionTexture]);
hfmMat.useOcclusionMap = true;
@ -1848,7 +1873,7 @@ void GLTFSerializer::setHFMMaterial(HFMMaterial& hfmMat, const GLTFMaterial& mat
if (material.pbrMetallicRoughness.defined["roughnessFactor"]) {
hfmMat._material->setRoughness(material.pbrMetallicRoughness.roughnessFactor);
}
if (material.pbrMetallicRoughness.defined["baseColorFactor"] &&
if (material.pbrMetallicRoughness.defined["baseColorFactor"] &&
material.pbrMetallicRoughness.baseColorFactor.size() == 4) {
glm::vec3 dcolor =
glm::vec3(material.pbrMetallicRoughness.baseColorFactor[0], material.pbrMetallicRoughness.baseColorFactor[1],
@ -1864,7 +1889,7 @@ void GLTFSerializer::setHFMMaterial(HFMMaterial& hfmMat, const GLTFMaterial& mat
template<typename T, typename L>
bool GLTFSerializer::readArray(const hifi::ByteArray& bin, int byteOffset, int count,
QVector<L>& outarray, int accessorType, bool normalized) {
QDataStream blobstream(bin);
blobstream.setByteOrder(QDataStream::LittleEndian);
blobstream.setVersion(QDataStream::Qt_5_9);
@ -1904,7 +1929,7 @@ bool GLTFSerializer::readArray(const hifi::ByteArray& bin, int byteOffset, int c
if (normalized) {
scale = (float)(std::numeric_limits<T>::max)();
}
for (int i = 0; i < count; ++i) {
for (int j = 0; j < bufferCount; ++j) {
if (!blobstream.atEnd()) {
@ -1928,7 +1953,7 @@ bool GLTFSerializer::readArray(const hifi::ByteArray& bin, int byteOffset, int c
template<typename T>
bool GLTFSerializer::addArrayOfType(const hifi::ByteArray& bin, int byteOffset, int count,
QVector<T>& outarray, int accessorType, int componentType, bool normalized) {
switch (componentType) {
case GLTFAccessorComponentType::BYTE: {}
case GLTFAccessorComponentType::UNSIGNED_BYTE: {
@ -1996,7 +2021,7 @@ bool GLTFSerializer::addArrayFromAccessor(GLTFAccessor& accessor, QVector<T>& ou
if (success) {
for (int i = 0; i < accessor.sparse.count; ++i) {
if ((i * 3) + 2 < out_sparse_values_array.size()) {
if ((i * 3) + 2 < out_sparse_values_array.size()) {
if ((out_sparse_indices_array[i] * 3) + 2 < outarray.length()) {
for (int j = 0; j < 3; ++j) {
outarray[(out_sparse_indices_array[i] * 3) + j] = out_sparse_values_array[(i * 3) + j];
@ -2018,8 +2043,8 @@ bool GLTFSerializer::addArrayFromAccessor(GLTFAccessor& accessor, QVector<T>& ou
return success;
}
void GLTFSerializer::retriangulate(const QVector<int>& inIndices, const QVector<glm::vec3>& in_vertices,
const QVector<glm::vec3>& in_normals, QVector<int>& outIndices,
void GLTFSerializer::retriangulate(const QVector<int>& inIndices, const QVector<glm::vec3>& in_vertices,
const QVector<glm::vec3>& in_normals, QVector<int>& outIndices,
QVector<glm::vec3>& out_vertices, QVector<glm::vec3>& out_normals) {
for (int i = 0; i < inIndices.size(); i = i + 3) {

View file

@ -1,6 +1,6 @@
//
// GLTFSerializer.h
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Luis Cuenca on 8/30/17.
// Copyright 2017 High Fidelity, Inc.
@ -343,7 +343,7 @@ struct GLTFCamera {
QString name;
GLTFCameraPerspective perspective; //required (or)
GLTFCameraOrthographic orthographic; //required (or)
int type;
int type;
QMap<QString, bool> defined;
void dump() {
if (defined["name"]) {
@ -519,7 +519,7 @@ struct GLTFAccessor {
QMap<QString, bool> defined;
void dump() {
}
};
int bufferView;
@ -778,26 +778,26 @@ private:
bool buildGeometry(HFMModel& hfmModel, const hifi::VariantHash& mapping, const hifi::URL& url);
bool parseGLTF(const hifi::ByteArray& data);
bool getStringVal(const QJsonObject& object, const QString& fieldname,
bool getStringVal(const QJsonObject& object, const QString& fieldname,
QString& value, QMap<QString, bool>& defined);
bool getBoolVal(const QJsonObject& object, const QString& fieldname,
bool getBoolVal(const QJsonObject& object, const QString& fieldname,
bool& value, QMap<QString, bool>& defined);
bool getIntVal(const QJsonObject& object, const QString& fieldname,
bool getIntVal(const QJsonObject& object, const QString& fieldname,
int& value, QMap<QString, bool>& defined);
bool getDoubleVal(const QJsonObject& object, const QString& fieldname,
bool getDoubleVal(const QJsonObject& object, const QString& fieldname,
double& value, QMap<QString, bool>& defined);
bool getObjectVal(const QJsonObject& object, const QString& fieldname,
bool getObjectVal(const QJsonObject& object, const QString& fieldname,
QJsonObject& value, QMap<QString, bool>& defined);
bool getIntArrayVal(const QJsonObject& object, const QString& fieldname,
bool getIntArrayVal(const QJsonObject& object, const QString& fieldname,
QVector<int>& values, QMap<QString, bool>& defined);
bool getDoubleArrayVal(const QJsonObject& object, const QString& fieldname,
bool getDoubleArrayVal(const QJsonObject& object, const QString& fieldname,
QVector<double>& values, QMap<QString, bool>& defined);
bool getObjectArrayVal(const QJsonObject& object, const QString& fieldname,
bool getObjectArrayVal(const QJsonObject& object, const QString& fieldname,
QJsonArray& objects, QMap<QString, bool>& defined);
hifi::ByteArray setGLBChunks(const hifi::ByteArray& data);
graphics::MaterialKey::OpacityMapMode getMaterialAlphaMode(const QString& type);
int getAccessorType(const QString& type);
int getAnimationSamplerInterpolation(const QString& interpolation);
@ -805,7 +805,7 @@ private:
int getImageMimeType(const QString& mime);
int getMeshPrimitiveRenderingMode(const QString& type);
bool getIndexFromObject(const QJsonObject& object, const QString& field,
bool getIndexFromObject(const QJsonObject& object, const QString& field,
int& outidx, QMap<QString, bool>& defined);
bool setAsset(const QJsonObject& object);
@ -841,8 +841,8 @@ private:
template <typename T>
bool addArrayFromAccessor(GLTFAccessor& accessor, QVector<T>& outarray);
void retriangulate(const QVector<int>& in_indices, const QVector<glm::vec3>& in_vertices,
const QVector<glm::vec3>& in_normals, QVector<int>& out_indices,
void retriangulate(const QVector<int>& in_indices, const QVector<glm::vec3>& in_vertices,
const QVector<glm::vec3>& in_normals, QVector<int>& out_indices,
QVector<glm::vec3>& out_vertices, QVector<glm::vec3>& out_normals);
std::tuple<bool, hifi::ByteArray> requestData(hifi::URL& url);
@ -857,4 +857,4 @@ private:
void glTFDebugDump();
};
#endif // hifi_GLTFSerializer_h
#endif // hifi_GLTFSerializer_h

View file

@ -1,6 +1,6 @@
//
// OBJSerializer.cpp
// libraries/fbx/src/
// libraries/model-serializers/src
//
// Created by Seth Alves on 3/7/15.
// Copyright 2013 High Fidelity, Inc.
@ -15,7 +15,7 @@
#include "OBJSerializer.h"
#include <ctype.h> // .obj files are not locale-specific. The C/ASCII charset applies.
#include <sstream>
#include <sstream>
#include <QtCore/QBuffer>
#include <QtCore/QIODevice>
@ -263,16 +263,16 @@ void OBJSerializer::parseMaterialLibrary(QIODevice* device) {
default:
materials[matName] = currentMaterial;
#ifdef WANT_DEBUG
qCDebug(modelformat) <<
qCDebug(modelformat) <<
"OBJSerializer Last material illumination model:" << currentMaterial.illuminationModel <<
" shininess:" << currentMaterial.shininess <<
" shininess:" << currentMaterial.shininess <<
" opacity:" << currentMaterial.opacity <<
" diffuse color:" << currentMaterial.diffuseColor <<
" specular color:" << currentMaterial.specularColor <<
" emissive color:" << currentMaterial.emissiveColor <<
" diffuse texture:" << currentMaterial.diffuseTextureFilename <<
" specular texture:" << currentMaterial.specularTextureFilename <<
" emissive texture:" << currentMaterial.emissiveTextureFilename <<
" diffuse color:" << currentMaterial.diffuseColor <<
" specular color:" << currentMaterial.specularColor <<
" emissive color:" << currentMaterial.emissiveColor <<
" diffuse texture:" << currentMaterial.diffuseTextureFilename <<
" specular texture:" << currentMaterial.specularTextureFilename <<
" emissive texture:" << currentMaterial.emissiveTextureFilename <<
" bump texture:" << currentMaterial.bumpTextureFilename <<
" opacity texture:" << currentMaterial.opacityTextureFilename;
#endif
@ -352,7 +352,7 @@ void OBJSerializer::parseMaterialLibrary(QIODevice* device) {
}
}
}
}
}
void OBJSerializer::parseTextureLine(const hifi::ByteArray& textureLine, hifi::ByteArray& filename, OBJMaterialTextureOptions& textureOptions) {
// Texture options reference http://paulbourke.net/dataformats/mtl/
@ -803,7 +803,7 @@ HFMModel::Pointer OBJSerializer::read(const hifi::ByteArray& data, const hifi::V
n0 = checked_at(normals, face.normalIndices[0]);
n1 = checked_at(normals, face.normalIndices[1]);
n2 = checked_at(normals, face.normalIndices[2]);
} else {
} else {
// generate normals from triangle plane if not provided
n0 = n1 = n2 = glm::cross(v1 - v0, v2 - v0);
}
@ -932,7 +932,7 @@ HFMModel::Pointer OBJSerializer::read(const hifi::ByteArray& data, const hifi::V
bool applyNonMetallic = false;
bool fresnelOn = false;
// Illumination model reference http://paulbourke.net/dataformats/mtl/
// Illumination model reference http://paulbourke.net/dataformats/mtl/
switch (objMaterial.illuminationModel) {
case 0: // Color on and Ambient off
// We don't support ambient = do nothing?
@ -976,7 +976,7 @@ HFMModel::Pointer OBJSerializer::read(const hifi::ByteArray& data, const hifi::V
case 10: // Casts shadows onto invisible surfaces
// Do nothing?
break;
}
}
if (applyTransparency) {
hfmMaterial.opacity = std::max(hfmMaterial.opacity, ILLUMINATION_MODEL_MIN_OPACITY);

View file

@ -1,6 +1,6 @@
//
// OBJSerializer.h
// libraries/fbx/src/
// libraries/model-serializers/src
//
// Created by Seth Alves on 3/6/15.
// Copyright 2015 High Fidelity, Inc.
@ -93,7 +93,7 @@ class OBJSerializer: public QObject, public HFMSerializer { // QObject so we can
public:
MediaType getMediaType() const override;
std::unique_ptr<hfm::Serializer::Factory> getFactory() const override;
typedef QVector<OBJFace> FaceGroup;
QVector<glm::vec3> vertices;
QVector<glm::vec3> vertexColors;
@ -102,7 +102,7 @@ public:
QVector<FaceGroup> faceGroups;
QString currentMaterialName;
QHash<QString, OBJMaterial> materials;
HFMModel::Pointer read(const hifi::ByteArray& data, const hifi::VariantHash& mapping, const hifi::URL& url = hifi::URL()) override;
private:

View file

@ -1,6 +1,6 @@
//
// OBJWriter.cpp
// libraries/fbx/src/
// libraries/model-serializers/src
//
// Created by Seth Alves on 2017-1-27.
// Copyright 2017 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// OBJWriter.h
// libraries/fbx/src/
// libraries/model-serializers/src
//
// Created by Seth Alves on 2017-1-27.
// Copyright 2017 High Fidelity, Inc.

View file

@ -32,12 +32,25 @@
#include <IOKit/storage/IOMedia.h>
#endif //Q_OS_MAC
// Number of iterations to apply to the hash, for stretching.
// The number is arbitrary and has the only purpose of slowing down brute-force
// attempts. The number here should be low enough not to cause any trouble for
// low-end hardware.
//
// Changing this results in different hardware IDs being computed.
static const int HASH_ITERATIONS = 65535;
// Salt string for the hardware ID, makes our IDs unique to our project.
// Changing this results in different hardware IDs being computed.
static const QByteArray HASH_SALT{"Vircadia"};
static const QString FALLBACK_FINGERPRINT_KEY = "fallbackFingerprint";
QUuid FingerprintUtils::_machineFingerprint { QUuid() };
QString FingerprintUtils::getMachineFingerprintString() {
QString uuidString;
QCryptographicHash hash(QCryptographicHash::Keccak_256);
#ifdef Q_OS_LINUX
// As per the documentation:
// https://man7.org/linux/man-pages/man5/machine-id.5.html
@ -45,8 +58,6 @@ QString FingerprintUtils::getMachineFingerprintString() {
// we use the machine id as a base, but add an application-specific key to it.
// If machine-id isn't available, we try hardware networking devices instead.
QCryptographicHash hash(QCryptographicHash::Keccak_256);
QFile machineIdFile("/etc/machine-id");
if (!machineIdFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
// No machine ID, probably no systemd.
@ -58,7 +69,7 @@ QString FingerprintUtils::getMachineFingerprintString() {
if (netDevicesInfo.empty()) {
// Let getMachineFingerprint handle this contingency
qCWarning(networking) << "Failed to find any hardware networking devices";
return "";
return QUuid().toString();
}
for(auto& fileInfo : netDevicesInfo) {
@ -84,49 +95,20 @@ QString FingerprintUtils::getMachineFingerprintString() {
hash.addData(data);
}
// Makes this hash unique to us
hash.addData("Vircadia");
// Stretching
for (int i=0; i < 65535; i++) {
hash.addData(hash.result());
}
QByteArray result = hash.result();
result.resize(128 / 8); // GUIDs are 128 bit numbers
// Set UUID version to 4, ensuring it's a valid UUID
result[6] = (result[6] & 0x0F) | 0x40;
// Of course, Qt couldn't be nice and just parse something like:
// 1b1b9d6d45c2473bac13dc3011ff58d6
//
// So we have to turn it into:
// {1b1b9d6d-45c2-473b-ac13-dc3011ff58d6}
uuidString = result.toHex();
uuidString.insert(20, '-');
uuidString.insert(16, '-');
uuidString.insert(12, '-');
uuidString.insert(8, '-');
uuidString.prepend("{");
uuidString.append("}");
qCDebug(networking) << "Linux machine fingerprint:" << uuidString;
#endif //Q_OS_LINUX
#ifdef Q_OS_MAC
io_registry_entry_t ioRegistryRoot = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");
CFStringRef uuidCf = (CFStringRef) IORegistryEntryCreateCFProperty(ioRegistryRoot, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0);
IOObjectRelease(ioRegistryRoot);
uuidString = QString::fromCFString(uuidCf);
hash.addData(QString::fromCFString(uuidCf).toUtf8());
CFRelease(uuidCf);
qCDebug(networking) << "Mac serial number: " << uuidString;
#endif //Q_OS_MAC
#ifdef Q_OS_WIN
HKEY cryptoKey;
bool success = false;
// try and open the key that contains the machine GUID
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Cryptography", 0, KEY_READ, &cryptoKey) == ERROR_SUCCESS) {
DWORD type;
@ -143,7 +125,8 @@ QString FingerprintUtils::getMachineFingerprintString() {
if (RegQueryValueEx(cryptoKey, MACHINE_GUID_KEY, NULL, NULL,
reinterpret_cast<LPBYTE>(&machineGUID[0]), &guidSize) == ERROR_SUCCESS) {
uuidString = QString::fromStdString(machineGUID);
hash.addData(QString::fromStdString(machineGUID).toUtf8());
success = true;
}
}
}
@ -151,10 +134,43 @@ QString FingerprintUtils::getMachineFingerprintString() {
RegCloseKey(cryptoKey);
}
if (!success) {
// Let getMachineFingerprint handle this contingency
return QUuid().toString();
}
#endif //Q_OS_WIN
return uuidString;
// Makes this hash unique to us
hash.addData(HASH_SALT);
// Stretching
for (int i = 0; i < HASH_ITERATIONS; i++) {
hash.addData(hash.result());
}
QByteArray result = hash.result();
result.resize(128 / 8); // GUIDs are 128 bit numbers
// Set UUID version to 4, ensuring it's a valid UUID
result[6] = (result[6] & 0x0F) | 0x40;
// Of course, Qt couldn't be nice and just parse something like:
// 1b1b9d6d45c2473bac13dc3011ff58d6
//
// So we have to turn it into:
// {1b1b9d6d-45c2-473b-ac13-dc3011ff58d6}
QString uuidString = result.toHex();
uuidString.insert(20, '-');
uuidString.insert(16, '-');
uuidString.insert(12, '-');
uuidString.insert(8, '-');
uuidString.prepend("{");
uuidString.append("}");
qCDebug(networking) << "Final machine fingerprint:" << uuidString;
return uuidString;
}
QUuid FingerprintUtils::getMachineFingerprint() {

View file

@ -26,7 +26,7 @@ namespace NetworkingConstants {
// if you manually generate a personal access token for the domains scope
// at https://staging.highfidelity.com/user/tokens/new?for_domain_server=true
const QString WEB_ENGINE_VERSION = "Chrome/69.0.3497.113";
const QString WEB_ENGINE_VERSION = "Chrome/83.0.4103.122";
// For now we only have one Metaverse server.
const QUrl METAVERSE_SERVER_URL_STABLE { "https://metaverse.vircadia.com/live" };

Some files were not shown because too many files have changed in this diff Show more