Merge branch master into protocol_changes
This commit is contained in:
parent
f9e729b01a
commit
ee705d285e
111
.github/workflows/linux_server_build.yml
vendored
111
.github/workflows/linux_server_build.yml
vendored
@ -1,6 +1,6 @@
|
|||||||
# Copyright 2013-2019 High Fidelity, Inc.
|
# Copyright 2013-2019 High Fidelity, Inc.
|
||||||
# Copyright 2020-2022 Vircadia contributors.
|
# Copyright 2020-2022 Vircadia contributors.
|
||||||
# Copyright 2021-2023 Overte e.V.
|
# Copyright 2021-2024 Overte e.V.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
name: Linux Server CI Build
|
name: Linux Server CI Build
|
||||||
@ -12,6 +12,10 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
tags:
|
||||||
|
# Release tags. E.g. 2024.06.1
|
||||||
|
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
|
||||||
|
- "[0-9][0-9][0-9][0-9].[0-9][0-9].**"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
@ -19,8 +23,8 @@ env:
|
|||||||
UPLOAD_BUCKET: overte-public
|
UPLOAD_BUCKET: overte-public
|
||||||
UPLOAD_REGION: fra1
|
UPLOAD_REGION: fra1
|
||||||
UPLOAD_ENDPOINT: "https://fra1.digitaloceanspaces.com"
|
UPLOAD_ENDPOINT: "https://fra1.digitaloceanspaces.com"
|
||||||
CMAKE_BACKTRACE_URL: ${{ secrets.SENTRY_MINIDUMP_ENDPOINT }}
|
# Disable VCPKG caching to save time.
|
||||||
CMAKE_BACKTRACE_TOKEN: server_${{ github.event.number }}_${{ github.sha }}
|
VCPKG_FEATURE_FLAGS: -binarycaching
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -33,62 +37,77 @@ jobs:
|
|||||||
- os: debian-11
|
- os: debian-11
|
||||||
image: docker.io/overte/overte-server-build:0.1.3-debian-11-amd64
|
image: docker.io/overte/overte-server-build:0.1.3-debian-11-amd64
|
||||||
arch: amd64
|
arch: amd64
|
||||||
runner: linux_amd64
|
# https://github.com/testflows/TestFlows-GitHub-Hetzner-Runners/wiki/Meta-Labels
|
||||||
|
# self_hosted makes the Hetzner auto-scaler put up the job.
|
||||||
|
# type-cx52 is a Hetzner VPS server type. In this case cs52 is a server with 16-cores and 32GB of RAM.
|
||||||
|
# image-x86-app-docker-ce is a Hetzner image.
|
||||||
|
# https://github.com/testflows/TestFlows-GitHub-Hetzner-Runners/wiki/Specifying-The-Runner-Image
|
||||||
|
runner: [self_hosted, type-cx52, image-x86-app-docker-ce]
|
||||||
|
|
||||||
- os: debian-11
|
- os: debian-11
|
||||||
image: docker.io/overte/overte-server-build:0.1.3-debian-11-aarch64
|
image: docker.io/overte/overte-server-build:0.1.3-debian-11-aarch64
|
||||||
arch: aarch64
|
arch: aarch64
|
||||||
runner: linux_aarch64
|
runner: [self_hosted, type-cax41, image-arm-app-docker-ce]
|
||||||
|
|
||||||
- os: debian-12
|
- os: debian-12
|
||||||
image: docker.io/overte/overte-server-build:0.1.3-debian-12-amd64
|
image: docker.io/overte/overte-server-build:0.1.3-debian-12-amd64
|
||||||
arch: amd64
|
arch: amd64
|
||||||
runner: linux_amd64
|
runner: [self_hosted, type-cx52, image-x86-app-docker-ce]
|
||||||
|
|
||||||
- os: debian-12
|
- os: debian-12
|
||||||
image: docker.io/overte/overte-server-build:0.1.3-debian-12-aarch64
|
image: docker.io/overte/overte-server-build:0.1.3-debian-12-aarch64
|
||||||
arch: aarch64
|
arch: aarch64
|
||||||
runner: linux_aarch64
|
runner: [self_hosted, type-cax41, image-arm-app-docker-ce]
|
||||||
|
|
||||||
- os: ubuntu-20.04
|
- os: ubuntu-20.04
|
||||||
image: docker.io/overte/overte-server-build:0.1.3-ubuntu-20.04-amd64
|
image: docker.io/overte/overte-server-build:0.1.3-ubuntu-20.04-amd64
|
||||||
arch: amd64
|
arch: amd64
|
||||||
runner: linux_amd64
|
runner: [self_hosted, type-cx52, image-x86-app-docker-ce]
|
||||||
|
|
||||||
- os: ubuntu-22.04
|
- os: ubuntu-22.04
|
||||||
image: docker.io/overte/overte-server-build:0.1.3-ubuntu-22.04-amd64
|
image: docker.io/overte/overte-server-build:0.1.3-ubuntu-22.04-amd64
|
||||||
arch: amd64
|
arch: amd64
|
||||||
runner: linux_amd64
|
runner: [self_hosted, type-cx52, image-x86-app-docker-ce]
|
||||||
|
|
||||||
- os: ubuntu-22.04
|
- os: ubuntu-22.04
|
||||||
image: docker.io/overte/overte-server-build:0.1.3-ubuntu-22.04-aarch64
|
image: docker.io/overte/overte-server-build:0.1.3-ubuntu-22.04-aarch64
|
||||||
arch: aarch64
|
arch: aarch64
|
||||||
runner: linux_aarch64
|
runner: [self_hosted, type-cax41, image-arm-app-docker-ce]
|
||||||
|
|
||||||
- os: fedora-37
|
- os: ubuntu-24.04
|
||||||
image: docker.io/overte/overte-server-build:0.1.3-fedora-37-amd64
|
image: docker.io/overte/overte-server-build:0.1.3-ubuntu-24.04-amd64
|
||||||
arch: amd64
|
arch: amd64
|
||||||
runner: linux_amd64
|
runner: [self_hosted, type-cx52, image-x86-app-docker-ce]
|
||||||
|
|
||||||
- os: fedora-37
|
- os: ubuntu-24.04
|
||||||
image: docker.io/overte/overte-server-build:0.1.3-fedora-37-aarch64
|
image: docker.io/overte/overte-server-build:0.1.3-ubuntu-24.04-aarch64
|
||||||
arch: aarch64
|
arch: aarch64
|
||||||
runner: linux_aarch64
|
runner: [self_hosted, type-cax41, image-arm-app-docker-ce]
|
||||||
|
|
||||||
- os: fedora-38
|
- os: fedora-39
|
||||||
image: docker.io/overte/overte-server-build:0.1.3-fedora-38-amd64
|
image: docker.io/overte/overte-server-build:0.1.4-fedora-39-amd64
|
||||||
arch: amd64
|
arch: amd64
|
||||||
runner: linux_amd64
|
runner: [self_hosted, type-cx52, image-x86-app-docker-ce]
|
||||||
|
|
||||||
- os: fedora-38
|
- os: fedora-39
|
||||||
image: docker.io/overte/overte-server-build:0.1.3-fedora-38-aarch64
|
image: docker.io/overte/overte-server-build:0.1.4-fedora-39-aarch64
|
||||||
arch: aarch64
|
arch: aarch64
|
||||||
runner: linux_aarch64
|
runner: [self_hosted, type-cax41, image-arm-app-docker-ce]
|
||||||
|
|
||||||
|
- os: fedora-40
|
||||||
|
image: docker.io/overte/overte-server-build:0.1.4-fedora-39-amd64
|
||||||
|
arch: amd64
|
||||||
|
runner: [self_hosted, type-cx52, image-x86-app-docker-ce]
|
||||||
|
|
||||||
|
- os: fedora-40
|
||||||
|
image: docker.io/overte/overte-server-build:0.1.4-fedora-39-aarch64
|
||||||
|
arch: aarch64
|
||||||
|
runner: [self_hosted, type-cax41, image-arm-app-docker-ce]
|
||||||
|
|
||||||
- os: rockylinux-9
|
- os: rockylinux-9
|
||||||
image: docker.io/overte/overte-server-build:0.1.3-rockylinux-9-amd64
|
image: docker.io/overte/overte-server-build:0.1.3-rockylinux-9-amd64
|
||||||
arch: amd64
|
arch: amd64
|
||||||
runner: linux_amd64
|
runner: [self_hosted, type-cx52, image-x86-app-docker-ce]
|
||||||
|
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
@ -132,7 +151,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Tagged builds. E.g. release or release candidate builds.
|
# Tagged builds. E.g. release or release candidate builds.
|
||||||
if [ "${{github.event_name}}" != "pull_request" ]; then
|
if [ "${{github.ref_type}}" == "tag" ]; then
|
||||||
echo "PRODUCTION_BUILD=true" >> $GITHUB_ENV
|
echo "PRODUCTION_BUILD=true" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -166,16 +185,30 @@ jobs:
|
|||||||
echo "UPLOAD_PREFIX=build/overte/master" >> $GITHUB_ENV
|
echo "UPLOAD_PREFIX=build/overte/master" >> $GITHUB_ENV
|
||||||
echo "RELEASE_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
|
echo "RELEASE_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
|
||||||
else # tagged
|
else # tagged
|
||||||
echo "DEBVERSION=${{ github.run_number }}-${{ github.ref_name }}-$GIT_COMMIT_SHORT-${{ matrix.os }}" >> $GITHUB_ENV
|
echo "DEBVERSION=${{ github.ref_name }}-$GIT_COMMIT_SHORT-${{ matrix.os }}" >> $GITHUB_ENV
|
||||||
echo "RPMVERSION=${${{ github.ref_name }}//-/.}.${{ github.run_number }}.$GIT_COMMIT_SHORT" >> $GITHUB_ENV
|
echo "RPMVERSION=${{ github.ref_name }}.$GIT_COMMIT_SHORT" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${{ github.ref_name }}" != "master" && "${{ github.ref_name }}" != "pull_request" ]]; then # tagged
|
if [ "${{ github.ref_type }}" == "tag" ]; then # tagged
|
||||||
echo "RELEASE_NUMBER=/${{ github.ref_name }}" >> $GITHUB_ENV
|
echo "RELEASE_NUMBER=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
if [ "${{ github.ref_name }}" == *"rc"* ]; then # release candidate
|
if [[ "${{ github.ref_name }}" == *"rc"* ]]; then # release candidate
|
||||||
echo "UPLOAD_PREFIX=build/overte/release-candidate" >> $GITHUB_ENV
|
# The uploader already creates a subfolder for each RELEASE_NUMBER.
|
||||||
|
echo "UPLOAD_PREFIX=build/overte/release-candidate/" >> $GITHUB_ENV
|
||||||
else # release
|
else # release
|
||||||
echo "UPLOAD_PREFIX=build/overte/release" >> $GITHUB_ENV
|
echo "UPLOAD_PREFIX=build/overte/release/" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "BUILD_NUMBER=$GIT_COMMIT_SHORT" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
if [ -z "$CMAKE_BACKTRACE_URL" ]; then
|
||||||
|
if [ "${{ github.ref_type }}" == "tag" ]; then
|
||||||
|
export CMAKE_BACKTRACE_URL="${{ secrets.SENTRY_MINIDUMP_ENDPOINT }}"
|
||||||
|
export CMAKE_BACKTRACE_TOKEN="${{ github.ref_name }}_${{ matrix.os }}_${{ github.sha }}"
|
||||||
|
else
|
||||||
|
# We're building a PR, default to the PR endpoint
|
||||||
|
export CMAKE_BACKTRACE_URL="https://o4504831972343808.ingest.sentry.io/api/4504832427950080/minidump/?sentry_key=f511de295975461b8f92a36f4a4a4f32"
|
||||||
|
export CMAKE_BACKTRACE_TOKEN="server_pr_${{ github.event.number }}_${{ github.sha }}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -192,10 +225,12 @@ jobs:
|
|||||||
else # RPM
|
else # RPM
|
||||||
if [ "${{ matrix.os }}" == "rockylinux-9" ]; then
|
if [ "${{ matrix.os }}" == "rockylinux-9" ]; then
|
||||||
echo "ARTIFACT_PATTERN=overte-server-$RPMVERSION-1.el9.$INSTALLER_EXT" >> $GITHUB_ENV
|
echo "ARTIFACT_PATTERN=overte-server-$RPMVERSION-1.el9.$INSTALLER_EXT" >> $GITHUB_ENV
|
||||||
elif [ "${{ matrix.os }}" == "fedora-37" ]; then
|
|
||||||
echo "ARTIFACT_PATTERN=overte-server-$RPMVERSION-1.fc37.$INSTALLER_EXT" >> $GITHUB_ENV
|
|
||||||
elif [ "${{ matrix.os }}" == "fedora-38" ]; then
|
elif [ "${{ matrix.os }}" == "fedora-38" ]; then
|
||||||
echo "ARTIFACT_PATTERN=overte-server-$RPMVERSION-1.fc38.$INSTALLER_EXT" >> $GITHUB_ENV
|
echo "ARTIFACT_PATTERN=overte-server-$RPMVERSION-1.fc38.$INSTALLER_EXT" >> $GITHUB_ENV
|
||||||
|
elif [ "${{ matrix.os }}" == "fedora-39" ]; then
|
||||||
|
echo "ARTIFACT_PATTERN=overte-server-$RPMVERSION-1.fc39.$INSTALLER_EXT" >> $GITHUB_ENV
|
||||||
|
elif [ "${{ matrix.os }}" == "fedora-40" ]; then
|
||||||
|
echo "ARTIFACT_PATTERN=overte-server-$RPMVERSION-1.fc40.$INSTALLER_EXT" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
echo "Error! ARTIFACT_PATTERN not set!"
|
echo "Error! ARTIFACT_PATTERN not set!"
|
||||||
exit 1 # Fail
|
exit 1 # Fail
|
||||||
@ -203,7 +238,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: false
|
submodules: false
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
@ -216,11 +251,6 @@ jobs:
|
|||||||
working-directory: build
|
working-directory: build
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [ -z "$CMAKE_BACKTRACE_URL" ] ; then
|
|
||||||
# We're building a PR, default to the PR endpoint
|
|
||||||
export CMAKE_BACKTRACE_URL="https://o4504831972343808.ingest.sentry.io/api/4504832427950080/minidump/?sentry_key=f511de295975461b8f92a36f4a4a4f32"
|
|
||||||
export CMAKE_BACKTRACE_TOKEN="server_pr_${{ github.event.number }}_${{ github.sha }}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DVCPKG_BUILD_TYPE=release $CMAKE_EXTRA
|
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DVCPKG_BUILD_TYPE=release $CMAKE_EXTRA
|
||||||
|
|
||||||
@ -275,8 +305,7 @@ jobs:
|
|||||||
df -h
|
df -h
|
||||||
|
|
||||||
- name: Upload artifact to GitHub
|
- name: Upload artifact to GitHub
|
||||||
if: github.event_name == 'pull_request'
|
uses: actions/upload-artifact@v4
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
with:
|
||||||
name: ${{ env.ARTIFACT_PATTERN }}
|
name: ${{ env.ARTIFACT_PATTERN }}
|
||||||
path: pkg-scripts/${{ env.ARTIFACT_PATTERN }}
|
path: pkg-scripts/${{ env.ARTIFACT_PATTERN }}
|
||||||
|
6
.github/workflows/master_build.yml
vendored
6
.github/workflows/master_build.yml
vendored
@ -1,6 +1,6 @@
|
|||||||
# Copyright 2013-2019 High Fidelity, Inc.
|
# Copyright 2013-2019 High Fidelity, Inc.
|
||||||
# Copyright 2020-2022 Vircadia contributors
|
# Copyright 2020-2022 Vircadia contributors
|
||||||
# Copyright 2021-2022 Overte e.V.
|
# Copyright 2021-2024 Overte e.V.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
name: Master CI Build
|
name: Master CI Build
|
||||||
@ -26,6 +26,8 @@ env:
|
|||||||
UPLOAD_ENDPOINT: "https://fra1.digitaloceanspaces.com"
|
UPLOAD_ENDPOINT: "https://fra1.digitaloceanspaces.com"
|
||||||
CMAKE_BACKTRACE_URL: ${{ secrets.SENTRY_MINIDUMP_ENDPOINT }}
|
CMAKE_BACKTRACE_URL: ${{ secrets.SENTRY_MINIDUMP_ENDPOINT }}
|
||||||
CMAKE_BACKTRACE_TOKEN: master_${{ github.event.number }}_${{ github.sha }}
|
CMAKE_BACKTRACE_TOKEN: master_${{ github.event.number }}_${{ github.sha }}
|
||||||
|
# Disable VCPKG caching to save time.
|
||||||
|
VCPKG_FEATURE_FLAGS: -binarycaching
|
||||||
|
|
||||||
# OSX-specific variables
|
# OSX-specific variables
|
||||||
DEVELOPER_DIR: /Applications/Xcode_11.2.app/Contents/Developer
|
DEVELOPER_DIR: /Applications/Xcode_11.2.app/Contents/Developer
|
||||||
@ -120,7 +122,7 @@ jobs:
|
|||||||
rm -rf ~/overte-files
|
rm -rf ~/overte-files
|
||||||
rm -rf ~/.cache
|
rm -rf ~/.cache
|
||||||
|
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: false
|
submodules: false
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
4
.github/workflows/master_deploy_apidocs.yml
vendored
4
.github/workflows/master_deploy_apidocs.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2022-2023 Overte e.V.
|
# Copyright 2022-2024 Overte e.V.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
name: Master API-docs CI Build and Deploy
|
name: Master API-docs CI Build and Deploy
|
||||||
@ -14,7 +14,7 @@ jobs:
|
|||||||
|
|
||||||
name: Build and deploy API-docs
|
name: Build and deploy API-docs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: tools/jsdoc
|
working-directory: tools/jsdoc
|
||||||
|
4
.github/workflows/master_deploy_doxygen.yml
vendored
4
.github/workflows/master_deploy_doxygen.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2022-2023 Overte e.V.
|
# Copyright 2022-2024 Overte e.V.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
name: Master Doxygen CI Build and Deploy
|
name: Master Doxygen CI Build and Deploy
|
||||||
@ -14,7 +14,7 @@ jobs:
|
|||||||
|
|
||||||
name: Build and deploy Doxygen documentation
|
name: Build and deploy Doxygen documentation
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
17
.github/workflows/pr_build.yml
vendored
17
.github/workflows/pr_build.yml
vendored
@ -1,6 +1,6 @@
|
|||||||
# Copyright 2013-2019 High Fidelity, Inc.
|
# Copyright 2013-2019 High Fidelity, Inc.
|
||||||
# Copyright 2020-2022 Vircadia contributors.
|
# Copyright 2020-2022 Vircadia contributors.
|
||||||
# Copyright 2021-2022 Overte e.V.
|
# Copyright 2021-2024 Overte e.V.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
name: Pull Request CI Build
|
name: Pull Request CI Build
|
||||||
@ -24,6 +24,8 @@ env:
|
|||||||
# We can't use secrets or actions here, so the actual value has to be hardcoded.
|
# We can't use secrets or actions here, so the actual value has to be hardcoded.
|
||||||
CMAKE_BACKTRACE_URL: "https://o4504831972343808.ingest.sentry.io/api/4504832427950080/minidump/?sentry_key=f511de295975461b8f92a36f4a4a4f32"
|
CMAKE_BACKTRACE_URL: "https://o4504831972343808.ingest.sentry.io/api/4504832427950080/minidump/?sentry_key=f511de295975461b8f92a36f4a4a4f32"
|
||||||
CMAKE_BACKTRACE_TOKEN: PR_${{ github.event.number }}_${{ github.sha }}
|
CMAKE_BACKTRACE_TOKEN: PR_${{ github.event.number }}_${{ github.sha }}
|
||||||
|
# Disable VCPKG caching to save time.
|
||||||
|
VCPKG_FEATURE_FLAGS: -binarycaching
|
||||||
|
|
||||||
UPLOAD_BUCKET: overte-public
|
UPLOAD_BUCKET: overte-public
|
||||||
UPLOAD_REGION: fra1
|
UPLOAD_REGION: fra1
|
||||||
@ -54,7 +56,12 @@ jobs:
|
|||||||
#- os: macOS-10.15
|
#- os: macOS-10.15
|
||||||
# build_type: full
|
# build_type: full
|
||||||
- os: Ubuntu 20.04
|
- os: Ubuntu 20.04
|
||||||
runner: linux_amd64
|
# https://github.com/testflows/TestFlows-GitHub-Hetzner-Runners/wiki/Meta-Labels
|
||||||
|
# self_hosted makes the Hetzner auto-scaler put up the job.
|
||||||
|
# type-cx52 is a Hetzner VPS server type. In this case cs52 is a server with 16-cores and 32GB of RAM.
|
||||||
|
# image-x86-app-docker-ce is a Hetzner image.
|
||||||
|
# https://github.com/testflows/TestFlows-GitHub-Hetzner-Runners/wiki/Specifying-The-Runner-Image
|
||||||
|
runner: [self_hosted, type-cx52, image-x86-app-docker-ce]
|
||||||
arch: amd64
|
arch: amd64
|
||||||
build_type: full
|
build_type: full
|
||||||
apt-dependencies: pkg-config libxext-dev libdouble-conversion-dev libpcre2-16-0 libpulse0 libharfbuzz-dev libnss3 libnspr4 libxdamage1 libasound2 # add missing dependencies to docker image when convenient
|
apt-dependencies: pkg-config libxext-dev libdouble-conversion-dev libpcre2-16-0 libpulse0 libharfbuzz-dev libnss3 libnspr4 libxdamage1 libasound2 # add missing dependencies to docker image when convenient
|
||||||
@ -65,7 +72,7 @@ jobs:
|
|||||||
# apt-dependencies: mesa-common-dev libegl1 libglvnd-dev libdouble-conversion1 libpulse0 python3-github python3-distro
|
# apt-dependencies: mesa-common-dev libegl1 libglvnd-dev libdouble-conversion1 libpulse0 python3-github python3-distro
|
||||||
# Do not change the names of self-hosted runners without knowing what you are doing, as they correspond to labels that have to be set on the runner.
|
# Do not change the names of self-hosted runners without knowing what you are doing, as they correspond to labels that have to be set on the runner.
|
||||||
- os: Ubuntu 22.04
|
- os: Ubuntu 22.04
|
||||||
runner: linux_aarch64
|
runner: [self_hosted, type-cax41, image-arm-app-docker-ce]
|
||||||
arch: aarch64
|
arch: aarch64
|
||||||
build_type: full
|
build_type: full
|
||||||
image: docker.io/overte/overte-full-build:0.1.1-ubuntu-22.04-aarch64
|
image: docker.io/overte/overte-full-build:0.1.1-ubuntu-22.04-aarch64
|
||||||
@ -165,7 +172,7 @@ jobs:
|
|||||||
rm -rf ~/overte-files
|
rm -rf ~/overte-files
|
||||||
rm -rf ~/.cache
|
rm -rf ~/.cache
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: false
|
submodules: false
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
@ -335,7 +342,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
if: startsWith(matrix.os, 'Windows') || startsWith(matrix.os, 'macOS')
|
if: startsWith(matrix.os, 'Windows') || startsWith(matrix.os, 'macOS')
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.ARTIFACT_PATTERN }}
|
name: ${{ env.ARTIFACT_PATTERN }}
|
||||||
path: ./build/${{ env.ARTIFACT_PATTERN }}
|
path: ./build/${{ env.ARTIFACT_PATTERN }}
|
||||||
|
@ -8,6 +8,8 @@ SPDX-License-Identifier: Apache-2.0
|
|||||||
# Build Android
|
# Build Android
|
||||||
|
|
||||||
*Last Updated on December 15, 2020*
|
*Last Updated on December 15, 2020*
|
||||||
|
> [!WARNING]
|
||||||
|
> Android building is currently broken, due to breaking changes in Qt and Gradle. Help with updating (or rewriting) the Gradle scripts would be great.
|
||||||
|
|
||||||
Please read the [general build guide](BUILD.md) for information on building other platforms. Only Android specific instructions are found in this file. **Note that these instructions apply to building for the Oculus Quest 1.**
|
Please read the [general build guide](BUILD.md) for information on building other platforms. Only Android specific instructions are found in this file. **Note that these instructions apply to building for the Oculus Quest 1.**
|
||||||
|
|
||||||
|
@ -15,6 +15,9 @@ endif()
|
|||||||
# 3.14 is the minimum version that supports symlinks on Windows
|
# 3.14 is the minimum version that supports symlinks on Windows
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
|
|
||||||
|
# This should allow using long paths on Windows
|
||||||
|
SET(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "")
|
||||||
|
|
||||||
# Passing of variables to vcpkg
|
# Passing of variables to vcpkg
|
||||||
#
|
#
|
||||||
# vcpkg runs cmake scripts in an isolated environment, see this for details:
|
# vcpkg runs cmake scripts in an isolated environment, see this for details:
|
||||||
@ -181,8 +184,13 @@ if(OVERTE_WARNINGS_WHITELIST)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(OVERTE_WARNINGS_AS_ERRORS)
|
if(OVERTE_WARNINGS_AS_ERRORS)
|
||||||
set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} -Werror")
|
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" OR (CMAKE_CXX_COMPILER_ID MATCHES "" AND WIN32))
|
||||||
set(ENV{CFLAGS} "$ENV{CXXFLAGS} -Werror")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
|
||||||
|
set(CMAKE_CFLAGS "${CMAKE_CFLAGS} /WX")
|
||||||
|
else()
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||||
|
set(CMAKE_CFLAGS "${CMAKE_CFLAGS} -Werror")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
@ -249,9 +257,6 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SCREENSHARE 0)
|
set(SCREENSHARE 0)
|
||||||
if (WIN32)
|
|
||||||
set(SCREENSHARE 1)
|
|
||||||
endif()
|
|
||||||
if (APPLE AND NOT CLIENT_ONLY)
|
if (APPLE AND NOT CLIENT_ONLY)
|
||||||
# Don't include Screenshare in OSX client-only builds.
|
# Don't include Screenshare in OSX client-only builds.
|
||||||
set(SCREENSHARE 1)
|
set(SCREENSHARE 1)
|
||||||
@ -483,6 +488,7 @@ if (BUILD_CLIENT)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(USE_SIXENSE "Build Interface with sixense library/plugin" OFF)
|
option(USE_SIXENSE "Build Interface with sixense library/plugin" OFF)
|
||||||
|
option(USE_NEURON "Build Interface with Neuron library/plugin" OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (BUILD_CLIENT OR BUILD_SERVER)
|
if (BUILD_CLIENT OR BUILD_SERVER)
|
||||||
|
@ -109,7 +109,7 @@ public class PermissionChecker extends Activity {
|
|||||||
JSONObject obj = new JSONObject();
|
JSONObject obj = new JSONObject();
|
||||||
try {
|
try {
|
||||||
obj.put("firstRun",false);
|
obj.put("firstRun",false);
|
||||||
obj.put("Avatar/fullAvatarURL", avatarPaths[which]);
|
obj.put(SETTINGS_FULL_PRIVATE_GROUP_NAME + "/Avatar/fullAvatarURL", avatarPaths[which]);
|
||||||
File directory = new File(pathForJson);
|
File directory = new File(pathForJson);
|
||||||
|
|
||||||
if(!directory.exists()) directory.mkdirs();
|
if(!directory.exists()) directory.mkdirs();
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
*/
|
*/
|
||||||
class AgentScriptingInterface : public QObject {
|
class AgentScriptingInterface : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(bool isAvatar READ isAvatar WRITE setIsAvatar)
|
Q_PROPERTY(bool isAvatar READ getIsAvatar WRITE setIsAvatar)
|
||||||
Q_PROPERTY(bool isPlayingAvatarSound READ isPlayingAvatarSound)
|
Q_PROPERTY(bool isPlayingAvatarSound READ isPlayingAvatarSound)
|
||||||
Q_PROPERTY(bool isListeningToAudioStream READ isListeningToAudioStream WRITE setIsListeningToAudioStream)
|
Q_PROPERTY(bool isListeningToAudioStream READ isListeningToAudioStream WRITE setIsListeningToAudioStream)
|
||||||
Q_PROPERTY(bool isNoiseGateEnabled READ isNoiseGateEnabled WRITE setIsNoiseGateEnabled)
|
Q_PROPERTY(bool isNoiseGateEnabled READ isNoiseGateEnabled WRITE setIsNoiseGateEnabled)
|
||||||
@ -77,15 +77,15 @@ public slots:
|
|||||||
|
|
||||||
/*@jsdoc
|
/*@jsdoc
|
||||||
* Checks whether the script is emulating an avatar.
|
* Checks whether the script is emulating an avatar.
|
||||||
* @function Agent.isAvatar
|
* @function Agent.getIsAvatar
|
||||||
* @returns {boolean} <code>true</code> if the script is emulating an avatar, otherwise <code>false</code>.
|
* @returns {boolean} <code>true</code> if the script is emulating an avatar, otherwise <code>false</code>.
|
||||||
* @example <caption>Check whether the agent is emulating an avatar.</caption>
|
* @example <caption>Check whether the agent is emulating an avatar.</caption>
|
||||||
* (function () {
|
* (function () {
|
||||||
* print("Agent is avatar: " + Agent.isAvatar());
|
* print("Agent is avatar: " + Agent.getIsAvatar());
|
||||||
* print("Agent is avatar: " + Agent.isAvatar); // Same result.
|
* print("Agent is avatar: " + Agent.isAvatar); // Same result.
|
||||||
* }());
|
* }());
|
||||||
*/
|
*/
|
||||||
bool isAvatar() const { return _agent->isAvatar(); }
|
bool getIsAvatar() const { return _agent->isAvatar(); }
|
||||||
|
|
||||||
/*@jsdoc
|
/*@jsdoc
|
||||||
* Plays a sound from the position and with the orientation of the emulated avatar's head. No sound is played unless
|
* Plays a sound from the position and with the orientation of the emulated avatar's head. No sound is played unless
|
||||||
|
@ -222,13 +222,23 @@ void AudioMixerClientData::parseInjectorGainSet(ReceivedMessage& message, const
|
|||||||
qCDebug(audio) << "Setting MASTER injector gain for" << uuid << "to" << gain;
|
qCDebug(audio) << "Setting MASTER injector gain for" << uuid << "to" << gain;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioMixerClientData::setGainForAvatar(QUuid nodeID, float gain) {
|
bool setGainInStreams(const QUuid &nodeID, float gain, std::vector<AudioMixerClientData::MixableStream> &streamVector) {
|
||||||
auto it = std::find_if(_streams.active.cbegin(), _streams.active.cend(), [nodeID](const MixableStream& mixableStream){
|
auto itActive = std::find_if(streamVector.cbegin(), streamVector.cend(),
|
||||||
|
[nodeID](const AudioMixerClientData::MixableStream& mixableStream){
|
||||||
return mixableStream.nodeStreamID.nodeID == nodeID && mixableStream.nodeStreamID.streamID.isNull();
|
return mixableStream.nodeStreamID.nodeID == nodeID && mixableStream.nodeStreamID.streamID.isNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (it != _streams.active.cend()) {
|
if (itActive != streamVector.cend()) {
|
||||||
it->hrtf->setGainAdjustment(gain);
|
itActive->hrtf->setGainAdjustment(gain);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AudioMixerClientData::setGainForAvatar(QUuid nodeID, float gain) {
|
||||||
|
if (!setGainInStreams(nodeID, gain, _streams.active)) {
|
||||||
|
setGainInStreams(nodeID, gain, _streams.inactive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,8 +30,12 @@
|
|||||||
#include <NetworkingConstants.h>
|
#include <NetworkingConstants.h>
|
||||||
|
|
||||||
|
|
||||||
ScriptableAvatar::ScriptableAvatar(): _scriptEngine(newScriptEngine()) {
|
ScriptableAvatar::ScriptableAvatar() {
|
||||||
_clientTraitsHandler.reset(new ClientTraitsHandler(this));
|
_clientTraitsHandler.reset(new ClientTraitsHandler(this));
|
||||||
|
static std::once_flag once;
|
||||||
|
std::call_once(once, [] {
|
||||||
|
qRegisterMetaType<HFMModel::Pointer>("HFMModel::Pointer");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray ScriptableAvatar::toByteArrayStateful(AvatarDataDetail dataDetail, bool dropFaceTracking) {
|
QByteArray ScriptableAvatar::toByteArrayStateful(AvatarDataDetail dataDetail, bool dropFaceTracking) {
|
||||||
@ -52,6 +56,7 @@ void ScriptableAvatar::startAnimation(const QString& url, float fps, float prior
|
|||||||
_animation = DependencyManager::get<AnimationCache>()->getAnimation(url);
|
_animation = DependencyManager::get<AnimationCache>()->getAnimation(url);
|
||||||
_animationDetails = AnimationDetails("", QUrl(url), fps, 0, loop, hold, false, firstFrame, lastFrame, true, firstFrame, false);
|
_animationDetails = AnimationDetails("", QUrl(url), fps, 0, loop, hold, false, firstFrame, lastFrame, true, firstFrame, false);
|
||||||
_maskedJoints = maskedJoints;
|
_maskedJoints = maskedJoints;
|
||||||
|
_isAnimationRigValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptableAvatar::stopAnimation() {
|
void ScriptableAvatar::stopAnimation() {
|
||||||
@ -89,11 +94,12 @@ QStringList ScriptableAvatar::getJointNames() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScriptableAvatar::setSkeletonModelURL(const QUrl& skeletonModelURL) {
|
void ScriptableAvatar::setSkeletonModelURL(const QUrl& skeletonModelURL) {
|
||||||
_bind.reset();
|
_avatarAnimSkeleton.reset();
|
||||||
_animSkeleton.reset();
|
_geometryResource.reset();
|
||||||
|
|
||||||
AvatarData::setSkeletonModelURL(skeletonModelURL);
|
AvatarData::setSkeletonModelURL(skeletonModelURL);
|
||||||
updateJointMappings();
|
updateJointMappings();
|
||||||
|
_isRigValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ScriptableAvatar::sendAvatarDataPacket(bool sendAll) {
|
int ScriptableAvatar::sendAvatarDataPacket(bool sendAll) {
|
||||||
@ -137,65 +143,87 @@ static AnimPose composeAnimPose(const HFMJoint& joint, const glm::quat rotation,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScriptableAvatar::update(float deltatime) {
|
void ScriptableAvatar::update(float deltatime) {
|
||||||
|
if (!_geometryResource && !_skeletonModelFilenameURL.isEmpty()) { // AvatarData will parse the .fst, but not get the .fbx skeleton.
|
||||||
|
_geometryResource = DependencyManager::get<ModelCache>()->getGeometryResource(_skeletonModelFilenameURL);
|
||||||
|
}
|
||||||
|
|
||||||
// Run animation
|
// Run animation
|
||||||
if (_animation && _animation->isLoaded() && _animation->getFrames().size() > 0 && !_bind.isNull() && _bind->isLoaded()) {
|
Q_ASSERT(QThread::currentThread() == thread());
|
||||||
if (!_animSkeleton) {
|
if (_animation && _animation->isLoaded()) {
|
||||||
_animSkeleton = std::make_shared<AnimSkeleton>(_bind->getHFMModel());
|
Q_ASSERT(thread() == _animation->thread());
|
||||||
}
|
auto frames = _animation->getFramesReference();
|
||||||
float currentFrame = _animationDetails.currentFrame + deltatime * _animationDetails.fps;
|
if (frames.size() > 0 && _geometryResource && _geometryResource->isHFMModelLoaded()) {
|
||||||
if (_animationDetails.loop || currentFrame < _animationDetails.lastFrame) {
|
if (!_isRigValid) {
|
||||||
while (currentFrame >= _animationDetails.lastFrame) {
|
_rig.reset(_geometryResource->getHFMModel());
|
||||||
currentFrame -= (_animationDetails.lastFrame - _animationDetails.firstFrame);
|
_isRigValid = true;
|
||||||
}
|
}
|
||||||
_animationDetails.currentFrame = currentFrame;
|
if (!_isAnimationRigValid) {
|
||||||
|
_animationRig.reset(_animation->getHFMModel());
|
||||||
const QVector<HFMJoint>& modelJoints = _bind->getHFMModel().joints;
|
_isAnimationRigValid = true;
|
||||||
QStringList animationJointNames = _animation->getJointNames();
|
|
||||||
|
|
||||||
const int nJoints = modelJoints.size();
|
|
||||||
if (_jointData.size() != nJoints) {
|
|
||||||
_jointData.resize(nJoints);
|
|
||||||
}
|
}
|
||||||
|
if (!_avatarAnimSkeleton) {
|
||||||
const int frameCount = _animation->getFrames().size();
|
_avatarAnimSkeleton = std::make_shared<AnimSkeleton>(_geometryResource->getHFMModel());
|
||||||
const HFMAnimationFrame& floorFrame = _animation->getFrames().at((int)glm::floor(currentFrame) % frameCount);
|
|
||||||
const HFMAnimationFrame& ceilFrame = _animation->getFrames().at((int)glm::ceil(currentFrame) % frameCount);
|
|
||||||
const float frameFraction = glm::fract(currentFrame);
|
|
||||||
std::vector<AnimPose> poses = _animSkeleton->getRelativeDefaultPoses();
|
|
||||||
|
|
||||||
const float UNIT_SCALE = 0.01f;
|
|
||||||
|
|
||||||
for (int i = 0; i < animationJointNames.size(); i++) {
|
|
||||||
const QString& name = animationJointNames[i];
|
|
||||||
// As long as we need the model preRotations anyway, let's get the jointIndex from the bind skeleton rather than
|
|
||||||
// trusting the .fst (which is sometimes not updated to match changes to .fbx).
|
|
||||||
int mapping = _bind->getHFMModel().getJointIndex(name);
|
|
||||||
if (mapping != -1 && !_maskedJoints.contains(name)) {
|
|
||||||
|
|
||||||
AnimPose floorPose = composeAnimPose(modelJoints[mapping], floorFrame.rotations[i], floorFrame.translations[i] * UNIT_SCALE);
|
|
||||||
AnimPose ceilPose = composeAnimPose(modelJoints[mapping], ceilFrame.rotations[i], floorFrame.translations[i] * UNIT_SCALE);
|
|
||||||
blend(1, &floorPose, &ceilPose, frameFraction, &poses[mapping]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
float currentFrame = _animationDetails.currentFrame + deltatime * _animationDetails.fps;
|
||||||
std::vector<AnimPose> absPoses = poses;
|
if (_animationDetails.loop || currentFrame < _animationDetails.lastFrame) {
|
||||||
_animSkeleton->convertRelativePosesToAbsolute(absPoses);
|
while (currentFrame >= _animationDetails.lastFrame) {
|
||||||
for (int i = 0; i < nJoints; i++) {
|
currentFrame -= (_animationDetails.lastFrame - _animationDetails.firstFrame);
|
||||||
JointData& data = _jointData[i];
|
|
||||||
AnimPose& absPose = absPoses[i];
|
|
||||||
if (data.rotation != absPose.rot()) {
|
|
||||||
data.rotation = absPose.rot();
|
|
||||||
data.rotationIsDefaultPose = false;
|
|
||||||
}
|
}
|
||||||
AnimPose& relPose = poses[i];
|
_animationDetails.currentFrame = currentFrame;
|
||||||
if (data.translation != relPose.trans()) {
|
|
||||||
data.translation = relPose.trans();
|
|
||||||
data.translationIsDefaultPose = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
const QVector<HFMJoint>& modelJoints = _geometryResource->getHFMModel().joints;
|
||||||
_animation.clear();
|
QStringList animationJointNames = _animation->getJointNames();
|
||||||
|
|
||||||
|
const int nJoints = modelJoints.size();
|
||||||
|
if (_jointData.size() != nJoints) {
|
||||||
|
_jointData.resize(nJoints);
|
||||||
|
}
|
||||||
|
|
||||||
|
const int frameCount = frames.size();
|
||||||
|
const HFMAnimationFrame& floorFrame = frames.at((int)glm::floor(currentFrame) % frameCount);
|
||||||
|
const HFMAnimationFrame& ceilFrame = frames.at((int)glm::ceil(currentFrame) % frameCount);
|
||||||
|
const float frameFraction = glm::fract(currentFrame);
|
||||||
|
std::vector<AnimPose> poses = _avatarAnimSkeleton->getRelativeDefaultPoses();
|
||||||
|
|
||||||
|
// TODO: this needs more testing, it's possible that we need not only scale but also rotation and translation
|
||||||
|
// According to tests with unmatching avatar and animation armatures, sometimes bones are not rotated correctly.
|
||||||
|
// Matching armatures already work very well now.
|
||||||
|
const float UNIT_SCALE = _animationRig.GetScaleFactorGeometryToUnscaledRig() / _rig.GetScaleFactorGeometryToUnscaledRig();
|
||||||
|
|
||||||
|
for (int i = 0; i < animationJointNames.size(); i++) {
|
||||||
|
const QString& name = animationJointNames[i];
|
||||||
|
// As long as we need the model preRotations anyway, let's get the jointIndex from the bind skeleton rather than
|
||||||
|
// trusting the .fst (which is sometimes not updated to match changes to .fbx).
|
||||||
|
int mapping = _geometryResource->getHFMModel().getJointIndex(name);
|
||||||
|
if (mapping != -1 && !_maskedJoints.contains(name)) {
|
||||||
|
AnimPose floorPose = composeAnimPose(modelJoints[mapping], floorFrame.rotations[i],
|
||||||
|
floorFrame.translations[i] * UNIT_SCALE);
|
||||||
|
AnimPose ceilPose = composeAnimPose(modelJoints[mapping], ceilFrame.rotations[i],
|
||||||
|
ceilFrame.translations[i] * UNIT_SCALE);
|
||||||
|
blend(1, &floorPose, &ceilPose, frameFraction, &poses[mapping]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<AnimPose> absPoses = poses;
|
||||||
|
Q_ASSERT(_avatarAnimSkeleton != nullptr);
|
||||||
|
_avatarAnimSkeleton->convertRelativePosesToAbsolute(absPoses);
|
||||||
|
for (int i = 0; i < nJoints; i++) {
|
||||||
|
JointData& data = _jointData[i];
|
||||||
|
AnimPose& absPose = absPoses[i];
|
||||||
|
if (data.rotation != absPose.rot()) {
|
||||||
|
data.rotation = absPose.rot();
|
||||||
|
data.rotationIsDefaultPose = false;
|
||||||
|
}
|
||||||
|
AnimPose& relPose = poses[i];
|
||||||
|
if (data.translation != relPose.trans()) {
|
||||||
|
data.translation = relPose.trans();
|
||||||
|
data.translationIsDefaultPose = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_animation.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,6 +273,7 @@ void ScriptableAvatar::setJointMappingsFromNetworkReply() {
|
|||||||
networkReply->deleteLater();
|
networkReply->deleteLater();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// TODO: this works only with .fst files currently, not directly with FBX and GLB models
|
||||||
{
|
{
|
||||||
QWriteLocker writeLock(&_jointDataLock);
|
QWriteLocker writeLock(&_jointDataLock);
|
||||||
QByteArray line;
|
QByteArray line;
|
||||||
@ -253,7 +282,7 @@ void ScriptableAvatar::setJointMappingsFromNetworkReply() {
|
|||||||
if (line.startsWith("filename")) {
|
if (line.startsWith("filename")) {
|
||||||
int filenameIndex = line.indexOf('=') + 1;
|
int filenameIndex = line.indexOf('=') + 1;
|
||||||
if (filenameIndex > 0) {
|
if (filenameIndex > 0) {
|
||||||
_skeletonFBXURL = _skeletonModelURL.resolved(QString(line.mid(filenameIndex).trimmed()));
|
_skeletonModelFilenameURL = _skeletonModelURL.resolved(QString(line.mid(filenameIndex).trimmed()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!line.startsWith("jointIndex")) {
|
if (!line.startsWith("jointIndex")) {
|
||||||
@ -315,7 +344,9 @@ AvatarEntityMap ScriptableAvatar::getAvatarEntityDataInternal(bool allProperties
|
|||||||
EntityItemProperties properties = entity->getProperties(desiredProperties);
|
EntityItemProperties properties = entity->getProperties(desiredProperties);
|
||||||
|
|
||||||
QByteArray blob;
|
QByteArray blob;
|
||||||
EntityItemProperties::propertiesToBlob(*_scriptEngine, sessionID, properties, blob, allProperties);
|
_helperScriptEngine.run( [&] {
|
||||||
|
EntityItemProperties::propertiesToBlob(*_helperScriptEngine.get(), sessionID, properties, blob, allProperties);
|
||||||
|
});
|
||||||
data[id] = blob;
|
data[id] = blob;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -339,8 +370,12 @@ void ScriptableAvatar::setAvatarEntityData(const AvatarEntityMap& avatarEntityDa
|
|||||||
while (dataItr != avatarEntityData.end()) {
|
while (dataItr != avatarEntityData.end()) {
|
||||||
EntityItemProperties properties;
|
EntityItemProperties properties;
|
||||||
const QByteArray& blob = dataItr.value();
|
const QByteArray& blob = dataItr.value();
|
||||||
if (!blob.isNull() && EntityItemProperties::blobToProperties(*_scriptEngine, blob, properties)) {
|
if (!blob.isNull()) {
|
||||||
newProperties[dataItr.key()] = properties;
|
_helperScriptEngine.run([&] {
|
||||||
|
if (EntityItemProperties::blobToProperties(*_helperScriptEngine.get(), blob, properties)) {
|
||||||
|
newProperties[dataItr.key()] = properties;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
++dataItr;
|
++dataItr;
|
||||||
}
|
}
|
||||||
@ -419,9 +454,16 @@ void ScriptableAvatar::updateAvatarEntity(const QUuid& entityID, const QByteArra
|
|||||||
|
|
||||||
EntityItemPointer entity;
|
EntityItemPointer entity;
|
||||||
EntityItemProperties properties;
|
EntityItemProperties properties;
|
||||||
if (!EntityItemProperties::blobToProperties(*_scriptEngine, entityData, properties)) {
|
{
|
||||||
// entityData is corrupt
|
// TODO: checking how often this happens and what is the performance impact of having the script engine on separate thread
|
||||||
return;
|
// If it's happening often, a method to move HelperScriptEngine into the current thread would be a good idea
|
||||||
|
bool result = _helperScriptEngine.runWithResult<bool> ( [&]() {
|
||||||
|
return EntityItemProperties::blobToProperties(*_helperScriptEngine.get(), entityData, properties);
|
||||||
|
});
|
||||||
|
if (!result) {
|
||||||
|
// entityData is corrupt
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<QUuid, EntityItemPointer>::iterator itr = _entities.find(entityID);
|
std::map<QUuid, EntityItemPointer>::iterator itr = _entities.find(entityID);
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
#include <AvatarData.h>
|
#include <AvatarData.h>
|
||||||
#include <ScriptEngine.h>
|
#include <ScriptEngine.h>
|
||||||
#include <EntityItem.h>
|
#include <EntityItem.h>
|
||||||
|
#include "model-networking/ModelCache.h"
|
||||||
|
#include "Rig.h"
|
||||||
|
#include <HelperScriptEngine.h>
|
||||||
|
|
||||||
/*@jsdoc
|
/*@jsdoc
|
||||||
* The <code>Avatar</code> API is used to manipulate scriptable avatars on the domain. This API is a subset of the
|
* The <code>Avatar</code> API is used to manipulate scriptable avatars on the domain. This API is a subset of the
|
||||||
@ -217,12 +220,16 @@ private:
|
|||||||
AnimationPointer _animation;
|
AnimationPointer _animation;
|
||||||
AnimationDetails _animationDetails;
|
AnimationDetails _animationDetails;
|
||||||
QStringList _maskedJoints;
|
QStringList _maskedJoints;
|
||||||
AnimationPointer _bind; // a sleazy way to get the skeleton, given the various library/cmake dependencies
|
GeometryResource::Pointer _geometryResource;
|
||||||
std::shared_ptr<AnimSkeleton> _animSkeleton;
|
Rig _rig;
|
||||||
|
bool _isRigValid{false};
|
||||||
|
Rig _animationRig;
|
||||||
|
bool _isAnimationRigValid{false};
|
||||||
|
std::shared_ptr<AnimSkeleton> _avatarAnimSkeleton;
|
||||||
QHash<QString, int> _fstJointIndices; ///< 1-based, since zero is returned for missing keys
|
QHash<QString, int> _fstJointIndices; ///< 1-based, since zero is returned for missing keys
|
||||||
QStringList _fstJointNames; ///< in order of depth-first traversal
|
QStringList _fstJointNames; ///< in order of depth-first traversal
|
||||||
QUrl _skeletonFBXURL;
|
QUrl _skeletonModelFilenameURL; // This contains URL from filename field in fst file
|
||||||
mutable ScriptEnginePointer _scriptEngine;
|
mutable HelperScriptEngine _helperScriptEngine;
|
||||||
std::map<QUuid, EntityItemPointer> _entities;
|
std::map<QUuid, EntityItemPointer> _entities;
|
||||||
|
|
||||||
/// Loads the joint indices, names from the FST file (if any)
|
/// Loads the joint indices, names from the FST file (if any)
|
||||||
|
@ -44,16 +44,8 @@
|
|||||||
using Mutex = std::mutex;
|
using Mutex = std::mutex;
|
||||||
using Lock = std::lock_guard<Mutex>;
|
using Lock = std::lock_guard<Mutex>;
|
||||||
|
|
||||||
static std::mutex logBufferMutex;
|
|
||||||
static std::string logBuffer;
|
|
||||||
|
|
||||||
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
|
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
|
||||||
auto logMessage = LogHandler::getInstance().printMessage((LogMsgType) type, context, message);
|
auto logMessage = LogHandler::getInstance().printMessage((LogMsgType) type, context, message);
|
||||||
|
|
||||||
if (!logMessage.isEmpty()) {
|
|
||||||
Lock lock(logBufferMutex);
|
|
||||||
logBuffer.append(logMessage.toStdString() + '\n');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int EntityScriptServer::_entitiesScriptEngineCount = 0;
|
int EntityScriptServer::_entitiesScriptEngineCount = 0;
|
||||||
@ -217,10 +209,10 @@ void EntityScriptServer::handleEntityServerScriptLogPacket(QSharedPointer<Receiv
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EntityScriptServer::pushLogs() {
|
void EntityScriptServer::pushLogs() {
|
||||||
std::string buffer;
|
QJsonArray buffer;
|
||||||
{
|
{
|
||||||
Lock lock(logBufferMutex);
|
Lock lock(_logBufferMutex);
|
||||||
std::swap(logBuffer, buffer);
|
std::swap(_logBuffer, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffer.empty()) {
|
if (buffer.empty()) {
|
||||||
@ -231,16 +223,27 @@ void EntityScriptServer::pushLogs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
QJsonDocument document;
|
||||||
|
document.setArray(buffer);
|
||||||
|
QString data(document.toJson());
|
||||||
|
std::string string = data.toStdString();
|
||||||
|
auto cstring = string.c_str();
|
||||||
for (auto uuid : _logListeners) {
|
for (auto uuid : _logListeners) {
|
||||||
auto node = nodeList->nodeWithUUID(uuid);
|
auto node = nodeList->nodeWithUUID(uuid);
|
||||||
if (node && node->getActiveSocket()) {
|
if (node && node->getActiveSocket()) {
|
||||||
auto packet = NLPacketList::create(PacketType::EntityServerScriptLog, QByteArray(), true, true);
|
auto packet = NLPacketList::create(PacketType::EntityServerScriptLog, QByteArray(), true, true);
|
||||||
packet->write(buffer.data(), buffer.size());
|
packet->write(cstring, strlen(cstring));
|
||||||
nodeList->sendPacketList(std::move(packet), *node);
|
nodeList->sendPacketList(std::move(packet), *node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EntityScriptServer::addLogEntry(const QString& message, const QString& fileName, int lineNumber, const EntityItemID& entityID, ScriptMessage::Severity severity) {
|
||||||
|
ScriptMessage entry(message, fileName, lineNumber, entityID, ScriptMessage::ScriptType::TYPE_ENTITY_SCRIPT, severity);
|
||||||
|
Lock lock(_logBufferMutex);
|
||||||
|
_logBuffer.append(entry.toJson());
|
||||||
|
}
|
||||||
|
|
||||||
void EntityScriptServer::handleEntityScriptCallMethodPacket(QSharedPointer<ReceivedMessage> receivedMessage, SharedNodePointer senderNode) {
|
void EntityScriptServer::handleEntityScriptCallMethodPacket(QSharedPointer<ReceivedMessage> receivedMessage, SharedNodePointer senderNode) {
|
||||||
|
|
||||||
if (_entitiesScriptManager && _entityViewer.getTree() && !_shuttingDown) {
|
if (_entitiesScriptManager && _entityViewer.getTree() && !_shuttingDown) {
|
||||||
@ -469,6 +472,29 @@ void EntityScriptServer::resetEntitiesScriptEngine() {
|
|||||||
connect(newManager.get(), &ScriptManager::warningMessage, scriptEngines, &ScriptEngines::onWarningMessage);
|
connect(newManager.get(), &ScriptManager::warningMessage, scriptEngines, &ScriptEngines::onWarningMessage);
|
||||||
connect(newManager.get(), &ScriptManager::infoMessage, scriptEngines, &ScriptEngines::onInfoMessage);
|
connect(newManager.get(), &ScriptManager::infoMessage, scriptEngines, &ScriptEngines::onInfoMessage);
|
||||||
|
|
||||||
|
// Make script engine messages available through ScriptDiscoveryService
|
||||||
|
connect(newManager.get(), &ScriptManager::infoEntityMessage, scriptEngines, &ScriptEngines::infoEntityMessage);
|
||||||
|
connect(newManager.get(), &ScriptManager::printedEntityMessage, scriptEngines, &ScriptEngines::printedEntityMessage);
|
||||||
|
connect(newManager.get(), &ScriptManager::errorEntityMessage, scriptEngines, &ScriptEngines::errorEntityMessage);
|
||||||
|
connect(newManager.get(), &ScriptManager::warningEntityMessage, scriptEngines, &ScriptEngines::warningEntityMessage);
|
||||||
|
|
||||||
|
connect(newManager.get(), &ScriptManager::infoEntityMessage,
|
||||||
|
[this](const QString& message, const QString& fileName, int lineNumber, const EntityItemID& entityID) {
|
||||||
|
addLogEntry(message, fileName, lineNumber, entityID, ScriptMessage::Severity::SEVERITY_INFO);
|
||||||
|
});
|
||||||
|
connect(newManager.get(), &ScriptManager::printedEntityMessage,
|
||||||
|
[this](const QString& message, const QString& fileName, int lineNumber, const EntityItemID& entityID) {
|
||||||
|
addLogEntry(message, fileName, lineNumber, entityID, ScriptMessage::Severity::SEVERITY_PRINT);
|
||||||
|
});
|
||||||
|
connect(newManager.get(), &ScriptManager::errorEntityMessage,
|
||||||
|
[this](const QString& message, const QString& fileName, int lineNumber, const EntityItemID& entityID) {
|
||||||
|
addLogEntry(message, fileName, lineNumber, entityID, ScriptMessage::Severity::SEVERITY_ERROR);
|
||||||
|
});
|
||||||
|
connect(newManager.get(), &ScriptManager::warningEntityMessage,
|
||||||
|
[this](const QString& message, const QString& fileName, int lineNumber, const EntityItemID& entityID) {
|
||||||
|
addLogEntry(message, fileName, lineNumber, entityID, ScriptMessage::Severity::SEVERITY_WARNING);
|
||||||
|
});
|
||||||
|
|
||||||
connect(newManager.get(), &ScriptManager::update, this, [this] {
|
connect(newManager.get(), &ScriptManager::update, this, [this] {
|
||||||
_entityViewer.queryOctree();
|
_entityViewer.queryOctree();
|
||||||
_entityViewer.getTree()->preUpdate();
|
_entityViewer.getTree()->preUpdate();
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
#include <SimpleEntitySimulation.h>
|
#include <SimpleEntitySimulation.h>
|
||||||
#include <ThreadedAssignment.h>
|
#include <ThreadedAssignment.h>
|
||||||
#include <ScriptManager.h>
|
#include <ScriptManager.h>
|
||||||
|
#include <ScriptMessage.h>
|
||||||
|
#include <QJsonArray>
|
||||||
|
|
||||||
#include "../entities/EntityTreeHeadlessViewer.h"
|
#include "../entities/EntityTreeHeadlessViewer.h"
|
||||||
|
|
||||||
@ -55,10 +57,32 @@ private slots:
|
|||||||
void handleSettings();
|
void handleSettings();
|
||||||
void updateEntityPPS();
|
void updateEntityPPS();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Handles log subscribe/unsubscribe requests
|
||||||
|
*
|
||||||
|
* Clients can subscribe to logs by sending a script log packet. Entity Script Server keeps list of subscribers
|
||||||
|
* and sends them logs in JSON format.
|
||||||
|
*/
|
||||||
|
|
||||||
void handleEntityServerScriptLogPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode);
|
void handleEntityServerScriptLogPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Transmit logs
|
||||||
|
*
|
||||||
|
* This is called periodically through a timer to transmit logs from scripts.
|
||||||
|
*/
|
||||||
|
|
||||||
void pushLogs();
|
void pushLogs();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds log entry to the transmit buffer
|
||||||
|
*
|
||||||
|
* This is connected to entity script log events in the script manager and adds script log message to the buffer
|
||||||
|
* containing messages that will be sent to subscribed clients.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void addLogEntry(const QString& message, const QString& fileName, int lineNumber, const EntityItemID& entityID, ScriptMessage::Severity severity);
|
||||||
|
|
||||||
void handleEntityScriptCallMethodPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode);
|
void handleEntityScriptCallMethodPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode);
|
||||||
|
|
||||||
|
|
||||||
@ -85,6 +109,9 @@ private:
|
|||||||
EntityEditPacketSender _entityEditSender;
|
EntityEditPacketSender _entityEditSender;
|
||||||
EntityTreeHeadlessViewer _entityViewer;
|
EntityTreeHeadlessViewer _entityViewer;
|
||||||
|
|
||||||
|
QJsonArray _logBuffer;
|
||||||
|
std::mutex _logBufferMutex;
|
||||||
|
|
||||||
int _maxEntityPPS { DEFAULT_MAX_ENTITY_PPS };
|
int _maxEntityPPS { DEFAULT_MAX_ENTITY_PPS };
|
||||||
int _entityPPSPerScript { DEFAULT_ENTITY_PPS_PER_SCRIPT };
|
int _entityPPSPerScript { DEFAULT_ENTITY_PPS_PER_SCRIPT };
|
||||||
|
|
||||||
|
@ -6,10 +6,6 @@ if (NOT "${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
|||||||
message( FATAL_ERROR "Only 64 bit builds supported." )
|
message( FATAL_ERROR "Only 64 bit builds supported." )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (USE_CCACHE OR "$ENV{USE_CCACHE}")
|
|
||||||
configure_ccache()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_WARNINGS)
|
add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_WARNINGS)
|
||||||
|
|
||||||
|
10
cmake/externals/LibOVR/CMakeLists.txt
vendored
10
cmake/externals/LibOVR/CMakeLists.txt
vendored
@ -15,14 +15,22 @@ string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
|
|||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|
||||||
|
# Note the -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||||
|
# It's important that we pass our build type down to other builds we make, especially on Windows.
|
||||||
|
# On Windows, debug libraries get a 'd' suffix, eg, LibOVRd.lib. This means that a mismatch of build
|
||||||
|
# types means we'll generate a LibOVRd.lib and the rest of the system will look for LibOVR.lib, or
|
||||||
|
# viceversa.
|
||||||
ExternalProject_Add(
|
ExternalProject_Add(
|
||||||
${EXTERNAL_NAME}
|
${EXTERNAL_NAME}
|
||||||
URL "${EXTERNAL_BUILD_ASSETS}/dependencies/ovr_sdk_win_1.35.0.zip"
|
URL "${EXTERNAL_BUILD_ASSETS}/dependencies/ovr_sdk_win_1.35.0.zip"
|
||||||
URL_MD5 1e3e8b2101387af07ff9c841d0ea285e
|
URL_MD5 1e3e8b2101387af07ff9c841d0ea285e
|
||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/LibOVRCMakeLists.txt" <SOURCE_DIR>/CMakeLists.txt
|
PATCH_COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/LibOVRCMakeLists.txt" <SOURCE_DIR>/CMakeLists.txt
|
||||||
LOG_DOWNLOAD 1
|
LOG_DOWNLOAD 1
|
||||||
DOWNLOAD_EXTRACT_TIMESTAMP 1
|
DOWNLOAD_EXTRACT_TIMESTAMP 1
|
||||||
|
BUILD_BYPRODUCTS
|
||||||
|
"project/Lib/LibOVR.lib"
|
||||||
|
"project/Lib/LibOVRd.lib"
|
||||||
)
|
)
|
||||||
|
|
||||||
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
||||||
|
4
cmake/externals/LibOVR/LibOVRCMakeLists.txt
vendored
4
cmake/externals/LibOVR/LibOVRCMakeLists.txt
vendored
@ -1,6 +1,8 @@
|
|||||||
cmake_minimum_required(VERSION 3.2)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
project(LibOVR)
|
project(LibOVR)
|
||||||
|
|
||||||
|
message(STATUS "Building LibOVR for ${CMAKE_BUILD_TYPE} configuration")
|
||||||
|
|
||||||
include_directories(LibOVR/Include LibOVR/Src)
|
include_directories(LibOVR/Include LibOVR/Src)
|
||||||
file(GLOB HEADER_FILES LibOVR/Include/*.h)
|
file(GLOB HEADER_FILES LibOVR/Include/*.h)
|
||||||
file(GLOB EXTRA_HEADER_FILES LibOVR/Include/Extras/*.h)
|
file(GLOB EXTRA_HEADER_FILES LibOVR/Include/Extras/*.h)
|
||||||
|
@ -16,6 +16,8 @@ if (WIN32)
|
|||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
LOG_DOWNLOAD 1
|
LOG_DOWNLOAD 1
|
||||||
DOWNLOAD_EXTRACT_TIMESTAMP 1
|
DOWNLOAD_EXTRACT_TIMESTAMP 1
|
||||||
|
BUILD_BYPRODUCTS
|
||||||
|
"project/src/LibOVRPlatform/Windows/LibOVRPlatform64_1.lib"
|
||||||
)
|
)
|
||||||
|
|
||||||
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
||||||
|
7
cmake/externals/crashpad/CMakeLists.txt
vendored
7
cmake/externals/crashpad/CMakeLists.txt
vendored
@ -13,6 +13,13 @@ if (WIN32)
|
|||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
LOG_DOWNLOAD 1
|
LOG_DOWNLOAD 1
|
||||||
DOWNLOAD_EXTRACT_TIMESTAMP 1
|
DOWNLOAD_EXTRACT_TIMESTAMP 1
|
||||||
|
BUILD_BYPRODUCTS
|
||||||
|
"project/src/crashpad/out/Release_x64/lib_MD/crashpad_client.lib"
|
||||||
|
"project/src/crashpad/out/Release_x64/lib_MD/crashpad_util.lib"
|
||||||
|
"project/src/crashpad/out/Release_x64/lib_MD/base.lib"
|
||||||
|
"project/src/crashpad/out/Debug_x64/lib_MD/crashpad_client.lib"
|
||||||
|
"project/src/crashpad/out/Debug_x64/lib_MD/crashpad_util.lib"
|
||||||
|
"project/src/crashpad/out/Debug_x64/lib_MD/base.lib"
|
||||||
)
|
)
|
||||||
|
|
||||||
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
||||||
|
70
cmake/externals/steamworks/CMakeLists.txt
vendored
70
cmake/externals/steamworks/CMakeLists.txt
vendored
@ -4,18 +4,82 @@ set(EXTERNAL_NAME steamworks)
|
|||||||
|
|
||||||
string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
|
string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
|
||||||
|
|
||||||
set(STEAMWORKS_URL "${EXTERNAL_BUILD_ASSETS}/dependencies/steamworks_sdk_137.zip")
|
set(STEAMWORKS_URL "${EXTERNAL_BUILD_ASSETS}/dependencies/steamworks_sdk_158a.zip")
|
||||||
set(STEAMWORKS_URL_MD5 "95ba9d0e3ddc04f8a8be17d2da806cbb")
|
set(STEAMWORKS_URL_SHA512 "fe906a7510a2125ab1441ad349e8bc31fafc9ab8130ec3843287e615a850305a8ed303e8d9e5bae4fee06024987834fb9f64c6c10d3da3784267a4906e59c831")
|
||||||
|
|
||||||
|
# Ninja needs to know all the files that result from this upfront, so we need to tell it what files this is going
|
||||||
|
# to generate with BUILD_BYPRODUCTS. We need to include all the files that are going to be referenced from elsewhere
|
||||||
|
# in the build.
|
||||||
|
#
|
||||||
|
# This should include both libraries and headers, since from the point of view of the build, those are the outputs
|
||||||
|
# of the project, even though we're not actually building anything here, and just unzipping an existing binary.
|
||||||
|
#
|
||||||
|
# I believe this list can't be obtained automatically from the compressed file, and needs to be generated by hand.
|
||||||
|
# Steam SDK .zip has a sdk/ subdirectory, but for ExternalProject, this gets turned into project/src/steamworks.
|
||||||
|
# So inside the SDK, sdk/redistributable_bin/steam_api.dll becomes project/src/steamworks/redistributable_bin/steam_api.dll
|
||||||
|
# This can be seen under $BUILD_DIR/ext.
|
||||||
ExternalProject_Add(
|
ExternalProject_Add(
|
||||||
${EXTERNAL_NAME}
|
${EXTERNAL_NAME}
|
||||||
URL ${STEAMWORKS_URL}
|
URL ${STEAMWORKS_URL}
|
||||||
URL_MD5 ${STEAMWORKS_URL_MD5}
|
URL_HASH SHA512=${STEAMWORKS_URL_SHA512}
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
BUILD_COMMAND ""
|
BUILD_COMMAND ""
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
LOG_DOWNLOAD 1
|
LOG_DOWNLOAD 1
|
||||||
DOWNLOAD_EXTRACT_TIMESTAMP 1
|
DOWNLOAD_EXTRACT_TIMESTAMP 1
|
||||||
|
BUILD_BYPRODUCTS
|
||||||
|
"project/src/steamworks/redistributable_bin/win64/steam_api64.lib"
|
||||||
|
"project/src/steamworks/redistributable_bin/win64/steam_api64.dll"
|
||||||
|
"project/src/steamworks/redistributable_bin/osx/steam_api.dylib"
|
||||||
|
"project/src/steamworks/redistributable_bin/linux64/libsteam_api.so"
|
||||||
|
"project/src/steamworks/redistributable_bin/linux32/libsteam_api.so"
|
||||||
|
"project/src/steamworks/redistributable_bin/steam_api.lib"
|
||||||
|
"project/src/steamworks/redistributable_bin/steam_api.dll"
|
||||||
|
"project/src/steamworks/public/steam/isteamapplist.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamapps.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamappticket.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamclient.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamcontroller.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamdualsense.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamfriends.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamgamecoordinator.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamgameserver.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamgameserverstats.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamhtmlsurface.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamhttp.h"
|
||||||
|
"project/src/steamworks/public/steam/isteaminput.h"
|
||||||
|
"project/src/steamworks/public/steam/isteaminventory.h"
|
||||||
|
"project/src/steamworks/public/steam/isteammatchmaking.h"
|
||||||
|
"project/src/steamworks/public/steam/isteammusic.h"
|
||||||
|
"project/src/steamworks/public/steam/isteammusicremote.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamnetworking.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamnetworkingmessages.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamnetworkingsockets.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamnetworkingutils.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamparentalsettings.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamps3overlayrenderer.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamremoteplay.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamremotestorage.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamscreenshots.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamugc.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamuser.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamuserstats.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamutils.h"
|
||||||
|
"project/src/steamworks/public/steam/isteamvideo.h"
|
||||||
|
"project/src/steamworks/public/steam/matchmakingtypes.h"
|
||||||
|
"project/src/steamworks/public/steam/steam_api_common.h"
|
||||||
|
"project/src/steamworks/public/steam/steam_api_flat.h"
|
||||||
|
"project/src/steamworks/public/steam/steam_api.h"
|
||||||
|
"project/src/steamworks/public/steam/steam_api_internal.h"
|
||||||
|
"project/src/steamworks/public/steam/steamclientpublic.h"
|
||||||
|
"project/src/steamworks/public/steam/steamencryptedappticket.h"
|
||||||
|
"project/src/steamworks/public/steam/steam_gameserver.h"
|
||||||
|
"project/src/steamworks/public/steam/steamhttpenums.h"
|
||||||
|
"project/src/steamworks/public/steam/steamnetworkingfakeip.h"
|
||||||
|
"project/src/steamworks/public/steam/steamnetworkingtypes.h"
|
||||||
|
"project/src/steamworks/public/steam/steamps3params.h"
|
||||||
|
"project/src/steamworks/public/steam/steamtypes.h"
|
||||||
|
"project/src/steamworks/public/steam/steamuniverse.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
|
set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
#
|
|
||||||
# ConfigureCCache.cmake
|
|
||||||
# cmake/macros
|
|
||||||
#
|
|
||||||
# Created by Clement Brisset on 10/10/18.
|
|
||||||
# Copyright 2018 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
|
|
||||||
#
|
|
||||||
|
|
||||||
macro(configure_ccache)
|
|
||||||
find_program(CCACHE_PROGRAM ccache)
|
|
||||||
if(CCACHE_PROGRAM)
|
|
||||||
message(STATUS "Configuring ccache")
|
|
||||||
|
|
||||||
# Set up wrapper scripts
|
|
||||||
set(C_LAUNCHER "${CCACHE_PROGRAM}")
|
|
||||||
set(CXX_LAUNCHER "${CCACHE_PROGRAM}")
|
|
||||||
|
|
||||||
set(LAUNCH_C_IN "${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/launch-c.in")
|
|
||||||
set(LAUNCH_CXX_IN "${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/launch-cxx.in")
|
|
||||||
set(LAUNCH_C "${CMAKE_BINARY_DIR}/CMakeFiles/launch-c")
|
|
||||||
set(LAUNCH_CXX "${CMAKE_BINARY_DIR}/CMakeFiles/launch-cxx")
|
|
||||||
|
|
||||||
configure_file(${LAUNCH_C_IN} ${LAUNCH_C})
|
|
||||||
configure_file(${LAUNCH_CXX_IN} ${LAUNCH_CXX})
|
|
||||||
execute_process(COMMAND chmod a+rx ${LAUNCH_C} ${LAUNCH_CXX})
|
|
||||||
|
|
||||||
if(CMAKE_GENERATOR STREQUAL "Xcode")
|
|
||||||
# Set Xcode project attributes to route compilation and linking
|
|
||||||
# through our scripts
|
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_CC ${LAUNCH_C})
|
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_CXX ${LAUNCH_CXX})
|
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_LD ${LAUNCH_C})
|
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS ${LAUNCH_CXX})
|
|
||||||
else()
|
|
||||||
# Support Unix Makefiles and Ninja
|
|
||||||
set(CMAKE_C_COMPILER_LAUNCHER ${LAUNCH_C})
|
|
||||||
set(CMAKE_CXX_COMPILER_LAUNCHER ${LAUNCH_CXX})
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
message(WARNING "Could not find ccache")
|
|
||||||
endif()
|
|
||||||
endmacro()
|
|
@ -14,36 +14,38 @@ macro(TARGET_OPENEXR)
|
|||||||
TMP
|
TMP
|
||||||
REGEX "#define OPENEXR_VERSION_STRING.*$")
|
REGEX "#define OPENEXR_VERSION_STRING.*$")
|
||||||
string(REGEX MATCHALL "[0-9.]+" OPENEXR_VERSION ${TMP})
|
string(REGEX MATCHALL "[0-9.]+" OPENEXR_VERSION ${TMP})
|
||||||
|
|
||||||
file(STRINGS
|
file(STRINGS
|
||||||
${openexr_config_file}
|
${openexr_config_file}
|
||||||
TMP
|
TMP
|
||||||
REGEX "#define OPENEXR_VERSION_MAJOR.*$")
|
REGEX "#define OPENEXR_VERSION_MAJOR.*$")
|
||||||
string(REGEX MATCHALL "[0-9]" OPENEXR_MAJOR_VERSION ${TMP})
|
string(REGEX MATCHALL "[0-9]" OPENEXR_MAJOR_VERSION ${TMP})
|
||||||
|
|
||||||
file(STRINGS
|
file(STRINGS
|
||||||
${openexr_config_file}
|
${openexr_config_file}
|
||||||
TMP
|
TMP
|
||||||
REGEX "#define OPENEXR_VERSION_MINOR.*$")
|
REGEX "#define OPENEXR_VERSION_MINOR.*$")
|
||||||
string(REGEX MATCHALL "[0-9]" OPENEXR_MINOR_VERSION ${TMP})
|
string(REGEX MATCHALL "[0-9]" OPENEXR_MINOR_VERSION ${TMP})
|
||||||
|
else()
|
||||||
|
message(WARNING "Failed to find ${openexr_config_file}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(OPENEXR_LIBRARY_RELEASE "")
|
set(OPENEXR_LIBRARY_RELEASE "")
|
||||||
set(OPENEXR_LIBRARY_DEBUG "")
|
set(OPENEXR_LIBRARY_DEBUG "")
|
||||||
foreach(OPENEXR_LIB
|
foreach(OPENEXR_LIB
|
||||||
IlmImf
|
OpenEXRCore
|
||||||
IlmImfUtil
|
OpenEXR
|
||||||
Half
|
OpenEXRUtil
|
||||||
Iex
|
Iex
|
||||||
IexMath
|
IlmThread
|
||||||
Imath
|
Imath
|
||||||
IlmThread)
|
)
|
||||||
|
|
||||||
# OpenEXR libraries may be suffixed with the version number, so we search
|
# OpenEXR libraries may be suffixed with the version number, so we search
|
||||||
# using both versioned and unversioned names.
|
# using both versioned and unversioned names.
|
||||||
find_library(OPENEXR_${OPENEXR_LIB}_LIBRARY_RELEASE
|
find_library(OPENEXR_${OPENEXR_LIB}_LIBRARY_RELEASE
|
||||||
NAMES
|
NAMES
|
||||||
${OPENEXR_LIB}-${OPENEXR_MAJOR_VERSION}_${OPENEXR_MINOR_VERSION}_s
|
${OPENEXR_LIB}-${OPENEXR_MAJOR_VERSION}_${OPENEXR_MINOR_VERSION}
|
||||||
${OPENEXR_LIB}_s
|
${OPENEXR_LIB}_s
|
||||||
|
|
||||||
PATHS ${VCPKG_INSTALL_ROOT}/lib NO_DEFAULT_PATH
|
PATHS ${VCPKG_INSTALL_ROOT}/lib NO_DEFAULT_PATH
|
||||||
@ -52,13 +54,15 @@ macro(TARGET_OPENEXR)
|
|||||||
|
|
||||||
if(OPENEXR_${OPENEXR_LIB}_LIBRARY_RELEASE)
|
if(OPENEXR_${OPENEXR_LIB}_LIBRARY_RELEASE)
|
||||||
list(APPEND OPENEXR_LIBRARY_RELEASE ${OPENEXR_${OPENEXR_LIB}_LIBRARY_RELEASE})
|
list(APPEND OPENEXR_LIBRARY_RELEASE ${OPENEXR_${OPENEXR_LIB}_LIBRARY_RELEASE})
|
||||||
|
else()
|
||||||
|
message(WARNING "Failed to find ${OPENEXR_LIB} (release); ${OPENEXR_LIB}-${OPENEXR_MAJOR_VERSION}_${OPENEXR_MINOR_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# OpenEXR libraries may be suffixed with the version number, so we search
|
# OpenEXR libraries may be suffixed with the version number, so we search
|
||||||
# using both versioned and unversioned names.
|
# using both versioned and unversioned names.
|
||||||
find_library(OPENEXR_${OPENEXR_LIB}_LIBRARY_DEBUG
|
find_library(OPENEXR_${OPENEXR_LIB}_LIBRARY_DEBUG
|
||||||
NAMES
|
NAMES
|
||||||
${OPENEXR_LIB}-${OPENEXR_MAJOR_VERSION}_${OPENEXR_MINOR_VERSION}_s_d
|
${OPENEXR_LIB}-${OPENEXR_MAJOR_VERSION}_${OPENEXR_MINOR_VERSION}_d
|
||||||
${OPENEXR_LIB}_s_d
|
${OPENEXR_LIB}_s_d
|
||||||
|
|
||||||
PATHS ${VCPKG_INSTALL_ROOT}/debug/lib NO_DEFAULT_PATH
|
PATHS ${VCPKG_INSTALL_ROOT}/debug/lib NO_DEFAULT_PATH
|
||||||
@ -67,10 +71,19 @@ macro(TARGET_OPENEXR)
|
|||||||
|
|
||||||
if(OPENEXR_${OPENEXR_LIB}_LIBRARY_DEBUG)
|
if(OPENEXR_${OPENEXR_LIB}_LIBRARY_DEBUG)
|
||||||
list(APPEND OPENEXR_LIBRARY_DEBUG ${OPENEXR_${OPENEXR_LIB}_LIBRARY_DEBUG})
|
list(APPEND OPENEXR_LIBRARY_DEBUG ${OPENEXR_${OPENEXR_LIB}_LIBRARY_DEBUG})
|
||||||
|
else()
|
||||||
|
message(WARNING "Failed to find ${OPENEXR_LIB} (debug); ${OPENEXR_LIB}-${OPENEXR_MAJOR_VERSION}_${OPENEXR_MINOR_VERSION}_d")
|
||||||
endif()
|
endif()
|
||||||
endforeach(OPENEXR_LIB)
|
endforeach(OPENEXR_LIB)
|
||||||
|
|
||||||
select_library_configurations(OPENEXR)
|
select_library_configurations(OPENEXR)
|
||||||
target_link_libraries(${TARGET_NAME} ${OPENEXR_LIBRARY})
|
target_link_libraries(${TARGET_NAME} ${OPENEXR_LIBRARY})
|
||||||
|
target_include_directories(${TARGET_NAME} PUBLIC "${VCPKG_INSTALL_ROOT}/include/Imath")
|
||||||
|
|
||||||
|
# This prevents:
|
||||||
|
# LNK2001 unresolved external symbol imath_half_to_float_table
|
||||||
|
#
|
||||||
|
# Apparently something changed in newer versions.
|
||||||
|
target_compile_definitions(${TARGET_NAME} PUBLIC IMATH_HALF_NO_LOOKUP_TABLE)
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
38
cmake/ports/artery-font-format/disable-checksum.patch
Normal file
38
cmake/ports/artery-font-format/disable-checksum.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
diff --git a/artery-font/serialization.hpp b/artery-font/serialization.hpp
|
||||||
|
index 69263a8..6075eda 100644
|
||||||
|
--- a/artery-font/serialization.hpp
|
||||||
|
+++ b/artery-font/serialization.hpp
|
||||||
|
@@ -109,15 +109,16 @@ template <ReadFunction READ, typename REAL, template <typename> class LIST, clas
|
||||||
|
bool decode(ArteryFont<REAL, LIST, BYTE_ARRAY, STRING> &font, void *userData) {
|
||||||
|
uint32 totalLength = 0;
|
||||||
|
uint32 prevLength = 0;
|
||||||
|
- uint32 checksum = crc32Init();
|
||||||
|
+ //uint32 checksum = crc32Init();
|
||||||
|
byte dump[4];
|
||||||
|
#define ARTERY_FONT_DECODE_READ(target, len) { \
|
||||||
|
if (READ((target), (len), userData) != int(len)) \
|
||||||
|
return false; \
|
||||||
|
totalLength += (len); \
|
||||||
|
- for (int _i = 0; _i < int(len); ++_i) \
|
||||||
|
- checksum = crc32Update(checksum, reinterpret_cast<const byte *>(target)[_i]); \
|
||||||
|
}
|
||||||
|
+ // for (int _i = 0; _i < int(len); ++_i) \
|
||||||
|
+ // checksum = crc32update(checksum, reinterpret_cast<const byte *>(target)[_i]); \
|
||||||
|
+ //}
|
||||||
|
#define ARTERY_FONT_DECODE_REALIGN() { \
|
||||||
|
if (totalLength&0x03u) { \
|
||||||
|
uint32 len = 0x04u-(totalLength&0x03u); \
|
||||||
|
@@ -228,10 +229,10 @@ bool decode(ArteryFont<REAL, LIST, BYTE_ARRAY, STRING> &font, void *userData) {
|
||||||
|
ARTERY_FONT_DECODE_READ(&footer, sizeof(footer)-sizeof(footer.checksum));
|
||||||
|
if (footer.magicNo != ARTERY_FONT_FOOTER_MAGIC_NO)
|
||||||
|
return false;
|
||||||
|
- uint32 finalChecksum = checksum;
|
||||||
|
+ //uint32 finalChecksum = checksum;
|
||||||
|
ARTERY_FONT_DECODE_READ(&footer.checksum, sizeof(footer.checksum));
|
||||||
|
- if (footer.checksum != finalChecksum)
|
||||||
|
- return false;
|
||||||
|
+ //if (footer.checksum != finalChecksum)
|
||||||
|
+ // return false;
|
||||||
|
if (totalLength != footer.totalLength)
|
||||||
|
return false;
|
||||||
|
}
|
15
cmake/ports/artery-font-format/portfile.cmake
Normal file
15
cmake/ports/artery-font-format/portfile.cmake
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# header-only library
|
||||||
|
|
||||||
|
vcpkg_from_github(
|
||||||
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
|
REPO Chlumsky/artery-font-format
|
||||||
|
REF 34134bde3cea35a93c2ae5703fa8d3d463793400
|
||||||
|
SHA512 6b2fc0de9ca7b367c9b98f829ce6cee858f1252b12a49b6f1e89a5a2fdb109e20ef812f0b30495195ca0b177adae32d5e238fdc305724857ced098be2d29a6af
|
||||||
|
HEAD_REF master
|
||||||
|
PATCHES "disable-checksum.patch"
|
||||||
|
)
|
||||||
|
|
||||||
|
file(COPY "${SOURCE_PATH}/artery-font" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
|
||||||
|
|
||||||
|
# Handle copyright
|
||||||
|
configure_file("${SOURCE_PATH}/LICENSE.txt" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
|
7
cmake/ports/artery-font-format/vcpkg.json
Normal file
7
cmake/ports/artery-font-format/vcpkg.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"name": "artery-font-format",
|
||||||
|
"version": "1.0.1",
|
||||||
|
"description": "Header-only C++ library that facilitates encoding and decoding of the Artery Atlas Font format",
|
||||||
|
"homepage": "https://github.com/Chlumsky/artery-font-format",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
15
cmake/ports/cgltf/portfile.cmake
Normal file
15
cmake/ports/cgltf/portfile.cmake
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# header-only library
|
||||||
|
|
||||||
|
vcpkg_from_github(
|
||||||
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
|
REPO jkuhlmann/cgltf
|
||||||
|
REF de399881c65c438a635627c749440eeea7e05599
|
||||||
|
SHA512 753923116b92642848ff2bda70695ddd0e7be6db43ed3cfc37aff4cba90a29a92e3dbda139a5f2c80cad1d2cdaf81e1383e4ea7a12195f61fe8cfeb105e53ea2
|
||||||
|
HEAD_REF master
|
||||||
|
)
|
||||||
|
|
||||||
|
file(COPY "${SOURCE_PATH}/cgltf.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
|
||||||
|
file(COPY "${SOURCE_PATH}/cgltf_write.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
|
||||||
|
|
||||||
|
# Handle copyright
|
||||||
|
configure_file("${SOURCE_PATH}/LICENSE" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
|
7
cmake/ports/cgltf/vcpkg.json
Normal file
7
cmake/ports/cgltf/vcpkg.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"name": "cgltf",
|
||||||
|
"version": "1.13",
|
||||||
|
"description": "Single-file glTF 2.0 loader and writer written in C99",
|
||||||
|
"homepage": "https://github.com/jkuhlmann/cgltf",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
@ -5,4 +5,4 @@
|
|||||||
Source: hifi-deps
|
Source: hifi-deps
|
||||||
Version: 0.1.5-github-actions
|
Version: 0.1.5-github-actions
|
||||||
Description: Collected dependencies for High Fidelity applications
|
Description: Collected dependencies for High Fidelity applications
|
||||||
Build-Depends: bullet3, draco, etc2comp, glad, glm, node, nvtt, openexr (!android), openssl (windows), opus, polyvox, tbb (!android), vhacd, webrtc (!android|!(linux&arm)), zlib
|
Build-Depends: artery-font-format, bullet3, cgltf, draco, etc2comp, glad, glm, node, nvtt, openexr (!android), openssl (windows), opus, polyvox, tbb (!android), vhacd, webrtc (!android|!(linux&arm)), zlib
|
||||||
|
25
cmake/ports/imath/portfile.cmake
Normal file
25
cmake/ports/imath/portfile.cmake
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
vcpkg_from_github(
|
||||||
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
|
REPO AcademySoftwareFoundation/Imath
|
||||||
|
REF v3.1.9
|
||||||
|
SHA512 ad96b2ac306fc13c01e8ea3256f885499c3f545be327feaba0f5e093b70b544bcca6f8b353fa7e35107aae515c19caced44331a95d0414f367ead4691ec73564
|
||||||
|
HEAD_REF master
|
||||||
|
)
|
||||||
|
|
||||||
|
vcpkg_cmake_configure(
|
||||||
|
SOURCE_PATH "${SOURCE_PATH}"
|
||||||
|
OPTIONS
|
||||||
|
-DIMATH_INSTALL_SYM_LINK=OFF
|
||||||
|
-DBUILD_TESTING=OFF
|
||||||
|
-DIMATH_INSTALL_PKG_CONFIG=ON
|
||||||
|
)
|
||||||
|
|
||||||
|
vcpkg_cmake_install()
|
||||||
|
|
||||||
|
vcpkg_copy_pdbs()
|
||||||
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Imath)
|
||||||
|
vcpkg_fixup_pkgconfig()
|
||||||
|
|
||||||
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||||
|
|
||||||
|
file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
18
cmake/ports/imath/vcpkg.json
Normal file
18
cmake/ports/imath/vcpkg.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "imath",
|
||||||
|
"version": "3.1.9",
|
||||||
|
"port-version": 1,
|
||||||
|
"description": "Imath is a C++ and Python library of 2D and 3D vector, matrix, and math operations for computer graphics.",
|
||||||
|
"homepage": "https://github.com/AcademySoftwareFoundation/Imath",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"dependencies": [
|
||||||
|
{
|
||||||
|
"name": "vcpkg-cmake",
|
||||||
|
"host": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vcpkg-cmake-config",
|
||||||
|
"host": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
8
cmake/ports/node/portfile.cmake
Executable file → Normal file
8
cmake/ports/node/portfile.cmake
Executable file → Normal file
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2023 Overte e.V.
|
# Copyright 2023-2024 Overte e.V.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
set(NODE_VERSION 18.14.2)
|
set(NODE_VERSION 18.14.2)
|
||||||
@ -28,9 +28,9 @@ else ()
|
|||||||
vcpkg_from_github(
|
vcpkg_from_github(
|
||||||
OUT_SOURCE_PATH SOURCE_PATH
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
REPO nodejs/node
|
REPO nodejs/node
|
||||||
REF v18.16.1
|
REF v18.20.2
|
||||||
SHA512 cd2d7871a1a2aca8d800e0a501bd2836cbce076de750dcfc0b2bbe602c8a23705154bfb12faa3ff78e25ec753f419220742228569c281fa458987fb24f6d4d09
|
SHA512 10d3637c26274677d137f76bbb648d0e7851c994634a16c89858c3a13094a0692ea2cb9a787c6463c3001abd71dab0d83123127bc305171d097c48d21d691678
|
||||||
HEAD_REF v18.16.1
|
HEAD_REF v18.20.2
|
||||||
)
|
)
|
||||||
# node cannot configure out of source, which VCPKG expects. So we copy the source to the configure directory.
|
# node cannot configure out of source, which VCPKG expects. So we copy the source to the configure directory.
|
||||||
file(COPY ${SOURCE_PATH}/ DESTINATION "${CURRENT_BUILDTREES_DIR}")
|
file(COPY ${SOURCE_PATH}/ DESTINATION "${CURRENT_BUILDTREES_DIR}")
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
Source: openexr
|
|
||||||
Version: 2.3.0-2
|
|
||||||
Description: OpenEXR is a high dynamic-range (HDR) image file format developed by Industrial Light & Magic for use in computer imaging applications
|
|
||||||
Build-Depends: zlib
|
|
@ -1,87 +0,0 @@
|
|||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
|
|
||||||
find_path(OpenEXR_INCLUDE_DIRS OpenEXR/OpenEXRConfig.h)
|
|
||||||
find_path(OPENEXR_INCLUDE_PATHS NAMES ImfRgbaFile.h PATH_SUFFIXES OpenEXR)
|
|
||||||
|
|
||||||
file(STRINGS "${OpenEXR_INCLUDE_DIRS}/OpenEXR/OpenEXRConfig.h" OPENEXR_CONFIG_H)
|
|
||||||
|
|
||||||
string(REGEX REPLACE "^.*define OPENEXR_VERSION_MAJOR ([0-9]+).*$" "\\1" OpenEXR_VERSION_MAJOR "${OPENEXR_CONFIG_H}")
|
|
||||||
string(REGEX REPLACE "^.*define OPENEXR_VERSION_MINOR ([0-9]+).*$" "\\1" OpenEXR_VERSION_MINOR "${OPENEXR_CONFIG_H}")
|
|
||||||
set(OpenEXR_LIB_SUFFIX "${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}")
|
|
||||||
|
|
||||||
include(SelectLibraryConfigurations)
|
|
||||||
|
|
||||||
if(NOT OpenEXR_BASE_LIBRARY)
|
|
||||||
find_library(OpenEXR_BASE_LIBRARY_RELEASE NAMES IlmImf-${OpenEXR_LIB_SUFFIX})
|
|
||||||
find_library(OpenEXR_BASE_LIBRARY_DEBUG NAMES IlmImf-${OpenEXR_LIB_SUFFIX}_d)
|
|
||||||
select_library_configurations(OpenEXR_BASE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT OpenEXR_UTIL_LIBRARY)
|
|
||||||
find_library(OpenEXR_UTIL_LIBRARY_RELEASE NAMES IlmImfUtil-${OpenEXR_LIB_SUFFIX})
|
|
||||||
find_library(OpenEXR_UTIL_LIBRARY_DEBUG NAMES IlmImfUtil-${OpenEXR_LIB_SUFFIX}_d)
|
|
||||||
select_library_configurations(OpenEXR_UTIL)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT OpenEXR_HALF_LIBRARY)
|
|
||||||
find_library(OpenEXR_HALF_LIBRARY_RELEASE NAMES Half-${OpenEXR_LIB_SUFFIX})
|
|
||||||
find_library(OpenEXR_HALF_LIBRARY_DEBUG NAMES Half-${OpenEXR_LIB_SUFFIX}_d)
|
|
||||||
select_library_configurations(OpenEXR_HALF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT OpenEXR_IEX_LIBRARY)
|
|
||||||
find_library(OpenEXR_IEX_LIBRARY_RELEASE NAMES Iex-${OpenEXR_LIB_SUFFIX})
|
|
||||||
find_library(OpenEXR_IEX_LIBRARY_DEBUG NAMES Iex-${OpenEXR_LIB_SUFFIX}_d)
|
|
||||||
select_library_configurations(OpenEXR_IEX)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT OpenEXR_MATH_LIBRARY)
|
|
||||||
find_library(OpenEXR_MATH_LIBRARY_RELEASE NAMES Imath-${OpenEXR_LIB_SUFFIX})
|
|
||||||
find_library(OpenEXR_MATH_LIBRARY_DEBUG NAMES Imath-${OpenEXR_LIB_SUFFIX}_d)
|
|
||||||
select_library_configurations(OpenEXR_MATH)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT OpenEXR_THREAD_LIBRARY)
|
|
||||||
find_library(OpenEXR_THREAD_LIBRARY_RELEASE NAMES IlmThread-${OpenEXR_LIB_SUFFIX})
|
|
||||||
find_library(OpenEXR_THREAD_LIBRARY_DEBUG NAMES IlmThread-${OpenEXR_LIB_SUFFIX}_d)
|
|
||||||
select_library_configurations(OpenEXR_THREAD)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT OpenEXR_IEXMATH_LIBRARY)
|
|
||||||
find_library(OpenEXR_IEXMATH_LIBRARY_RELEASE NAMES IexMath-${OpenEXR_LIB_SUFFIX})
|
|
||||||
find_library(OpenEXR_IEXMATH_LIBRARY_DEBUG NAMES IexMath-${OpenEXR_LIB_SUFFIX}d)
|
|
||||||
select_library_configurations(OpenEXR_IEXMATH)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(OPENEXR_HALF_LIBRARY "${OpenEXR_HALF_LIBRARY}")
|
|
||||||
set(OPENEXR_IEX_LIBRARY "${OpenEXR_IEX_LIBRARY}")
|
|
||||||
set(OPENEXR_IMATH_LIBRARY "${OpenEXR_MATH_LIBRARY}")
|
|
||||||
set(OPENEXR_ILMIMF_LIBRARY "${OpenEXR_BASE_LIBRARY}")
|
|
||||||
set(OPENEXR_ILMIMFUTIL_LIBRARY "${OpenEXR_UTIL_LIBRARY}")
|
|
||||||
set(OPENEXR_ILMTHREAD_LIBRARY "${OpenEXR_THREAD_LIBRARY}")
|
|
||||||
|
|
||||||
set(OpenEXR_LIBRARY "${OpenEXR_BASE_LIBRARY}")
|
|
||||||
|
|
||||||
set(OpenEXR_LIBRARIES
|
|
||||||
${OpenEXR_LIBRARY}
|
|
||||||
${OpenEXR_MATH_LIBRARY}
|
|
||||||
${OpenEXR_IEXMATH_LIBRARY}
|
|
||||||
${OpenEXR_UTIL_LIBRARY}
|
|
||||||
${OpenEXR_HALF_LIBRARY}
|
|
||||||
${OpenEXR_IEX_LIBRARY}
|
|
||||||
${OpenEXR_THREAD_LIBRARY}
|
|
||||||
)
|
|
||||||
|
|
||||||
set(OPENEXR_LIBRARIES
|
|
||||||
${OPENEXR_HALF_LIBRARY}
|
|
||||||
${OPENEXR_IEX_LIBRARY}
|
|
||||||
${OPENEXR_IMATH_LIBRARY}
|
|
||||||
${OPENEXR_ILMIMF_LIBRARY}
|
|
||||||
${OPENEXR_ILMTHREAD_LIBRARY}
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR REQUIRED_VARS OpenEXR_LIBRARIES OpenEXR_INCLUDE_DIRS)
|
|
||||||
|
|
||||||
if(OpenEXR_FOUND)
|
|
||||||
set(OPENEXR_FOUND 1)
|
|
||||||
endif()
|
|
13
cmake/ports/openexr/fix-arm64-windows-build.patch
Normal file
13
cmake/ports/openexr/fix-arm64-windows-build.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/src/lib/OpenEXRCore/internal_dwa_simd.h b/src/lib/OpenEXRCore/internal_dwa_simd.h
|
||||||
|
index 7b53501ac..ca69c9848 100644
|
||||||
|
--- a/src/lib/OpenEXRCore/internal_dwa_simd.h
|
||||||
|
+++ b/src/lib/OpenEXRCore/internal_dwa_simd.h
|
||||||
|
@@ -18,7 +18,7 @@
|
||||||
|
// aligned. Unaligned pointers may risk seg-faulting.
|
||||||
|
//
|
||||||
|
|
||||||
|
-#if defined __SSE2__ || (_MSC_VER >= 1300 && !_M_CEE_PURE)
|
||||||
|
+#if defined __SSE2__ || (_MSC_VER >= 1300 && (_M_IX86 || _M_X64) && !_M_CEE_PURE)
|
||||||
|
# define IMF_HAVE_SSE2 1
|
||||||
|
# include <emmintrin.h>
|
||||||
|
# include <mmintrin.h>
|
@ -1,19 +0,0 @@
|
|||||||
diff --git a/OpenEXR/IlmImf/CMakeLists.txt b/OpenEXR/IlmImf/CMakeLists.txt
|
|
||||||
index e1a8740..d31cf68 100644
|
|
||||||
--- a/OpenEXR/IlmImf/CMakeLists.txt
|
|
||||||
+++ b/OpenEXR/IlmImf/CMakeLists.txt
|
|
||||||
@@ -2,14 +2,6 @@
|
|
||||||
|
|
||||||
SET(CMAKE_INCLUDE_CURRENT_DIR 1)
|
|
||||||
|
|
||||||
-IF (WIN32)
|
|
||||||
- SET(RUNTIME_DIR ${OPENEXR_PACKAGE_PREFIX}/bin)
|
|
||||||
- SET(WORKING_DIR ${RUNTIME_DIR})
|
|
||||||
-ELSE ()
|
|
||||||
- SET(RUNTIME_DIR ${OPENEXR_PACKAGE_PREFIX}/lib)
|
|
||||||
- SET(WORKING_DIR .)
|
|
||||||
-ENDIF ()
|
|
||||||
-
|
|
||||||
SET(BUILD_B44EXPLOGTABLE OFF)
|
|
||||||
IF (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/b44ExpLogTable.h")
|
|
||||||
SET(BUILD_B44EXPLOGTABLE ON)
|
|
@ -1,71 +1,46 @@
|
|||||||
set(OPENEXR_VERSION 2.3.0)
|
|
||||||
set(OPENEXR_HASH 268ae64b40d21d662f405fba97c307dad1456b7d996a447aadafd41b640ca736d4851d9544b4741a94e7b7c335fe6e9d3b16180e710671abfc0c8b2740b147b2)
|
|
||||||
|
|
||||||
vcpkg_from_github(
|
vcpkg_from_github(
|
||||||
OUT_SOURCE_PATH SOURCE_PATH
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
REPO openexr/openexr
|
REPO AcademySoftwareFoundation/openexr
|
||||||
REF v${OPENEXR_VERSION}
|
REF "v${VERSION}"
|
||||||
SHA512 ${OPENEXR_HASH}
|
SHA512 ec60e79341695452e05f50bbcc0d55e0ce00fbb64cdec01a83911189c8643eb28a8046b14ee4230e5f438f018f2f1d0714f691983474d7979befd199f3f34758
|
||||||
HEAD_REF master
|
HEAD_REF master
|
||||||
PATCHES "fix_install_ilmimf.patch"
|
PATCHES
|
||||||
|
fix-arm64-windows-build.patch # https://github.com/AcademySoftwareFoundation/openexr/pull/1447
|
||||||
)
|
)
|
||||||
|
|
||||||
set(OPENEXR_STATIC ON)
|
vcpkg_check_features(OUT_FEATURE_OPTIONS OPTIONS
|
||||||
set(OPENEXR_SHARED OFF)
|
FEATURES
|
||||||
|
tools OPENEXR_BUILD_TOOLS
|
||||||
vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}
|
tools OPENEXR_INSTALL_TOOLS
|
||||||
PREFER_NINJA
|
)
|
||||||
OPTIONS
|
vcpkg_cmake_configure(
|
||||||
-DOPENEXR_BUILD_PYTHON_LIBS=OFF
|
SOURCE_PATH "${SOURCE_PATH}"
|
||||||
-DOPENEXR_BUILD_VIEWERS=OFF
|
OPTIONS
|
||||||
-DOPENEXR_RUN_FUZZ_TESTS=OFF
|
${OPTIONS}
|
||||||
-DOPENEXR_BUILD_SHARED=${OPENEXR_SHARED}
|
-DBUILD_TESTING=OFF
|
||||||
-DOPENEXR_BUILD_STATIC=${OPENEXR_STATIC}
|
-DOPENEXR_INSTALL_EXAMPLES=OFF
|
||||||
OPTIONS_DEBUG
|
-DBUILD_DOCS=OFF
|
||||||
-DILMBASE_PACKAGE_PREFIX=${CURRENT_INSTALLED_DIR}/debug
|
OPTIONS_DEBUG
|
||||||
OPTIONS_RELEASE
|
-DOPENEXR_BUILD_TOOLS=OFF
|
||||||
-DILMBASE_PACKAGE_PREFIX=${CURRENT_INSTALLED_DIR})
|
-DOPENEXR_INSTALL_TOOLS=OFF
|
||||||
|
)
|
||||||
vcpkg_install_cmake()
|
vcpkg_cmake_install()
|
||||||
|
|
||||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
||||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
|
||||||
|
|
||||||
# NOTE: Only use ".exe" extension on Windows executables.
|
|
||||||
# Is there a cleaner way to do this?
|
|
||||||
if(WIN32)
|
|
||||||
set(EXECUTABLE_SUFFIX ".exe")
|
|
||||||
else()
|
|
||||||
set(EXECUTABLE_SUFFIX "")
|
|
||||||
endif()
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrenvmap${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrheader${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmakepreview${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmaketiled${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultipart${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultiview${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrstdattr${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/exrenvmap${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/exrheader${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/exrmakepreview${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/exrmaketiled${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/exrmultipart${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/exrmultiview${EXECUTABLE_SUFFIX})
|
|
||||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/exrstdattr${EXECUTABLE_SUFFIX})
|
|
||||||
|
|
||||||
vcpkg_copy_pdbs()
|
vcpkg_copy_pdbs()
|
||||||
|
|
||||||
if (OPENEXR_STATIC)
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/OpenEXR)
|
||||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
vcpkg_fixup_pkgconfig()
|
||||||
|
|
||||||
|
if(OPENEXR_INSTALL_TOOLS)
|
||||||
|
vcpkg_copy_tools(
|
||||||
|
TOOL_NAMES exrenvmap exrheader exrinfo exrmakepreview exrmaketiled exrmultipart exrmultiview exrstdattr exr2aces
|
||||||
|
AUTO_CLEAN
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
file(REMOVE_RECURSE
|
||||||
set(OPENEXR_PORT_DIR "openexr")
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
||||||
else()
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
||||||
set(OPENEXR_PORT_DIR "OpenEXR")
|
)
|
||||||
endif()
|
|
||||||
|
|
||||||
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${OPENEXR_PORT_DIR})
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/${OPENEXR_PORT_DIR}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${OPENEXR_PORT_DIR}/copyright)
|
file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||||
|
|
||||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindOpenEXR.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${OPENEXR_PORT_DIR})
|
|
||||||
|
4
cmake/ports/openexr/usage
Normal file
4
cmake/ports/openexr/usage
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
openexr provides CMake targets:
|
||||||
|
|
||||||
|
find_package(OpenEXR CONFIG REQUIRED)
|
||||||
|
target_link_libraries(main PRIVATE OpenEXR::OpenEXR)
|
25
cmake/ports/openexr/vcpkg.json
Normal file
25
cmake/ports/openexr/vcpkg.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"name": "openexr",
|
||||||
|
"version": "3.1.8",
|
||||||
|
"description": "OpenEXR is a high dynamic-range (HDR) image file format developed by Industrial Light & Magic for use in computer imaging applications",
|
||||||
|
"homepage": "https://www.openexr.com/",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"supports": "!uwp",
|
||||||
|
"dependencies": [
|
||||||
|
"imath",
|
||||||
|
{
|
||||||
|
"name": "vcpkg-cmake",
|
||||||
|
"host": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vcpkg-cmake-config",
|
||||||
|
"host": true
|
||||||
|
},
|
||||||
|
"zlib"
|
||||||
|
],
|
||||||
|
"features": {
|
||||||
|
"tools": {
|
||||||
|
"description": "Build tools"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Xcode generator doesn't include the compiler as the
|
|
||||||
# first argument, Ninja and Makefiles do. Handle both cases.
|
|
||||||
if [[ "$1" = "${CMAKE_C_COMPILER}" ]] ; then
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
export CCACHE_CPP2=true
|
|
||||||
export CCACHE_HARDLINK=true
|
|
||||||
export CCACHE_SLOPPINESS=file_macro,time_macros,include_file_mtime,include_file_ctime,file_stat_matches
|
|
||||||
exec "${C_LAUNCHER}" "${CMAKE_C_COMPILER}" "$@"
|
|
@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Xcode generator doesn't include the compiler as the
|
|
||||||
# first argument, Ninja and Makefiles do. Handle both cases.
|
|
||||||
if [[ "$1" = "${CMAKE_CXX_COMPILER}" ]] ; then
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
export CCACHE_CPP2=true
|
|
||||||
export CCACHE_HARDLINK=true
|
|
||||||
export CCACHE_SLOPPINESS=file_macro,time_macros,include_file_mtime,include_file_ctime,file_stat_matches
|
|
||||||
exec "${CXX_LAUNCHER}" "${CMAKE_CXX_COMPILER}" "$@"
|
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": 2.6,
|
"version": 2.7,
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
"name": "metaverse",
|
"name": "metaverse",
|
||||||
@ -402,7 +402,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Permissions <a data-toggle='tooltip' data-html='true' title='<p><strong>Domain-Wide User Permissions</strong></p><ul><li><strong>Connect</strong><br />Sets whether a user can connect to the domain.</li><li><strong>Avatar Entities</strong><br />Sets whether a user can use avatar entities on the domain.</li><li><strong>Lock / Unlock</strong><br />Sets whether a user change the “locked” property of an entity (either from on to off or off to on).</li><li><strong>Rez</strong><br />Sets whether a user can create new entities.</li><li><strong>Rez Temporary</strong><br />Sets whether a user can create new entities with a finite lifetime.</li><li><strong>Write Assets</strong><br />Sets whether a user can make changes to the domain’s asset-server assets.</li><li><strong>Ignore Max Capacity</strong><br />Sets whether a user can connect even if the domain has reached or exceeded its maximum allowed agents.</li><li><strong>Replace Content</strong><br>Sets whether a user can replace entire content sets by wiping existing domain content.</li><li><strong>Get and Set Private User Data</strong><br>Sets whether a user can get and set the privateUserData entity property.</li></ul><p>Note that permissions assigned to a specific user will supersede any parameter-level permissions that might otherwise apply to that user. Additionally, if more than one parameter is applicable to a given user, the permissions given to that user will be the sum of all applicable parameters. For example, let’s say only localhost users can connect and only logged in users can lock and unlock entities. If a user is both logged in and on localhost then they will be able to both connect and lock/unlock entities.</p>'>?</a>",
|
"label": "Permissions <a data-toggle='tooltip' data-html='true' title='<p><strong>Domain-Wide User Permissions</strong></p><ul><li><strong>Connect</strong><br />Sets whether a user can connect to the domain.</li><li><strong>Avatar Entities</strong><br />Sets whether a user can use avatar entities on the domain.</li><li><strong>Lock / Unlock</strong><br />Sets whether a user change the “locked” property of an entity (either from on to off or off to on).</li><li><strong>Rez</strong><br />Sets whether a user can create new entities.</li><li><strong>Rez Temporary</strong><br />Sets whether a user can create new entities with a finite lifetime.</li><li><strong>Write Assets</strong><br />Sets whether a user can make changes to the domain’s asset-server assets.</li><li><strong>Ignore Max Capacity</strong><br />Sets whether a user can connect even if the domain has reached or exceeded its maximum allowed agents.</li><li><strong>Replace Content</strong><br>Sets whether a user can replace entire content sets by wiping existing domain content.</li><li><strong>Get and Set Private User Data</strong><br>Sets whether a user can get and set the privateUserData entity property.</li></ul><p>Note that permissions assigned to a specific user will supersede any parameter-level permissions that might otherwise apply to that user. Additionally, if more than one parameter is applicable to a given user, the permissions given to that user will be the sum of all applicable parameters. For example, let’s say only localhost users can connect and only logged in users can lock and unlock entities. If a user is both logged in and on localhost then they will be able to both connect and lock/unlock entities.</p>'>?</a>",
|
||||||
"span": 12
|
"span": 11
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"columns": [
|
"columns": [
|
||||||
@ -479,6 +479,13 @@
|
|||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"editable": true,
|
"editable": true,
|
||||||
"default": false
|
"default": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id_can_view_asset_urls",
|
||||||
|
"label": "View Asset URLs",
|
||||||
|
"type": "checkbox",
|
||||||
|
"editable": true,
|
||||||
|
"default": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"non-deletable-row-key": "permissions_id",
|
"non-deletable-row-key": "permissions_id",
|
||||||
@ -505,6 +512,7 @@
|
|||||||
"id_can_rez_tmp": true,
|
"id_can_rez_tmp": true,
|
||||||
"id_can_write_to_asset_server": true,
|
"id_can_write_to_asset_server": true,
|
||||||
"id_can_get_and_set_private_user_data": true,
|
"id_can_get_and_set_private_user_data": true,
|
||||||
|
"id_can_view_asset_urls": true,
|
||||||
"permissions_id": "localhost"
|
"permissions_id": "localhost"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -633,6 +641,13 @@
|
|||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"editable": true,
|
"editable": true,
|
||||||
"default": false
|
"default": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id_can_view_asset_urls",
|
||||||
|
"label": "View Asset URLs",
|
||||||
|
"type": "checkbox",
|
||||||
|
"editable": true,
|
||||||
|
"default": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -752,6 +767,13 @@
|
|||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"editable": true,
|
"editable": true,
|
||||||
"default": false
|
"default": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id_can_view_asset_urls",
|
||||||
|
"label": "View Asset URLs",
|
||||||
|
"type": "checkbox",
|
||||||
|
"editable": true,
|
||||||
|
"default": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -844,6 +866,13 @@
|
|||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"editable": true,
|
"editable": true,
|
||||||
"default": false
|
"default": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id_can_view_asset_urls",
|
||||||
|
"label": "View Asset URLs",
|
||||||
|
"type": "checkbox",
|
||||||
|
"editable": true,
|
||||||
|
"default": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -936,6 +965,13 @@
|
|||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"editable": true,
|
"editable": true,
|
||||||
"default": false
|
"default": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id_can_view_asset_urls",
|
||||||
|
"label": "View Asset URLs",
|
||||||
|
"type": "checkbox",
|
||||||
|
"editable": true,
|
||||||
|
"default": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -1022,13 +1058,20 @@
|
|||||||
"editable": true,
|
"editable": true,
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "id_can_get_and_set_private_user_data",
|
"name": "id_can_get_and_set_private_user_data",
|
||||||
"label": "Get and Set Private User Data",
|
"label": "Get and Set Private User Data",
|
||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"editable": true,
|
"editable": true,
|
||||||
"default": false
|
"default": false
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"name": "id_can_view_asset_urls",
|
||||||
|
"label": "View Asset URLs",
|
||||||
|
"type": "checkbox",
|
||||||
|
"editable": true,
|
||||||
|
"default": false
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1120,6 +1163,13 @@
|
|||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"editable": true,
|
"editable": true,
|
||||||
"default": false
|
"default": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id_can_view_asset_urls",
|
||||||
|
"label": "View Asset URLs",
|
||||||
|
"type": "checkbox",
|
||||||
|
"editable": true,
|
||||||
|
"default": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -601,7 +601,7 @@ $(document).ready(function(){
|
|||||||
form += '<label class="control-label">' + label + '</label>';
|
form += '<label class="control-label">' + label + '</label>';
|
||||||
form += ' <a id="edit-network-address-port" class="domain-loading-hide" href="#">Edit</a>';
|
form += ' <a id="edit-network-address-port" class="domain-loading-hide" href="#">Edit</a>';
|
||||||
form += '<input type="text" class="domain-loading-hide form-control" disabled></input>';
|
form += '<input type="text" class="domain-loading-hide form-control" disabled></input>';
|
||||||
form += '<div class="domain-loading-hide help-block">This defines how nodes will connect to your domain. You can read more about automatic networking <a href="">here</a>.</div>';
|
form += '<div class="domain-loading-hide help-block">This defines how nodes will connect to your domain. Since the displayed setting is read back from directory server, it takes some time to update after being edited. You can read more about automatic networking <a href="">here</a>.</div>';
|
||||||
form += '</div>';
|
form += '</div>';
|
||||||
|
|
||||||
form = $(form);
|
form = $(form);
|
||||||
@ -664,7 +664,13 @@ $(document).ready(function(){
|
|||||||
success: function(xhr) {
|
success: function(xhr) {
|
||||||
console.log(xhr, parseJSONResponse(xhr));
|
console.log(xhr, parseJSONResponse(xhr));
|
||||||
dialog.modal('hide');
|
dialog.modal('hide');
|
||||||
reloadDomainInfo();
|
reloadDomainInfo(); // TODO: this one doesn't work since directory server still has old data
|
||||||
|
setTimeout(function() {
|
||||||
|
reloadDomainInfo();
|
||||||
|
}, 16000);
|
||||||
|
setTimeout(function() {
|
||||||
|
reloadDomainInfo();
|
||||||
|
}, 64000);
|
||||||
},
|
},
|
||||||
error:function(xhr) {
|
error:function(xhr) {
|
||||||
var data = parseJSONResponse(xhr);
|
var data = parseJSONResponse(xhr);
|
||||||
|
@ -353,6 +353,7 @@ void DomainGatekeeper::updateNodePermissions() {
|
|||||||
userPerms.permissions |= NodePermissions::Permission::canReplaceDomainContent;
|
userPerms.permissions |= NodePermissions::Permission::canReplaceDomainContent;
|
||||||
userPerms.permissions |= NodePermissions::Permission::canGetAndSetPrivateUserData;
|
userPerms.permissions |= NodePermissions::Permission::canGetAndSetPrivateUserData;
|
||||||
userPerms.permissions |= NodePermissions::Permission::canRezAvatarEntities;
|
userPerms.permissions |= NodePermissions::Permission::canRezAvatarEntities;
|
||||||
|
userPerms.permissions |= NodePermissions::Permission::canViewAssetURLs;
|
||||||
} else {
|
} else {
|
||||||
// at this point we don't have a sending socket for packets from this node - assume it is the active socket
|
// at this point we don't have a sending socket for packets from this node - assume it is the active socket
|
||||||
// or the public socket if we haven't activated a socket for the node yet
|
// or the public socket if we haven't activated a socket for the node yet
|
||||||
@ -446,6 +447,7 @@ SharedNodePointer DomainGatekeeper::processAssignmentConnectRequest(const NodeCo
|
|||||||
userPerms.permissions |= NodePermissions::Permission::canReplaceDomainContent;
|
userPerms.permissions |= NodePermissions::Permission::canReplaceDomainContent;
|
||||||
userPerms.permissions |= NodePermissions::Permission::canGetAndSetPrivateUserData;
|
userPerms.permissions |= NodePermissions::Permission::canGetAndSetPrivateUserData;
|
||||||
userPerms.permissions |= NodePermissions::Permission::canRezAvatarEntities;
|
userPerms.permissions |= NodePermissions::Permission::canRezAvatarEntities;
|
||||||
|
userPerms.permissions |= NodePermissions::Permission::canViewAssetURLs;
|
||||||
newNode->setPermissions(userPerms);
|
newNode->setPermissions(userPerms);
|
||||||
return newNode;
|
return newNode;
|
||||||
}
|
}
|
||||||
|
@ -73,9 +73,9 @@ Q_LOGGING_CATEGORY(domain_server_auth, "overte.domain_server.auth")
|
|||||||
|
|
||||||
const QString ACCESS_TOKEN_KEY_PATH = "metaverse.access_token";
|
const QString ACCESS_TOKEN_KEY_PATH = "metaverse.access_token";
|
||||||
const QString DomainServer::REPLACEMENT_FILE_EXTENSION = ".replace";
|
const QString DomainServer::REPLACEMENT_FILE_EXTENSION = ".replace";
|
||||||
|
const QString& DOMAIN_SERVER_SETTINGS_KEY = "domain_server";
|
||||||
const QString PUBLIC_SOCKET_ADDRESS_KEY = "network_address";
|
const QString PUBLIC_SOCKET_ADDRESS_KEY = "network_address";
|
||||||
const QString PUBLIC_SOCKET_PORT_KEY = "network_port";
|
const QString PUBLIC_SOCKET_PORT_KEY = "network_port";
|
||||||
const QString DOMAIN_UPDATE_AUTOMATIC_NETWORKING_KEY = "automatic_networking";
|
|
||||||
const int MIN_PORT = 1;
|
const int MIN_PORT = 1;
|
||||||
const int MAX_PORT = 65535;
|
const int MAX_PORT = 65535;
|
||||||
|
|
||||||
@ -1567,18 +1567,25 @@ QJsonObject jsonForDomainSocketUpdate(const SockAddr& socket) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DomainServer::performIPAddressPortUpdate(const SockAddr& newPublicSockAddr) {
|
void DomainServer::performIPAddressPortUpdate(const SockAddr& newPublicSockAddr) {
|
||||||
const QString& DOMAIN_SERVER_SETTINGS_KEY = "domain_server";
|
|
||||||
const QString& publicSocketAddress = newPublicSockAddr.getAddress().toString();
|
const QString& publicSocketAddress = newPublicSockAddr.getAddress().toString();
|
||||||
const int publicSocketPort = newPublicSockAddr.getPort();
|
const int publicSocketPort = newPublicSockAddr.getPort();
|
||||||
|
|
||||||
sendHeartbeatToMetaverse(publicSocketAddress, publicSocketPort);
|
if (_automaticNetworkingSetting == IP_ONLY_AUTOMATIC_NETWORKING_VALUE) {
|
||||||
|
sendHeartbeatToMetaverse(publicSocketAddress, 0);
|
||||||
|
} else {
|
||||||
|
// Full automatic networking, update both port and IP address
|
||||||
|
sendHeartbeatToMetaverse(publicSocketAddress, publicSocketPort);
|
||||||
|
}
|
||||||
|
|
||||||
QJsonObject rootObject;
|
QJsonObject rootObject;
|
||||||
QJsonObject domainServerObject;
|
QJsonObject domainServerObject;
|
||||||
domainServerObject.insert(PUBLIC_SOCKET_ADDRESS_KEY, publicSocketAddress);
|
domainServerObject.insert(PUBLIC_SOCKET_ADDRESS_KEY, publicSocketAddress);
|
||||||
domainServerObject.insert(PUBLIC_SOCKET_PORT_KEY, publicSocketPort);
|
if (_automaticNetworkingSetting == FULL_AUTOMATIC_NETWORKING_VALUE) {
|
||||||
|
domainServerObject.insert(PUBLIC_SOCKET_PORT_KEY, publicSocketPort);
|
||||||
|
}
|
||||||
rootObject.insert(DOMAIN_SERVER_SETTINGS_KEY, domainServerObject);
|
rootObject.insert(DOMAIN_SERVER_SETTINGS_KEY, domainServerObject);
|
||||||
QJsonDocument doc(rootObject);
|
QJsonDocument doc(rootObject);
|
||||||
|
qDebug() << "DomainServer::performIPAddressPortUpdate: " << doc;
|
||||||
_settingsManager.recurseJSONObjectAndOverwriteSettings(rootObject, DomainSettings);
|
_settingsManager.recurseJSONObjectAndOverwriteSettings(rootObject, DomainSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2487,6 +2494,16 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
auto domainID = domainSetting.toString();
|
auto domainID = domainSetting.toString();
|
||||||
|
qDebug() << connection->parseUrlEncodedForm();
|
||||||
|
auto parsed = connection->parseUrlEncodedForm();
|
||||||
|
if (parsed.contains(PUBLIC_SOCKET_PORT_KEY) || parsed.contains(PUBLIC_SOCKET_ADDRESS_KEY)) {
|
||||||
|
QJsonObject domainServerObject;
|
||||||
|
domainServerObject.insert(PUBLIC_SOCKET_PORT_KEY, parsed[PUBLIC_SOCKET_PORT_KEY]);
|
||||||
|
domainServerObject.insert(PUBLIC_SOCKET_ADDRESS_KEY, parsed[PUBLIC_SOCKET_ADDRESS_KEY]);
|
||||||
|
QJsonObject rootObject;
|
||||||
|
rootObject.insert(DOMAIN_SERVER_SETTINGS_KEY, domainServerObject);
|
||||||
|
_settingsManager.recurseJSONObjectAndOverwriteSettings(rootObject, DomainSettings);
|
||||||
|
}
|
||||||
return forwardMetaverseAPIRequest(connection, url, "/api/v1/domains/" + domainID, "domain",
|
return forwardMetaverseAPIRequest(connection, url, "/api/v1/domains/" + domainID, "domain",
|
||||||
{ }, { "network_address", "network_port", "label" });
|
{ }, { "network_address", "network_port", "label" });
|
||||||
} else if (url.path() == URI_API_PLACES) {
|
} else if (url.path() == URI_API_PLACES) {
|
||||||
|
@ -547,6 +547,29 @@ void DomainServerSettingsManager::setupConfigMap(const QString& userConfigFilena
|
|||||||
|
|
||||||
// No migration needed to version 2.6.
|
// No migration needed to version 2.6.
|
||||||
|
|
||||||
|
if (oldVersion < 2.7) {
|
||||||
|
// Default values for new canViewAssetURLs permission.
|
||||||
|
unpackPermissions();
|
||||||
|
std::list<std::unordered_map<NodePermissionsKey, NodePermissionsPointer>> permissionsSets{
|
||||||
|
_standardAgentPermissions.get(),
|
||||||
|
_agentPermissions.get(),
|
||||||
|
_ipPermissions.get(),
|
||||||
|
_macPermissions.get(),
|
||||||
|
_machineFingerprintPermissions.get(),
|
||||||
|
_groupPermissions.get(),
|
||||||
|
_groupForbiddens.get()
|
||||||
|
};
|
||||||
|
foreach (auto permissionsSet, permissionsSets) {
|
||||||
|
for (auto entry : permissionsSet) {
|
||||||
|
const auto& userKey = entry.first;
|
||||||
|
if (permissionsSet[userKey]->can(NodePermissions::Permission::canConnectToDomain)) {
|
||||||
|
permissionsSet[userKey]->set(NodePermissions::Permission::canViewAssetURLs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
packPermissions();
|
||||||
|
}
|
||||||
|
|
||||||
// write the current description version to our settings
|
// write the current description version to our settings
|
||||||
*versionVariant = _descriptionVersion;
|
*versionVariant = _descriptionVersion;
|
||||||
|
|
||||||
|
23
hifi_qt.py
23
hifi_qt.py
@ -81,7 +81,9 @@ endif()
|
|||||||
|
|
||||||
qt_found = True
|
qt_found = True
|
||||||
system_qt = True
|
system_qt = True
|
||||||
print("Using system Qt")
|
|
||||||
|
if not self.args.quiet:
|
||||||
|
print("Using system Qt")
|
||||||
|
|
||||||
elif os.getenv('OVERTE_QT_PATH', "") != "":
|
elif os.getenv('OVERTE_QT_PATH', "") != "":
|
||||||
# 2. Using an user-provided directory.
|
# 2. Using an user-provided directory.
|
||||||
@ -92,7 +94,9 @@ endif()
|
|||||||
self.cmakePath = os.path.join(self.fullPath, 'lib', 'cmake')
|
self.cmakePath = os.path.join(self.fullPath, 'lib', 'cmake')
|
||||||
|
|
||||||
qt_found = True
|
qt_found = True
|
||||||
print("Using Qt from " + self.fullPath)
|
|
||||||
|
if not self.args.quiet:
|
||||||
|
print("Using Qt from " + self.fullPath)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# 3. Using a pre-built Qt.
|
# 3. Using a pre-built Qt.
|
||||||
@ -135,7 +139,8 @@ endif()
|
|||||||
self.lockFile = os.path.join(lockDir, lockName)
|
self.lockFile = os.path.join(lockDir, lockName)
|
||||||
|
|
||||||
if qt_found:
|
if qt_found:
|
||||||
print("Found pre-built Qt5")
|
if not self.args.quiet:
|
||||||
|
print("Found pre-built Qt5")
|
||||||
return
|
return
|
||||||
|
|
||||||
if 'Windows' == system:
|
if 'Windows' == system:
|
||||||
@ -147,8 +152,8 @@ endif()
|
|||||||
cpu_architecture = platform.machine()
|
cpu_architecture = platform.machine()
|
||||||
|
|
||||||
if 'x86_64' == cpu_architecture:
|
if 'x86_64' == cpu_architecture:
|
||||||
# `major_version()` can return blank string on rolling release distros like arch
|
# `major_version()` can return blank string on rolling release distros like arch
|
||||||
# The `or 0` conditional assignment prevents the int parsing error from hiding the useful Qt package error
|
# The `or 0` conditional assignment prevents the int parsing error from hiding the useful Qt package error
|
||||||
u_major = int( distro.major_version() or '0' )
|
u_major = int( distro.major_version() or '0' )
|
||||||
if distro.id() == 'ubuntu' or distro.id() == 'linuxmint':
|
if distro.id() == 'ubuntu' or distro.id() == 'linuxmint':
|
||||||
if (distro.id() == 'ubuntu' and u_major == 20) or distro.id() == 'linuxmint' and u_major == 20:
|
if (distro.id() == 'ubuntu' and u_major == 20) or distro.id() == 'linuxmint' and u_major == 20:
|
||||||
@ -165,9 +170,7 @@ endif()
|
|||||||
if distro.id() == 'ubuntu':
|
if distro.id() == 'ubuntu':
|
||||||
u_major = int( distro.major_version() )
|
u_major = int( distro.major_version() )
|
||||||
|
|
||||||
if u_major == 18:
|
if u_major == 20:
|
||||||
self.qtUrl = 'http://motofckr9k.ddns.net/vircadia_packages/qt5-install-5.15.2-ubuntu-18.04-aarch64_test.tar.xz'
|
|
||||||
elif u_major == 20:
|
|
||||||
self.qtUrl = self.assets_url + '/dependencies/qt5/qt5-install-5.15.9-2023.05.21-kde_fb3ec282151b1ee281a24f0545a40ac6438537c2-ubuntu-20.04-aarch64.tar.xz'
|
self.qtUrl = self.assets_url + '/dependencies/qt5/qt5-install-5.15.9-2023.05.21-kde_fb3ec282151b1ee281a24f0545a40ac6438537c2-ubuntu-20.04-aarch64.tar.xz'
|
||||||
elif u_major > 20:
|
elif u_major > 20:
|
||||||
self.__no_qt_package_error()
|
self.__no_qt_package_error()
|
||||||
@ -177,9 +180,7 @@ endif()
|
|||||||
elif distro.id() == 'debian':
|
elif distro.id() == 'debian':
|
||||||
u_major = int( distro.major_version() )
|
u_major = int( distro.major_version() )
|
||||||
|
|
||||||
if u_major == 10:
|
if u_major > 10:
|
||||||
self.qtUrl = 'https://data.moto9000.moe/vircadia_packages/qt5-install-5.15.2-debian-10-aarch64.tar.xz'
|
|
||||||
elif u_major > 10:
|
|
||||||
self.__no_qt_package_error()
|
self.__no_qt_package_error()
|
||||||
else:
|
else:
|
||||||
self.__unsupported_error()
|
self.__unsupported_error()
|
||||||
|
@ -13,7 +13,7 @@ from os import path
|
|||||||
|
|
||||||
print = functools.partial(print, flush=True)
|
print = functools.partial(print, flush=True)
|
||||||
|
|
||||||
# Encapsulates the vcpkg system
|
# Encapsulates the vcpkg system
|
||||||
class VcpkgRepo:
|
class VcpkgRepo:
|
||||||
CMAKE_TEMPLATE = """
|
CMAKE_TEMPLATE = """
|
||||||
# this file auto-generated by hifi_vcpkg.py
|
# this file auto-generated by hifi_vcpkg.py
|
||||||
@ -41,7 +41,13 @@ endif()
|
|||||||
else:
|
else:
|
||||||
self.id = hifi_utils.hashFolder(self.sourcePortsPath)[:8]
|
self.id = hifi_utils.hashFolder(self.sourcePortsPath)[:8]
|
||||||
self.configFilePath = os.path.join(args.build_root, 'vcpkg.cmake')
|
self.configFilePath = os.path.join(args.build_root, 'vcpkg.cmake')
|
||||||
self.assets_url = self.readVar('EXTERNAL_BUILD_ASSETS')
|
|
||||||
|
if args.get_vcpkg_id or args.get_vcpkg_path:
|
||||||
|
# With these arguments no assets will be downloaded, and they may be used in conditions
|
||||||
|
# where the _env hack doesn't work.
|
||||||
|
self.assets_url = "http://no_assets.invalid"
|
||||||
|
else:
|
||||||
|
self.assets_url = self.readVar('EXTERNAL_BUILD_ASSETS')
|
||||||
|
|
||||||
# The noClean flag indicates we're doing weird dependency maintenance stuff
|
# 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
|
# i.e. we've got an explicit checkout of vcpkg and we don't want the script to
|
||||||
@ -71,7 +77,8 @@ endif()
|
|||||||
os.makedirs(self.basePath)
|
os.makedirs(self.basePath)
|
||||||
self.path = os.path.join(self.basePath, self.id)
|
self.path = os.path.join(self.basePath, self.id)
|
||||||
|
|
||||||
print("Using vcpkg path {}".format(self.path))
|
if not self.args.quiet:
|
||||||
|
print("Using vcpkg path {}".format(self.path))
|
||||||
lockDir, lockName = os.path.split(self.path)
|
lockDir, lockName = os.path.split(self.path)
|
||||||
lockName += '.lock'
|
lockName += '.lock'
|
||||||
if not os.path.isdir(lockDir):
|
if not os.path.isdir(lockDir):
|
||||||
@ -80,7 +87,7 @@ endif()
|
|||||||
self.lockFile = os.path.join(lockDir, lockName)
|
self.lockFile = os.path.join(lockDir, lockName)
|
||||||
self.tagFile = os.path.join(self.path, '.id')
|
self.tagFile = os.path.join(self.path, '.id')
|
||||||
self.prebuildTagFile = os.path.join(self.path, '.prebuild')
|
self.prebuildTagFile = os.path.join(self.path, '.prebuild')
|
||||||
# A format version attached to the tag file... increment when you want to force the build systems to rebuild
|
# A format version attached to the tag file... increment when you want to force the build systems to rebuild
|
||||||
# without the contents of the ports changing
|
# without the contents of the ports changing
|
||||||
self.version = 1
|
self.version = 1
|
||||||
self.tagContents = "{}_{}".format(self.id, self.version)
|
self.tagContents = "{}_{}".format(self.id, self.version)
|
||||||
@ -108,14 +115,14 @@ endif()
|
|||||||
elif 'Linux' == system and 'aarch64' == machine:
|
elif 'Linux' == system and 'aarch64' == machine:
|
||||||
self.exe = os.path.join(self.path, 'vcpkg')
|
self.exe = os.path.join(self.path, 'vcpkg')
|
||||||
self.bootstrapCmds = [ os.path.join(self.path, 'bootstrap-vcpkg.sh'), '-disableMetrics' ]
|
self.bootstrapCmds = [ os.path.join(self.path, 'bootstrap-vcpkg.sh'), '-disableMetrics' ]
|
||||||
self.vcpkgUrl = self.assets_url + '/dependencies/vcpkg/vcpkg-linux_aarch64_2022.07.25.tar.xz'
|
self.vcpkgUrl = self.assets_url + '/dependencies/vcpkg/vcpkg-linux_aarch64_2023.11.20.tar.xz'
|
||||||
self.vcpkgHash = '7abb7aa96200e3cb5a6d0ec1c6ee63aa7886df2d1fecf8f9ee41ebe4d2cea0d4143274222c4941cb7aca61e4048229fdfe9eb2cd36dd559dd26db871a3b3ed61'
|
self.vcpkgHash = 'f38efba40bd4b0b6df47986e373d5535d3e787e257cf19d66ee8ee00e670a6fb95b3e824020024f3edbdcf86a0548e5bbddcc0ac7bd2ff6352a245efac8402fe'
|
||||||
self.hostTriplet = 'arm64-linux'
|
self.hostTriplet = 'arm64-linux'
|
||||||
else:
|
else:
|
||||||
self.exe = os.path.join(self.path, 'vcpkg')
|
self.exe = os.path.join(self.path, 'vcpkg')
|
||||||
self.bootstrapCmds = [ os.path.join(self.path, 'bootstrap-vcpkg.sh'), '-disableMetrics' ]
|
self.bootstrapCmds = [ os.path.join(self.path, 'bootstrap-vcpkg.sh'), '-disableMetrics' ]
|
||||||
self.vcpkgUrl = self.assets_url + '/dependencies/vcpkg/vcpkg-linux_amd64_2022.07.25.tar.xz'
|
self.vcpkgUrl = self.assets_url + '/dependencies/vcpkg/vcpkg-linux_amd64_2023.10.19.tar.xz'
|
||||||
self.vcpkgHash = '6a1ce47ef6621e699a4627e8821ad32528c82fce62a6939d35b205da2d299aaa405b5f392df4a9e5343dd6a296516e341105fbb2dd8b48864781d129d7fba10d'
|
self.vcpkgHash = '6c26ff73d6348e121cca47e90d5358587bf83ba22852acb195b76fbf0473070b24512c8fdd3216d26f03515a79c085f239272ef87c7020cc578cc79abbbd338d'
|
||||||
self.hostTriplet = 'x64-linux'
|
self.hostTriplet = 'x64-linux'
|
||||||
|
|
||||||
if self.args.android:
|
if self.args.android:
|
||||||
@ -188,7 +195,7 @@ endif()
|
|||||||
if not downloadVcpkg and not os.path.isfile(self.exe):
|
if not downloadVcpkg and not os.path.isfile(self.exe):
|
||||||
print("Missing executable, boot-strapping")
|
print("Missing executable, boot-strapping")
|
||||||
downloadVcpkg = True
|
downloadVcpkg = True
|
||||||
|
|
||||||
# Make sure we have a vcpkg executable
|
# Make sure we have a vcpkg executable
|
||||||
testFile = os.path.join(self.path, '.vcpkg-root')
|
testFile = os.path.join(self.path, '.vcpkg-root')
|
||||||
if not downloadVcpkg and not os.path.isfile(testFile):
|
if not downloadVcpkg and not os.path.isfile(testFile):
|
||||||
@ -241,7 +248,7 @@ endif()
|
|||||||
hifi_utils.downloadAndExtract(self.prebuiltArchive, self.path)
|
hifi_utils.downloadAndExtract(self.prebuiltArchive, self.path)
|
||||||
self.writePrebuildTag()
|
self.writePrebuildTag()
|
||||||
return
|
return
|
||||||
|
|
||||||
if qt is not None:
|
if qt is not None:
|
||||||
self.buildEnv['QT_CMAKE_PREFIX_PATH'] = qt
|
self.buildEnv['QT_CMAKE_PREFIX_PATH'] = qt
|
||||||
|
|
||||||
@ -327,12 +334,12 @@ endif()
|
|||||||
write_obj.write(line)
|
write_obj.write(line)
|
||||||
else:
|
else:
|
||||||
isFileChanged = True
|
isFileChanged = True
|
||||||
|
|
||||||
if isFileChanged:
|
if isFileChanged:
|
||||||
shutil.move(newCmakeScript, cmakeScript)
|
shutil.move(newCmakeScript, cmakeScript)
|
||||||
else:
|
else:
|
||||||
os.remove(newCmakeScript)
|
os.remove(newCmakeScript)
|
||||||
|
|
||||||
|
|
||||||
def writeConfig(self):
|
def writeConfig(self):
|
||||||
print("Writing cmake config to {}".format(self.configFilePath))
|
print("Writing cmake config to {}".format(self.configFilePath))
|
||||||
@ -352,7 +359,7 @@ endif()
|
|||||||
f.write(cmakeConfig)
|
f.write(cmakeConfig)
|
||||||
|
|
||||||
def cleanOldBuilds(self):
|
def cleanOldBuilds(self):
|
||||||
# FIXME because we have the base directory, and because a build will
|
# FIXME because we have the base directory, and because a build will
|
||||||
# update the tag file on every run, we can scan the base dir for sub directories containing
|
# update the tag file on every run, we can scan the base dir for sub directories containing
|
||||||
# a tag file that is older than N days, and if found, delete the directory, recovering space
|
# a tag file that is older than N days, and if found, delete the directory, recovering space
|
||||||
print("Not implemented")
|
print("Not implemented")
|
||||||
|
@ -347,6 +347,10 @@ Flickable {
|
|||||||
text: "Real-Time"
|
text: "Real-Time"
|
||||||
refreshRatePreset: 2 // RefreshRateProfile::REALTIME
|
refreshRatePreset: 2 // RefreshRateProfile::REALTIME
|
||||||
}
|
}
|
||||||
|
ListElement {
|
||||||
|
text: "Custom"
|
||||||
|
refreshRatePreset: 3 // RefreshRateProfile::CUSTOM
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiControlsUit.ComboBox {
|
HifiControlsUit.ComboBox {
|
||||||
@ -362,13 +366,7 @@ Flickable {
|
|||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
|
|
||||||
function refreshRefreshRateDropdownDisplay() {
|
function refreshRefreshRateDropdownDisplay() {
|
||||||
if (Performance.getRefreshRateProfile() === 0) {
|
refreshRateDropdown.currentIndex = Performance.getRefreshRateProfile();
|
||||||
refreshRateDropdown.currentIndex = 0;
|
|
||||||
} else if (Performance.getRefreshRateProfile() === 1) {
|
|
||||||
refreshRateDropdown.currentIndex = 1;
|
|
||||||
} else {
|
|
||||||
refreshRateDropdown.currentIndex = 2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
@ -382,6 +380,180 @@ Flickable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
width: parent.width
|
||||||
|
Layout.topMargin: 32
|
||||||
|
visible: refreshRateDropdown.currentIndex == 3
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.margins: 8
|
||||||
|
|
||||||
|
HifiControlsUit.SpinBox {
|
||||||
|
id: refreshRateCustomFocusActive
|
||||||
|
decimals: 0
|
||||||
|
width: 160
|
||||||
|
height: 32
|
||||||
|
suffix: " FPS"
|
||||||
|
label: "Focus Active"
|
||||||
|
realFrom: 1
|
||||||
|
realTo: 1000
|
||||||
|
realStepSize: 15
|
||||||
|
realValue: 60
|
||||||
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
property var loaded: false
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
realValue = Performance.getCustomRefreshRate(0)
|
||||||
|
loaded = true
|
||||||
|
}
|
||||||
|
|
||||||
|
onRealValueChanged: {
|
||||||
|
if (loaded) {
|
||||||
|
Performance.setCustomRefreshRate(0, realValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HifiControlsUit.SpinBox {
|
||||||
|
id: refreshRateCustomFocusInactive
|
||||||
|
decimals: 0
|
||||||
|
width: 160
|
||||||
|
height: 32
|
||||||
|
suffix: " FPS"
|
||||||
|
label: "Focus Inactive"
|
||||||
|
realFrom: 1
|
||||||
|
realTo: 1000
|
||||||
|
realStepSize: 15
|
||||||
|
realValue: 60
|
||||||
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
property var loaded: false
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
realValue = Performance.getCustomRefreshRate(1)
|
||||||
|
loaded = true
|
||||||
|
}
|
||||||
|
|
||||||
|
onRealValueChanged: {
|
||||||
|
if (loaded) {
|
||||||
|
Performance.setCustomRefreshRate(1, realValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.margins: 8
|
||||||
|
|
||||||
|
HifiControlsUit.SpinBox {
|
||||||
|
id: refreshRateCustomUnfocus
|
||||||
|
decimals: 0
|
||||||
|
width: 160
|
||||||
|
height: 32
|
||||||
|
suffix: " FPS"
|
||||||
|
label: "Unfocus"
|
||||||
|
realFrom: 1
|
||||||
|
realTo: 1000
|
||||||
|
realStepSize: 15
|
||||||
|
realValue: 60
|
||||||
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
property var loaded: false
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
realValue = Performance.getCustomRefreshRate(2)
|
||||||
|
loaded = true
|
||||||
|
}
|
||||||
|
|
||||||
|
onRealValueChanged: {
|
||||||
|
if (loaded) {
|
||||||
|
Performance.setCustomRefreshRate(2, realValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HifiControlsUit.SpinBox {
|
||||||
|
id: refreshRateCustomMinimized
|
||||||
|
decimals: 0
|
||||||
|
width: 160
|
||||||
|
height: 32
|
||||||
|
suffix: " FPS"
|
||||||
|
label: "Minimized"
|
||||||
|
realFrom: 1
|
||||||
|
realTo: 1000
|
||||||
|
realStepSize: 1
|
||||||
|
realValue: 60
|
||||||
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
property var loaded: false
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
realValue = Performance.getCustomRefreshRate(3)
|
||||||
|
loaded = true
|
||||||
|
}
|
||||||
|
|
||||||
|
onRealValueChanged: {
|
||||||
|
if (loaded) {
|
||||||
|
Performance.setCustomRefreshRate(3, realValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.margins: 8
|
||||||
|
|
||||||
|
HifiControlsUit.SpinBox {
|
||||||
|
id: refreshRateCustomStartup
|
||||||
|
decimals: 0
|
||||||
|
width: 160
|
||||||
|
height: 32
|
||||||
|
suffix: " FPS"
|
||||||
|
label: "Startup"
|
||||||
|
realFrom: 1
|
||||||
|
realTo: 1000
|
||||||
|
realStepSize: 15
|
||||||
|
realValue: 60
|
||||||
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
property var loaded: false
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
realValue = Performance.getCustomRefreshRate(4)
|
||||||
|
loaded = true
|
||||||
|
}
|
||||||
|
|
||||||
|
onRealValueChanged: {
|
||||||
|
if (loaded) {
|
||||||
|
Performance.setCustomRefreshRate(4, realValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HifiControlsUit.SpinBox {
|
||||||
|
id: refreshRateCustomShutdown
|
||||||
|
decimals: 0
|
||||||
|
width: 160
|
||||||
|
height: 32
|
||||||
|
suffix: " FPS"
|
||||||
|
label: "Shutdown"
|
||||||
|
realFrom: 1
|
||||||
|
realTo: 1000
|
||||||
|
realStepSize: 15
|
||||||
|
realValue: 60
|
||||||
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
property var loaded: false
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
realValue = Performance.getCustomRefreshRate(5)
|
||||||
|
loaded = true
|
||||||
|
}
|
||||||
|
|
||||||
|
onRealValueChanged: {
|
||||||
|
if (loaded) {
|
||||||
|
Performance.setCustomRefreshRate(5, realValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.preferredWidth: parent.width
|
Layout.preferredWidth: parent.width
|
||||||
Layout.preferredHeight: 35
|
Layout.preferredHeight: 35
|
||||||
|
152
interface/resources/qml/hifi/dialogs/security/ScriptSecurity.qml
Normal file
152
interface/resources/qml/hifi/dialogs/security/ScriptSecurity.qml
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
//
|
||||||
|
// ScriptPermissions.cpp
|
||||||
|
// libraries/script-engine/src/ScriptPermissions.cpp
|
||||||
|
//
|
||||||
|
// Created by dr Karol Suprynowicz on 2024/03/24.
|
||||||
|
// Copyright 2024 Overte e.V.
|
||||||
|
//
|
||||||
|
// Based on EntityScriptQMLWhitelist.qml
|
||||||
|
// Created by Kalila L. on 2019.12.05 | realities.dev | somnilibertas@gmail.com
|
||||||
|
// Copyright 2019 Kalila L.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
// Security settings for the script engines
|
||||||
|
|
||||||
|
import Hifi 1.0 as Hifi
|
||||||
|
import QtQuick 2.8
|
||||||
|
import QtQuick.Controls 2.3
|
||||||
|
import QtQuick.Layouts 1.12
|
||||||
|
import stylesUit 1.0 as HifiStylesUit
|
||||||
|
import controlsUit 1.0 as HiFiControls
|
||||||
|
import PerformanceEnums 1.0
|
||||||
|
import "../../../windows"
|
||||||
|
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: parentBody;
|
||||||
|
|
||||||
|
function getWhitelistAsText() {
|
||||||
|
var whitelist = Settings.getValue("private/scriptPermissionGetAvatarURLSafeURLs");
|
||||||
|
var arrayWhitelist = whitelist.replace(",", "\n");
|
||||||
|
return arrayWhitelist;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setWhitelistAsText(whitelistText) {
|
||||||
|
Settings.setValue("private/scriptPermissionGetAvatarURLSafeURLs", whitelistText.text);
|
||||||
|
notificationText.text = "Whitelist saved.";
|
||||||
|
}
|
||||||
|
|
||||||
|
function setAvatarProtection(enabled) {
|
||||||
|
Settings.setValue("private/scriptPermissionGetAvatarURLEnable", enabled);
|
||||||
|
console.info("Setting Protect Avatar URLs to:", enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
width: parent.width;
|
||||||
|
height: 120;
|
||||||
|
color: "#80010203";
|
||||||
|
|
||||||
|
HifiStylesUit.RalewayRegular {
|
||||||
|
id: titleText;
|
||||||
|
text: "Protect Avatar URLs"
|
||||||
|
// Text size
|
||||||
|
size: 24;
|
||||||
|
// Style
|
||||||
|
color: "white";
|
||||||
|
elide: Text.ElideRight;
|
||||||
|
// Anchors
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: 20;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 20;
|
||||||
|
height: 60;
|
||||||
|
|
||||||
|
CheckBox {
|
||||||
|
id: whitelistEnabled;
|
||||||
|
|
||||||
|
checked: Settings.getValue("private/scriptPermissionGetAvatarURLEnable", true);
|
||||||
|
|
||||||
|
anchors.right: parent.right;
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.topMargin: 10;
|
||||||
|
onToggled: {
|
||||||
|
setAvatarProtection(whitelistEnabled.checked)
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: "Enabled"
|
||||||
|
color: "white"
|
||||||
|
font.pixelSize: 18;
|
||||||
|
anchors.right: parent.left;
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.topMargin: 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: textAreaRectangle;
|
||||||
|
color: "black";
|
||||||
|
width: parent.width;
|
||||||
|
height: 250;
|
||||||
|
anchors.top: titleText.bottom;
|
||||||
|
|
||||||
|
ScrollView {
|
||||||
|
id: textAreaScrollView
|
||||||
|
anchors.fill: parent;
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
contentWidth: parent.width
|
||||||
|
contentHeight: parent.height
|
||||||
|
clip: false;
|
||||||
|
|
||||||
|
TextArea {
|
||||||
|
id: whitelistTextArea
|
||||||
|
text: getWhitelistAsText();
|
||||||
|
onTextChanged: notificationText.text = "";
|
||||||
|
width: parent.width;
|
||||||
|
height: parent.height;
|
||||||
|
font.family: "Ubuntu";
|
||||||
|
font.pointSize: 12;
|
||||||
|
color: "white";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: saveChanges
|
||||||
|
anchors.topMargin: 5;
|
||||||
|
anchors.leftMargin: 20;
|
||||||
|
anchors.rightMargin: 20;
|
||||||
|
x: textAreaRectangle.x + textAreaRectangle.width - width - 15;
|
||||||
|
y: textAreaRectangle.y + textAreaRectangle.height - height;
|
||||||
|
contentItem: Text {
|
||||||
|
text: saveChanges.text
|
||||||
|
font.family: "Ubuntu";
|
||||||
|
font.pointSize: 12;
|
||||||
|
opacity: enabled ? 1.0 : 0.3
|
||||||
|
color: "black"
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
elide: Text.ElideRight
|
||||||
|
}
|
||||||
|
text: "Save Changes"
|
||||||
|
onClicked: setWhitelistAsText(whitelistTextArea)
|
||||||
|
|
||||||
|
HifiStylesUit.RalewayRegular {
|
||||||
|
id: notificationText;
|
||||||
|
text: ""
|
||||||
|
// Text size
|
||||||
|
size: 16;
|
||||||
|
// Style
|
||||||
|
color: "white";
|
||||||
|
elide: Text.ElideLeft;
|
||||||
|
// Anchors
|
||||||
|
anchors.right: parent.left;
|
||||||
|
anchors.rightMargin: 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Zach Fox on 2019-08-08
|
// Created by Zach Fox on 2019-08-08
|
||||||
// Copyright 2019 High Fidelity, Inc.
|
// Copyright 2019 High Fidelity, Inc.
|
||||||
|
// Copyright 2024 Overte e.V.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
@ -78,7 +79,7 @@ Item {
|
|||||||
temporaryText: "Viewing!"
|
temporaryText: "Viewing!"
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Qt.openUrlExternally("https://www.highfidelity.com/knowledge");
|
Qt.openUrlExternally("https://overte.org/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Zach Fox on 2019-08-20
|
// Created by Zach Fox on 2019-08-20
|
||||||
// Copyright 2019 High Fidelity, Inc.
|
// Copyright 2019 High Fidelity, Inc.
|
||||||
|
// Copyright 2024 Overte e.V.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
@ -76,7 +77,7 @@ Item {
|
|||||||
temporaryText: "Opening browser..."
|
temporaryText: "Opening browser..."
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Qt.openUrlExternally("https://www.highfidelity.com/knowledge/kb-tickets/new");
|
Qt.openUrlExternally("https://overte.org/contact.html");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Zach Fox on 2019-06-11
|
// Created by Zach Fox on 2019-06-11
|
||||||
// Copyright 2019 High Fidelity, Inc.
|
// Copyright 2019 High Fidelity, Inc.
|
||||||
|
// Copyright 2024 Overte e.V.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
@ -93,9 +94,9 @@ Flickable {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: 18
|
height: 18
|
||||||
labelTextOn: "Keep Old Menus (File, Edit, etc)"
|
labelTextOn: "Keep Old Menus (File, Edit, etc)"
|
||||||
checked: Settings.getValue("simplifiedUI/keepMenus", false);
|
checked: Settings.getValue("simplifiedUI/keepMenus", true);
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Settings.setValue("simplifiedUI/keepMenus", !Settings.getValue("simplifiedUI/keepMenus", false));
|
Settings.setValue("simplifiedUI/keepMenus", !Settings.getValue("simplifiedUI/keepMenus", true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Zach Fox on 2019-05-06
|
// Created by Zach Fox on 2019-05-06
|
||||||
// Copyright 2019 High Fidelity, Inc.
|
// Copyright 2019 High Fidelity, Inc.
|
||||||
|
// Copyright 2024 Overte e.V.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
@ -175,7 +176,7 @@ Flickable {
|
|||||||
spacing: simplifiedUI.margins.settings.spacingBetweenRadiobuttons
|
spacing: simplifiedUI.margins.settings.spacingBetweenRadiobuttons
|
||||||
|
|
||||||
SimplifiedControls.RadioButton {
|
SimplifiedControls.RadioButton {
|
||||||
id: performanceLow
|
id: performanceLowPower
|
||||||
text: "Low Power Quality" + (PlatformInfo.getTierProfiled() === PerformanceEnums.LOW_POWER ? " (Recommended)" : "")
|
text: "Low Power Quality" + (PlatformInfo.getTierProfiled() === PerformanceEnums.LOW_POWER ? " (Recommended)" : "")
|
||||||
checked: Performance.getPerformancePreset() === PerformanceEnums.LOW_POWER
|
checked: Performance.getPerformancePreset() === PerformanceEnums.LOW_POWER
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Zach Fox on 2019-05-08
|
// Created by Zach Fox on 2019-05-08
|
||||||
// Copyright 2019 High Fidelity, Inc.
|
// Copyright 2019 High Fidelity, Inc.
|
||||||
|
// Copyright 2024 Overte e.V.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
@ -96,12 +97,11 @@ Original.Button {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: HifiStylesUit.FiraSansMedium {
|
contentItem: Text {
|
||||||
id: buttonText
|
id: buttonText
|
||||||
//topPadding: -2 // Necessary for proper alignment using Graphik Medium
|
//topPadding: -2 // Necessary for proper alignment using Graphik Medium
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
color: enabled ? simplifiedUI.colors.controls.button.text.enabled : simplifiedUI.colors.controls.button.text.disabled
|
color: enabled ? simplifiedUI.colors.controls.button.text.enabled : simplifiedUI.colors.controls.button.text.disabled
|
||||||
size: simplifiedUI.sizes.controls.button.textSize
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: root.text
|
text: root.text
|
||||||
|
@ -27,7 +27,7 @@ Item {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
property string title: "Controls"
|
property string title: "Controls"
|
||||||
property var openVRDevices: ["HTC Vive", "Valve Index", "Valve HMD", "Valve", "WindowsMR"]
|
property var openVRDevices: ["HTC Vive", "Valve Index", "Valve HMD", "Valve", "WindowsMR", "Oculus"]
|
||||||
|
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
function startDopplegangerShow(entityID) {
|
function startDopplegangerShow(entityID) {
|
||||||
var properties = Entities.getEntityProperties(entityID, ["position", "rotation"]);
|
var properties = Entities.getEntityProperties(entityID, ["position", "rotation"]);
|
||||||
var avatarPosition = MyAvatar.position;
|
var avatarPosition = MyAvatar.feetPosition;
|
||||||
var drawPosition = {
|
var drawPosition = {
|
||||||
"x": properties.position.x,
|
"x": properties.position.x,
|
||||||
"y": avatarPosition.y,
|
"y": avatarPosition.y,
|
||||||
|
@ -724,8 +724,8 @@ extern DisplayPluginList getDisplayPlugins();
|
|||||||
extern InputPluginList getInputPlugins();
|
extern InputPluginList getInputPlugins();
|
||||||
extern void saveInputPluginSettings(const InputPluginList& plugins);
|
extern void saveInputPluginSettings(const InputPluginList& plugins);
|
||||||
|
|
||||||
bool setupEssentials(int& argc, char** argv, const QCommandLineParser& parser, bool runningMarkerExisted) {
|
bool setupEssentials(const QCommandLineParser& parser, bool runningMarkerExisted) {
|
||||||
qInstallMessageHandler(messageHandler);
|
|
||||||
|
|
||||||
|
|
||||||
const int listenPort = parser.isSet("listenPort") ? parser.value("listenPort").toInt() : INVALID_PORT;
|
const int listenPort = parser.isSet("listenPort") ? parser.value("listenPort").toInt() : INVALID_PORT;
|
||||||
@ -743,6 +743,7 @@ bool setupEssentials(int& argc, char** argv, const QCommandLineParser& parser, b
|
|||||||
|
|
||||||
bool previousSessionCrashed { false };
|
bool previousSessionCrashed { false };
|
||||||
if (!inTestMode) {
|
if (!inTestMode) {
|
||||||
|
// TODO: FIX
|
||||||
previousSessionCrashed = CrashRecoveryHandler::checkForResetSettings(runningMarkerExisted, suppressPrompt);
|
previousSessionCrashed = CrashRecoveryHandler::checkForResetSettings(runningMarkerExisted, suppressPrompt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -763,13 +764,12 @@ bool setupEssentials(int& argc, char** argv, const QCommandLineParser& parser, b
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tell the plugin manager about our statically linked plugins
|
|
||||||
|
|
||||||
DependencyManager::set<ScriptInitializers>();
|
DependencyManager::set<ScriptInitializers>();
|
||||||
DependencyManager::set<PluginManager>();
|
|
||||||
|
// Tell the plugin manager about our statically linked plugins
|
||||||
auto pluginManager = PluginManager::getInstance();
|
auto pluginManager = PluginManager::getInstance();
|
||||||
pluginManager->setInputPluginProvider([] { return getInputPlugins(); });
|
|
||||||
pluginManager->setDisplayPluginProvider([] { return getDisplayPlugins(); });
|
|
||||||
pluginManager->setInputPluginSettingsPersister([](const InputPluginList& plugins) { saveInputPluginSettings(plugins); });
|
|
||||||
if (auto steamClient = pluginManager->getSteamClientPlugin()) {
|
if (auto steamClient = pluginManager->getSteamClientPlugin()) {
|
||||||
steamClient->init();
|
steamClient->init();
|
||||||
}
|
}
|
||||||
@ -777,6 +777,7 @@ bool setupEssentials(int& argc, char** argv, const QCommandLineParser& parser, b
|
|||||||
oculusPlatform->init();
|
oculusPlatform->init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PROFILE_SET_THREAD_NAME("Main Thread");
|
PROFILE_SET_THREAD_NAME("Main Thread");
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
@ -901,7 +902,12 @@ bool setupEssentials(int& argc, char** argv, const QCommandLineParser& parser, b
|
|||||||
DependencyManager::set<CompositorHelper>();
|
DependencyManager::set<CompositorHelper>();
|
||||||
DependencyManager::set<OffscreenQmlSurfaceCache>();
|
DependencyManager::set<OffscreenQmlSurfaceCache>();
|
||||||
DependencyManager::set<EntityScriptClient>();
|
DependencyManager::set<EntityScriptClient>();
|
||||||
|
|
||||||
DependencyManager::set<EntityScriptServerLogClient>();
|
DependencyManager::set<EntityScriptServerLogClient>();
|
||||||
|
auto scriptEngines = DependencyManager::get<ScriptEngines>();
|
||||||
|
auto entityScriptServerLog = DependencyManager::get<EntityScriptServerLogClient>();
|
||||||
|
QObject::connect(scriptEngines.data(), &ScriptEngines::requestingEntityScriptServerLog, entityScriptServerLog.data(), &EntityScriptServerLogClient::requestMessagesForScriptEngines);
|
||||||
|
|
||||||
DependencyManager::set<GooglePolyScriptingInterface>();
|
DependencyManager::set<GooglePolyScriptingInterface>();
|
||||||
DependencyManager::set<OctreeStatsProvider>(nullptr, qApp->getOcteeSceneStats());
|
DependencyManager::set<OctreeStatsProvider>(nullptr, qApp->getOcteeSceneStats());
|
||||||
DependencyManager::set<AvatarBookmarks>();
|
DependencyManager::set<AvatarBookmarks>();
|
||||||
@ -993,8 +999,7 @@ bool Application::initMenu() {
|
|||||||
Application::Application(
|
Application::Application(
|
||||||
int& argc, char** argv,
|
int& argc, char** argv,
|
||||||
const QCommandLineParser& parser,
|
const QCommandLineParser& parser,
|
||||||
QElapsedTimer& startupTimer,
|
QElapsedTimer& startupTimer
|
||||||
bool runningMarkerExisted
|
|
||||||
) :
|
) :
|
||||||
QApplication(argc, argv),
|
QApplication(argc, argv),
|
||||||
_window(new MainWindow(desktop())),
|
_window(new MainWindow(desktop())),
|
||||||
@ -1004,10 +1009,7 @@ Application::Application(
|
|||||||
#ifndef Q_OS_ANDROID
|
#ifndef Q_OS_ANDROID
|
||||||
_logger(new FileLogger(this)),
|
_logger(new FileLogger(this)),
|
||||||
#endif
|
#endif
|
||||||
_previousSessionCrashed(setupEssentials(argc, argv, parser, runningMarkerExisted)),
|
_previousSessionCrashed(false), //setupEssentials(parser, false)),
|
||||||
_entitySimulation(std::make_shared<PhysicalEntitySimulation>()),
|
|
||||||
_physicsEngine(std::make_shared<PhysicsEngine>(Vectors::ZERO)),
|
|
||||||
_entityClipboard(std::make_shared<EntityTree>()),
|
|
||||||
_previousScriptLocation("LastScriptLocation", DESKTOP_LOCATION),
|
_previousScriptLocation("LastScriptLocation", DESKTOP_LOCATION),
|
||||||
_fieldOfView("fieldOfView", DEFAULT_FIELD_OF_VIEW_DEGREES),
|
_fieldOfView("fieldOfView", DEFAULT_FIELD_OF_VIEW_DEGREES),
|
||||||
_hmdTabletScale("hmdTabletScale", DEFAULT_HMD_TABLET_SCALE_PERCENT),
|
_hmdTabletScale("hmdTabletScale", DEFAULT_HMD_TABLET_SCALE_PERCENT),
|
||||||
@ -1032,12 +1034,72 @@ Application::Application(
|
|||||||
_snapshotSound(nullptr),
|
_snapshotSound(nullptr),
|
||||||
_sampleSound(nullptr)
|
_sampleSound(nullptr)
|
||||||
{
|
{
|
||||||
auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
|
|
||||||
setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
|
|
||||||
setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
|
setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
|
||||||
|
|
||||||
LogHandler::getInstance().moveToThread(thread());
|
LogHandler::getInstance().moveToThread(thread());
|
||||||
LogHandler::getInstance().setupRepeatedMessageFlusher();
|
LogHandler::getInstance().setupRepeatedMessageFlusher();
|
||||||
|
qInstallMessageHandler(messageHandler);
|
||||||
|
|
||||||
|
DependencyManager::set<PathUtils>();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Application::initializePluginManager(const QCommandLineParser& parser) {
|
||||||
|
DependencyManager::set<PluginManager>();
|
||||||
|
auto pluginManager = PluginManager::getInstance();
|
||||||
|
|
||||||
|
// To avoid any confusion: the getInputPlugins and getDisplayPlugins are not the ones
|
||||||
|
// from PluginManager, but functions exported by input-plugins/InputPlugin.cpp and
|
||||||
|
// display-plugins/DisplayPlugin.cpp.
|
||||||
|
//
|
||||||
|
// These functions provide the plugin manager with static default plugins.
|
||||||
|
pluginManager->setInputPluginProvider([] { return getInputPlugins(); });
|
||||||
|
pluginManager->setDisplayPluginProvider([] { return getDisplayPlugins(); });
|
||||||
|
pluginManager->setInputPluginSettingsPersister([](const InputPluginList& plugins) { saveInputPluginSettings(plugins); });
|
||||||
|
|
||||||
|
|
||||||
|
// This must be a member function -- PluginManager must exist, and for that
|
||||||
|
// QApplication must exist, or it can't find the plugin path, as QCoreApplication:applicationDirPath
|
||||||
|
// won't work yet.
|
||||||
|
|
||||||
|
if (parser.isSet("display")) {
|
||||||
|
auto preferredDisplays = parser.value("display").split(',', Qt::SkipEmptyParts);
|
||||||
|
qInfo() << "Setting prefered display plugins:" << preferredDisplays;
|
||||||
|
PluginManager::getInstance()->setPreferredDisplayPlugins(preferredDisplays);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parser.isSet("disableDisplayPlugins")) {
|
||||||
|
auto disabledDisplays = parser.value("disableDisplayPlugins").split(',', Qt::SkipEmptyParts);
|
||||||
|
qInfo() << "Disabling following display plugins:" << disabledDisplays;
|
||||||
|
PluginManager::getInstance()->disableDisplays(disabledDisplays);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parser.isSet("disableInputPlugins")) {
|
||||||
|
auto disabledInputs = parser.value("disableInputPlugins").split(',', Qt::SkipEmptyParts);
|
||||||
|
qInfo() << "Disabling following input plugins:" << disabledInputs;
|
||||||
|
PluginManager::getInstance()->disableInputs(disabledInputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Application::initialize(const QCommandLineParser &parser) {
|
||||||
|
|
||||||
|
//qCDebug(interfaceapp) << "Setting up essentials";
|
||||||
|
setupEssentials(parser, _previousSessionCrashed);
|
||||||
|
qCDebug(interfaceapp) << "Initializing application";
|
||||||
|
|
||||||
|
_entitySimulation = std::make_shared<PhysicalEntitySimulation>();
|
||||||
|
_physicsEngine = std::make_shared<PhysicsEngine>(Vectors::ZERO);
|
||||||
|
_entityClipboard = std::make_shared<EntityTree>();
|
||||||
|
_octreeProcessor = std::make_shared<OctreePacketProcessor>();
|
||||||
|
_entityEditSender = std::make_shared<EntityEditPacketSender>();
|
||||||
|
_graphicsEngine = std::make_shared<GraphicsEngine>();
|
||||||
|
_applicationOverlay = std::make_shared<ApplicationOverlay>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
|
||||||
|
setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
if (parser.isSet("testScript")) {
|
if (parser.isSet("testScript")) {
|
||||||
@ -1405,7 +1467,7 @@ Application::Application(
|
|||||||
connect(myAvatar.get(), &MyAvatar::positionGoneTo, this, [this] {
|
connect(myAvatar.get(), &MyAvatar::positionGoneTo, this, [this] {
|
||||||
if (!_physicsEnabled) {
|
if (!_physicsEnabled) {
|
||||||
// when we arrive somewhere without physics enabled --> startSafeLanding
|
// when we arrive somewhere without physics enabled --> startSafeLanding
|
||||||
_octreeProcessor.startSafeLanding();
|
_octreeProcessor->startSafeLanding();
|
||||||
}
|
}
|
||||||
}, Qt::QueuedConnection);
|
}, Qt::QueuedConnection);
|
||||||
|
|
||||||
@ -1578,9 +1640,9 @@ Application::Application(
|
|||||||
qCDebug(interfaceapp, "init() complete.");
|
qCDebug(interfaceapp, "init() complete.");
|
||||||
|
|
||||||
// create thread for parsing of octree data independent of the main network and rendering threads
|
// create thread for parsing of octree data independent of the main network and rendering threads
|
||||||
_octreeProcessor.initialize(_enableProcessOctreeThread);
|
_octreeProcessor->initialize(_enableProcessOctreeThread);
|
||||||
connect(&_octreeProcessor, &OctreePacketProcessor::packetVersionMismatch, this, &Application::notifyPacketVersionMismatch);
|
connect(_octreeProcessor.get(), &OctreePacketProcessor::packetVersionMismatch, this, &Application::notifyPacketVersionMismatch);
|
||||||
_entityEditSender.initialize(_enableProcessOctreeThread);
|
_entityEditSender->initialize(_enableProcessOctreeThread);
|
||||||
|
|
||||||
_idleLoopStdev.reset();
|
_idleLoopStdev.reset();
|
||||||
|
|
||||||
@ -1698,7 +1760,7 @@ Application::Application(
|
|||||||
userActivityLogger.logAction("launch", properties);
|
userActivityLogger.logAction("launch", properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
_entityEditSender.setMyAvatar(myAvatar.get());
|
_entityEditSender->setMyAvatar(myAvatar.get());
|
||||||
|
|
||||||
// The entity octree will have to know about MyAvatar for the parentJointName import
|
// The entity octree will have to know about MyAvatar for the parentJointName import
|
||||||
getEntities()->getTree()->setMyAvatar(myAvatar);
|
getEntities()->getTree()->setMyAvatar(myAvatar);
|
||||||
@ -1707,7 +1769,7 @@ Application::Application(
|
|||||||
// For now we're going to set the PPS for outbound packets to be super high, this is
|
// For now we're going to set the PPS for outbound packets to be super high, this is
|
||||||
// probably not the right long term solution. But for now, we're going to do this to
|
// probably not the right long term solution. But for now, we're going to do this to
|
||||||
// allow you to move an entity around in your hand
|
// allow you to move an entity around in your hand
|
||||||
_entityEditSender.setPacketsPerSecond(3000); // super high!!
|
_entityEditSender->setPacketsPerSecond(3000); // super high!!
|
||||||
|
|
||||||
// Make sure we don't time out during slow operations at startup
|
// Make sure we don't time out during slow operations at startup
|
||||||
updateHeartbeat();
|
updateHeartbeat();
|
||||||
@ -2375,7 +2437,7 @@ Application::Application(
|
|||||||
|
|
||||||
connect(this, &Application::applicationStateChanged, this, &Application::activeChanged);
|
connect(this, &Application::applicationStateChanged, this, &Application::activeChanged);
|
||||||
connect(_window, SIGNAL(windowMinimizedChanged(bool)), this, SLOT(windowMinimizedChanged(bool)));
|
connect(_window, SIGNAL(windowMinimizedChanged(bool)), this, SLOT(windowMinimizedChanged(bool)));
|
||||||
qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTimer.elapsed() / 1000.0);
|
qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)_sessionRunTimer.elapsed() / 1000.0);
|
||||||
|
|
||||||
EntityTreeRenderer::setEntitiesShouldFadeFunction([this]() {
|
EntityTreeRenderer::setEntitiesShouldFadeFunction([this]() {
|
||||||
SharedNodePointer entityServerNode = DependencyManager::get<NodeList>()->soloNodeOfType(NodeType::EntityServer);
|
SharedNodePointer entityServerNode = DependencyManager::get<NodeList>()->soloNodeOfType(NodeType::EntityServer);
|
||||||
@ -2573,7 +2635,7 @@ Application::Application(
|
|||||||
}
|
}
|
||||||
|
|
||||||
_pendingIdleEvent = false;
|
_pendingIdleEvent = false;
|
||||||
_graphicsEngine.startup();
|
_graphicsEngine->startup();
|
||||||
|
|
||||||
qCDebug(interfaceapp) << "Directory Service session ID is" << uuidStringWithoutCurlyBraces(accountManager->getSessionID());
|
qCDebug(interfaceapp) << "Directory Service session ID is" << uuidStringWithoutCurlyBraces(accountManager->getSessionID());
|
||||||
|
|
||||||
@ -2880,43 +2942,59 @@ void Application::cleanupBeforeQuit() {
|
|||||||
|
|
||||||
Application::~Application() {
|
Application::~Application() {
|
||||||
// remove avatars from physics engine
|
// remove avatars from physics engine
|
||||||
auto avatarManager = DependencyManager::get<AvatarManager>();
|
if (auto avatarManager = DependencyManager::get<AvatarManager>()) {
|
||||||
avatarManager->clearOtherAvatars();
|
// AvatarManager may not yet exist in case of an early exit
|
||||||
auto myCharacterController = getMyAvatar()->getCharacterController();
|
|
||||||
myCharacterController->clearDetailedMotionStates();
|
|
||||||
|
|
||||||
PhysicsEngine::Transaction transaction;
|
avatarManager->clearOtherAvatars();
|
||||||
avatarManager->buildPhysicsTransaction(transaction);
|
auto myCharacterController = getMyAvatar()->getCharacterController();
|
||||||
_physicsEngine->processTransaction(transaction);
|
myCharacterController->clearDetailedMotionStates();
|
||||||
avatarManager->handleProcessedPhysicsTransaction(transaction);
|
|
||||||
avatarManager->deleteAllAvatars();
|
|
||||||
|
|
||||||
_physicsEngine->setCharacterController(nullptr);
|
PhysicsEngine::Transaction transaction;
|
||||||
|
avatarManager->buildPhysicsTransaction(transaction);
|
||||||
|
_physicsEngine->processTransaction(transaction);
|
||||||
|
avatarManager->handleProcessedPhysicsTransaction(transaction);
|
||||||
|
avatarManager->deleteAllAvatars();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_physicsEngine) {
|
||||||
|
_physicsEngine->setCharacterController(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
// the _shapeManager should have zero references
|
// the _shapeManager should have zero references
|
||||||
_shapeManager.collectGarbage();
|
_shapeManager.collectGarbage();
|
||||||
assert(_shapeManager.getNumShapes() == 0);
|
assert(_shapeManager.getNumShapes() == 0);
|
||||||
|
|
||||||
// shutdown graphics engine
|
if (_graphicsEngine) {
|
||||||
_graphicsEngine.shutdown();
|
// shutdown graphics engine
|
||||||
|
_graphicsEngine->shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
_gameWorkload.shutdown();
|
_gameWorkload.shutdown();
|
||||||
|
|
||||||
DependencyManager::destroy<Preferences>();
|
DependencyManager::destroy<Preferences>();
|
||||||
PlatformHelper::shutdown();
|
PlatformHelper::shutdown();
|
||||||
|
|
||||||
_entityClipboard->eraseAllOctreeElements();
|
if (_entityClipboard) {
|
||||||
_entityClipboard.reset();
|
_entityClipboard->eraseAllOctreeElements();
|
||||||
|
_entityClipboard.reset();
|
||||||
_octreeProcessor.terminate();
|
|
||||||
_entityEditSender.terminate();
|
|
||||||
|
|
||||||
if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) {
|
|
||||||
steamClient->shutdown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto oculusPlatform = PluginManager::getInstance()->getOculusPlatformPlugin()) {
|
if (_octreeProcessor) {
|
||||||
oculusPlatform->shutdown();
|
_octreeProcessor->terminate();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_entityEditSender) {
|
||||||
|
_entityEditSender->terminate();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (auto pluginManager = PluginManager::getInstance()) {
|
||||||
|
if (auto steamClient = pluginManager->getSteamClientPlugin()) {
|
||||||
|
steamClient->shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (auto oculusPlatform = pluginManager->getOculusPlatformPlugin()) {
|
||||||
|
oculusPlatform->shutdown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DependencyManager::destroy<PluginManager>();
|
DependencyManager::destroy<PluginManager>();
|
||||||
@ -2944,7 +3022,9 @@ Application::~Application() {
|
|||||||
DependencyManager::destroy<GeometryCache>();
|
DependencyManager::destroy<GeometryCache>();
|
||||||
DependencyManager::destroy<ScreenshareScriptingInterface>();
|
DependencyManager::destroy<ScreenshareScriptingInterface>();
|
||||||
|
|
||||||
DependencyManager::get<ResourceManager>()->cleanup();
|
if (auto resourceManager = DependencyManager::get<ResourceManager>()) {
|
||||||
|
resourceManager->cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
// remove the NodeList from the DependencyManager
|
// remove the NodeList from the DependencyManager
|
||||||
DependencyManager::destroy<NodeList>();
|
DependencyManager::destroy<NodeList>();
|
||||||
@ -2958,13 +3038,14 @@ Application::~Application() {
|
|||||||
_window->deleteLater();
|
_window->deleteLater();
|
||||||
|
|
||||||
// make sure that the quit event has finished sending before we take the application down
|
// make sure that the quit event has finished sending before we take the application down
|
||||||
auto closeEventSender = DependencyManager::get<CloseEventSender>();
|
if (auto closeEventSender = DependencyManager::get<CloseEventSender>()) {
|
||||||
while (!closeEventSender->hasFinishedQuitEvent() && !closeEventSender->hasTimedOutQuitEvent()) {
|
while (!closeEventSender->hasFinishedQuitEvent() && !closeEventSender->hasTimedOutQuitEvent()) {
|
||||||
// sleep a little so we're not spinning at 100%
|
// sleep a little so we're not spinning at 100%
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
|
}
|
||||||
|
// quit the thread used by the closure event sender
|
||||||
|
closeEventSender->thread()->quit();
|
||||||
}
|
}
|
||||||
// quit the thread used by the closure event sender
|
|
||||||
closeEventSender->thread()->quit();
|
|
||||||
|
|
||||||
// Can't log to file past this point, FileLogger about to be deleted
|
// Can't log to file past this point, FileLogger about to be deleted
|
||||||
qInstallMessageHandler(LogHandler::verboseMessageHandler);
|
qInstallMessageHandler(LogHandler::verboseMessageHandler);
|
||||||
@ -3104,7 +3185,7 @@ void Application::initializeGL() {
|
|||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
_glWidget->swapBuffers();
|
_glWidget->swapBuffers();
|
||||||
|
|
||||||
_graphicsEngine.initializeGPU(_glWidget);
|
_graphicsEngine->initializeGPU(_glWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::initializeDisplayPlugins() {
|
void Application::initializeDisplayPlugins() {
|
||||||
@ -3116,7 +3197,7 @@ void Application::initializeDisplayPlugins() {
|
|||||||
// Once time initialization code
|
// Once time initialization code
|
||||||
DisplayPluginPointer targetDisplayPlugin;
|
DisplayPluginPointer targetDisplayPlugin;
|
||||||
for(const auto& displayPlugin : displayPlugins) {
|
for(const auto& displayPlugin : displayPlugins) {
|
||||||
displayPlugin->setContext(_graphicsEngine.getGPUContext());
|
displayPlugin->setContext(_graphicsEngine->getGPUContext());
|
||||||
if (displayPlugin->getName() == lastActiveDisplayPluginName) {
|
if (displayPlugin->getName() == lastActiveDisplayPluginName) {
|
||||||
targetDisplayPlugin = displayPlugin;
|
targetDisplayPlugin = displayPlugin;
|
||||||
}
|
}
|
||||||
@ -3168,7 +3249,7 @@ void Application::initializeDisplayPlugins() {
|
|||||||
void Application::initializeRenderEngine() {
|
void Application::initializeRenderEngine() {
|
||||||
// FIXME: on low end systems os the shaders take up to 1 minute to compile, so we pause the deadlock watchdog thread.
|
// FIXME: on low end systems os the shaders take up to 1 minute to compile, so we pause the deadlock watchdog thread.
|
||||||
DeadlockWatchdogThread::withPause([&] {
|
DeadlockWatchdogThread::withPause([&] {
|
||||||
_graphicsEngine.initializeRender();
|
_graphicsEngine->initializeRender();
|
||||||
DependencyManager::get<Keyboard>()->registerKeyboardHighlighting();
|
DependencyManager::get<Keyboard>()->registerKeyboardHighlighting();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -3225,7 +3306,7 @@ void Application::initializeUi() {
|
|||||||
|
|
||||||
// END PULL SAFEURLS FROM INTERFACE.JSON Settings
|
// END PULL SAFEURLS FROM INTERFACE.JSON Settings
|
||||||
|
|
||||||
if (AUTHORIZED_EXTERNAL_QML_SOURCE.isParentOf(url)) {
|
if (QUrl(NetworkingConstants::OVERTE_COMMUNITY_APPLICATIONS).isParentOf(url)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
for (const auto& str : safeURLS) {
|
for (const auto& str : safeURLS) {
|
||||||
@ -3425,7 +3506,7 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) {
|
|||||||
surfaceContext->setContextProperty("Recording", DependencyManager::get<RecordingScriptingInterface>().data());
|
surfaceContext->setContextProperty("Recording", DependencyManager::get<RecordingScriptingInterface>().data());
|
||||||
surfaceContext->setContextProperty("Preferences", DependencyManager::get<Preferences>().data());
|
surfaceContext->setContextProperty("Preferences", DependencyManager::get<Preferences>().data());
|
||||||
surfaceContext->setContextProperty("AddressManager", DependencyManager::get<AddressManager>().data());
|
surfaceContext->setContextProperty("AddressManager", DependencyManager::get<AddressManager>().data());
|
||||||
surfaceContext->setContextProperty("FrameTimings", &_graphicsEngine._frameTimingsScriptingInterface);
|
surfaceContext->setContextProperty("FrameTimings", &_graphicsEngine->_frameTimingsScriptingInterface);
|
||||||
surfaceContext->setContextProperty("Rates", new RatesScriptingInterface(this));
|
surfaceContext->setContextProperty("Rates", new RatesScriptingInterface(this));
|
||||||
|
|
||||||
surfaceContext->setContextProperty("TREE_SCALE", TREE_SCALE);
|
surfaceContext->setContextProperty("TREE_SCALE", TREE_SCALE);
|
||||||
@ -4061,7 +4142,7 @@ std::map<QString, QString> Application::prepareServerlessDomainContents(QUrl dom
|
|||||||
bool success = tmpTree->readFromByteArray(domainURL.toString(), data);
|
bool success = tmpTree->readFromByteArray(domainURL.toString(), data);
|
||||||
if (success) {
|
if (success) {
|
||||||
tmpTree->reaverageOctreeElements();
|
tmpTree->reaverageOctreeElements();
|
||||||
tmpTree->sendEntities(&_entityEditSender, getEntities()->getTree(), "domain", 0, 0, 0);
|
tmpTree->sendEntities(_entityEditSender.get(), getEntities()->getTree(), "domain", 0, 0, 0);
|
||||||
}
|
}
|
||||||
std::map<QString, QString> namedPaths = tmpTree->getNamedPaths();
|
std::map<QString, QString> namedPaths = tmpTree->getNamedPaths();
|
||||||
|
|
||||||
@ -4131,8 +4212,8 @@ void Application::onPresent(quint32 frameCount) {
|
|||||||
postEvent(this, new QEvent((QEvent::Type)ApplicationEvent::Idle), Qt::HighEventPriority);
|
postEvent(this, new QEvent((QEvent::Type)ApplicationEvent::Idle), Qt::HighEventPriority);
|
||||||
}
|
}
|
||||||
expected = false;
|
expected = false;
|
||||||
if (_graphicsEngine.checkPendingRenderEvent() && !isAboutToQuit()) {
|
if (_graphicsEngine->checkPendingRenderEvent() && !isAboutToQuit()) {
|
||||||
postEvent(_graphicsEngine._renderEventHandler, new QEvent((QEvent::Type)ApplicationEvent::Render));
|
postEvent(_graphicsEngine->_renderEventHandler, new QEvent((QEvent::Type)ApplicationEvent::Render));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4202,7 +4283,9 @@ bool Application::handleFileOpenEvent(QFileOpenEvent* fileEvent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Application::notify(QObject * object, QEvent * event) {
|
bool Application::notify(QObject * object, QEvent * event) {
|
||||||
if (thread() == QThread::currentThread()) {
|
if (thread() == QThread::currentThread() && _profilingInitialized ) {
|
||||||
|
// _profilingInitialized gets set once we're reading for profiling.
|
||||||
|
// this prevents a deadlock due to profiling not working yet
|
||||||
PROFILE_RANGE_IF_LONGER(app, "notify", 2)
|
PROFILE_RANGE_IF_LONGER(app, "notify", 2)
|
||||||
return QApplication::notify(object, event);
|
return QApplication::notify(object, event);
|
||||||
}
|
}
|
||||||
@ -5247,8 +5330,8 @@ void Application::idle() {
|
|||||||
PROFILE_COUNTER_IF_CHANGED(app, "pendingDownloads", uint32_t, ResourceCache::getPendingRequestCount());
|
PROFILE_COUNTER_IF_CHANGED(app, "pendingDownloads", uint32_t, ResourceCache::getPendingRequestCount());
|
||||||
PROFILE_COUNTER_IF_CHANGED(app, "currentProcessing", int, DependencyManager::get<StatTracker>()->getStat("Processing").toInt());
|
PROFILE_COUNTER_IF_CHANGED(app, "currentProcessing", int, DependencyManager::get<StatTracker>()->getStat("Processing").toInt());
|
||||||
PROFILE_COUNTER_IF_CHANGED(app, "pendingProcessing", int, DependencyManager::get<StatTracker>()->getStat("PendingProcessing").toInt());
|
PROFILE_COUNTER_IF_CHANGED(app, "pendingProcessing", int, DependencyManager::get<StatTracker>()->getStat("PendingProcessing").toInt());
|
||||||
auto renderConfig = _graphicsEngine.getRenderEngine()->getConfiguration();
|
auto renderConfig = _graphicsEngine->getRenderEngine()->getConfiguration();
|
||||||
PROFILE_COUNTER_IF_CHANGED(render, "gpuTime", float, (float)_graphicsEngine.getGPUContext()->getFrameTimerGPUAverage());
|
PROFILE_COUNTER_IF_CHANGED(render, "gpuTime", float, (float)_graphicsEngine->getGPUContext()->getFrameTimerGPUAverage());
|
||||||
|
|
||||||
PROFILE_RANGE(app, __FUNCTION__);
|
PROFILE_RANGE(app, __FUNCTION__);
|
||||||
|
|
||||||
@ -5615,7 +5698,7 @@ bool Application::importEntities(const QString& urlOrFilename, const bool isObse
|
|||||||
}
|
}
|
||||||
|
|
||||||
QVector<EntityItemID> Application::pasteEntities(const QString& entityHostType, float x, float y, float z) {
|
QVector<EntityItemID> Application::pasteEntities(const QString& entityHostType, float x, float y, float z) {
|
||||||
return _entityClipboard->sendEntities(&_entityEditSender, getEntities()->getTree(), entityHostType, x, y, z);
|
return _entityClipboard->sendEntities(_entityEditSender.get(), getEntities()->getTree(), entityHostType, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::init() {
|
void Application::init() {
|
||||||
@ -5665,7 +5748,7 @@ void Application::init() {
|
|||||||
_physicsEngine->init();
|
_physicsEngine->init();
|
||||||
|
|
||||||
EntityTreePointer tree = getEntities()->getTree();
|
EntityTreePointer tree = getEntities()->getTree();
|
||||||
_entitySimulation->init(tree, _physicsEngine, &_entityEditSender);
|
_entitySimulation->init(tree, _physicsEngine, _entityEditSender.get());
|
||||||
tree->setSimulation(_entitySimulation);
|
tree->setSimulation(_entitySimulation);
|
||||||
|
|
||||||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
@ -5689,7 +5772,7 @@ void Application::init() {
|
|||||||
}
|
}
|
||||||
}, Qt::QueuedConnection);
|
}, Qt::QueuedConnection);
|
||||||
|
|
||||||
_gameWorkload.startup(getEntities()->getWorkloadSpace(), _graphicsEngine.getRenderScene(), _entitySimulation);
|
_gameWorkload.startup(getEntities()->getWorkloadSpace(), _graphicsEngine->getRenderScene(), _entitySimulation);
|
||||||
_entitySimulation->setWorkloadSpace(getEntities()->getWorkloadSpace());
|
_entitySimulation->setWorkloadSpace(getEntities()->getWorkloadSpace());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5861,7 +5944,7 @@ void Application::updateLOD(float deltaTime) const {
|
|||||||
// adjust it unless we were asked to disable this feature, or if we're currently in throttleRendering mode
|
// adjust it unless we were asked to disable this feature, or if we're currently in throttleRendering mode
|
||||||
if (!isThrottleRendering()) {
|
if (!isThrottleRendering()) {
|
||||||
float presentTime = getActiveDisplayPlugin()->getAveragePresentTime();
|
float presentTime = getActiveDisplayPlugin()->getAveragePresentTime();
|
||||||
float engineRunTime = (float)(_graphicsEngine.getRenderEngine()->getConfiguration().get()->getCPURunTime());
|
float engineRunTime = (float)(_graphicsEngine->getRenderEngine()->getConfiguration().get()->getCPURunTime());
|
||||||
float gpuTime = getGPUContext()->getFrameTimerGPUAverage();
|
float gpuTime = getGPUContext()->getFrameTimerGPUAverage();
|
||||||
float batchTime = getGPUContext()->getFrameTimerBatchAverage();
|
float batchTime = getGPUContext()->getFrameTimerBatchAverage();
|
||||||
auto lodManager = DependencyManager::get<LODManager>();
|
auto lodManager = DependencyManager::get<LODManager>();
|
||||||
@ -5897,8 +5980,8 @@ void Application::updateThreads(float deltaTime) {
|
|||||||
|
|
||||||
// parse voxel packets
|
// parse voxel packets
|
||||||
if (!_enableProcessOctreeThread) {
|
if (!_enableProcessOctreeThread) {
|
||||||
_octreeProcessor.threadRoutine();
|
_octreeProcessor->threadRoutine();
|
||||||
_entityEditSender.threadRoutine();
|
_entityEditSender->threadRoutine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6021,7 +6104,7 @@ void Application::resetPhysicsReadyInformation() {
|
|||||||
_gpuTextureMemSizeStabilityCount = 0;
|
_gpuTextureMemSizeStabilityCount = 0;
|
||||||
_gpuTextureMemSizeAtLastCheck = 0;
|
_gpuTextureMemSizeAtLastCheck = 0;
|
||||||
_physicsEnabled = false;
|
_physicsEnabled = false;
|
||||||
_octreeProcessor.stopSafeLanding();
|
_octreeProcessor->stopSafeLanding();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::reloadResourceCaches() {
|
void Application::reloadResourceCaches() {
|
||||||
@ -6166,7 +6249,7 @@ void Application::updateSecondaryCameraViewFrustum() {
|
|||||||
// camera should be.
|
// camera should be.
|
||||||
|
|
||||||
// Code based on SecondaryCameraJob
|
// Code based on SecondaryCameraJob
|
||||||
auto renderConfig = _graphicsEngine.getRenderEngine()->getConfiguration();
|
auto renderConfig = _graphicsEngine->getRenderEngine()->getConfiguration();
|
||||||
assert(renderConfig);
|
assert(renderConfig);
|
||||||
auto camera = dynamic_cast<SecondaryCameraJobConfig*>(renderConfig->getConfig("SecondaryCamera"));
|
auto camera = dynamic_cast<SecondaryCameraJobConfig*>(renderConfig->getConfig("SecondaryCamera"));
|
||||||
|
|
||||||
@ -6284,7 +6367,7 @@ void Application::tryToEnablePhysics() {
|
|||||||
auto myAvatar = getMyAvatar();
|
auto myAvatar = getMyAvatar();
|
||||||
if (myAvatar->isReadyForPhysics()) {
|
if (myAvatar->isReadyForPhysics()) {
|
||||||
myAvatar->getCharacterController()->setPhysicsEngine(_physicsEngine);
|
myAvatar->getCharacterController()->setPhysicsEngine(_physicsEngine);
|
||||||
_octreeProcessor.resetSafeLanding();
|
_octreeProcessor->resetSafeLanding();
|
||||||
_physicsEnabled = true;
|
_physicsEnabled = true;
|
||||||
setIsInterstitialMode(false);
|
setIsInterstitialMode(false);
|
||||||
myAvatar->updateMotionBehaviorFromMenu();
|
myAvatar->updateMotionBehaviorFromMenu();
|
||||||
@ -6293,7 +6376,7 @@ void Application::tryToEnablePhysics() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Application::update(float deltaTime) {
|
void Application::update(float deltaTime) {
|
||||||
PROFILE_RANGE_EX(app, __FUNCTION__, 0xffff0000, (uint64_t)_graphicsEngine._renderFrameCount + 1);
|
PROFILE_RANGE_EX(app, __FUNCTION__, 0xffff0000, (uint64_t)_graphicsEngine->_renderFrameCount + 1);
|
||||||
|
|
||||||
if (_aboutToQuit) {
|
if (_aboutToQuit) {
|
||||||
return;
|
return;
|
||||||
@ -6310,12 +6393,12 @@ void Application::update(float deltaTime) {
|
|||||||
if (isServerlessMode()) {
|
if (isServerlessMode()) {
|
||||||
tryToEnablePhysics();
|
tryToEnablePhysics();
|
||||||
} else if (_failedToConnectToEntityServer) {
|
} else if (_failedToConnectToEntityServer) {
|
||||||
if (_octreeProcessor.safeLandingIsActive()) {
|
if (_octreeProcessor->safeLandingIsActive()) {
|
||||||
_octreeProcessor.stopSafeLanding();
|
_octreeProcessor->stopSafeLanding();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_octreeProcessor.updateSafeLanding();
|
_octreeProcessor->updateSafeLanding();
|
||||||
if (_octreeProcessor.safeLandingIsComplete()) {
|
if (_octreeProcessor->safeLandingIsComplete()) {
|
||||||
tryToEnablePhysics();
|
tryToEnablePhysics();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6802,7 +6885,7 @@ void Application::update(float deltaTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Application::updateRenderArgs(float deltaTime) {
|
void Application::updateRenderArgs(float deltaTime) {
|
||||||
_graphicsEngine.editRenderArgs([this, deltaTime](AppRenderArgs& appRenderArgs) {
|
_graphicsEngine->editRenderArgs([this, deltaTime](AppRenderArgs& appRenderArgs) {
|
||||||
PerformanceTimer perfTimer("editRenderArgs");
|
PerformanceTimer perfTimer("editRenderArgs");
|
||||||
appRenderArgs._headPose = getHMDSensorPose();
|
appRenderArgs._headPose = getHMDSensorPose();
|
||||||
|
|
||||||
@ -6831,7 +6914,7 @@ void Application::updateRenderArgs(float deltaTime) {
|
|||||||
_viewFrustum.setProjection(adjustedProjection);
|
_viewFrustum.setProjection(adjustedProjection);
|
||||||
_viewFrustum.calculate();
|
_viewFrustum.calculate();
|
||||||
}
|
}
|
||||||
appRenderArgs._renderArgs = RenderArgs(_graphicsEngine.getGPUContext(), lodManager->getVisibilityDistance(),
|
appRenderArgs._renderArgs = RenderArgs(_graphicsEngine->getGPUContext(), lodManager->getVisibilityDistance(),
|
||||||
lodManager->getBoundaryLevelAdjust(), lodManager->getLODFarHalfAngleTan(), lodManager->getLODNearHalfAngleTan(),
|
lodManager->getBoundaryLevelAdjust(), lodManager->getLODFarHalfAngleTan(), lodManager->getLODNearHalfAngleTan(),
|
||||||
lodManager->getLODFarDistance(), lodManager->getLODNearDistance(), RenderArgs::DEFAULT_RENDER_MODE,
|
lodManager->getLODFarDistance(), lodManager->getLODNearDistance(), RenderArgs::DEFAULT_RENDER_MODE,
|
||||||
RenderArgs::MONO, RenderArgs::DEFERRED, RenderArgs::RENDER_DEBUG_NONE);
|
RenderArgs::MONO, RenderArgs::DEFERRED, RenderArgs::RENDER_DEBUG_NONE);
|
||||||
@ -6970,7 +7053,7 @@ int Application::sendNackPackets() {
|
|||||||
|
|
||||||
// if there are octree packets from this node that are waiting to be processed,
|
// if there are octree packets from this node that are waiting to be processed,
|
||||||
// don't send a NACK since the missing packets may be among those waiting packets.
|
// don't send a NACK since the missing packets may be among those waiting packets.
|
||||||
if (_octreeProcessor.hasPacketsToProcessFrom(nodeUUID)) {
|
if (_octreeProcessor->hasPacketsToProcessFrom(nodeUUID)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7012,7 +7095,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType) {
|
|||||||
|
|
||||||
const bool isModifiedQuery = !_physicsEnabled;
|
const bool isModifiedQuery = !_physicsEnabled;
|
||||||
if (isModifiedQuery) {
|
if (isModifiedQuery) {
|
||||||
if (!_octreeProcessor.safeLandingIsActive()) {
|
if (!_octreeProcessor->safeLandingIsActive()) {
|
||||||
// don't send the octreeQuery until SafeLanding knows it has started
|
// don't send the octreeQuery until SafeLanding knows it has started
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -7281,12 +7364,12 @@ void Application::resettingDomain() {
|
|||||||
void Application::nodeAdded(SharedNodePointer node) {
|
void Application::nodeAdded(SharedNodePointer node) {
|
||||||
if (node->getType() == NodeType::EntityServer) {
|
if (node->getType() == NodeType::EntityServer) {
|
||||||
if (_failedToConnectToEntityServer && !_entityServerConnectionTimer.isActive()) {
|
if (_failedToConnectToEntityServer && !_entityServerConnectionTimer.isActive()) {
|
||||||
_octreeProcessor.stopSafeLanding();
|
_octreeProcessor->stopSafeLanding();
|
||||||
_failedToConnectToEntityServer = false;
|
_failedToConnectToEntityServer = false;
|
||||||
} else if (_entityServerConnectionTimer.isActive()) {
|
} else if (_entityServerConnectionTimer.isActive()) {
|
||||||
_entityServerConnectionTimer.stop();
|
_entityServerConnectionTimer.stop();
|
||||||
}
|
}
|
||||||
_octreeProcessor.startSafeLanding();
|
_octreeProcessor->startSafeLanding();
|
||||||
_entityServerConnectionTimer.setInterval(ENTITY_SERVER_CONNECTION_TIMEOUT);
|
_entityServerConnectionTimer.setInterval(ENTITY_SERVER_CONNECTION_TIMEOUT);
|
||||||
_entityServerConnectionTimer.start();
|
_entityServerConnectionTimer.start();
|
||||||
}
|
}
|
||||||
@ -7358,9 +7441,9 @@ void Application::nodeKilled(SharedNodePointer node) {
|
|||||||
// OctreePacketProcessor::nodeKilled is not being called when NodeList::nodeKilled is emitted.
|
// OctreePacketProcessor::nodeKilled is not being called when NodeList::nodeKilled is emitted.
|
||||||
// This may have to do with GenericThread::threadRoutine() blocking the QThread event loop
|
// This may have to do with GenericThread::threadRoutine() blocking the QThread event loop
|
||||||
|
|
||||||
_octreeProcessor.nodeKilled(node);
|
_octreeProcessor->nodeKilled(node);
|
||||||
|
|
||||||
_entityEditSender.nodeKilled(node);
|
_entityEditSender->nodeKilled(node);
|
||||||
|
|
||||||
if (node->getType() == NodeType::AudioMixer) {
|
if (node->getType() == NodeType::AudioMixer) {
|
||||||
QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "audioMixerKilled");
|
QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "audioMixerKilled");
|
||||||
@ -7449,7 +7532,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptManagerPoint
|
|||||||
// setup the packet sender of the script engine's scripting interfaces so
|
// setup the packet sender of the script engine's scripting interfaces so
|
||||||
// we can use the same ones from the application.
|
// we can use the same ones from the application.
|
||||||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
entityScriptingInterface->setPacketSender(&_entityEditSender);
|
entityScriptingInterface->setPacketSender(_entityEditSender.get());
|
||||||
entityScriptingInterface->setEntityTree(getEntities()->getTree());
|
entityScriptingInterface->setEntityTree(getEntities()->getTree());
|
||||||
|
|
||||||
if (property(hifi::properties::TEST).isValid()) {
|
if (property(hifi::properties::TEST).isValid()) {
|
||||||
@ -7575,7 +7658,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptManagerPoint
|
|||||||
|
|
||||||
{
|
{
|
||||||
auto connection = std::make_shared<QMetaObject::Connection>();
|
auto connection = std::make_shared<QMetaObject::Connection>();
|
||||||
*connection = scriptManager->connect(scriptManager.get(), &ScriptManager::scriptEnding, [scriptManager, connection]() {
|
*connection = scriptManager->connect(scriptManager.get(), &ScriptManager::scriptEnding, [this, scriptManager, connection]() {
|
||||||
// Request removal of controller routes with callbacks to a given script engine
|
// Request removal of controller routes with callbacks to a given script engine
|
||||||
auto userInputMapper = DependencyManager::get<UserInputMapper>();
|
auto userInputMapper = DependencyManager::get<UserInputMapper>();
|
||||||
// scheduleScriptEndpointCleanup will have the last instance of shared pointer to script manager
|
// scheduleScriptEndpointCleanup will have the last instance of shared pointer to script manager
|
||||||
@ -8215,7 +8298,7 @@ void Application::addAssetToWorldCheckModelSize() {
|
|||||||
propertyFlags += PROP_NAME;
|
propertyFlags += PROP_NAME;
|
||||||
propertyFlags += PROP_DIMENSIONS;
|
propertyFlags += PROP_DIMENSIONS;
|
||||||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
auto properties = entityScriptingInterface->getEntityPropertiesInternal(entityID, propertyFlags);
|
auto properties = entityScriptingInterface->getEntityPropertiesInternal(entityID, propertyFlags, false);
|
||||||
auto name = properties.getName();
|
auto name = properties.getName();
|
||||||
auto dimensions = properties.getDimensions();
|
auto dimensions = properties.getDimensions();
|
||||||
|
|
||||||
@ -8763,26 +8846,6 @@ void Application::sendLambdaEvent(const std::function<void()>& f) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::initPlugins(const QCommandLineParser& parser) {
|
|
||||||
if (parser.isSet("display")) {
|
|
||||||
auto preferredDisplays = parser.value("display").split(',', Qt::SkipEmptyParts);
|
|
||||||
qInfo() << "Setting prefered display plugins:" << preferredDisplays;
|
|
||||||
PluginManager::getInstance()->setPreferredDisplayPlugins(preferredDisplays);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parser.isSet("disable-displays")) {
|
|
||||||
auto disabledDisplays = parser.value("disable-displays").split(',', Qt::SkipEmptyParts);
|
|
||||||
qInfo() << "Disabling following display plugins:" << disabledDisplays;
|
|
||||||
PluginManager::getInstance()->disableDisplays(disabledDisplays);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parser.isSet("disable-inputs")) {
|
|
||||||
auto disabledInputs = parser.value("disable-inputs").split(',', Qt::SkipEmptyParts);
|
|
||||||
qInfo() << "Disabling following input plugins:" << disabledInputs;
|
|
||||||
PluginManager::getInstance()->disableInputs(disabledInputs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application::shutdownPlugins() {
|
void Application::shutdownPlugins() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9205,7 +9268,7 @@ void Application::updateLoginDialogPosition() {
|
|||||||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
EntityPropertyFlags desiredProperties;
|
EntityPropertyFlags desiredProperties;
|
||||||
desiredProperties += PROP_POSITION;
|
desiredProperties += PROP_POSITION;
|
||||||
auto properties = entityScriptingInterface->getEntityPropertiesInternal(_loginDialogID, desiredProperties);
|
auto properties = entityScriptingInterface->getEntityPropertiesInternal(_loginDialogID, desiredProperties, false);
|
||||||
auto positionVec = properties.getPosition();
|
auto positionVec = properties.getPosition();
|
||||||
auto cameraPositionVec = _myCamera.getPosition();
|
auto cameraPositionVec = _myCamera.getPosition();
|
||||||
auto cameraOrientation = cancelOutRollAndPitch(_myCamera.getOrientation());
|
auto cameraOrientation = cancelOutRollAndPitch(_myCamera.getOrientation());
|
||||||
|
@ -123,6 +123,31 @@ class Application : public QApplication,
|
|||||||
friend class OctreePacketProcessor;
|
friend class OctreePacketProcessor;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize the plugin manager
|
||||||
|
*
|
||||||
|
* This both does the initial startup and parses arguments. This
|
||||||
|
* is necessary because the plugin manager's options must be set
|
||||||
|
* before any usage of it is made, or they won't apply.
|
||||||
|
*
|
||||||
|
* @param parser
|
||||||
|
*/
|
||||||
|
void initializePluginManager(const QCommandLineParser& parser);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize everything
|
||||||
|
*
|
||||||
|
* This is a QApplication, and for Qt reasons it's desirable to create this object
|
||||||
|
* as early as possible. Without that some Qt functions don't work, like QCoreApplication::applicationDirPath()
|
||||||
|
*
|
||||||
|
* So we keep the constructor as minimal as possible, and do the rest of the work in
|
||||||
|
* this function.
|
||||||
|
*/
|
||||||
|
void initialize(const QCommandLineParser &parser);
|
||||||
|
|
||||||
|
void setPreviousSessionCrashed(bool value) { _previousSessionCrashed = value; }
|
||||||
|
|
||||||
// virtual functions required for PluginContainer
|
// virtual functions required for PluginContainer
|
||||||
virtual ui::Menu* getPrimaryMenu() override;
|
virtual ui::Menu* getPrimaryMenu() override;
|
||||||
virtual void requestReset() override { resetSensors(false); }
|
virtual void requestReset() override { resetSensors(false); }
|
||||||
@ -135,15 +160,12 @@ public:
|
|||||||
|
|
||||||
virtual DisplayPluginPointer getActiveDisplayPlugin() const override;
|
virtual DisplayPluginPointer getActiveDisplayPlugin() const override;
|
||||||
|
|
||||||
// FIXME? Empty methods, do we still need them?
|
|
||||||
static void initPlugins(const QCommandLineParser& parser);
|
|
||||||
static void shutdownPlugins();
|
static void shutdownPlugins();
|
||||||
|
|
||||||
Application(
|
Application(
|
||||||
int& argc, char** argv,
|
int& argc, char** argv,
|
||||||
const QCommandLineParser& parser,
|
const QCommandLineParser& parser,
|
||||||
QElapsedTimer& startup_time,
|
QElapsedTimer& startup_time
|
||||||
bool runningMarkerExisted
|
|
||||||
);
|
);
|
||||||
~Application();
|
~Application();
|
||||||
|
|
||||||
@ -197,16 +219,16 @@ public:
|
|||||||
|
|
||||||
const ConicalViewFrustums& getConicalViews() const override { return _conicalViews; }
|
const ConicalViewFrustums& getConicalViews() const override { return _conicalViews; }
|
||||||
|
|
||||||
const OctreePacketProcessor& getOctreePacketProcessor() const { return _octreeProcessor; }
|
const OctreePacketProcessor& getOctreePacketProcessor() const { return *_octreeProcessor; }
|
||||||
QSharedPointer<EntityTreeRenderer> getEntities() const { return DependencyManager::get<EntityTreeRenderer>(); }
|
QSharedPointer<EntityTreeRenderer> getEntities() const { return DependencyManager::get<EntityTreeRenderer>(); }
|
||||||
MainWindow* getWindow() const { return _window; }
|
MainWindow* getWindow() const { return _window; }
|
||||||
EntityTreePointer getEntityClipboard() const { return _entityClipboard; }
|
EntityTreePointer getEntityClipboard() const { return _entityClipboard; }
|
||||||
EntityEditPacketSender* getEntityEditPacketSender() { return &_entityEditSender; }
|
std::shared_ptr<EntityEditPacketSender> getEntityEditPacketSender() { return _entityEditSender; }
|
||||||
|
|
||||||
ivec2 getMouse() const;
|
ivec2 getMouse() const;
|
||||||
|
|
||||||
ApplicationOverlay& getApplicationOverlay() { return _applicationOverlay; }
|
ApplicationOverlay& getApplicationOverlay() { return *_applicationOverlay; }
|
||||||
const ApplicationOverlay& getApplicationOverlay() const { return _applicationOverlay; }
|
const ApplicationOverlay& getApplicationOverlay() const { return *_applicationOverlay; }
|
||||||
CompositorHelper& getApplicationCompositor() const;
|
CompositorHelper& getApplicationCompositor() const;
|
||||||
|
|
||||||
Overlays& getOverlays() { return _overlays; }
|
Overlays& getOverlays() { return _overlays; }
|
||||||
@ -214,8 +236,8 @@ public:
|
|||||||
PerformanceManager& getPerformanceManager() { return _performanceManager; }
|
PerformanceManager& getPerformanceManager() { return _performanceManager; }
|
||||||
RefreshRateManager& getRefreshRateManager() { return _refreshRateManager; }
|
RefreshRateManager& getRefreshRateManager() { return _refreshRateManager; }
|
||||||
|
|
||||||
size_t getRenderFrameCount() const { return _graphicsEngine.getRenderFrameCount(); }
|
size_t getRenderFrameCount() const { return _graphicsEngine->getRenderFrameCount(); }
|
||||||
float getRenderLoopRate() const { return _graphicsEngine.getRenderLoopRate(); }
|
float getRenderLoopRate() const { return _graphicsEngine->getRenderLoopRate(); }
|
||||||
float getNumCollisionObjects() const;
|
float getNumCollisionObjects() const;
|
||||||
float getTargetRenderFrameRate() const; // frames/second
|
float getTargetRenderFrameRate() const; // frames/second
|
||||||
|
|
||||||
@ -293,9 +315,9 @@ public:
|
|||||||
void setMaxOctreePacketsPerSecond(int maxOctreePPS);
|
void setMaxOctreePacketsPerSecond(int maxOctreePPS);
|
||||||
int getMaxOctreePacketsPerSecond() const;
|
int getMaxOctreePacketsPerSecond() const;
|
||||||
|
|
||||||
render::ScenePointer getMain3DScene() override { return _graphicsEngine.getRenderScene(); }
|
render::ScenePointer getMain3DScene() override { return _graphicsEngine->getRenderScene(); }
|
||||||
render::EnginePointer getRenderEngine() override { return _graphicsEngine.getRenderEngine(); }
|
render::EnginePointer getRenderEngine() override { return _graphicsEngine->getRenderEngine(); }
|
||||||
gpu::ContextPointer getGPUContext() const { return _graphicsEngine.getGPUContext(); }
|
gpu::ContextPointer getGPUContext() const { return _graphicsEngine->getGPUContext(); }
|
||||||
|
|
||||||
const GameWorkload& getGameWorkload() const { return _gameWorkload; }
|
const GameWorkload& getGameWorkload() const { return _gameWorkload; }
|
||||||
|
|
||||||
@ -709,8 +731,8 @@ private:
|
|||||||
bool _enableProcessOctreeThread;
|
bool _enableProcessOctreeThread;
|
||||||
bool _interstitialMode { false };
|
bool _interstitialMode { false };
|
||||||
|
|
||||||
OctreePacketProcessor _octreeProcessor;
|
std::shared_ptr<OctreePacketProcessor> _octreeProcessor;
|
||||||
EntityEditPacketSender _entityEditSender;
|
std::shared_ptr<EntityEditPacketSender> _entityEditSender;
|
||||||
|
|
||||||
StDev _idleLoopStdev;
|
StDev _idleLoopStdev;
|
||||||
float _idleLoopMeasuredJitter;
|
float _idleLoopMeasuredJitter;
|
||||||
@ -757,13 +779,13 @@ private:
|
|||||||
|
|
||||||
GameWorkload _gameWorkload;
|
GameWorkload _gameWorkload;
|
||||||
|
|
||||||
GraphicsEngine _graphicsEngine;
|
std::shared_ptr<GraphicsEngine> _graphicsEngine;
|
||||||
void updateRenderArgs(float deltaTime);
|
void updateRenderArgs(float deltaTime);
|
||||||
|
|
||||||
bool _disableLoginScreen { true };
|
bool _disableLoginScreen { true };
|
||||||
|
|
||||||
Overlays _overlays;
|
Overlays _overlays;
|
||||||
ApplicationOverlay _applicationOverlay;
|
std::shared_ptr<ApplicationOverlay> _applicationOverlay;
|
||||||
OverlayConductor _overlayConductor;
|
OverlayConductor _overlayConductor;
|
||||||
|
|
||||||
DialogsManagerScriptingInterface* _dialogsManagerScriptingInterface = new DialogsManagerScriptingInterface();
|
DialogsManagerScriptingInterface* _dialogsManagerScriptingInterface = new DialogsManagerScriptingInterface();
|
||||||
@ -860,5 +882,7 @@ private:
|
|||||||
bool _crashOnShutdown { false };
|
bool _crashOnShutdown { false };
|
||||||
|
|
||||||
DiscordPresence* _discordPresence{ nullptr };
|
DiscordPresence* _discordPresence{ nullptr };
|
||||||
|
|
||||||
|
bool _profilingInitialized { false };
|
||||||
};
|
};
|
||||||
#endif // hifi_Application_h
|
#endif // hifi_Application_h
|
||||||
|
@ -41,6 +41,15 @@
|
|||||||
#include <QtQuick/QQuickWindow>
|
#include <QtQuick/QQuickWindow>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "WarningsSuppression.h"
|
#include "WarningsSuppression.h"
|
||||||
|
#include "ScriptPermissions.h"
|
||||||
|
|
||||||
|
QVariantMap AvatarBookmarks::getBookmarks() {
|
||||||
|
if (ScriptPermissions::isCurrentScriptAllowed(ScriptPermissions::Permission::SCRIPT_PERMISSION_GET_AVATAR_URL)) {
|
||||||
|
return _bookmarks;
|
||||||
|
} else {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void addAvatarEntities(const QVariantList& avatarEntities) {
|
void addAvatarEntities(const QVariantList& avatarEntities) {
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
@ -123,6 +132,12 @@ AvatarBookmarks::AvatarBookmarks() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AvatarBookmarks::addBookmark(const QString& bookmarkName) {
|
void AvatarBookmarks::addBookmark(const QString& bookmarkName) {
|
||||||
|
if (ScriptPermissions::isCurrentScriptAllowed(ScriptPermissions::Permission::SCRIPT_PERMISSION_GET_AVATAR_URL)) {
|
||||||
|
addBookmarkInternal(bookmarkName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AvatarBookmarks::addBookmarkInternal(const QString& bookmarkName) {
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
BLOCKING_INVOKE_METHOD(this, "addBookmark", Q_ARG(QString, bookmarkName));
|
BLOCKING_INVOKE_METHOD(this, "addBookmark", Q_ARG(QString, bookmarkName));
|
||||||
return;
|
return;
|
||||||
@ -134,6 +149,12 @@ void AvatarBookmarks::addBookmark(const QString& bookmarkName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AvatarBookmarks::saveBookmark(const QString& bookmarkName) {
|
void AvatarBookmarks::saveBookmark(const QString& bookmarkName) {
|
||||||
|
if (ScriptPermissions::isCurrentScriptAllowed(ScriptPermissions::Permission::SCRIPT_PERMISSION_GET_AVATAR_URL)) {
|
||||||
|
saveBookmarkInternal(bookmarkName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AvatarBookmarks::saveBookmarkInternal(const QString& bookmarkName) {
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
BLOCKING_INVOKE_METHOD(this, "saveBookmark", Q_ARG(QString, bookmarkName));
|
BLOCKING_INVOKE_METHOD(this, "saveBookmark", Q_ARG(QString, bookmarkName));
|
||||||
return;
|
return;
|
||||||
@ -145,6 +166,12 @@ void AvatarBookmarks::saveBookmark(const QString& bookmarkName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AvatarBookmarks::removeBookmark(const QString& bookmarkName) {
|
void AvatarBookmarks::removeBookmark(const QString& bookmarkName) {
|
||||||
|
if (ScriptPermissions::isCurrentScriptAllowed(ScriptPermissions::Permission::SCRIPT_PERMISSION_GET_AVATAR_URL)) {
|
||||||
|
removeBookmarkInternal(bookmarkName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AvatarBookmarks::removeBookmarkInternal(const QString& bookmarkName) {
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
BLOCKING_INVOKE_METHOD(this, "removeBookmark", Q_ARG(QString, bookmarkName));
|
BLOCKING_INVOKE_METHOD(this, "removeBookmark", Q_ARG(QString, bookmarkName));
|
||||||
return;
|
return;
|
||||||
@ -200,6 +227,12 @@ void AvatarBookmarks::updateAvatarEntities(const QVariantList &avatarEntities) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void AvatarBookmarks::loadBookmark(const QString& bookmarkName) {
|
void AvatarBookmarks::loadBookmark(const QString& bookmarkName) {
|
||||||
|
if (ScriptPermissions::isCurrentScriptAllowed(ScriptPermissions::Permission::SCRIPT_PERMISSION_GET_AVATAR_URL)) {
|
||||||
|
loadBookmarkInternal(bookmarkName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AvatarBookmarks::loadBookmarkInternal(const QString& bookmarkName) {
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
BLOCKING_INVOKE_METHOD(this, "loadBookmark", Q_ARG(QString, bookmarkName));
|
BLOCKING_INVOKE_METHOD(this, "loadBookmark", Q_ARG(QString, bookmarkName));
|
||||||
return;
|
return;
|
||||||
@ -268,6 +301,15 @@ void AvatarBookmarks::readFromFile() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap AvatarBookmarks::getBookmark(const QString &bookmarkName)
|
QVariantMap AvatarBookmarks::getBookmark(const QString &bookmarkName)
|
||||||
|
{
|
||||||
|
if (ScriptPermissions::isCurrentScriptAllowed(ScriptPermissions::Permission::SCRIPT_PERMISSION_GET_AVATAR_URL)) {
|
||||||
|
return getBookmarkInternal(bookmarkName);
|
||||||
|
} else {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariantMap AvatarBookmarks::getBookmarkInternal(const QString &bookmarkName)
|
||||||
{
|
{
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
QVariantMap result;
|
QVariantMap result;
|
||||||
|
@ -100,7 +100,7 @@ public slots:
|
|||||||
* print("- " + key + " " + bookmarks[key].avatarUrl);
|
* print("- " + key + " " + bookmarks[key].avatarUrl);
|
||||||
* };
|
* };
|
||||||
*/
|
*/
|
||||||
QVariantMap getBookmarks() { return _bookmarks; }
|
QVariantMap getBookmarks();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/*@jsdoc
|
/*@jsdoc
|
||||||
@ -147,6 +147,11 @@ protected slots:
|
|||||||
void deleteBookmark() override;
|
void deleteBookmark() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QVariantMap getBookmarkInternal(const QString &bookmarkName);
|
||||||
|
void addBookmarkInternal(const QString& bookmarkName);
|
||||||
|
void saveBookmarkInternal(const QString& bookmarkName);
|
||||||
|
void loadBookmarkInternal(const QString& bookmarkName);
|
||||||
|
void removeBookmarkInternal(const QString& bookmarkName);
|
||||||
const QString AVATARBOOKMARKS_FILENAME = "avatarbookmarks.json";
|
const QString AVATARBOOKMARKS_FILENAME = "avatarbookmarks.json";
|
||||||
const QString ENTRY_AVATAR_URL = "avatarUrl";
|
const QString ENTRY_AVATAR_URL = "avatarUrl";
|
||||||
const QString ENTRY_AVATAR_ICON = "avatarIcon";
|
const QString ENTRY_AVATAR_ICON = "avatarIcon";
|
||||||
|
@ -258,10 +258,11 @@ void CrashRecoveryHandler::handleCrash(CrashRecoveryHandler::Action action) {
|
|||||||
// Display name and avatar
|
// Display name and avatar
|
||||||
settings.beginGroup(AVATAR_GROUP);
|
settings.beginGroup(AVATAR_GROUP);
|
||||||
displayName = settings.value(DISPLAY_NAME_KEY).toString();
|
displayName = settings.value(DISPLAY_NAME_KEY).toString();
|
||||||
fullAvatarURL = settings.value(FULL_AVATAR_URL_KEY).toUrl();
|
|
||||||
fullAvatarModelName = settings.value(FULL_AVATAR_MODEL_NAME_KEY).toString();
|
fullAvatarModelName = settings.value(FULL_AVATAR_MODEL_NAME_KEY).toString();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
|
fullAvatarURL = settings.value(SETTINGS_FULL_PRIVATE_GROUP_NAME + "/" + AVATAR_GROUP + "/" + FULL_AVATAR_URL_KEY).toUrl();
|
||||||
|
|
||||||
// Tutorial complete
|
// Tutorial complete
|
||||||
tutorialComplete = settings.value(TUTORIAL_COMPLETE_FLAG_KEY).toBool();
|
tutorialComplete = settings.value(TUTORIAL_COMPLETE_FLAG_KEY).toBool();
|
||||||
}
|
}
|
||||||
@ -280,12 +281,12 @@ void CrashRecoveryHandler::handleCrash(CrashRecoveryHandler::Action action) {
|
|||||||
// Display name and avatar
|
// Display name and avatar
|
||||||
settings.beginGroup(AVATAR_GROUP);
|
settings.beginGroup(AVATAR_GROUP);
|
||||||
settings.setValue(DISPLAY_NAME_KEY, displayName);
|
settings.setValue(DISPLAY_NAME_KEY, displayName);
|
||||||
settings.setValue(FULL_AVATAR_URL_KEY, fullAvatarURL);
|
|
||||||
settings.setValue(FULL_AVATAR_MODEL_NAME_KEY, fullAvatarModelName);
|
settings.setValue(FULL_AVATAR_MODEL_NAME_KEY, fullAvatarModelName);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
|
settings.setValue(SETTINGS_FULL_PRIVATE_GROUP_NAME + "/" + AVATAR_GROUP + "/" + FULL_AVATAR_URL_KEY, fullAvatarURL);
|
||||||
|
|
||||||
// Tutorial complete
|
// Tutorial complete
|
||||||
settings.setValue(TUTORIAL_COMPLETE_FLAG_KEY, tutorialComplete);
|
settings.setValue(TUTORIAL_COMPLETE_FLAG_KEY, tutorialComplete);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,10 +49,10 @@ LODManager::LODManager() {
|
|||||||
const float LOD_ADJUST_RUNNING_AVG_TIMESCALE = 0.08f; // sec
|
const float LOD_ADJUST_RUNNING_AVG_TIMESCALE = 0.08f; // sec
|
||||||
|
|
||||||
// batchTIme is always contained in presentTime.
|
// batchTIme is always contained in presentTime.
|
||||||
// We favor using batchTime instead of presentTime as a representative value for rendering duration (on present thread)
|
// We favor using batchTime instead of presentTime as a representative value for rendering duration (on present thread)
|
||||||
// if batchTime + cushionTime < presentTime.
|
// if batchTime + cushionTime < presentTime.
|
||||||
// since we are shooting for fps around 60, 90Hz, the ideal frames are around 10ms
|
// since we are shooting for fps around 60, 90Hz, the ideal frames are around 10ms
|
||||||
// so we are picking a cushion time of 3ms
|
// so we are picking a cushion time of 3ms
|
||||||
const float LOD_BATCH_TO_PRESENT_CUSHION_TIME = 3.0f; // msec
|
const float LOD_BATCH_TO_PRESENT_CUSHION_TIME = 3.0f; // msec
|
||||||
|
|
||||||
void LODManager::setRenderTimes(float presentTime, float engineRunTime, float batchTime, float gpuTime) {
|
void LODManager::setRenderTimes(float presentTime, float engineRunTime, float batchTime, float gpuTime) {
|
||||||
@ -64,8 +64,8 @@ void LODManager::setRenderTimes(float presentTime, float engineRunTime, float ba
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LODManager::autoAdjustLOD(float realTimeDelta) {
|
void LODManager::autoAdjustLOD(float realTimeDelta) {
|
||||||
std::lock_guard<std::mutex> { _automaticLODLock };
|
std::lock_guard<std::mutex> lock(_automaticLODLock);
|
||||||
|
|
||||||
// The "render time" is the worse of:
|
// The "render time" is the worse of:
|
||||||
// - engineRunTime: Time spent in the render thread in the engine producing the gpu::Frame N
|
// - engineRunTime: Time spent in the render thread in the engine producing the gpu::Frame N
|
||||||
// - batchTime: Time spent in the present thread processing the batches of gpu::Frame N+1
|
// - batchTime: Time spent in the present thread processing the batches of gpu::Frame N+1
|
||||||
@ -92,7 +92,7 @@ void LODManager::autoAdjustLOD(float realTimeDelta) {
|
|||||||
float smoothBlend = (realTimeDelta < LOD_ADJUST_RUNNING_AVG_TIMESCALE * _smoothScale) ? realTimeDelta / (LOD_ADJUST_RUNNING_AVG_TIMESCALE * _smoothScale) : 1.0f;
|
float smoothBlend = (realTimeDelta < LOD_ADJUST_RUNNING_AVG_TIMESCALE * _smoothScale) ? realTimeDelta / (LOD_ADJUST_RUNNING_AVG_TIMESCALE * _smoothScale) : 1.0f;
|
||||||
|
|
||||||
//Evaluate the running averages for the render time
|
//Evaluate the running averages for the render time
|
||||||
// We must sanity check for the output average evaluated to be in a valid range to avoid issues
|
// We must sanity check for the output average evaluated to be in a valid range to avoid issues
|
||||||
_nowRenderTime = (1.0f - nowBlend) * _nowRenderTime + nowBlend * maxRenderTime; // msec
|
_nowRenderTime = (1.0f - nowBlend) * _nowRenderTime + nowBlend * maxRenderTime; // msec
|
||||||
_nowRenderTime = std::max(0.0f, std::min(_nowRenderTime, (float)MSECS_PER_SECOND));
|
_nowRenderTime = std::max(0.0f, std::min(_nowRenderTime, (float)MSECS_PER_SECOND));
|
||||||
_smoothRenderTime = (1.0f - smoothBlend) * _smoothRenderTime + smoothBlend * maxRenderTime; // msec
|
_smoothRenderTime = (1.0f - smoothBlend) * _smoothRenderTime + smoothBlend * maxRenderTime; // msec
|
||||||
@ -112,7 +112,7 @@ void LODManager::autoAdjustLOD(float realTimeDelta) {
|
|||||||
// Current fps based on latest measurments
|
// Current fps based on latest measurments
|
||||||
float currentNowFPS = (float)MSECS_PER_SECOND / _nowRenderTime;
|
float currentNowFPS = (float)MSECS_PER_SECOND / _nowRenderTime;
|
||||||
float currentSmoothFPS = (float)MSECS_PER_SECOND / _smoothRenderTime;
|
float currentSmoothFPS = (float)MSECS_PER_SECOND / _smoothRenderTime;
|
||||||
|
|
||||||
// Compute the Variance of the FPS signal (FPS - smouthFPS)^2
|
// Compute the Variance of the FPS signal (FPS - smouthFPS)^2
|
||||||
// Also scale it by a percentage for fine tuning (default is 100%)
|
// Also scale it by a percentage for fine tuning (default is 100%)
|
||||||
float currentVarianceFPS = (currentSmoothFPS - currentNowFPS);
|
float currentVarianceFPS = (currentSmoothFPS - currentNowFPS);
|
||||||
@ -165,7 +165,7 @@ void LODManager::autoAdjustLOD(float realTimeDelta) {
|
|||||||
|
|
||||||
// Compute the output of the PID and record intermediate results for tuning
|
// Compute the output of the PID and record intermediate results for tuning
|
||||||
_pidOutputs.x = _pidCoefs.x * error; // Kp * error
|
_pidOutputs.x = _pidCoefs.x * error; // Kp * error
|
||||||
_pidOutputs.y = _pidCoefs.y * integral; // Ki * integral
|
_pidOutputs.y = _pidCoefs.y * integral; // Ki * integral
|
||||||
_pidOutputs.z = _pidCoefs.z * derivative; // Kd * derivative
|
_pidOutputs.z = _pidCoefs.z * derivative; // Kd * derivative
|
||||||
|
|
||||||
auto output = _pidOutputs.x + _pidOutputs.y + _pidOutputs.z;
|
auto output = _pidOutputs.x + _pidOutputs.y + _pidOutputs.z;
|
||||||
@ -300,7 +300,7 @@ void LODManager::resetLODAdjust() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LODManager::setAutomaticLODAdjust(bool value) {
|
void LODManager::setAutomaticLODAdjust(bool value) {
|
||||||
std::lock_guard<std::mutex> { _automaticLODLock };
|
std::lock_guard<std::mutex> lock(_automaticLODLock);
|
||||||
_automaticLODAdjust = value;
|
_automaticLODAdjust = value;
|
||||||
saveSettings();
|
saveSettings();
|
||||||
emit autoLODChanged();
|
emit autoLODChanged();
|
||||||
@ -399,7 +399,7 @@ void LODManager::loadSettings() {
|
|||||||
if (qApp->property(hifi::properties::OCULUS_STORE).toBool() && firstRun.get()) {
|
if (qApp->property(hifi::properties::OCULUS_STORE).toBool() && firstRun.get()) {
|
||||||
hmdQuality = WORLD_DETAIL_HIGH;
|
hmdQuality = WORLD_DETAIL_HIGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
_automaticLODAdjust = automaticLODAdjust.get();
|
_automaticLODAdjust = automaticLODAdjust.get();
|
||||||
_lodHalfAngle = lodHalfAngle.get();
|
_lodHalfAngle = lodHalfAngle.get();
|
||||||
|
|
||||||
@ -457,7 +457,7 @@ float LODManager::getLODTargetFPS() const {
|
|||||||
if (qApp->isHMDMode()) {
|
if (qApp->isHMDMode()) {
|
||||||
lodTargetFPS = getHMDLODTargetFPS();
|
lodTargetFPS = getHMDLODTargetFPS();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if RefreshRate is slower than LOD target then it becomes the true LOD target
|
// if RefreshRate is slower than LOD target then it becomes the true LOD target
|
||||||
if (lodTargetFPS > refreshRateFPS) {
|
if (lodTargetFPS > refreshRateFPS) {
|
||||||
return refreshRateFPS;
|
return refreshRateFPS;
|
||||||
@ -476,7 +476,7 @@ void LODManager::setWorldDetailQuality(WorldDetailQuality quality, bool isHMDMod
|
|||||||
setDesktopLODTargetFPS(desiredFPS);
|
setDesktopLODTargetFPS(desiredFPS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LODManager::setWorldDetailQuality(WorldDetailQuality quality) {
|
void LODManager::setWorldDetailQuality(WorldDetailQuality quality) {
|
||||||
setWorldDetailQuality(quality, qApp->isHMDMode());
|
setWorldDetailQuality(quality, qApp->isHMDMode());
|
||||||
saveSettings();
|
saveSettings();
|
||||||
@ -492,7 +492,7 @@ ScriptValue worldDetailQualityToScriptValue(ScriptEngine* engine, const WorldDet
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool worldDetailQualityFromScriptValue(const ScriptValue& object, WorldDetailQuality& worldDetailQuality) {
|
bool worldDetailQualityFromScriptValue(const ScriptValue& object, WorldDetailQuality& worldDetailQuality) {
|
||||||
worldDetailQuality =
|
worldDetailQuality =
|
||||||
static_cast<WorldDetailQuality>(std::min(std::max(object.toInt32(), (int)WORLD_DETAIL_LOW), (int)WORLD_DETAIL_HIGH));
|
static_cast<WorldDetailQuality>(std::min(std::max(object.toInt32(), (int)WORLD_DETAIL_LOW), (int)WORLD_DETAIL_HIGH));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -323,6 +323,19 @@ Menu::Menu() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Settings > Script Security
|
||||||
|
action = addActionToQMenuAndActionHash(settingsMenu, MenuOption::ScriptSecurity);
|
||||||
|
connect(action, &QAction::triggered, [] {
|
||||||
|
auto tablet = DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
auto hmd = DependencyManager::get<HMDScriptingInterface>();
|
||||||
|
|
||||||
|
tablet->pushOntoStack("hifi/dialogs/security/ScriptSecurity.qml");
|
||||||
|
|
||||||
|
if (!hmd->getShouldShowTablet()) {
|
||||||
|
hmd->toggleShouldShowTablet();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Settings > Developer Menu
|
// Settings > Developer Menu
|
||||||
addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menu", 0, false, this, SLOT(toggleDeveloperMenus()));
|
addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menu", 0, false, this, SLOT(toggleDeveloperMenus()));
|
||||||
|
|
||||||
@ -388,13 +401,18 @@ Menu::Menu() {
|
|||||||
|
|
||||||
// Developer > UI >>>
|
// Developer > UI >>>
|
||||||
MenuWrapper* uiOptionsMenu = developerMenu->addMenu("UI");
|
MenuWrapper* uiOptionsMenu = developerMenu->addMenu("UI");
|
||||||
|
|
||||||
|
// Developer > UI > Show Overlays
|
||||||
|
action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::Overlays, 0, true);
|
||||||
|
|
||||||
|
connect(action, &QAction::triggered, [action] {
|
||||||
|
qApp->getApplicationOverlay().setEnabled(action->isChecked());
|
||||||
|
});
|
||||||
|
|
||||||
|
// Developer > UI > Desktop Tablet Becomes Toolbar
|
||||||
action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::DesktopTabletToToolbar, 0,
|
action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::DesktopTabletToToolbar, 0,
|
||||||
qApp->getDesktopTabletBecomesToolbarSetting());
|
qApp->getDesktopTabletBecomesToolbarSetting());
|
||||||
|
|
||||||
// Developer > UI > Show Overlays
|
|
||||||
addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::Overlays, 0, true);
|
|
||||||
|
|
||||||
// Developer > UI > Desktop Tablet Becomes Toolbar
|
|
||||||
connect(action, &QAction::triggered, [action] {
|
connect(action, &QAction::triggered, [action] {
|
||||||
qApp->setDesktopTabletBecomesToolbarSetting(action->isChecked());
|
qApp->setDesktopTabletBecomesToolbarSetting(action->isChecked());
|
||||||
});
|
});
|
||||||
@ -445,6 +463,10 @@ Menu::Menu() {
|
|||||||
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture4096MB, 0, false));
|
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture4096MB, 0, false));
|
||||||
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture6144MB, 0, false));
|
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture6144MB, 0, false));
|
||||||
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture8192MB, 0, false));
|
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture8192MB, 0, false));
|
||||||
|
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture10240MB, 0, false));
|
||||||
|
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture12288MB, 0, false));
|
||||||
|
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture16384MB, 0, false));
|
||||||
|
textureGroup->addAction(addCheckableActionToQMenuAndActionHash(textureMenu, MenuOption::RenderMaxTexture20480MB, 0, false));
|
||||||
connect(textureGroup, &QActionGroup::triggered, [textureGroup] {
|
connect(textureGroup, &QActionGroup::triggered, [textureGroup] {
|
||||||
auto checked = textureGroup->checkedAction();
|
auto checked = textureGroup->checkedAction();
|
||||||
auto text = checked->text();
|
auto text = checked->text();
|
||||||
@ -465,8 +487,16 @@ Menu::Menu() {
|
|||||||
newMaxTextureMemory = MB_TO_BYTES(4096);
|
newMaxTextureMemory = MB_TO_BYTES(4096);
|
||||||
} else if (MenuOption::RenderMaxTexture6144MB == text) {
|
} else if (MenuOption::RenderMaxTexture6144MB == text) {
|
||||||
newMaxTextureMemory = MB_TO_BYTES(6144);
|
newMaxTextureMemory = MB_TO_BYTES(6144);
|
||||||
} else if (MenuOption::RenderMaxTexture8192MB == text) {
|
} else if (MenuOption::RenderMaxTexture1024MB == text) {
|
||||||
newMaxTextureMemory = MB_TO_BYTES(8192);
|
newMaxTextureMemory = MB_TO_BYTES(8192);
|
||||||
|
} else if (MenuOption::RenderMaxTexture10240MB == text) {
|
||||||
|
newMaxTextureMemory = MB_TO_BYTES(10240);
|
||||||
|
} else if (MenuOption::RenderMaxTexture12288MB == text) {
|
||||||
|
newMaxTextureMemory = MB_TO_BYTES(12288);
|
||||||
|
} else if (MenuOption::RenderMaxTexture16384MB == text) {
|
||||||
|
newMaxTextureMemory = MB_TO_BYTES(16384);
|
||||||
|
} else if (MenuOption::RenderMaxTexture20480MB == text) {
|
||||||
|
newMaxTextureMemory = MB_TO_BYTES(20480);
|
||||||
}
|
}
|
||||||
gpu::Texture::setAllowedGPUMemoryUsage(newMaxTextureMemory);
|
gpu::Texture::setAllowedGPUMemoryUsage(newMaxTextureMemory);
|
||||||
});
|
});
|
||||||
@ -775,7 +805,6 @@ Menu::Menu() {
|
|||||||
addActionToQMenuAndActionHash(crashMenu, MenuOption::CrashOnShutdown, 0, qApp, SLOT(crashOnShutdown()));
|
addActionToQMenuAndActionHash(crashMenu, MenuOption::CrashOnShutdown, 0, qApp, SLOT(crashOnShutdown()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Developer > Show Statistics
|
// Developer > Show Statistics
|
||||||
addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Stats, 0, true);
|
addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Stats, 0, true);
|
||||||
|
|
||||||
|
@ -175,6 +175,10 @@ namespace MenuOption {
|
|||||||
const QString RenderMaxTexture4096MB = "4096 MB";
|
const QString RenderMaxTexture4096MB = "4096 MB";
|
||||||
const QString RenderMaxTexture6144MB = "6144 MB";
|
const QString RenderMaxTexture6144MB = "6144 MB";
|
||||||
const QString RenderMaxTexture8192MB = "8192 MB";
|
const QString RenderMaxTexture8192MB = "8192 MB";
|
||||||
|
const QString RenderMaxTexture10240MB = "10240 MB";
|
||||||
|
const QString RenderMaxTexture12288MB = "12288 MB";
|
||||||
|
const QString RenderMaxTexture16384MB = "16384 MB";
|
||||||
|
const QString RenderMaxTexture20480MB = "20480 MB";
|
||||||
const QString RenderSensorToWorldMatrix = "Show SensorToWorld Matrix";
|
const QString RenderSensorToWorldMatrix = "Show SensorToWorld Matrix";
|
||||||
const QString RenderIKTargets = "Show IK Targets";
|
const QString RenderIKTargets = "Show IK Targets";
|
||||||
const QString RenderIKConstraints = "Show IK Constraints";
|
const QString RenderIKConstraints = "Show IK Constraints";
|
||||||
@ -186,6 +190,7 @@ namespace MenuOption {
|
|||||||
const QString RunTimingTests = "Run Timing Tests";
|
const QString RunTimingTests = "Run Timing Tests";
|
||||||
const QString ScriptedMotorControl = "Enable Scripted Motor Control";
|
const QString ScriptedMotorControl = "Enable Scripted Motor Control";
|
||||||
const QString EntityScriptQMLWhitelist = "Entity Script / QML Whitelist";
|
const QString EntityScriptQMLWhitelist = "Entity Script / QML Whitelist";
|
||||||
|
const QString ScriptSecurity = "Script Security";
|
||||||
const QString ShowTrackedObjects = "Show Tracked Objects";
|
const QString ShowTrackedObjects = "Show Tracked Objects";
|
||||||
const QString SelfieCamera = "Selfie";
|
const QString SelfieCamera = "Selfie";
|
||||||
const QString SendWrongDSConnectVersion = "Send wrong DS connect version";
|
const QString SendWrongDSConnectVersion = "Send wrong DS connect version";
|
||||||
|
@ -48,12 +48,13 @@ static const int VR_TARGET_RATE = 90;
|
|||||||
* <tr><td><code>"Interactive"</code></td><td>Medium refresh rate, which is reduced when Interface doesn't have focus or is
|
* <tr><td><code>"Interactive"</code></td><td>Medium refresh rate, which is reduced when Interface doesn't have focus or is
|
||||||
* minimized.</td></tr>
|
* minimized.</td></tr>
|
||||||
* <tr><td><code>"Realtime"</code></td><td>High refresh rate, even when Interface doesn't have focus or is minimized.
|
* <tr><td><code>"Realtime"</code></td><td>High refresh rate, even when Interface doesn't have focus or is minimized.
|
||||||
|
* <tr><td><code>"Custom"</code></td><td>Custom refresh rate for full control over the refresh rate in all states.
|
||||||
* </tbody>
|
* </tbody>
|
||||||
* </table>
|
* </table>
|
||||||
* @typedef {string} RefreshRateProfileName
|
* @typedef {string} RefreshRateProfileName
|
||||||
*/
|
*/
|
||||||
static const std::array<std::string, RefreshRateManager::RefreshRateProfile::PROFILE_NUM> REFRESH_RATE_PROFILE_TO_STRING =
|
static const std::array<std::string, RefreshRateManager::RefreshRateProfile::PROFILE_NUM> REFRESH_RATE_PROFILE_TO_STRING =
|
||||||
{ { "Eco", "Interactive", "Realtime" } };
|
{ { "Eco", "Interactive", "Realtime", "Custom" } };
|
||||||
|
|
||||||
/*@jsdoc
|
/*@jsdoc
|
||||||
* <p>Interface states that affect the refresh rate.</p>
|
* <p>Interface states that affect the refresh rate.</p>
|
||||||
@ -94,7 +95,8 @@ static const std::array<std::string, RefreshRateManager::UXMode::UX_NUM> UX_MODE
|
|||||||
static const std::map<std::string, RefreshRateManager::RefreshRateProfile> REFRESH_RATE_PROFILE_FROM_STRING =
|
static const std::map<std::string, RefreshRateManager::RefreshRateProfile> REFRESH_RATE_PROFILE_FROM_STRING =
|
||||||
{ { "Eco", RefreshRateManager::RefreshRateProfile::ECO },
|
{ { "Eco", RefreshRateManager::RefreshRateProfile::ECO },
|
||||||
{ "Interactive", RefreshRateManager::RefreshRateProfile::INTERACTIVE },
|
{ "Interactive", RefreshRateManager::RefreshRateProfile::INTERACTIVE },
|
||||||
{ "Realtime", RefreshRateManager::RefreshRateProfile::REALTIME } };
|
{ "Realtime", RefreshRateManager::RefreshRateProfile::REALTIME },
|
||||||
|
{ "Custom", RefreshRateManager::RefreshRateProfile::CUSTOM } };
|
||||||
|
|
||||||
|
|
||||||
// Porfile regimes are:
|
// Porfile regimes are:
|
||||||
@ -107,10 +109,12 @@ static const std::array<int, RefreshRateManager::RefreshRateRegime::REGIME_NUM>
|
|||||||
{ { 30, 20, 10, 2, 30, 30 } };
|
{ { 30, 20, 10, 2, 30, 30 } };
|
||||||
|
|
||||||
static const std::array<int, RefreshRateManager::RefreshRateRegime::REGIME_NUM> REALTIME_PROFILE =
|
static const std::array<int, RefreshRateManager::RefreshRateRegime::REGIME_NUM> REALTIME_PROFILE =
|
||||||
{ { 60, 60, 60, 2, 30, 30} };
|
{ { 60, 60, 60, 2, 30, 30 } };
|
||||||
|
|
||||||
static const std::array<std::array<int, RefreshRateManager::RefreshRateRegime::REGIME_NUM>, RefreshRateManager::RefreshRateProfile::PROFILE_NUM> REFRESH_RATE_PROFILES =
|
static const std::array<int, RefreshRateManager::RefreshRateRegime::REGIME_NUM> CUSTOM_PROFILE = REALTIME_PROFILE; // derived from settings and modified by scripts below
|
||||||
{ { ECO_PROFILE, INTERACTIVE_PROFILE, REALTIME_PROFILE } };
|
|
||||||
|
static std::array<std::array<int, RefreshRateManager::RefreshRateRegime::REGIME_NUM>, RefreshRateManager::RefreshRateProfile::PROFILE_NUM> REFRESH_RATE_PROFILES =
|
||||||
|
{ { ECO_PROFILE, INTERACTIVE_PROFILE, REALTIME_PROFILE, CUSTOM_PROFILE } };
|
||||||
|
|
||||||
|
|
||||||
static const int INACTIVE_TIMER_LIMIT = 3000;
|
static const int INACTIVE_TIMER_LIMIT = 3000;
|
||||||
@ -134,6 +138,10 @@ std::string RefreshRateManager::uxModeToString(RefreshRateManager::RefreshRateMa
|
|||||||
|
|
||||||
RefreshRateManager::RefreshRateManager() {
|
RefreshRateManager::RefreshRateManager() {
|
||||||
_refreshRateProfile = (RefreshRateManager::RefreshRateProfile) _refreshRateProfileSetting.get();
|
_refreshRateProfile = (RefreshRateManager::RefreshRateProfile) _refreshRateProfileSetting.get();
|
||||||
|
for (size_t i = 0; i < _customRefreshRateSettings.size(); i++) {
|
||||||
|
REFRESH_RATE_PROFILES[CUSTOM][i] = _customRefreshRateSettings[i].get();
|
||||||
|
}
|
||||||
|
|
||||||
_inactiveTimer->setInterval(INACTIVE_TIMER_LIMIT);
|
_inactiveTimer->setInterval(INACTIVE_TIMER_LIMIT);
|
||||||
_inactiveTimer->setSingleShot(true);
|
_inactiveTimer->setSingleShot(true);
|
||||||
QObject::connect(_inactiveTimer.get(), &QTimer::timeout, [&] {
|
QObject::connect(_inactiveTimer.get(), &QTimer::timeout, [&] {
|
||||||
@ -168,6 +176,25 @@ void RefreshRateManager::setRefreshRateProfile(RefreshRateManager::RefreshRatePr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int RefreshRateManager::getCustomRefreshRate(RefreshRateRegime regime) {
|
||||||
|
if (isValidRefreshRateRegime(regime)) {
|
||||||
|
return REFRESH_RATE_PROFILES[RefreshRateProfile::CUSTOM][regime];
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RefreshRateManager::setCustomRefreshRate(RefreshRateRegime regime, int value) {
|
||||||
|
value = std::max(value, 1);
|
||||||
|
if (isValidRefreshRateRegime(regime)) {
|
||||||
|
_refreshRateProfileSettingLock.withWriteLock([&] {
|
||||||
|
REFRESH_RATE_PROFILES[RefreshRateProfile::CUSTOM][regime] = value;
|
||||||
|
_customRefreshRateSettings[regime].set(value);
|
||||||
|
});
|
||||||
|
updateRefreshRateController();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RefreshRateManager::RefreshRateProfile RefreshRateManager::getRefreshRateProfile() const {
|
RefreshRateManager::RefreshRateProfile RefreshRateManager::getRefreshRateProfile() const {
|
||||||
RefreshRateManager::RefreshRateProfile profile = RefreshRateManager::RefreshRateProfile::REALTIME;
|
RefreshRateManager::RefreshRateProfile profile = RefreshRateManager::RefreshRateProfile::REALTIME;
|
||||||
|
|
||||||
@ -191,7 +218,6 @@ void RefreshRateManager::setRefreshRateRegime(RefreshRateManager::RefreshRateReg
|
|||||||
_refreshRateRegime = refreshRateRegime;
|
_refreshRateRegime = refreshRateRegime;
|
||||||
updateRefreshRateController();
|
updateRefreshRateController();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefreshRateManager::setUXMode(RefreshRateManager::UXMode uxMode) {
|
void RefreshRateManager::setUXMode(RefreshRateManager::UXMode uxMode) {
|
||||||
|
@ -32,10 +32,11 @@ public:
|
|||||||
ECO = 0,
|
ECO = 0,
|
||||||
INTERACTIVE,
|
INTERACTIVE,
|
||||||
REALTIME,
|
REALTIME,
|
||||||
|
CUSTOM,
|
||||||
PROFILE_NUM
|
PROFILE_NUM
|
||||||
};
|
};
|
||||||
Q_ENUM(RefreshRateProfile)
|
Q_ENUM(RefreshRateProfile)
|
||||||
static bool isValidRefreshRateProfile(RefreshRateProfile value) { return (value >= RefreshRateProfile::ECO && value <= RefreshRateProfile::REALTIME); }
|
static bool isValidRefreshRateProfile(RefreshRateProfile value) { return (value >= 0 && value < RefreshRateProfile::PROFILE_NUM); }
|
||||||
|
|
||||||
/*@jsdoc
|
/*@jsdoc
|
||||||
* <p>Interface states that affect the refresh rate.</p>
|
* <p>Interface states that affect the refresh rate.</p>
|
||||||
@ -106,6 +107,9 @@ public:
|
|||||||
// query the refresh rate target at the specified combination
|
// query the refresh rate target at the specified combination
|
||||||
int queryRefreshRateTarget(RefreshRateProfile profile, RefreshRateRegime regime, UXMode uxMode) const;
|
int queryRefreshRateTarget(RefreshRateProfile profile, RefreshRateRegime regime, UXMode uxMode) const;
|
||||||
|
|
||||||
|
int getCustomRefreshRate(RefreshRateRegime regime);
|
||||||
|
void setCustomRefreshRate(RefreshRateRegime regime, int value);
|
||||||
|
|
||||||
void resetInactiveTimer();
|
void resetInactiveTimer();
|
||||||
void toggleInactive();
|
void toggleInactive();
|
||||||
|
|
||||||
@ -121,7 +125,15 @@ private:
|
|||||||
UXMode _uxMode { UXMode::DESKTOP };
|
UXMode _uxMode { UXMode::DESKTOP };
|
||||||
|
|
||||||
mutable ReadWriteLockable _refreshRateProfileSettingLock;
|
mutable ReadWriteLockable _refreshRateProfileSettingLock;
|
||||||
Setting::Handle<int> _refreshRateProfileSetting { "refreshRateProfile", RefreshRateProfile::INTERACTIVE };
|
Setting::Handle<int> _refreshRateProfileSetting{ "refreshRateProfile", RefreshRateProfile::INTERACTIVE };
|
||||||
|
std::array<Setting::Handle<int>, REGIME_NUM> _customRefreshRateSettings { {
|
||||||
|
{ "customRefreshRateFocusActive", 60 },
|
||||||
|
{ "customRefreshRateFocusInactive", 60 },
|
||||||
|
{ "customRefreshRateUnfocus", 60 },
|
||||||
|
{ "customRefreshRateMinimized", 2 },
|
||||||
|
{ "customRefreshRateStartup", 30 },
|
||||||
|
{ "customRefreshRateShutdown", 30 }
|
||||||
|
} };
|
||||||
|
|
||||||
std::function<void(int)> _refreshRateOperator { nullptr };
|
std::function<void(int)> _refreshRateOperator { nullptr };
|
||||||
|
|
||||||
|
@ -333,6 +333,14 @@ void AvatarDoctor::diagnoseTextures() {
|
|||||||
addTextureToList(material.occlusionTexture);
|
addTextureToList(material.occlusionTexture);
|
||||||
addTextureToList(material.scatteringTexture);
|
addTextureToList(material.scatteringTexture);
|
||||||
addTextureToList(material.lightmapTexture);
|
addTextureToList(material.lightmapTexture);
|
||||||
|
|
||||||
|
if (material.isMToonMaterial) {
|
||||||
|
addTextureToList(material.shadeTexture);
|
||||||
|
addTextureToList(material.shadingShiftTexture);
|
||||||
|
addTextureToList(material.matcapTexture);
|
||||||
|
addTextureToList(material.rimTexture);
|
||||||
|
addTextureToList(material.uvAnimationTexture);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& materialMapping : model->getMaterialMapping()) {
|
for (const auto& materialMapping : model->getMaterialMapping()) {
|
||||||
|
@ -27,6 +27,10 @@ void AvatarMotionState::handleEasyChanges(uint32_t& flags) {
|
|||||||
if (flags & Simulation::DIRTY_PHYSICS_ACTIVATION && !_body->isActive()) {
|
if (flags & Simulation::DIRTY_PHYSICS_ACTIVATION && !_body->isActive()) {
|
||||||
_body->activate();
|
_body->activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flags & Simulation::DIRTY_MASS) {
|
||||||
|
updateBodyMassProperties();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AvatarMotionState::~AvatarMotionState() {
|
AvatarMotionState::~AvatarMotionState() {
|
||||||
|
@ -136,6 +136,14 @@ AvatarProject* AvatarProject::createAvatarProject(const QString& projectsFolder,
|
|||||||
addTextureToList(material.occlusionTexture);
|
addTextureToList(material.occlusionTexture);
|
||||||
addTextureToList(material.scatteringTexture);
|
addTextureToList(material.scatteringTexture);
|
||||||
addTextureToList(material.lightmapTexture);
|
addTextureToList(material.lightmapTexture);
|
||||||
|
|
||||||
|
if (material.isMToonMaterial) {
|
||||||
|
addTextureToList(material.shadeTexture);
|
||||||
|
addTextureToList(material.shadingShiftTexture);
|
||||||
|
addTextureToList(material.matcapTexture);
|
||||||
|
addTextureToList(material.rimTexture);
|
||||||
|
addTextureToList(material.uvAnimationTexture);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QDir textureDir(textureFolder.isEmpty() ? fbxInfo.absoluteDir() : textureFolder);
|
QDir textureDir(textureFolder.isEmpty() ? fbxInfo.absoluteDir() : textureFolder);
|
||||||
|
@ -31,6 +31,10 @@ void DetailedMotionState::handleEasyChanges(uint32_t& flags) {
|
|||||||
if (flags & Simulation::DIRTY_PHYSICS_ACTIVATION && !_body->isActive()) {
|
if (flags & Simulation::DIRTY_PHYSICS_ACTIVATION && !_body->isActive()) {
|
||||||
_body->activate();
|
_body->activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flags & Simulation::DIRTY_MASS) {
|
||||||
|
updateBodyMassProperties();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DetailedMotionState::~DetailedMotionState() {
|
DetailedMotionState::~DetailedMotionState() {
|
||||||
|
@ -73,6 +73,7 @@
|
|||||||
#include "MovingEntitiesOperator.h"
|
#include "MovingEntitiesOperator.h"
|
||||||
#include "SceneScriptingInterface.h"
|
#include "SceneScriptingInterface.h"
|
||||||
#include "WarningsSuppression.h"
|
#include "WarningsSuppression.h"
|
||||||
|
#include "ScriptPermissions.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -226,7 +227,7 @@ MyAvatar::MyAvatar(QThread* thread) :
|
|||||||
_yawSpeedSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "yawSpeed", _yawSpeed),
|
_yawSpeedSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "yawSpeed", _yawSpeed),
|
||||||
_hmdYawSpeedSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "hmdYawSpeed", _hmdYawSpeed),
|
_hmdYawSpeedSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "hmdYawSpeed", _hmdYawSpeed),
|
||||||
_pitchSpeedSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "pitchSpeed", _pitchSpeed),
|
_pitchSpeedSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "pitchSpeed", _pitchSpeed),
|
||||||
_fullAvatarURLSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "fullAvatarURL",
|
_fullAvatarURLSetting(QStringList() << SETTINGS_FULL_PRIVATE_GROUP_NAME << AVATAR_SETTINGS_GROUP_NAME << "fullAvatarURL",
|
||||||
AvatarData::defaultFullAvatarModelUrl()),
|
AvatarData::defaultFullAvatarModelUrl()),
|
||||||
_fullAvatarModelNameSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "fullAvatarModelName", _fullAvatarModelName),
|
_fullAvatarModelNameSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "fullAvatarModelName", _fullAvatarModelName),
|
||||||
_animGraphURLSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "animGraphURL", QUrl("")),
|
_animGraphURLSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "animGraphURL", QUrl("")),
|
||||||
@ -1035,8 +1036,8 @@ void MyAvatar::simulate(float deltaTime, bool inView) {
|
|||||||
std::pair<bool, bool> zoneInteractionProperties;
|
std::pair<bool, bool> zoneInteractionProperties;
|
||||||
entityTree->withWriteLock([&] {
|
entityTree->withWriteLock([&] {
|
||||||
zoneInteractionProperties = entityTreeRenderer->getZoneInteractionProperties();
|
zoneInteractionProperties = entityTreeRenderer->getZoneInteractionProperties();
|
||||||
EntityEditPacketSender* packetSender = qApp->getEntityEditPacketSender();
|
std::shared_ptr<EntityEditPacketSender> packetSender = qApp->getEntityEditPacketSender();
|
||||||
entityTree->updateEntityQueryAACube(shared_from_this(), packetSender, false, true);
|
entityTree->updateEntityQueryAACube(shared_from_this(), packetSender.get(), false, true);
|
||||||
});
|
});
|
||||||
bool isPhysicsEnabled = qApp->isPhysicsEnabled();
|
bool isPhysicsEnabled = qApp->isPhysicsEnabled();
|
||||||
bool zoneAllowsFlying = zoneInteractionProperties.first;
|
bool zoneAllowsFlying = zoneInteractionProperties.first;
|
||||||
@ -1729,7 +1730,7 @@ void MyAvatar::handleChangedAvatarEntityData() {
|
|||||||
entityTree->deleteEntitiesByID(entitiesToDelete);
|
entityTree->deleteEntitiesByID(entitiesToDelete);
|
||||||
|
|
||||||
// ADD real entities
|
// ADD real entities
|
||||||
EntityEditPacketSender* packetSender = qApp->getEntityEditPacketSender();
|
auto packetSender = qApp->getEntityEditPacketSender();
|
||||||
for (const auto& id : entitiesToAdd) {
|
for (const auto& id : entitiesToAdd) {
|
||||||
bool blobFailed = false;
|
bool blobFailed = false;
|
||||||
EntityItemProperties properties;
|
EntityItemProperties properties;
|
||||||
@ -1739,10 +1740,11 @@ void MyAvatar::handleChangedAvatarEntityData() {
|
|||||||
blobFailed = true; // blob doesn't exist
|
blobFailed = true; // blob doesn't exist
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::lock_guard<std::mutex> guard(_scriptEngineLock);
|
_helperScriptEngine.run( [&] {
|
||||||
if (!EntityItemProperties::blobToProperties(*_scriptEngine, itr.value(), properties)) {
|
if (!EntityItemProperties::blobToProperties(*_helperScriptEngine.get(), itr.value(), properties)) {
|
||||||
blobFailed = true; // blob is corrupt
|
blobFailed = true; // blob is corrupt
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
if (blobFailed) {
|
if (blobFailed) {
|
||||||
// remove from _cachedAvatarEntityBlobUpdatesToSkip just in case:
|
// remove from _cachedAvatarEntityBlobUpdatesToSkip just in case:
|
||||||
@ -1775,10 +1777,11 @@ void MyAvatar::handleChangedAvatarEntityData() {
|
|||||||
skip = true;
|
skip = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::lock_guard<std::mutex> guard(_scriptEngineLock);
|
_helperScriptEngine.run( [&] {
|
||||||
if (!EntityItemProperties::blobToProperties(*_scriptEngine, itr.value(), properties)) {
|
if (!EntityItemProperties::blobToProperties(*_helperScriptEngine.get(), itr.value(), properties)) {
|
||||||
skip = true;
|
skip = true;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
if (!skip && canRezAvatarEntites) {
|
if (!skip && canRezAvatarEntites) {
|
||||||
sanitizeAvatarEntityProperties(properties);
|
sanitizeAvatarEntityProperties(properties);
|
||||||
@ -1883,10 +1886,9 @@ bool MyAvatar::updateStaleAvatarEntityBlobs() const {
|
|||||||
if (found) {
|
if (found) {
|
||||||
++numFound;
|
++numFound;
|
||||||
QByteArray blob;
|
QByteArray blob;
|
||||||
{
|
_helperScriptEngine.run( [&] {
|
||||||
std::lock_guard<std::mutex> guard(_scriptEngineLock);
|
EntityItemProperties::propertiesToBlob(*_helperScriptEngine.get(), getID(), properties, blob);
|
||||||
EntityItemProperties::propertiesToBlob(*_scriptEngine, getID(), properties, blob);
|
});
|
||||||
}
|
|
||||||
_avatarEntitiesLock.withWriteLock([&] {
|
_avatarEntitiesLock.withWriteLock([&] {
|
||||||
_cachedAvatarEntityBlobs[id] = blob;
|
_cachedAvatarEntityBlobs[id] = blob;
|
||||||
});
|
});
|
||||||
@ -1947,10 +1949,9 @@ AvatarEntityMap MyAvatar::getAvatarEntityData() const {
|
|||||||
EntityItemProperties properties = entity->getProperties(desiredProperties);
|
EntityItemProperties properties = entity->getProperties(desiredProperties);
|
||||||
|
|
||||||
QByteArray blob;
|
QByteArray blob;
|
||||||
{
|
_helperScriptEngine.run( [&] {
|
||||||
std::lock_guard<std::mutex> guard(_scriptEngineLock);
|
EntityItemProperties::propertiesToBlob(*_helperScriptEngine.get(), getID(), properties, blob, true);
|
||||||
EntityItemProperties::propertiesToBlob(*_scriptEngine, getID(), properties, blob, true);
|
});
|
||||||
}
|
|
||||||
|
|
||||||
data[entityID] = blob;
|
data[entityID] = blob;
|
||||||
}
|
}
|
||||||
@ -2092,9 +2093,6 @@ void MyAvatar::avatarEntityDataToJson(QJsonObject& root) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::loadData() {
|
void MyAvatar::loadData() {
|
||||||
if (!_scriptEngine) {
|
|
||||||
_scriptEngine = newScriptEngine();
|
|
||||||
}
|
|
||||||
getHead()->setBasePitch(_headPitchSetting.get());
|
getHead()->setBasePitch(_headPitchSetting.get());
|
||||||
|
|
||||||
_yawSpeed = _yawSpeedSetting.get(_yawSpeed);
|
_yawSpeed = _yawSpeedSetting.get(_yawSpeed);
|
||||||
@ -2236,6 +2234,9 @@ AttachmentData MyAvatar::loadAttachmentData(const QUrl& modelURL, const QString&
|
|||||||
return attachment;
|
return attachment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MyAvatar::isMyAvatarURLProtected() const {
|
||||||
|
return !ScriptPermissions::isCurrentScriptAllowed(ScriptPermissions::Permission::SCRIPT_PERMISSION_GET_AVATAR_URL);
|
||||||
|
}
|
||||||
|
|
||||||
int MyAvatar::parseDataFromBuffer(const QByteArray& buffer) {
|
int MyAvatar::parseDataFromBuffer(const QByteArray& buffer) {
|
||||||
qCDebug(interfaceapp) << "Error: ignoring update packet for MyAvatar"
|
qCDebug(interfaceapp) << "Error: ignoring update packet for MyAvatar"
|
||||||
@ -2700,11 +2701,10 @@ QVariantList MyAvatar::getAvatarEntitiesVariant() {
|
|||||||
QVariantMap avatarEntityData;
|
QVariantMap avatarEntityData;
|
||||||
avatarEntityData["id"] = entityID;
|
avatarEntityData["id"] = entityID;
|
||||||
EntityItemProperties entityProperties = entity->getProperties(desiredProperties);
|
EntityItemProperties entityProperties = entity->getProperties(desiredProperties);
|
||||||
{
|
_helperScriptEngine.run( [&] {
|
||||||
std::lock_guard<std::mutex> guard(_scriptEngineLock);
|
ScriptValue scriptProperties = EntityItemPropertiesToScriptValue(_helperScriptEngine.get(), entityProperties);
|
||||||
ScriptValue scriptProperties = EntityItemPropertiesToScriptValue(_scriptEngine.get(), entityProperties);
|
|
||||||
avatarEntityData["properties"] = scriptProperties.toVariant();
|
avatarEntityData["properties"] = scriptProperties.toVariant();
|
||||||
}
|
});
|
||||||
avatarEntitiesData.append(QVariant(avatarEntityData));
|
avatarEntitiesData.append(QVariant(avatarEntityData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4232,7 +4232,7 @@ void MyAvatar::setSessionUUID(const QUuid& sessionUUID) {
|
|||||||
_avatarEntitiesLock.withReadLock([&] {
|
_avatarEntitiesLock.withReadLock([&] {
|
||||||
avatarEntityIDs = _packedAvatarEntityData.keys();
|
avatarEntityIDs = _packedAvatarEntityData.keys();
|
||||||
});
|
});
|
||||||
EntityEditPacketSender* packetSender = qApp->getEntityEditPacketSender();
|
auto packetSender = qApp->getEntityEditPacketSender();
|
||||||
entityTree->withWriteLock([&] {
|
entityTree->withWriteLock([&] {
|
||||||
for (const auto& entityID : avatarEntityIDs) {
|
for (const auto& entityID : avatarEntityIDs) {
|
||||||
auto entity = entityTree->findEntityByID(entityID);
|
auto entity = entityTree->findEntityByID(entityID);
|
||||||
@ -5769,8 +5769,7 @@ void MyAvatar::FollowHelper::deactivate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::FollowHelper::deactivate(CharacterController::FollowType type) {
|
void MyAvatar::FollowHelper::deactivate(CharacterController::FollowType type) {
|
||||||
int int_type = static_cast<int>(type);
|
assert(type < CharacterController::FollowType::Count);
|
||||||
assert(int_type >= 0 && int_type < static_cast<int>(CharacterController::FollowType::Count));
|
|
||||||
_timeRemaining[(int)type] = 0.0f;
|
_timeRemaining[(int)type] = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5778,16 +5777,14 @@ void MyAvatar::FollowHelper::deactivate(CharacterController::FollowType type) {
|
|||||||
// eg. activate(FollowType::Rotation, true) snaps the FollowHelper's rotation immediately
|
// eg. activate(FollowType::Rotation, true) snaps the FollowHelper's rotation immediately
|
||||||
// to the rotation of its _followDesiredBodyTransform.
|
// to the rotation of its _followDesiredBodyTransform.
|
||||||
void MyAvatar::FollowHelper::activate(CharacterController::FollowType type, const bool snapFollow) {
|
void MyAvatar::FollowHelper::activate(CharacterController::FollowType type, const bool snapFollow) {
|
||||||
int int_type = static_cast<int>(type);
|
assert(type < CharacterController::FollowType::Count);
|
||||||
assert(int_type >= 0 && int_type < static_cast<int>(CharacterController::FollowType::Count));
|
|
||||||
|
|
||||||
// TODO: Perhaps, the follow time should be proportional to the displacement.
|
// TODO: Perhaps, the follow time should be proportional to the displacement.
|
||||||
_timeRemaining[(int)type] = snapFollow ? CharacterController::FOLLOW_TIME_IMMEDIATE_SNAP : FOLLOW_TIME;
|
_timeRemaining[(int)type] = snapFollow ? CharacterController::FOLLOW_TIME_IMMEDIATE_SNAP : FOLLOW_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MyAvatar::FollowHelper::isActive(CharacterController::FollowType type) const {
|
bool MyAvatar::FollowHelper::isActive(CharacterController::FollowType type) const {
|
||||||
int int_type = static_cast<int>(type);
|
assert(type < CharacterController::FollowType::Count);
|
||||||
assert(int_type >= 0 && int_type < static_cast<int>(CharacterController::FollowType::Count));
|
|
||||||
return _timeRemaining[(int)type] > 0.0f;
|
return _timeRemaining[(int)type] > 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6889,7 +6886,7 @@ void MyAvatar::sendPacket(const QUuid& entityID) const {
|
|||||||
if (entityTree) {
|
if (entityTree) {
|
||||||
entityTree->withWriteLock([&] {
|
entityTree->withWriteLock([&] {
|
||||||
// force an update packet
|
// force an update packet
|
||||||
EntityEditPacketSender* packetSender = qApp->getEntityEditPacketSender();
|
auto packetSender = qApp->getEntityEditPacketSender();
|
||||||
packetSender->queueEditAvatarEntityMessage(entityTree, entityID);
|
packetSender->queueEditAvatarEntityMessage(entityTree, entityID);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <controllers/Pose.h>
|
#include <controllers/Pose.h>
|
||||||
#include <controllers/Actions.h>
|
#include <controllers/Actions.h>
|
||||||
#include <EntityItem.h>
|
#include <EntityItem.h>
|
||||||
|
#include <HelperScriptEngine.h>
|
||||||
#include <ThreadSafeValueCache.h>
|
#include <ThreadSafeValueCache.h>
|
||||||
#include <Rig.h>
|
#include <Rig.h>
|
||||||
#include <SettingHandle.h>
|
#include <SettingHandle.h>
|
||||||
@ -2683,6 +2684,7 @@ private:
|
|||||||
void setEnableDrawAverageFacing(bool drawAverage) { _drawAverageFacingEnabled = drawAverage; }
|
void setEnableDrawAverageFacing(bool drawAverage) { _drawAverageFacingEnabled = drawAverage; }
|
||||||
bool getEnableDrawAverageFacing() const { return _drawAverageFacingEnabled; }
|
bool getEnableDrawAverageFacing() const { return _drawAverageFacingEnabled; }
|
||||||
virtual bool isMyAvatar() const override { return true; }
|
virtual bool isMyAvatar() const override { return true; }
|
||||||
|
virtual bool isMyAvatarURLProtected() const override;
|
||||||
virtual int parseDataFromBuffer(const QByteArray& buffer) override;
|
virtual int parseDataFromBuffer(const QByteArray& buffer) override;
|
||||||
virtual glm::vec3 getSkeletonPosition() const override;
|
virtual glm::vec3 getSkeletonPosition() const override;
|
||||||
int _skeletonModelChangeCount { 0 };
|
int _skeletonModelChangeCount { 0 };
|
||||||
@ -3101,8 +3103,10 @@ private:
|
|||||||
mutable std::set<EntityItemID> _staleCachedAvatarEntityBlobs;
|
mutable std::set<EntityItemID> _staleCachedAvatarEntityBlobs;
|
||||||
//
|
//
|
||||||
// keep a ScriptEngine around so we don't have to instantiate on the fly (these are very slow to create/delete)
|
// keep a ScriptEngine around so we don't have to instantiate on the fly (these are very slow to create/delete)
|
||||||
mutable std::mutex _scriptEngineLock;
|
// TODO: profile if it performs better when script engine is on avatar thread or on its own thread
|
||||||
ScriptEnginePointer _scriptEngine { nullptr };
|
// Own thread is safer from deadlocks
|
||||||
|
mutable HelperScriptEngine _helperScriptEngine;
|
||||||
|
|
||||||
bool _needToSaveAvatarEntitySettings { false };
|
bool _needToSaveAvatarEntitySettings { false };
|
||||||
|
|
||||||
bool _reactionTriggers[NUM_AVATAR_TRIGGER_REACTIONS] { false, false };
|
bool _reactionTriggers[NUM_AVATAR_TRIGGER_REACTIONS] { false, false };
|
||||||
|
@ -281,7 +281,7 @@ void GraphicsEngine::render_performFrame() {
|
|||||||
|
|
||||||
{
|
{
|
||||||
PROFILE_RANGE(render, "/runRenderFrame");
|
PROFILE_RANGE(render, "/runRenderFrame");
|
||||||
renderArgs._hudOperator = displayPlugin->getHUDOperator();
|
renderArgs._hudOperator = qApp->getApplicationOverlay().enabled() ? displayPlugin->getHUDOperator() : nullptr;
|
||||||
renderArgs._hudTexture = qApp->getApplicationOverlay().getOverlayTexture();
|
renderArgs._hudTexture = qApp->getApplicationOverlay().getOverlayTexture();
|
||||||
renderArgs._takingSnapshot = qApp->takeSnapshotOperators(snapshotOperators);
|
renderArgs._takingSnapshot = qApp->takeSnapshotOperators(snapshotOperators);
|
||||||
renderArgs._blitFramebuffer = finalFramebuffer;
|
renderArgs._blitFramebuffer = finalFramebuffer;
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
#include <NetworkAccessManager.h>
|
#include <NetworkAccessManager.h>
|
||||||
#include <gl/GLHelpers.h>
|
#include <gl/GLHelpers.h>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "AddressManager.h"
|
#include "AddressManager.h"
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
@ -33,6 +34,9 @@
|
|||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "Profile.h"
|
#include "Profile.h"
|
||||||
#include "LogHandler.h"
|
#include "LogHandler.h"
|
||||||
|
#include <plugins/PluginManager.h>
|
||||||
|
#include <plugins/DisplayPlugin.h>
|
||||||
|
#include <plugins/CodecPlugin.h>
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
@ -63,11 +67,24 @@ int main(int argc, const char* argv[]) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Setup QCoreApplication settings, install log message handler
|
||||||
setupHifiApplication(BuildInfo::INTERFACE_NAME);
|
setupHifiApplication(BuildInfo::INTERFACE_NAME);
|
||||||
|
|
||||||
// Journald by default in user applications is probably a bit too modern still.
|
// Journald by default in user applications is probably a bit too modern still.
|
||||||
LogHandler::getInstance().setShouldUseJournald(false);
|
LogHandler::getInstance().setShouldUseJournald(false);
|
||||||
|
|
||||||
|
|
||||||
|
// Extend argv to enable WebGL rendering
|
||||||
|
std::vector<const char*> argvExtended(&argv[0], &argv[argc]);
|
||||||
|
argvExtended.push_back("--ignore-gpu-blocklist");
|
||||||
|
#ifdef Q_OS_ANDROID
|
||||||
|
argvExtended.push_back("--suppress-settings-reset");
|
||||||
|
#endif
|
||||||
|
int argcExtended = (int)argvExtended.size();
|
||||||
|
|
||||||
|
QElapsedTimer startupTime;
|
||||||
|
startupTime.start();
|
||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
parser.setApplicationDescription("Overte -- A free/libre and open-source virtual worlds client");
|
parser.setApplicationDescription("Overte -- A free/libre and open-source virtual worlds client");
|
||||||
QCommandLineOption helpOption = parser.addHelpOption();
|
QCommandLineOption helpOption = parser.addHelpOption();
|
||||||
@ -125,12 +142,12 @@ int main(int argc, const char* argv[]) {
|
|||||||
"displays"
|
"displays"
|
||||||
);
|
);
|
||||||
QCommandLineOption disableDisplaysOption(
|
QCommandLineOption disableDisplaysOption(
|
||||||
"disable-displays",
|
"disableDisplayPlugins",
|
||||||
"Displays to disable. Valid options include \"OpenVR (Vive)\" and \"Oculus Rift\"",
|
"Displays to disable. Valid options include \"OpenVR (Vive)\" and \"Oculus Rift\"",
|
||||||
"string"
|
"string"
|
||||||
);
|
);
|
||||||
QCommandLineOption disableInputsOption(
|
QCommandLineOption disableInputsOption(
|
||||||
"disable-inputs",
|
"disableInputPlugins",
|
||||||
"Inputs to disable. Valid options include \"OpenVR (Vive)\" and \"Oculus Rift\"",
|
"Inputs to disable. Valid options include \"OpenVR (Vive)\" and \"Oculus Rift\"",
|
||||||
"string"
|
"string"
|
||||||
);
|
);
|
||||||
@ -246,6 +263,19 @@ int main(int argc, const char* argv[]) {
|
|||||||
"Logging options, comma separated: color,nocolor,process_id,thread_id,milliseconds,keep_repeats,journald,nojournald",
|
"Logging options, comma separated: color,nocolor,process_id,thread_id,milliseconds,keep_repeats,journald,nojournald",
|
||||||
"options"
|
"options"
|
||||||
);
|
);
|
||||||
|
QCommandLineOption getPluginsOption(
|
||||||
|
"getPlugins",
|
||||||
|
"Print out a list of plugins in JSON"
|
||||||
|
);
|
||||||
|
QCommandLineOption abortAfterStartupOption(
|
||||||
|
"abortAfterStartup",
|
||||||
|
"Debug option. Aborts right after startup."
|
||||||
|
);
|
||||||
|
QCommandLineOption abortAfterInitOption(
|
||||||
|
"abortAfterInit",
|
||||||
|
"Debug option. Aborts after initialization, right before the program starts running the event loop."
|
||||||
|
);
|
||||||
|
|
||||||
// "--qmljsdebugger", which appears in output from "--help-all".
|
// "--qmljsdebugger", which appears in output from "--help-all".
|
||||||
// Those below don't seem to be optional.
|
// Those below don't seem to be optional.
|
||||||
// --ignore-gpu-blacklist
|
// --ignore-gpu-blacklist
|
||||||
@ -288,6 +318,10 @@ int main(int argc, const char* argv[]) {
|
|||||||
parser.addOption(quitWhenFinishedOption);
|
parser.addOption(quitWhenFinishedOption);
|
||||||
parser.addOption(fastHeartbeatOption);
|
parser.addOption(fastHeartbeatOption);
|
||||||
parser.addOption(logOption);
|
parser.addOption(logOption);
|
||||||
|
parser.addOption(abortAfterStartupOption);
|
||||||
|
parser.addOption(abortAfterInitOption);
|
||||||
|
parser.addOption(getPluginsOption);
|
||||||
|
|
||||||
|
|
||||||
QString applicationPath;
|
QString applicationPath;
|
||||||
// A temporary application instance is needed to get the location of the running executable
|
// A temporary application instance is needed to get the location of the running executable
|
||||||
@ -310,6 +344,16 @@ int main(int argc, const char* argv[]) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: We need settings for Application, but Settings needs an Application
|
||||||
|
// to handle events. Needs splitting into two parts: enough initialization
|
||||||
|
// for Application to work, and then thread start afterwards.
|
||||||
|
Setting::init();
|
||||||
|
Application app(argcExtended, const_cast<char**>(argvExtended.data()), parser, startupTime);
|
||||||
|
|
||||||
|
if (parser.isSet("abortAfterStartup")) {
|
||||||
|
return 99;
|
||||||
|
}
|
||||||
|
|
||||||
// We want to configure the logging system as early as possible
|
// We want to configure the logging system as early as possible
|
||||||
auto& logHandler = LogHandler::getInstance();
|
auto& logHandler = LogHandler::getInstance();
|
||||||
|
|
||||||
@ -321,6 +365,75 @@ int main(int argc, const char* argv[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.initializePluginManager(parser);
|
||||||
|
|
||||||
|
if (parser.isSet(getPluginsOption)) {
|
||||||
|
auto pluginManager = PluginManager::getInstance();
|
||||||
|
|
||||||
|
QJsonObject pluginsJson;
|
||||||
|
for (const auto &plugin : pluginManager->getPluginInfo()) {
|
||||||
|
QJsonObject data;
|
||||||
|
data["data"] = plugin.metaData;
|
||||||
|
data["loaded"] = plugin.loaded;
|
||||||
|
data["disabled"] = plugin.disabled;
|
||||||
|
data["filteredOut"] = plugin.filteredOut;
|
||||||
|
data["wrongVersion"] = plugin.wrongVersion;
|
||||||
|
pluginsJson[plugin.name] = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
QJsonObject inputJson;
|
||||||
|
for (const auto &plugin : pluginManager->getInputPlugins()) {
|
||||||
|
QJsonObject data;
|
||||||
|
data["subdeviceNames"] = QJsonArray::fromStringList(plugin->getSubdeviceNames());
|
||||||
|
data["deviceName"] = plugin->getDeviceName();
|
||||||
|
data["configurable"] = plugin->configurable();
|
||||||
|
data["isHandController"] = plugin->isHandController();
|
||||||
|
data["isHeadController"] = plugin->isHeadController();
|
||||||
|
data["isActive"] = plugin->isActive();
|
||||||
|
data["isSupported"] = plugin->isSupported();
|
||||||
|
|
||||||
|
inputJson[plugin->getName()] = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
QJsonObject displayJson;
|
||||||
|
for (const auto &plugin : pluginManager->getDisplayPlugins()) {
|
||||||
|
QJsonObject data;
|
||||||
|
data["isHmd"] = plugin->isHmd();
|
||||||
|
data["isStereo"] = plugin->isStereo();
|
||||||
|
data["targetFramerate"] = plugin->getTargetFrameRate();
|
||||||
|
data["hasAsyncReprojection"] = plugin->hasAsyncReprojection();
|
||||||
|
data["isActive"] = plugin->isActive();
|
||||||
|
data["isSupported"] = plugin->isSupported();
|
||||||
|
|
||||||
|
displayJson[plugin->getName()] = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
QJsonObject codecsJson;
|
||||||
|
for (const auto &plugin : pluginManager->getCodecPlugins()) {
|
||||||
|
QJsonObject data;
|
||||||
|
data["isActive"] = plugin->isActive();
|
||||||
|
data["isSupported"] = plugin->isSupported();
|
||||||
|
|
||||||
|
codecsJson[plugin->getName()] = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
QJsonObject platformsJson;
|
||||||
|
platformsJson["steamAvailable"] = (pluginManager->getSteamClientPlugin() != nullptr);
|
||||||
|
platformsJson["oculusAvailable"] = (pluginManager->getOculusPlatformPlugin() != nullptr);
|
||||||
|
|
||||||
|
QJsonObject root;
|
||||||
|
root["plugins"] = pluginsJson;
|
||||||
|
root["inputs"] = inputJson;
|
||||||
|
root["displays"] = displayJson;
|
||||||
|
root["codecs"] = codecsJson;
|
||||||
|
root["platforms"] = platformsJson;
|
||||||
|
|
||||||
|
std::cout << QJsonDocument(root).toJson().toStdString() << "\n";
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Act on arguments for early termination.
|
// Act on arguments for early termination.
|
||||||
if (parser.isSet(versionOption)) {
|
if (parser.isSet(versionOption)) {
|
||||||
parser.showVersion();
|
parser.showVersion();
|
||||||
@ -407,10 +520,9 @@ int main(int argc, const char* argv[]) {
|
|||||||
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
|
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QElapsedTimer startupTime;
|
|
||||||
startupTime.start();
|
|
||||||
|
|
||||||
Setting::init();
|
|
||||||
|
|
||||||
|
|
||||||
// Instance UserActivityLogger now that the settings are loaded
|
// Instance UserActivityLogger now that the settings are loaded
|
||||||
auto& ual = UserActivityLogger::getInstance();
|
auto& ual = UserActivityLogger::getInstance();
|
||||||
@ -549,7 +661,7 @@ int main(int argc, const char* argv[]) {
|
|||||||
// Oculus initialization MUST PRECEDE OpenGL context creation.
|
// Oculus initialization MUST PRECEDE OpenGL context creation.
|
||||||
// The nature of the Application constructor means this has to be either here,
|
// The nature of the Application constructor means this has to be either here,
|
||||||
// or in the main window ctor, before GL startup.
|
// or in the main window ctor, before GL startup.
|
||||||
Application::initPlugins(parser);
|
//app.configurePlugins(parser);
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
// If we're running in steam mode, we need to do an explicit check to ensure we're up to the required min spec
|
// If we're running in steam mode, we need to do an explicit check to ensure we're up to the required min spec
|
||||||
@ -587,17 +699,10 @@ int main(int argc, const char* argv[]) {
|
|||||||
SandboxUtils::runLocalSandbox(serverContentPath, true, noUpdater);
|
SandboxUtils::runLocalSandbox(serverContentPath, true, noUpdater);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extend argv to enable WebGL rendering
|
|
||||||
std::vector<const char*> argvExtended(&argv[0], &argv[argc]);
|
|
||||||
argvExtended.push_back("--ignore-gpu-blocklist");
|
|
||||||
#ifdef Q_OS_ANDROID
|
|
||||||
argvExtended.push_back("--suppress-settings-reset");
|
|
||||||
#endif
|
|
||||||
int argcExtended = (int)argvExtended.size();
|
|
||||||
|
|
||||||
PROFILE_SYNC_END(startup, "main startup", "");
|
PROFILE_SYNC_END(startup, "main startup", "");
|
||||||
PROFILE_SYNC_BEGIN(startup, "app full ctor", "");
|
PROFILE_SYNC_BEGIN(startup, "app full ctor", "");
|
||||||
Application app(argcExtended, const_cast<char**>(argvExtended.data()), parser, startupTime, runningMarkerExisted);
|
app.setPreviousSessionCrashed(runningMarkerExisted);
|
||||||
|
app.initialize(parser);
|
||||||
PROFILE_SYNC_END(startup, "app full ctor", "");
|
PROFILE_SYNC_END(startup, "app full ctor", "");
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
@ -665,6 +770,9 @@ int main(int argc, const char* argv[]) {
|
|||||||
translator.load("i18n/interface_en");
|
translator.load("i18n/interface_en");
|
||||||
app.installTranslator(&translator);
|
app.installTranslator(&translator);
|
||||||
qCDebug(interfaceapp, "Created QT Application.");
|
qCDebug(interfaceapp, "Created QT Application.");
|
||||||
|
if (parser.isSet("abortAfterInit")) {
|
||||||
|
return 99;
|
||||||
|
}
|
||||||
exitCode = app.exec();
|
exitCode = app.exec();
|
||||||
server.close();
|
server.close();
|
||||||
|
|
||||||
|
@ -137,12 +137,12 @@ LaserPointer::RenderState::RenderState(const QUuid& startID, const QUuid& pathID
|
|||||||
{
|
{
|
||||||
EntityPropertyFlags desiredProperties;
|
EntityPropertyFlags desiredProperties;
|
||||||
desiredProperties += PROP_IGNORE_PICK_INTERSECTION;
|
desiredProperties += PROP_IGNORE_PICK_INTERSECTION;
|
||||||
_pathIgnorePicks = entityScriptingInterface->getEntityPropertiesInternal(getPathID(), desiredProperties).getIgnorePickIntersection();
|
_pathIgnorePicks = entityScriptingInterface->getEntityPropertiesInternal(getPathID(), desiredProperties, false).getIgnorePickIntersection();
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
EntityPropertyFlags desiredProperties;
|
EntityPropertyFlags desiredProperties;
|
||||||
desiredProperties += PROP_STROKE_WIDTHS;
|
desiredProperties += PROP_STROKE_WIDTHS;
|
||||||
auto widths = entityScriptingInterface->getEntityPropertiesInternal(getPathID(), desiredProperties).getStrokeWidths();
|
auto widths = entityScriptingInterface->getEntityPropertiesInternal(getPathID(), desiredProperties, false).getStrokeWidths();
|
||||||
_lineWidth = widths.length() == 0 ? PolyLineEntityItem::DEFAULT_LINE_WIDTH : widths[0];
|
_lineWidth = widths.length() == 0 ? PolyLineEntityItem::DEFAULT_LINE_WIDTH : widths[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ PickResultPointer ParabolaPick::getEntityIntersection(const PickParabola& pick)
|
|||||||
if (getFilter().doesPickLocalEntities()) {
|
if (getFilter().doesPickLocalEntities()) {
|
||||||
EntityPropertyFlags desiredProperties;
|
EntityPropertyFlags desiredProperties;
|
||||||
desiredProperties += PROP_ENTITY_HOST_TYPE;
|
desiredProperties += PROP_ENTITY_HOST_TYPE;
|
||||||
if (DependencyManager::get<EntityScriptingInterface>()->getEntityPropertiesInternal(entityRes.entityID, desiredProperties).getEntityHostType() == entity::HostType::LOCAL) {
|
if (DependencyManager::get<EntityScriptingInterface>()->getEntityPropertiesInternal(entityRes.entityID, desiredProperties, false).getEntityHostType() == entity::HostType::LOCAL) {
|
||||||
type = IntersectionType::LOCAL_ENTITY;
|
type = IntersectionType::LOCAL_ENTITY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ StartEndRenderState::StartEndRenderState(const QUuid& startID, const QUuid& endI
|
|||||||
EntityPropertyFlags desiredProperties;
|
EntityPropertyFlags desiredProperties;
|
||||||
desiredProperties += PROP_DIMENSIONS;
|
desiredProperties += PROP_DIMENSIONS;
|
||||||
desiredProperties += PROP_IGNORE_PICK_INTERSECTION;
|
desiredProperties += PROP_IGNORE_PICK_INTERSECTION;
|
||||||
auto properties = entityScriptingInterface->getEntityPropertiesInternal(_startID, desiredProperties);
|
auto properties = entityScriptingInterface->getEntityPropertiesInternal(_startID, desiredProperties, false);
|
||||||
_startDim = properties.getDimensions();
|
_startDim = properties.getDimensions();
|
||||||
_startIgnorePicks = properties.getIgnorePickIntersection();
|
_startIgnorePicks = properties.getIgnorePickIntersection();
|
||||||
}
|
}
|
||||||
@ -266,7 +266,7 @@ StartEndRenderState::StartEndRenderState(const QUuid& startID, const QUuid& endI
|
|||||||
desiredProperties += PROP_DIMENSIONS;
|
desiredProperties += PROP_DIMENSIONS;
|
||||||
desiredProperties += PROP_ROTATION;
|
desiredProperties += PROP_ROTATION;
|
||||||
desiredProperties += PROP_IGNORE_PICK_INTERSECTION;
|
desiredProperties += PROP_IGNORE_PICK_INTERSECTION;
|
||||||
auto properties = entityScriptingInterface->getEntityPropertiesInternal(_endID, desiredProperties);
|
auto properties = entityScriptingInterface->getEntityPropertiesInternal(_endID, desiredProperties, false);
|
||||||
_endDim = properties.getDimensions();
|
_endDim = properties.getDimensions();
|
||||||
_endRot = properties.getRotation();
|
_endRot = properties.getRotation();
|
||||||
_endIgnorePicks = properties.getIgnorePickIntersection();
|
_endIgnorePicks = properties.getIgnorePickIntersection();
|
||||||
|
@ -40,7 +40,7 @@ PickResultPointer RayPick::getEntityIntersection(const PickRay& pick) {
|
|||||||
if (getFilter().doesPickLocalEntities()) {
|
if (getFilter().doesPickLocalEntities()) {
|
||||||
EntityPropertyFlags desiredProperties;
|
EntityPropertyFlags desiredProperties;
|
||||||
desiredProperties += PROP_ENTITY_HOST_TYPE;
|
desiredProperties += PROP_ENTITY_HOST_TYPE;
|
||||||
if (DependencyManager::get<EntityScriptingInterface>()->getEntityPropertiesInternal(entityRes.entityID, desiredProperties).getEntityHostType() == entity::HostType::LOCAL) {
|
if (DependencyManager::get<EntityScriptingInterface>()->getEntityPropertiesInternal(entityRes.entityID, desiredProperties, false).getEntityHostType() == entity::HostType::LOCAL) {
|
||||||
type = IntersectionType::LOCAL_ENTITY;
|
type = IntersectionType::LOCAL_ENTITY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,6 +123,6 @@ glm::vec2 RayPick::projectOntoEntityXYPlane(const QUuid& entityID, const glm::ve
|
|||||||
desiredProperties += PROP_ROTATION;
|
desiredProperties += PROP_ROTATION;
|
||||||
desiredProperties += PROP_DIMENSIONS;
|
desiredProperties += PROP_DIMENSIONS;
|
||||||
desiredProperties += PROP_REGISTRATION_POINT;
|
desiredProperties += PROP_REGISTRATION_POINT;
|
||||||
auto props = DependencyManager::get<EntityScriptingInterface>()->getEntityPropertiesInternal(entityID, desiredProperties);
|
auto props = DependencyManager::get<EntityScriptingInterface>()->getEntityPropertiesInternal(entityID, desiredProperties, false);
|
||||||
return projectOntoXYPlane(worldPos, props.getPosition(), props.getRotation(), props.getDimensions(), props.getRegistrationPoint(), unNormalized);
|
return projectOntoXYPlane(worldPos, props.getPosition(), props.getRotation(), props.getDimensions(), props.getRegistrationPoint(), unNormalized);
|
||||||
}
|
}
|
||||||
|
@ -216,6 +216,7 @@ class ScriptEngine;
|
|||||||
*
|
*
|
||||||
* @property {Controller.Actions} Actions - Predefined actions on Interface and the user's avatar. These can be used as end
|
* @property {Controller.Actions} Actions - Predefined actions on Interface and the user's avatar. These can be used as end
|
||||||
* points in a {@link RouteObject} mapping. A synonym for <code>Controller.Hardware.Actions</code>.
|
* points in a {@link RouteObject} mapping. A synonym for <code>Controller.Hardware.Actions</code>.
|
||||||
|
* Getting this property is computationally expensive, so it's best to cache it once on script start.
|
||||||
* <em>Read-only.</em>
|
* <em>Read-only.</em>
|
||||||
* <p>Default mappings are provided from the <code>Controller.Hardware.Keyboard</code> and <code>Controller.Standard</code>
|
* <p>Default mappings are provided from the <code>Controller.Hardware.Keyboard</code> and <code>Controller.Standard</code>
|
||||||
* to actions in
|
* to actions in
|
||||||
@ -225,13 +226,16 @@ class ScriptEngine;
|
|||||||
* standard.json</a>, respectively.</p>
|
* standard.json</a>, respectively.</p>
|
||||||
*
|
*
|
||||||
* @property {Controller.Hardware} Hardware - Standard and hardware-specific controller and computer outputs, plus predefined
|
* @property {Controller.Hardware} Hardware - Standard and hardware-specific controller and computer outputs, plus predefined
|
||||||
* actions on Interface and the user's avatar. The outputs can be mapped to <code>Actions</code> or functions in a
|
* actions on Interface and the user's avatar. Getting this property is computationally expensive, so it's best to cache it
|
||||||
|
* instead of calling on every update.
|
||||||
|
* The outputs can be mapped to <code>Actions</code> or functions in a
|
||||||
* {@link RouteObject} mapping. Additionally, hardware-specific controller outputs can be mapped to
|
* {@link RouteObject} mapping. Additionally, hardware-specific controller outputs can be mapped to
|
||||||
* <code>Controller.Standard</code> controller outputs. <em>Read-only.</em>
|
* <code>Controller.Standard</code> controller outputs. <em>Read-only.</em>
|
||||||
*
|
*
|
||||||
* @property {Controller.Standard} Standard - Standard controller outputs that can be mapped to <code>Actions</code> or
|
* @property {Controller.Standard} Standard - Standard controller outputs that can be mapped to <code>Actions</code> or
|
||||||
* functions in a {@link RouteObject} mapping. <em>Read-only.</em>
|
* functions in a {@link RouteObject} mapping. <em>Read-only.</em>
|
||||||
* <p>Each hardware device has a mapping from its outputs to <code>Controller.Standard</code> items, specified in a JSON file.
|
* <p>Each hardware device has a mapping from its outputs to <code>Controller.Standard</code> items, specified in a JSON file.
|
||||||
|
* Getting this property is computationally expensive, so it's best to cache it once on script start.
|
||||||
* For example, <a href="https://github.com/highfidelity/hifi/blob/master/interface/resources/controllers/leapmotion.json">
|
* For example, <a href="https://github.com/highfidelity/hifi/blob/master/interface/resources/controllers/leapmotion.json">
|
||||||
* leapmotion.json</a> and
|
* leapmotion.json</a> and
|
||||||
* <a href="https://github.com/highfidelity/hifi/blob/master/interface/resources/controllers/vive.json">vive.json</a>.</p>
|
* <a href="https://github.com/highfidelity/hifi/blob/master/interface/resources/controllers/vive.json">vive.json</a>.</p>
|
||||||
|
@ -56,12 +56,22 @@ void PerformanceScriptingInterface::setRefreshRateProfile(RefreshRateProfile ref
|
|||||||
emit settingsChanged();
|
emit settingsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PerformanceScriptingInterface::setCustomRefreshRate(RefreshRateManager::RefreshRateRegime refreshRateRegime, int value)
|
||||||
|
{
|
||||||
|
qApp->getRefreshRateManager().setCustomRefreshRate(refreshRateRegime, value);
|
||||||
|
emit settingsChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
int PerformanceScriptingInterface::getCustomRefreshRate(RefreshRateManager::RefreshRateRegime refreshRateRegime) const {
|
||||||
|
return qApp->getRefreshRateManager().getCustomRefreshRate(refreshRateRegime);
|
||||||
|
}
|
||||||
|
|
||||||
PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface::getRefreshRateProfile() const {
|
PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface::getRefreshRateProfile() const {
|
||||||
return (PerformanceScriptingInterface::RefreshRateProfile)qApp->getRefreshRateManager().getRefreshRateProfile();
|
return (PerformanceScriptingInterface::RefreshRateProfile)qApp->getRefreshRateManager().getRefreshRateProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList PerformanceScriptingInterface::getRefreshRateProfileNames() const {
|
QStringList PerformanceScriptingInterface::getRefreshRateProfileNames() const {
|
||||||
static const QStringList refreshRateProfileNames = { "ECO", "INTERACTIVE", "REALTIME" };
|
static const QStringList refreshRateProfileNames = { "ECO", "INTERACTIVE", "REALTIME", "CUSTOM" };
|
||||||
return refreshRateProfileNames;
|
return refreshRateProfileNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +127,22 @@ public slots:
|
|||||||
*/
|
*/
|
||||||
void setRefreshRateProfile(RefreshRateProfile refreshRateProfile);
|
void setRefreshRateProfile(RefreshRateProfile refreshRateProfile);
|
||||||
|
|
||||||
|
/*@jsdoc
|
||||||
|
* Sets a custom refresh rate.
|
||||||
|
* @function Performance.setCustomRefreshRate
|
||||||
|
* @param {RefreshRateRegime} refreshRateRegime - The refresh rate regime
|
||||||
|
* @param {int} value - The value for the regime
|
||||||
|
*/
|
||||||
|
void setCustomRefreshRate(RefreshRateManager::RefreshRateRegime refreshRateRegime, int value);
|
||||||
|
|
||||||
|
/*@jsdoc
|
||||||
|
* Gets the value for a specific RefreshRateRegime.
|
||||||
|
* @function Performance.getCustomRefreshRate
|
||||||
|
* @param {RefreshRateRegime} - The regime to get the value from
|
||||||
|
* @returns {int} - The value from the specified regime
|
||||||
|
*/
|
||||||
|
int getCustomRefreshRate(RefreshRateManager::RefreshRateRegime regime) const;
|
||||||
|
|
||||||
/*@jsdoc
|
/*@jsdoc
|
||||||
* Gets the current refresh rate profile in use.
|
* Gets the current refresh rate profile in use.
|
||||||
* @function Performance.getRefreshRateProfile
|
* @function Performance.getRefreshRateProfile
|
||||||
|
@ -21,6 +21,9 @@ SettingsScriptingInterface* SettingsScriptingInterface::getInstance() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QVariant SettingsScriptingInterface::getValue(const QString& setting) {
|
QVariant SettingsScriptingInterface::getValue(const QString& setting) {
|
||||||
|
if (_restrictPrivateValues && setting.startsWith(SETTINGS_FULL_PRIVATE_GROUP_NAME + "/")) {
|
||||||
|
return {""};
|
||||||
|
}
|
||||||
QVariant value = Setting::Handle<QVariant>(setting).get();
|
QVariant value = Setting::Handle<QVariant>(setting).get();
|
||||||
if (!value.isValid()) {
|
if (!value.isValid()) {
|
||||||
value = "";
|
value = "";
|
||||||
@ -29,6 +32,9 @@ QVariant SettingsScriptingInterface::getValue(const QString& setting) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QVariant SettingsScriptingInterface::getValue(const QString& setting, const QVariant& defaultValue) {
|
QVariant SettingsScriptingInterface::getValue(const QString& setting, const QVariant& defaultValue) {
|
||||||
|
if (_restrictPrivateValues && setting.startsWith(SETTINGS_FULL_PRIVATE_GROUP_NAME + "/")) {
|
||||||
|
return {""};
|
||||||
|
}
|
||||||
QVariant value = Setting::Handle<QVariant>(setting, defaultValue).get();
|
QVariant value = Setting::Handle<QVariant>(setting, defaultValue).get();
|
||||||
if (!value.isValid()) {
|
if (!value.isValid()) {
|
||||||
value = "";
|
value = "";
|
||||||
@ -40,7 +46,7 @@ void SettingsScriptingInterface::setValue(const QString& setting, const QVariant
|
|||||||
if (getValue(setting) == value) {
|
if (getValue(setting) == value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (setting.startsWith("private/")) {
|
if (setting.startsWith("private/") || setting.startsWith(SETTINGS_FULL_PRIVATE_GROUP_NAME + "/")) {
|
||||||
if (_restrictPrivateValues) {
|
if (_restrictPrivateValues) {
|
||||||
qWarning() << "SettingsScriptingInterface::setValue -- restricted write: " << setting << value;
|
qWarning() << "SettingsScriptingInterface::setValue -- restricted write: " << setting << value;
|
||||||
return;
|
return;
|
||||||
|
@ -78,7 +78,7 @@ WindowScriptingInterface::~WindowScriptingInterface() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ScriptValue WindowScriptingInterface::hasFocus() {
|
ScriptValue WindowScriptingInterface::hasFocus() {
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
return engine()->newValue(qApp->hasFocus());
|
return engine()->newValue(qApp->hasFocus());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ void WindowScriptingInterface::alert(const QString& message) {
|
|||||||
/// \param const QString& message message to display
|
/// \param const QString& message message to display
|
||||||
/// \return ScriptValue `true` if 'Yes' was clicked, `false` otherwise
|
/// \return ScriptValue `true` if 'Yes' was clicked, `false` otherwise
|
||||||
ScriptValue WindowScriptingInterface::confirm(const QString& message) {
|
ScriptValue WindowScriptingInterface::confirm(const QString& message) {
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
return engine()->newValue((QMessageBox::Yes == OffscreenUi::question("", message, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)));
|
return engine()->newValue((QMessageBox::Yes == OffscreenUi::question("", message, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ ScriptValue WindowScriptingInterface::confirm(const QString& message) {
|
|||||||
/// \return ScriptValue string text value in text box if the dialog was accepted, `null` otherwise.
|
/// \return ScriptValue string text value in text box if the dialog was accepted, `null` otherwise.
|
||||||
ScriptValue WindowScriptingInterface::prompt(const QString& message, const QString& defaultText) {
|
ScriptValue WindowScriptingInterface::prompt(const QString& message, const QString& defaultText) {
|
||||||
QString result = OffscreenUi::getText(nullptr, "", message, QLineEdit::Normal, defaultText);
|
QString result = OffscreenUi::getText(nullptr, "", message, QLineEdit::Normal, defaultText);
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
auto sResult = engine()->newValue(result);
|
auto sResult = engine()->newValue(result);
|
||||||
if (sResult.equals(engine()->newValue(""))) {
|
if (sResult.equals(engine()->newValue(""))) {
|
||||||
return engine()->nullValue();
|
return engine()->nullValue();
|
||||||
@ -234,7 +234,7 @@ ScriptValue WindowScriptingInterface::browseDir(const QString& title, const QStr
|
|||||||
if (!result.isEmpty()) {
|
if (!result.isEmpty()) {
|
||||||
setPreviousBrowseLocation(QFileInfo(result).absolutePath());
|
setPreviousBrowseLocation(QFileInfo(result).absolutePath());
|
||||||
}
|
}
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
return result.isEmpty() ? engine()->nullValue() : engine()->newValue(result);
|
return result.isEmpty() ? engine()->nullValue() : engine()->newValue(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,7 +279,7 @@ ScriptValue WindowScriptingInterface::browse(const QString& title, const QString
|
|||||||
if (!result.isEmpty()) {
|
if (!result.isEmpty()) {
|
||||||
setPreviousBrowseLocation(QFileInfo(result).absolutePath());
|
setPreviousBrowseLocation(QFileInfo(result).absolutePath());
|
||||||
}
|
}
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
return result.isEmpty() ? engine()->nullValue() : engine()->newValue(result);
|
return result.isEmpty() ? engine()->nullValue() : engine()->newValue(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ ScriptValue WindowScriptingInterface::save(const QString& title, const QString&
|
|||||||
if (!result.isEmpty()) {
|
if (!result.isEmpty()) {
|
||||||
setPreviousBrowseLocation(QFileInfo(result).absolutePath());
|
setPreviousBrowseLocation(QFileInfo(result).absolutePath());
|
||||||
}
|
}
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
return result.isEmpty() ? engine()->nullValue() : engine()->newValue(result);
|
return result.isEmpty() ? engine()->nullValue() : engine()->newValue(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,7 +378,7 @@ ScriptValue WindowScriptingInterface::browseAssets(const QString& title, const Q
|
|||||||
if (!result.isEmpty()) {
|
if (!result.isEmpty()) {
|
||||||
setPreviousBrowseAssetLocation(QFileInfo(result).absolutePath());
|
setPreviousBrowseAssetLocation(QFileInfo(result).absolutePath());
|
||||||
}
|
}
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
return result.isEmpty() ? engine()->nullValue() : engine()->newValue(result);
|
return result.isEmpty() ? engine()->nullValue() : engine()->newValue(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,18 +27,17 @@ public:
|
|||||||
|
|
||||||
void renderOverlay(RenderArgs* renderArgs);
|
void renderOverlay(RenderArgs* renderArgs);
|
||||||
|
|
||||||
gpu::TexturePointer getOverlayTexture();
|
gpu::TexturePointer getOverlayTexture();
|
||||||
|
|
||||||
|
bool enabled() const { return _enabled; }
|
||||||
|
void setEnabled(bool enabled) { _enabled = enabled; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void renderStatsAndLogs(RenderArgs* renderArgs);
|
|
||||||
void renderDomainConnectionStatusBorder(RenderArgs* renderArgs);
|
void renderDomainConnectionStatusBorder(RenderArgs* renderArgs);
|
||||||
void renderQmlUi(RenderArgs* renderArgs);
|
void renderQmlUi(RenderArgs* renderArgs);
|
||||||
void renderOverlays(RenderArgs* renderArgs);
|
void renderOverlays(RenderArgs* renderArgs);
|
||||||
void buildFramebufferObject();
|
void buildFramebufferObject();
|
||||||
|
|
||||||
float _alpha{ 1.0f };
|
|
||||||
float _trailingAudioLoudness{ 0.0f };
|
|
||||||
|
|
||||||
int _domainStatusBorder;
|
int _domainStatusBorder;
|
||||||
int _magnifierBorder;
|
int _magnifierBorder;
|
||||||
|
|
||||||
@ -47,6 +46,8 @@ private:
|
|||||||
gpu::TexturePointer _overlayColorTexture;
|
gpu::TexturePointer _overlayColorTexture;
|
||||||
gpu::FramebufferPointer _overlayFramebuffer;
|
gpu::FramebufferPointer _overlayFramebuffer;
|
||||||
int _qmlGeometryId { 0 };
|
int _qmlGeometryId { 0 };
|
||||||
|
|
||||||
|
bool _enabled { true };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_ApplicationOverlay_h
|
#endif // hifi_ApplicationOverlay_h
|
||||||
|
@ -118,7 +118,7 @@ std::pair<glm::vec3, glm::quat> calculateKeyboardPositionAndOrientation() {
|
|||||||
EntityPropertyFlags desiredProperties;
|
EntityPropertyFlags desiredProperties;
|
||||||
desiredProperties += PROP_POSITION;
|
desiredProperties += PROP_POSITION;
|
||||||
desiredProperties += PROP_ROTATION;
|
desiredProperties += PROP_ROTATION;
|
||||||
auto properties = DependencyManager::get<EntityScriptingInterface>()->getEntityPropertiesInternal(tabletID, desiredProperties);
|
auto properties = DependencyManager::get<EntityScriptingInterface>()->getEntityPropertiesInternal(tabletID, desiredProperties, false);
|
||||||
|
|
||||||
auto tablet = DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system");
|
auto tablet = DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system");
|
||||||
bool landscapeMode = tablet->getLandscape();
|
bool landscapeMode = tablet->getLandscape();
|
||||||
@ -146,7 +146,7 @@ void Key::saveDimensionsAndLocalPosition() {
|
|||||||
EntityPropertyFlags desiredProperties;
|
EntityPropertyFlags desiredProperties;
|
||||||
desiredProperties += PROP_LOCAL_POSITION;
|
desiredProperties += PROP_LOCAL_POSITION;
|
||||||
desiredProperties += PROP_DIMENSIONS;
|
desiredProperties += PROP_DIMENSIONS;
|
||||||
auto properties = DependencyManager::get<EntityScriptingInterface>()->getEntityPropertiesInternal(_keyID, desiredProperties);
|
auto properties = DependencyManager::get<EntityScriptingInterface>()->getEntityPropertiesInternal(_keyID, desiredProperties, false);
|
||||||
|
|
||||||
_originalLocalPosition = properties.getLocalPosition();
|
_originalLocalPosition = properties.getLocalPosition();
|
||||||
_originalDimensions = properties.getDimensions();
|
_originalDimensions = properties.getDimensions();
|
||||||
@ -469,7 +469,7 @@ void Keyboard::switchToLayer(int layerIndex) {
|
|||||||
EntityPropertyFlags desiredProperties;
|
EntityPropertyFlags desiredProperties;
|
||||||
desiredProperties += PROP_POSITION;
|
desiredProperties += PROP_POSITION;
|
||||||
desiredProperties += PROP_ROTATION;
|
desiredProperties += PROP_ROTATION;
|
||||||
auto oldProperties = entityScriptingInterface->getEntityPropertiesInternal(_anchor.entityID, desiredProperties);
|
auto oldProperties = entityScriptingInterface->getEntityPropertiesInternal(_anchor.entityID, desiredProperties, false);
|
||||||
|
|
||||||
glm::vec3 currentPosition = oldProperties.getPosition();
|
glm::vec3 currentPosition = oldProperties.getPosition();
|
||||||
glm::quat currentOrientation = oldProperties.getRotation();
|
glm::quat currentOrientation = oldProperties.getRotation();
|
||||||
@ -530,7 +530,7 @@ void Keyboard::handleTriggerBegin(const QUuid& id, const PointerEvent& event) {
|
|||||||
|
|
||||||
EntityPropertyFlags desiredProperties;
|
EntityPropertyFlags desiredProperties;
|
||||||
desiredProperties += PROP_POSITION;
|
desiredProperties += PROP_POSITION;
|
||||||
glm::vec3 keyWorldPosition = DependencyManager::get<EntityScriptingInterface>()->getEntityPropertiesInternal(id, desiredProperties).getPosition();
|
glm::vec3 keyWorldPosition = DependencyManager::get<EntityScriptingInterface>()->getEntityPropertiesInternal(id, desiredProperties, false).getPosition();
|
||||||
|
|
||||||
AudioInjectorOptions audioOptions;
|
AudioInjectorOptions audioOptions;
|
||||||
audioOptions.localOnly = true;
|
audioOptions.localOnly = true;
|
||||||
@ -662,7 +662,7 @@ void Keyboard::handleTriggerContinue(const QUuid& id, const PointerEvent& event)
|
|||||||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
EntityPropertyFlags desiredProperties;
|
EntityPropertyFlags desiredProperties;
|
||||||
desiredProperties += PROP_ROTATION;
|
desiredProperties += PROP_ROTATION;
|
||||||
glm::quat orientation = entityScriptingInterface->getEntityPropertiesInternal(id, desiredProperties).getRotation();
|
glm::quat orientation = entityScriptingInterface->getEntityPropertiesInternal(id, desiredProperties, false).getRotation();
|
||||||
glm::vec3 yAxis = orientation * Z_AXIS;
|
glm::vec3 yAxis = orientation * Z_AXIS;
|
||||||
glm::vec3 yOffset = yAxis * Z_OFFSET;
|
glm::vec3 yOffset = yAxis * Z_OFFSET;
|
||||||
glm::vec3 localPosition = key.getCurrentLocalPosition() - yOffset;
|
glm::vec3 localPosition = key.getCurrentLocalPosition() - yOffset;
|
||||||
|
@ -100,7 +100,8 @@ void setupPreferences() {
|
|||||||
QStringList refreshRateProfiles
|
QStringList refreshRateProfiles
|
||||||
{ QString::fromStdString(RefreshRateManager::refreshRateProfileToString(RefreshRateManager::RefreshRateProfile::ECO)),
|
{ QString::fromStdString(RefreshRateManager::refreshRateProfileToString(RefreshRateManager::RefreshRateProfile::ECO)),
|
||||||
QString::fromStdString(RefreshRateManager::refreshRateProfileToString(RefreshRateManager::RefreshRateProfile::INTERACTIVE)),
|
QString::fromStdString(RefreshRateManager::refreshRateProfileToString(RefreshRateManager::RefreshRateProfile::INTERACTIVE)),
|
||||||
QString::fromStdString(RefreshRateManager::refreshRateProfileToString(RefreshRateManager::RefreshRateProfile::REALTIME)) };
|
QString::fromStdString(RefreshRateManager::refreshRateProfileToString(RefreshRateManager::RefreshRateProfile::REALTIME)),
|
||||||
|
QString::fromStdString(RefreshRateManager::refreshRateProfileToString(RefreshRateManager::RefreshRateProfile::CUSTOM)) };
|
||||||
|
|
||||||
preference->setItems(refreshRateProfiles);
|
preference->setItems(refreshRateProfiles);
|
||||||
preferences->addPreference(preference);
|
preferences->addPreference(preference);
|
||||||
|
@ -153,14 +153,6 @@ void Overlays::render(RenderArgs* renderArgs) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Overlays::disable() {
|
|
||||||
_enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Overlays::enable() {
|
|
||||||
_enabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Overlay::Pointer Overlays::take2DOverlay(const QUuid& id) {
|
Overlay::Pointer Overlays::take2DOverlay(const QUuid& id) {
|
||||||
if (_shuttingDown) {
|
if (_shuttingDown) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -378,7 +370,7 @@ QObject* Overlays::getOverlayObject(const QUuid& id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QUuid Overlays::getOverlayAtPoint(const glm::vec2& point) {
|
QUuid Overlays::getOverlayAtPoint(const glm::vec2& point) {
|
||||||
if (_shuttingDown || !_enabled) {
|
if (_shuttingDown) {
|
||||||
return UNKNOWN_ENTITY_ID;
|
return UNKNOWN_ENTITY_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,8 +99,6 @@ public:
|
|||||||
void init();
|
void init();
|
||||||
void update(float deltatime);
|
void update(float deltatime);
|
||||||
void render(RenderArgs* renderArgs);
|
void render(RenderArgs* renderArgs);
|
||||||
void disable();
|
|
||||||
void enable();
|
|
||||||
|
|
||||||
Overlay::Pointer take2DOverlay(const QUuid& id);
|
Overlay::Pointer take2DOverlay(const QUuid& id);
|
||||||
Overlay::Pointer get2DOverlay(const QUuid& id) const;
|
Overlay::Pointer get2DOverlay(const QUuid& id) const;
|
||||||
@ -683,7 +681,6 @@ private:
|
|||||||
|
|
||||||
unsigned int _stackOrder { 1 };
|
unsigned int _stackOrder { 1 };
|
||||||
|
|
||||||
bool _enabled { true };
|
|
||||||
std::atomic<bool> _shuttingDown { false };
|
std::atomic<bool> _shuttingDown { false };
|
||||||
|
|
||||||
PointerEvent calculateOverlayPointerEvent(const QUuid& id, const PickRay& ray, const RayToOverlayIntersectionResult& rayPickResult,
|
PointerEvent calculateOverlayPointerEvent(const QUuid& id, const PickRay& ray, const RayToOverlayIntersectionResult& rayPickResult,
|
||||||
|
@ -281,7 +281,7 @@ if (APPLE)
|
|||||||
|
|
||||||
set(CPACK_NSIS_DISPLAY_NAME ${_DISPLAY_NAME})
|
set(CPACK_NSIS_DISPLAY_NAME ${_DISPLAY_NAME})
|
||||||
|
|
||||||
set(DMG_SUBFOLDER_NAME "Vircadia")
|
set(DMG_SUBFOLDER_NAME "Overte")
|
||||||
set(ESCAPED_DMG_SUBFOLDER_NAME "")
|
set(ESCAPED_DMG_SUBFOLDER_NAME "")
|
||||||
set(DMG_SUBFOLDER_ICON "${CMAKE_SOURCE_DIR}/cmake/installer/install-folder.rsrc")
|
set(DMG_SUBFOLDER_ICON "${CMAKE_SOURCE_DIR}/cmake/installer/install-folder.rsrc")
|
||||||
|
|
||||||
|
@ -27,7 +27,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN 1
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
|
#endif
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <Mmsystem.h>
|
#include <Mmsystem.h>
|
||||||
#include <mmdeviceapi.h>
|
#include <mmdeviceapi.h>
|
||||||
|
@ -2106,6 +2106,14 @@ const QUrl& AvatarData::getSkeletonModelURL() const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString AvatarData::getSkeletonModelURLFromScript() const {
|
||||||
|
if (isMyAvatar() && !isMyAvatarURLProtected()) {
|
||||||
|
return _skeletonModelURL.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QString();
|
||||||
|
};
|
||||||
|
|
||||||
QByteArray AvatarData::packSkeletonData() const {
|
QByteArray AvatarData::packSkeletonData() const {
|
||||||
// Send an avatar trait packet with the skeleton data before the mesh is loaded
|
// Send an avatar trait packet with the skeleton data before the mesh is loaded
|
||||||
int avatarDataSize = 0;
|
int avatarDataSize = 0;
|
||||||
@ -2558,7 +2566,7 @@ QDataStream& operator>>(QDataStream& in, AttachmentData& attachment) {
|
|||||||
void AttachmentDataObject::setModelURL(const QString& modelURL) {
|
void AttachmentDataObject::setModelURL(const QString& modelURL) {
|
||||||
AttachmentData data = scriptvalue_cast<AttachmentData>(thisObject());
|
AttachmentData data = scriptvalue_cast<AttachmentData>(thisObject());
|
||||||
data.modelURL = modelURL;
|
data.modelURL = modelURL;
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
thisObject() = engine()->toScriptValue(data);
|
thisObject() = engine()->toScriptValue(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2569,7 +2577,7 @@ QString AttachmentDataObject::getModelURL() const {
|
|||||||
void AttachmentDataObject::setJointName(const QString& jointName) {
|
void AttachmentDataObject::setJointName(const QString& jointName) {
|
||||||
AttachmentData data = scriptvalue_cast<AttachmentData>(thisObject());
|
AttachmentData data = scriptvalue_cast<AttachmentData>(thisObject());
|
||||||
data.jointName = jointName;
|
data.jointName = jointName;
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
thisObject() = engine()->toScriptValue(data);
|
thisObject() = engine()->toScriptValue(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2580,7 +2588,7 @@ QString AttachmentDataObject::getJointName() const {
|
|||||||
void AttachmentDataObject::setTranslation(const glm::vec3& translation) {
|
void AttachmentDataObject::setTranslation(const glm::vec3& translation) {
|
||||||
AttachmentData data = scriptvalue_cast<AttachmentData>(thisObject());
|
AttachmentData data = scriptvalue_cast<AttachmentData>(thisObject());
|
||||||
data.translation = translation;
|
data.translation = translation;
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
thisObject() = engine()->toScriptValue(data);
|
thisObject() = engine()->toScriptValue(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2591,7 +2599,7 @@ glm::vec3 AttachmentDataObject::getTranslation() const {
|
|||||||
void AttachmentDataObject::setRotation(const glm::quat& rotation) {
|
void AttachmentDataObject::setRotation(const glm::quat& rotation) {
|
||||||
AttachmentData data = scriptvalue_cast<AttachmentData>(thisObject());
|
AttachmentData data = scriptvalue_cast<AttachmentData>(thisObject());
|
||||||
data.rotation = rotation;
|
data.rotation = rotation;
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
thisObject() = engine()->toScriptValue(data);
|
thisObject() = engine()->toScriptValue(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2602,7 +2610,7 @@ glm::quat AttachmentDataObject::getRotation() const {
|
|||||||
void AttachmentDataObject::setScale(float scale) {
|
void AttachmentDataObject::setScale(float scale) {
|
||||||
AttachmentData data = scriptvalue_cast<AttachmentData>(thisObject());
|
AttachmentData data = scriptvalue_cast<AttachmentData>(thisObject());
|
||||||
data.scale = scale;
|
data.scale = scale;
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
thisObject() = engine()->toScriptValue(data);
|
thisObject() = engine()->toScriptValue(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2613,7 +2621,7 @@ float AttachmentDataObject::getScale() const {
|
|||||||
void AttachmentDataObject::setIsSoft(bool isSoft) {
|
void AttachmentDataObject::setIsSoft(bool isSoft) {
|
||||||
AttachmentData data = scriptvalue_cast<AttachmentData>(thisObject());
|
AttachmentData data = scriptvalue_cast<AttachmentData>(thisObject());
|
||||||
data.isSoft = isSoft;
|
data.isSoft = isSoft;
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine());
|
||||||
thisObject() = engine()->toScriptValue(data);
|
thisObject() = engine()->toScriptValue(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,6 +610,8 @@ public:
|
|||||||
AvatarData();
|
AvatarData();
|
||||||
virtual ~AvatarData();
|
virtual ~AvatarData();
|
||||||
|
|
||||||
|
virtual bool isMyAvatarURLProtected() const { return false; } // This needs to be here because both MyAvatar and AvatarData inherit from MyAvatar
|
||||||
|
|
||||||
static const QUrl& defaultFullAvatarModelUrl();
|
static const QUrl& defaultFullAvatarModelUrl();
|
||||||
|
|
||||||
const QUuid getSessionUUID() const { return getID(); }
|
const QUuid getSessionUUID() const { return getID(); }
|
||||||
@ -1355,7 +1357,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
Q_INVOKABLE virtual void detachAll(const QString& modelURL, const QString& jointName = QString());
|
Q_INVOKABLE virtual void detachAll(const QString& modelURL, const QString& jointName = QString());
|
||||||
|
|
||||||
QString getSkeletonModelURLFromScript() const { return _skeletonModelURL.toString(); }
|
QString getSkeletonModelURLFromScript() const;
|
||||||
void setSkeletonModelURLFromScript(const QString& skeletonModelString) { setSkeletonModelURL(QUrl(skeletonModelString)); }
|
void setSkeletonModelURLFromScript(const QString& skeletonModelString) { setSkeletonModelURL(QUrl(skeletonModelString)); }
|
||||||
|
|
||||||
void setOwningAvatarMixer(const QWeakPointer<Node>& owningAvatarMixer) { _owningAvatarMixer = owningAvatarMixer; }
|
void setOwningAvatarMixer(const QWeakPointer<Node>& owningAvatarMixer) { _owningAvatarMixer = owningAvatarMixer; }
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "ScriptAvatarData.h"
|
#include "ScriptAvatarData.h"
|
||||||
|
|
||||||
|
#include <NodeList.h>
|
||||||
#include <ScriptEngineCast.h>
|
#include <ScriptEngineCast.h>
|
||||||
#include <ScriptManager.h>
|
#include <ScriptManager.h>
|
||||||
|
|
||||||
@ -204,7 +205,12 @@ bool ScriptAvatarData::getLookAtSnappingEnabled() const {
|
|||||||
//
|
//
|
||||||
QString ScriptAvatarData::getSkeletonModelURLFromScript() const {
|
QString ScriptAvatarData::getSkeletonModelURLFromScript() const {
|
||||||
if (AvatarSharedPointer sharedAvatarData = _avatarData.lock()) {
|
if (AvatarSharedPointer sharedAvatarData = _avatarData.lock()) {
|
||||||
return sharedAvatarData->getSkeletonModelURLFromScript();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
if (sharedAvatarData->isMyAvatar() && !sharedAvatarData->isMyAvatarURLProtected() && nodeList->getThisNodeCanViewAssetURLs()) {
|
||||||
|
return sharedAvatarData->getSkeletonModelURLFromScript();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QString();
|
||||||
} else {
|
} else {
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,7 @@ MaterialBaker::MaterialBaker(const QString& materialData, bool isURL, const QStr
|
|||||||
_isURL(isURL),
|
_isURL(isURL),
|
||||||
_destinationPath(destinationPath),
|
_destinationPath(destinationPath),
|
||||||
_bakedOutputDir(bakedOutputDir),
|
_bakedOutputDir(bakedOutputDir),
|
||||||
_textureOutputDir(bakedOutputDir + "/materialTextures/" + QString::number(materialNum++)),
|
_textureOutputDir(bakedOutputDir + "/materialTextures/" + QString::number(materialNum++))
|
||||||
_scriptEngine(newScriptEngine())
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,16 +213,20 @@ void MaterialBaker::outputMaterial() {
|
|||||||
if (_materialResource->parsedMaterials.networkMaterials.size() == 1) {
|
if (_materialResource->parsedMaterials.networkMaterials.size() == 1) {
|
||||||
auto networkMaterial = _materialResource->parsedMaterials.networkMaterials.begin();
|
auto networkMaterial = _materialResource->parsedMaterials.networkMaterials.begin();
|
||||||
auto scriptableMaterial = scriptable::ScriptableMaterial(networkMaterial->second);
|
auto scriptableMaterial = scriptable::ScriptableMaterial(networkMaterial->second);
|
||||||
QVariant materialVariant =
|
_helperScriptEngine.run( [&] {
|
||||||
scriptable::scriptableMaterialToScriptValue(_scriptEngine.get(), scriptableMaterial).toVariant();
|
QVariant materialVariant =
|
||||||
json.insert("materials", QJsonDocument::fromVariant(materialVariant).object());
|
scriptable::scriptableMaterialToScriptValue(_helperScriptEngine.get(), scriptableMaterial).toVariant();
|
||||||
|
json.insert("materials", QJsonDocument::fromVariant(materialVariant).object());
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
QJsonArray materialArray;
|
QJsonArray materialArray;
|
||||||
for (auto networkMaterial : _materialResource->parsedMaterials.networkMaterials) {
|
for (auto networkMaterial : _materialResource->parsedMaterials.networkMaterials) {
|
||||||
auto scriptableMaterial = scriptable::ScriptableMaterial(networkMaterial.second);
|
auto scriptableMaterial = scriptable::ScriptableMaterial(networkMaterial.second);
|
||||||
QVariant materialVariant =
|
_helperScriptEngine.run( [&] {
|
||||||
scriptable::scriptableMaterialToScriptValue(_scriptEngine.get(), scriptableMaterial).toVariant();
|
QVariant materialVariant =
|
||||||
materialArray.append(QJsonDocument::fromVariant(materialVariant).object());
|
scriptable::scriptableMaterialToScriptValue(_helperScriptEngine.get(), scriptableMaterial).toVariant();
|
||||||
|
materialArray.append(QJsonDocument::fromVariant(materialVariant).object());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
json.insert("materials", materialArray);
|
json.insert("materials", materialArray);
|
||||||
}
|
}
|
||||||
@ -269,19 +272,32 @@ void MaterialBaker::setMaterials(const QHash<QString, hfm::Material>& materials,
|
|||||||
_materialResource = NetworkMaterialResourcePointer(new NetworkMaterialResource(), [](NetworkMaterialResource* ptr) { ptr->deleteLater(); });
|
_materialResource = NetworkMaterialResourcePointer(new NetworkMaterialResource(), [](NetworkMaterialResource* ptr) { ptr->deleteLater(); });
|
||||||
for (auto& material : materials) {
|
for (auto& material : materials) {
|
||||||
_materialResource->parsedMaterials.names.push_back(material.name.toStdString());
|
_materialResource->parsedMaterials.names.push_back(material.name.toStdString());
|
||||||
_materialResource->parsedMaterials.networkMaterials[material.name.toStdString()] = std::make_shared<NetworkMaterial>(material, baseURL);
|
if (!material.isMToonMaterial) {
|
||||||
|
_materialResource->parsedMaterials.networkMaterials[material.name.toStdString()] = std::make_shared<NetworkMaterial>(material, baseURL);
|
||||||
|
} else {
|
||||||
|
_materialResource->parsedMaterials.networkMaterials[material.name.toStdString()] = std::make_shared<NetworkMToonMaterial>(material, baseURL);
|
||||||
|
}
|
||||||
|
|
||||||
// Store any embedded texture content
|
// Store any embedded texture content
|
||||||
addTexture(material.name, image::TextureUsage::NORMAL_TEXTURE, material.normalTexture);
|
addTexture(material.name, image::TextureUsage::NORMAL_TEXTURE, material.normalTexture);
|
||||||
addTexture(material.name, image::TextureUsage::ALBEDO_TEXTURE, material.albedoTexture);
|
addTexture(material.name, image::TextureUsage::ALBEDO_TEXTURE, material.albedoTexture);
|
||||||
addTexture(material.name, image::TextureUsage::GLOSS_TEXTURE, material.glossTexture);
|
|
||||||
addTexture(material.name, image::TextureUsage::ROUGHNESS_TEXTURE, material.roughnessTexture);
|
|
||||||
addTexture(material.name, image::TextureUsage::SPECULAR_TEXTURE, material.specularTexture);
|
|
||||||
addTexture(material.name, image::TextureUsage::METALLIC_TEXTURE, material.metallicTexture);
|
|
||||||
addTexture(material.name, image::TextureUsage::EMISSIVE_TEXTURE, material.emissiveTexture);
|
addTexture(material.name, image::TextureUsage::EMISSIVE_TEXTURE, material.emissiveTexture);
|
||||||
addTexture(material.name, image::TextureUsage::OCCLUSION_TEXTURE, material.occlusionTexture);
|
|
||||||
addTexture(material.name, image::TextureUsage::SCATTERING_TEXTURE, material.scatteringTexture);
|
if (!material.isMToonMaterial) {
|
||||||
addTexture(material.name, image::TextureUsage::LIGHTMAP_TEXTURE, material.lightmapTexture);
|
addTexture(material.name, image::TextureUsage::GLOSS_TEXTURE, material.glossTexture);
|
||||||
|
addTexture(material.name, image::TextureUsage::ROUGHNESS_TEXTURE, material.roughnessTexture);
|
||||||
|
addTexture(material.name, image::TextureUsage::SPECULAR_TEXTURE, material.specularTexture);
|
||||||
|
addTexture(material.name, image::TextureUsage::METALLIC_TEXTURE, material.metallicTexture);
|
||||||
|
addTexture(material.name, image::TextureUsage::OCCLUSION_TEXTURE, material.occlusionTexture);
|
||||||
|
addTexture(material.name, image::TextureUsage::SCATTERING_TEXTURE, material.scatteringTexture);
|
||||||
|
addTexture(material.name, image::TextureUsage::LIGHTMAP_TEXTURE, material.lightmapTexture);
|
||||||
|
} else {
|
||||||
|
addTexture(material.name, image::TextureUsage::ALBEDO_TEXTURE, material.shadeTexture);
|
||||||
|
addTexture(material.name, image::TextureUsage::ROUGHNESS_TEXTURE, material.shadingShiftTexture);
|
||||||
|
addTexture(material.name, image::TextureUsage::EMISSIVE_TEXTURE, material.matcapTexture);
|
||||||
|
addTexture(material.name, image::TextureUsage::ALBEDO_TEXTURE, material.rimTexture);
|
||||||
|
addTexture(material.name, image::TextureUsage::ROUGHNESS_TEXTURE, material.uvAnimationTexture);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "TextureBaker.h"
|
#include "TextureBaker.h"
|
||||||
#include "baking/TextureFileNamer.h"
|
#include "baking/TextureFileNamer.h"
|
||||||
|
|
||||||
|
#include <HelperScriptEngine.h>
|
||||||
#include <procedural/ProceduralMaterialCache.h>
|
#include <procedural/ProceduralMaterialCache.h>
|
||||||
#include <ScriptEngine.h>
|
#include <ScriptEngine.h>
|
||||||
|
|
||||||
@ -72,7 +73,7 @@ private:
|
|||||||
QString _textureOutputDir;
|
QString _textureOutputDir;
|
||||||
QString _bakedMaterialData;
|
QString _bakedMaterialData;
|
||||||
|
|
||||||
ScriptEnginePointer _scriptEngine;
|
HelperScriptEngine _helperScriptEngine;
|
||||||
static std::function<QThread*()> _getNextOvenWorkerThreadOperator;
|
static std::function<QThread*()> _getNextOvenWorkerThreadOperator;
|
||||||
TextureFileNamer _textureFileNamer;
|
TextureFileNamer _textureFileNamer;
|
||||||
|
|
||||||
|
@ -232,6 +232,14 @@ void EntityTreeRenderer::resetPersistentEntitiesScriptEngine() {
|
|||||||
_persistentEntitiesScriptManager = scriptManagerFactory(ScriptManager::ENTITY_CLIENT_SCRIPT, NO_SCRIPT,
|
_persistentEntitiesScriptManager = scriptManagerFactory(ScriptManager::ENTITY_CLIENT_SCRIPT, NO_SCRIPT,
|
||||||
QString("about:Entities %1").arg(++_entitiesScriptEngineCount));
|
QString("about:Entities %1").arg(++_entitiesScriptEngineCount));
|
||||||
DependencyManager::get<ScriptEngines>()->runScriptInitializers(_persistentEntitiesScriptManager);
|
DependencyManager::get<ScriptEngines>()->runScriptInitializers(_persistentEntitiesScriptManager);
|
||||||
|
|
||||||
|
// Make script engine messages available through ScriptDiscoveryService
|
||||||
|
auto scriptEngines = DependencyManager::get<ScriptEngines>().data();
|
||||||
|
connect(_persistentEntitiesScriptManager.get(), &ScriptManager::infoEntityMessage, scriptEngines, &ScriptEngines::infoEntityMessage);
|
||||||
|
connect(_persistentEntitiesScriptManager.get(), &ScriptManager::printedEntityMessage, scriptEngines, &ScriptEngines::printedEntityMessage);
|
||||||
|
connect(_persistentEntitiesScriptManager.get(), &ScriptManager::errorEntityMessage, scriptEngines, &ScriptEngines::errorEntityMessage);
|
||||||
|
connect(_persistentEntitiesScriptManager.get(), &ScriptManager::warningEntityMessage, scriptEngines, &ScriptEngines::warningEntityMessage);
|
||||||
|
|
||||||
_persistentEntitiesScriptManager->runInThread();
|
_persistentEntitiesScriptManager->runInThread();
|
||||||
std::shared_ptr<EntitiesScriptEngineProvider> entitiesScriptEngineProvider = _persistentEntitiesScriptManager;
|
std::shared_ptr<EntitiesScriptEngineProvider> entitiesScriptEngineProvider = _persistentEntitiesScriptManager;
|
||||||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
@ -255,6 +263,14 @@ void EntityTreeRenderer::resetNonPersistentEntitiesScriptEngine() {
|
|||||||
_nonPersistentEntitiesScriptManager = scriptManagerFactory(ScriptManager::ENTITY_CLIENT_SCRIPT, NO_SCRIPT,
|
_nonPersistentEntitiesScriptManager = scriptManagerFactory(ScriptManager::ENTITY_CLIENT_SCRIPT, NO_SCRIPT,
|
||||||
QString("about:Entities %1").arg(++_entitiesScriptEngineCount));
|
QString("about:Entities %1").arg(++_entitiesScriptEngineCount));
|
||||||
DependencyManager::get<ScriptEngines>()->runScriptInitializers(_nonPersistentEntitiesScriptManager);
|
DependencyManager::get<ScriptEngines>()->runScriptInitializers(_nonPersistentEntitiesScriptManager);
|
||||||
|
|
||||||
|
// Make script engine messages available through ScriptDiscoveryService
|
||||||
|
auto scriptEngines = DependencyManager::get<ScriptEngines>().data();
|
||||||
|
connect(_nonPersistentEntitiesScriptManager.get(), &ScriptManager::infoEntityMessage, scriptEngines, &ScriptEngines::infoEntityMessage);
|
||||||
|
connect(_nonPersistentEntitiesScriptManager.get(), &ScriptManager::printedEntityMessage, scriptEngines, &ScriptEngines::printedEntityMessage);
|
||||||
|
connect(_nonPersistentEntitiesScriptManager.get(), &ScriptManager::errorEntityMessage, scriptEngines, &ScriptEngines::errorEntityMessage);
|
||||||
|
connect(_nonPersistentEntitiesScriptManager.get(), &ScriptManager::warningEntityMessage, scriptEngines, &ScriptEngines::warningEntityMessage);
|
||||||
|
|
||||||
_nonPersistentEntitiesScriptManager->runInThread();
|
_nonPersistentEntitiesScriptManager->runInThread();
|
||||||
std::shared_ptr<EntitiesScriptEngineProvider> entitiesScriptEngineProvider = _nonPersistentEntitiesScriptManager;
|
std::shared_ptr<EntitiesScriptEngineProvider> entitiesScriptEngineProvider = _nonPersistentEntitiesScriptManager;
|
||||||
DependencyManager::get<EntityScriptingInterface>()->setNonPersistentEntitiesScriptEngine(entitiesScriptEngineProvider);
|
DependencyManager::get<EntityScriptingInterface>()->setNonPersistentEntitiesScriptEngine(entitiesScriptEngineProvider);
|
||||||
@ -912,7 +928,7 @@ QUuid EntityTreeRenderer::mousePressEvent(QMouseEvent* event) {
|
|||||||
pos2D, rayPickResult.intersection,
|
pos2D, rayPickResult.intersection,
|
||||||
rayPickResult.surfaceNormal, ray.direction,
|
rayPickResult.surfaceNormal, ray.direction,
|
||||||
toPointerButton(*event), toPointerButtons(*event),
|
toPointerButton(*event), toPointerButtons(*event),
|
||||||
Qt::NoModifier); // TODO -- check for modifier keys?
|
event->modifiers());
|
||||||
|
|
||||||
emit entityScriptingInterface->mousePressOnEntity(rayPickResult.entityID, pointerEvent);
|
emit entityScriptingInterface->mousePressOnEntity(rayPickResult.entityID, pointerEvent);
|
||||||
|
|
||||||
@ -943,9 +959,10 @@ void EntityTreeRenderer::mouseDoublePressEvent(QMouseEvent* event) {
|
|||||||
if (rayPickResult.intersects && (entity = getTree()->findEntityByID(rayPickResult.entityID))) {
|
if (rayPickResult.intersects && (entity = getTree()->findEntityByID(rayPickResult.entityID))) {
|
||||||
glm::vec2 pos2D = projectOntoEntityXYPlane(entity, ray, rayPickResult);
|
glm::vec2 pos2D = projectOntoEntityXYPlane(entity, ray, rayPickResult);
|
||||||
PointerEvent pointerEvent(PointerEvent::Press, PointerManager::MOUSE_POINTER_ID,
|
PointerEvent pointerEvent(PointerEvent::Press, PointerManager::MOUSE_POINTER_ID,
|
||||||
pos2D, rayPickResult.intersection,
|
pos2D, rayPickResult.intersection,
|
||||||
rayPickResult.surfaceNormal, ray.direction,
|
rayPickResult.surfaceNormal, ray.direction,
|
||||||
toPointerButton(*event), toPointerButtons(*event), Qt::NoModifier);
|
toPointerButton(*event), toPointerButtons(*event),
|
||||||
|
event->modifiers());
|
||||||
|
|
||||||
emit entityScriptingInterface->mouseDoublePressOnEntity(rayPickResult.entityID, pointerEvent);
|
emit entityScriptingInterface->mouseDoublePressOnEntity(rayPickResult.entityID, pointerEvent);
|
||||||
|
|
||||||
@ -979,7 +996,7 @@ void EntityTreeRenderer::mouseReleaseEvent(QMouseEvent* event) {
|
|||||||
pos2D, rayPickResult.intersection,
|
pos2D, rayPickResult.intersection,
|
||||||
rayPickResult.surfaceNormal, ray.direction,
|
rayPickResult.surfaceNormal, ray.direction,
|
||||||
toPointerButton(*event), toPointerButtons(*event),
|
toPointerButton(*event), toPointerButtons(*event),
|
||||||
Qt::NoModifier); // TODO -- check for modifier keys?
|
event->modifiers());
|
||||||
|
|
||||||
emit entityScriptingInterface->mouseReleaseOnEntity(rayPickResult.entityID, pointerEvent);
|
emit entityScriptingInterface->mouseReleaseOnEntity(rayPickResult.entityID, pointerEvent);
|
||||||
|
|
||||||
@ -995,7 +1012,7 @@ void EntityTreeRenderer::mouseReleaseEvent(QMouseEvent* event) {
|
|||||||
pos2D, rayPickResult.intersection,
|
pos2D, rayPickResult.intersection,
|
||||||
rayPickResult.surfaceNormal, ray.direction,
|
rayPickResult.surfaceNormal, ray.direction,
|
||||||
toPointerButton(*event), toPointerButtons(*event),
|
toPointerButton(*event), toPointerButtons(*event),
|
||||||
Qt::NoModifier); // TODO -- check for modifier keys?
|
event->modifiers());
|
||||||
|
|
||||||
emit entityScriptingInterface->clickReleaseOnEntity(_currentClickingOnEntityID, pointerEvent);
|
emit entityScriptingInterface->clickReleaseOnEntity(_currentClickingOnEntityID, pointerEvent);
|
||||||
}
|
}
|
||||||
@ -1022,7 +1039,7 @@ void EntityTreeRenderer::mouseMoveEvent(QMouseEvent* event) {
|
|||||||
pos2D, rayPickResult.intersection,
|
pos2D, rayPickResult.intersection,
|
||||||
rayPickResult.surfaceNormal, ray.direction,
|
rayPickResult.surfaceNormal, ray.direction,
|
||||||
toPointerButton(*event), toPointerButtons(*event),
|
toPointerButton(*event), toPointerButtons(*event),
|
||||||
Qt::NoModifier); // TODO -- check for modifier keys?
|
event->modifiers());
|
||||||
|
|
||||||
emit entityScriptingInterface->mouseMoveOnEntity(rayPickResult.entityID, pointerEvent);
|
emit entityScriptingInterface->mouseMoveOnEntity(rayPickResult.entityID, pointerEvent);
|
||||||
|
|
||||||
@ -1036,7 +1053,7 @@ void EntityTreeRenderer::mouseMoveEvent(QMouseEvent* event) {
|
|||||||
pos2D, rayPickResult.intersection,
|
pos2D, rayPickResult.intersection,
|
||||||
rayPickResult.surfaceNormal, ray.direction,
|
rayPickResult.surfaceNormal, ray.direction,
|
||||||
toPointerButton(*event), toPointerButtons(*event),
|
toPointerButton(*event), toPointerButtons(*event),
|
||||||
Qt::NoModifier); // TODO -- check for modifier keys?
|
event->modifiers());
|
||||||
|
|
||||||
emit entityScriptingInterface->hoverLeaveEntity(_currentHoverOverEntityID, pointerEvent);
|
emit entityScriptingInterface->hoverLeaveEntity(_currentHoverOverEntityID, pointerEvent);
|
||||||
}
|
}
|
||||||
@ -1064,10 +1081,10 @@ void EntityTreeRenderer::mouseMoveEvent(QMouseEvent* event) {
|
|||||||
if (!_currentHoverOverEntityID.isInvalidID()) {
|
if (!_currentHoverOverEntityID.isInvalidID()) {
|
||||||
glm::vec2 pos2D = projectOntoEntityXYPlane(entity, ray, rayPickResult);
|
glm::vec2 pos2D = projectOntoEntityXYPlane(entity, ray, rayPickResult);
|
||||||
PointerEvent pointerEvent(PointerEvent::Move, PointerManager::MOUSE_POINTER_ID,
|
PointerEvent pointerEvent(PointerEvent::Move, PointerManager::MOUSE_POINTER_ID,
|
||||||
pos2D, rayPickResult.intersection,
|
pos2D, rayPickResult.intersection,
|
||||||
rayPickResult.surfaceNormal, ray.direction,
|
rayPickResult.surfaceNormal, ray.direction,
|
||||||
toPointerButton(*event), toPointerButtons(*event),
|
toPointerButton(*event), toPointerButtons(*event),
|
||||||
Qt::NoModifier); // TODO -- check for modifier keys?
|
event->modifiers());
|
||||||
|
|
||||||
emit entityScriptingInterface->hoverLeaveEntity(_currentHoverOverEntityID, pointerEvent);
|
emit entityScriptingInterface->hoverLeaveEntity(_currentHoverOverEntityID, pointerEvent);
|
||||||
_currentHoverOverEntityID = UNKNOWN_ENTITY_ID; // makes it the unknown ID
|
_currentHoverOverEntityID = UNKNOWN_ENTITY_ID; // makes it the unknown ID
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 12/6/13.
|
// Created by Brad Hefta-Gaub on 12/6/13.
|
||||||
// Copyright 2013 High Fidelity, Inc.
|
// Copyright 2013 High Fidelity, Inc.
|
||||||
|
// Copyright 2024 Overte e.V.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
@ -202,6 +203,8 @@ ItemKey EntityRenderer::getKey() {
|
|||||||
builder.withInvisible();
|
builder.withInvisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateItemKeyBuilderFromMaterials(builder);
|
||||||
|
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,6 +331,20 @@ ItemID EntityRenderer::computeMirrorViewOperator(ViewFrustum& viewFrustum, const
|
|||||||
return foundPortalExit ? DependencyManager::get<EntityTreeRenderer>()->renderableIdForEntityId(portalExitID) : Item::INVALID_ITEM_ID;
|
return foundPortalExit ? DependencyManager::get<EntityTreeRenderer>()->renderableIdForEntityId(portalExitID) : Item::INVALID_ITEM_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HighlightStyle EntityRenderer::getOutlineStyle(const ViewFrustum& viewFrustum, const size_t height) const {
|
||||||
|
std::lock_guard<std::mutex> lock(_materialsLock);
|
||||||
|
auto materials = _materials.find("0");
|
||||||
|
if (materials != _materials.end()) {
|
||||||
|
glm::vec3 position;
|
||||||
|
withReadLock([&] {
|
||||||
|
position = _renderTransform.getTranslation();
|
||||||
|
});
|
||||||
|
return HighlightStyle::calculateOutlineStyle(materials->second.getOutlineWidthMode(), materials->second.getOutlineWidth(),
|
||||||
|
materials->second.getOutline(), position, viewFrustum, height);
|
||||||
|
}
|
||||||
|
return HighlightStyle();
|
||||||
|
}
|
||||||
|
|
||||||
void EntityRenderer::render(RenderArgs* args) {
|
void EntityRenderer::render(RenderArgs* args) {
|
||||||
if (!isValidRenderItem()) {
|
if (!isValidRenderItem()) {
|
||||||
return;
|
return;
|
||||||
@ -627,7 +644,7 @@ EntityRenderer::Pipeline EntityRenderer::getPipelineType(const graphics::MultiMa
|
|||||||
}
|
}
|
||||||
|
|
||||||
graphics::MaterialKey drawMaterialKey = materials.getMaterialKey();
|
graphics::MaterialKey drawMaterialKey = materials.getMaterialKey();
|
||||||
if (drawMaterialKey.isEmissive() || drawMaterialKey.isMetallic() || drawMaterialKey.isScattering()) {
|
if (materials.isMToon() || drawMaterialKey.isEmissive() || drawMaterialKey.isMetallic() || drawMaterialKey.isScattering()) {
|
||||||
return Pipeline::MATERIAL;
|
return Pipeline::MATERIAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -747,6 +764,26 @@ Item::Bound EntityRenderer::getMaterialBound(RenderArgs* args) {
|
|||||||
return EntityRenderer::getBound(args);
|
return EntityRenderer::getBound(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EntityRenderer::updateItemKeyBuilderFromMaterials(ItemKey::Builder& builder) {
|
||||||
|
MaterialMap::iterator materials;
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(_materialsLock);
|
||||||
|
materials = _materials.find("0");
|
||||||
|
|
||||||
|
if (materials != _materials.end()) {
|
||||||
|
if (materials->second.shouldUpdate()) {
|
||||||
|
RenderPipelines::updateMultiMaterial(materials->second);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (materials->second.hasOutline()) {
|
||||||
|
builder.withOutline();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EntityRenderer::updateShapeKeyBuilderFromMaterials(ShapeKey::Builder& builder) {
|
void EntityRenderer::updateShapeKeyBuilderFromMaterials(ShapeKey::Builder& builder) {
|
||||||
MaterialMap::iterator materials;
|
MaterialMap::iterator materials;
|
||||||
{
|
{
|
||||||
@ -773,7 +810,7 @@ void EntityRenderer::updateShapeKeyBuilderFromMaterials(ShapeKey::Builder& build
|
|||||||
builder.withCullFaceMode(materials->second.getCullFaceMode());
|
builder.withCullFaceMode(materials->second.getCullFaceMode());
|
||||||
|
|
||||||
graphics::MaterialKey drawMaterialKey = materials->second.getMaterialKey();
|
graphics::MaterialKey drawMaterialKey = materials->second.getMaterialKey();
|
||||||
if (drawMaterialKey.isUnlit()) {
|
if (!materials->second.isMToon() && drawMaterialKey.isUnlit()) {
|
||||||
builder.withUnlit();
|
builder.withUnlit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -783,8 +820,12 @@ void EntityRenderer::updateShapeKeyBuilderFromMaterials(ShapeKey::Builder& build
|
|||||||
if (drawMaterialKey.isNormalMap()) {
|
if (drawMaterialKey.isNormalMap()) {
|
||||||
builder.withTangents();
|
builder.withTangents();
|
||||||
}
|
}
|
||||||
if (drawMaterialKey.isLightMap()) {
|
if (!materials->second.isMToon()) {
|
||||||
builder.withLightMap();
|
if (drawMaterialKey.isLightMap()) {
|
||||||
|
builder.withLightMap();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
builder.withMToon();
|
||||||
}
|
}
|
||||||
} else if (pipelineType == Pipeline::PROCEDURAL) {
|
} else if (pipelineType == Pipeline::PROCEDURAL) {
|
||||||
builder.withOwnPipeline();
|
builder.withOwnPipeline();
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 12/6/13.
|
// Created by Brad Hefta-Gaub on 12/6/13.
|
||||||
// Copyright 2013 High Fidelity, Inc.
|
// Copyright 2013 High Fidelity, Inc.
|
||||||
|
// Copyright 2024 Overte e.V.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
@ -13,6 +14,8 @@
|
|||||||
#define hifi_RenderableEntityItem_h
|
#define hifi_RenderableEntityItem_h
|
||||||
|
|
||||||
#include <render/Scene.h>
|
#include <render/Scene.h>
|
||||||
|
#include <render/HighlightStyle.h>
|
||||||
|
|
||||||
#include <EntityItem.h>
|
#include <EntityItem.h>
|
||||||
#include <Sound.h>
|
#include <Sound.h>
|
||||||
#include "AbstractViewStateInterface.h"
|
#include "AbstractViewStateInterface.h"
|
||||||
@ -79,6 +82,7 @@ public:
|
|||||||
static ItemID computeMirrorViewOperator(ViewFrustum& viewFrustum, const glm::vec3& inPropertiesPosition, const glm::quat& inPropertiesRotation,
|
static ItemID computeMirrorViewOperator(ViewFrustum& viewFrustum, const glm::vec3& inPropertiesPosition, const glm::quat& inPropertiesRotation,
|
||||||
MirrorMode mirrorMode, const QUuid& portalExitID);
|
MirrorMode mirrorMode, const QUuid& portalExitID);
|
||||||
virtual void renderSimulate(RenderArgs* args) override {}
|
virtual void renderSimulate(RenderArgs* args) override {}
|
||||||
|
virtual HighlightStyle getOutlineStyle(const ViewFrustum& viewFrustum, const size_t height) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool needsRenderUpdateFromEntity() const final { return needsRenderUpdateFromEntity(_entity); }
|
virtual bool needsRenderUpdateFromEntity() const final { return needsRenderUpdateFromEntity(_entity); }
|
||||||
@ -138,6 +142,7 @@ protected:
|
|||||||
void updateMaterials(bool baseMaterialChanged = false);
|
void updateMaterials(bool baseMaterialChanged = false);
|
||||||
bool materialsTransparent() const;
|
bool materialsTransparent() const;
|
||||||
Item::Bound getMaterialBound(RenderArgs* args);
|
Item::Bound getMaterialBound(RenderArgs* args);
|
||||||
|
void updateItemKeyBuilderFromMaterials(ItemKey::Builder& builder);
|
||||||
void updateShapeKeyBuilderFromMaterials(ShapeKey::Builder& builder);
|
void updateShapeKeyBuilderFromMaterials(ShapeKey::Builder& builder);
|
||||||
|
|
||||||
Item::Bound _bound;
|
Item::Bound _bound;
|
||||||
|
@ -130,8 +130,7 @@ void ImageEntityRenderer::doRender(RenderArgs* args) {
|
|||||||
materials = _materials["0"];
|
materials = _materials["0"];
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& schema = materials.getSchemaBuffer().get<graphics::MultiMaterial::Schema>();
|
glm::vec4 color = materials.getColor();
|
||||||
glm::vec4 color = glm::vec4(ColorUtils::tosRGBVec3(schema._albedo), schema._opacity);
|
|
||||||
color = EntityRenderer::calculatePulseColor(color, _pulseProperties, _created);
|
color = EntityRenderer::calculatePulseColor(color, _pulseProperties, _created);
|
||||||
|
|
||||||
if (!_texture || !_texture->isLoaded() || color.a == 0.0f) {
|
if (!_texture || !_texture->isLoaded() || color.a == 0.0f) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Sam Gondelman on 1/18/2018
|
// Created by Sam Gondelman on 1/18/2018
|
||||||
// Copyright 2018 High Fidelity, Inc.
|
// Copyright 2018 High Fidelity, Inc.
|
||||||
|
// Copyright 2024 Overte e.V.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
@ -219,7 +220,7 @@ void MaterialEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPo
|
|||||||
ItemKey MaterialEntityRenderer::getKey() {
|
ItemKey MaterialEntityRenderer::getKey() {
|
||||||
auto builder = ItemKey::Builder().withTypeShape().withTagBits(getTagMask()).withLayer(getHifiRenderLayer());
|
auto builder = ItemKey::Builder().withTypeShape().withTagBits(getTagMask()).withLayer(getHifiRenderLayer());
|
||||||
|
|
||||||
if (!_visible) {
|
if (!_visible || !_parentID.isNull()) {
|
||||||
builder.withInvisible();
|
builder.withInvisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,6 +230,10 @@ ItemKey MaterialEntityRenderer::getKey() {
|
|||||||
if (matKey.isTranslucent()) {
|
if (matKey.isTranslucent()) {
|
||||||
builder.withTransparent();
|
builder.withTransparent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (drawMaterial->getOutlineWidthMode() != NetworkMToonMaterial::OutlineWidthMode::OUTLINE_NONE && drawMaterial->getOutlineWidth() > 0.0f) {
|
||||||
|
builder.withOutline();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return builder.build();
|
return builder.build();
|
||||||
@ -258,11 +263,16 @@ ShapeKey MaterialEntityRenderer::getShapeKey() {
|
|||||||
if (drawMaterialKey.isNormalMap()) {
|
if (drawMaterialKey.isNormalMap()) {
|
||||||
builder.withTangents();
|
builder.withTangents();
|
||||||
}
|
}
|
||||||
if (drawMaterialKey.isLightMap()) {
|
|
||||||
builder.withLightMap();
|
if (drawMaterial && drawMaterial->isMToon()) {
|
||||||
}
|
builder.withMToon();
|
||||||
if (drawMaterialKey.isUnlit()) {
|
} else {
|
||||||
builder.withUnlit();
|
if (drawMaterialKey.isLightMap()) {
|
||||||
|
builder.withLightMap();
|
||||||
|
}
|
||||||
|
if (drawMaterialKey.isUnlit()) {
|
||||||
|
builder.withUnlit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,6 +283,18 @@ ShapeKey MaterialEntityRenderer::getShapeKey() {
|
|||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HighlightStyle MaterialEntityRenderer::getOutlineStyle(const ViewFrustum& viewFrustum, const size_t height) const {
|
||||||
|
if (const auto drawMaterial = getMaterial()) {
|
||||||
|
glm::vec3 position;
|
||||||
|
withReadLock([&] {
|
||||||
|
position = _renderTransform.getTranslation();
|
||||||
|
});
|
||||||
|
return HighlightStyle::calculateOutlineStyle(drawMaterial->getOutlineWidthMode(), drawMaterial->getOutlineWidth(),
|
||||||
|
drawMaterial->getOutline(), position, viewFrustum, height);
|
||||||
|
}
|
||||||
|
return HighlightStyle();
|
||||||
|
}
|
||||||
|
|
||||||
void MaterialEntityRenderer::doRender(RenderArgs* args) {
|
void MaterialEntityRenderer::doRender(RenderArgs* args) {
|
||||||
PerformanceTimer perfTimer("RenderableMaterialEntityItem::render");
|
PerformanceTimer perfTimer("RenderableMaterialEntityItem::render");
|
||||||
Q_ASSERT(args->_batch);
|
Q_ASSERT(args->_batch);
|
||||||
@ -316,21 +338,26 @@ void MaterialEntityRenderer::doRender(RenderArgs* args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Draw!
|
// Draw!
|
||||||
DependencyManager::get<GeometryCache>()->renderSphere(batch);
|
const uint32_t compactColor = 0xFFFFFFFF;
|
||||||
|
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||||
|
DependencyManager::get<GeometryCache>()->renderShape(batch, GeometryCache::Shape::Sphere, _colorBuffer);
|
||||||
} else {
|
} else {
|
||||||
auto proceduralDrawMaterial = std::static_pointer_cast<graphics::ProceduralMaterial>(drawMaterial);
|
auto proceduralDrawMaterial = std::static_pointer_cast<graphics::ProceduralMaterial>(drawMaterial);
|
||||||
glm::vec4 outColor = glm::vec4(drawMaterial->getAlbedo(), drawMaterial->getOpacity());
|
glm::vec4 outColor = glm::vec4(drawMaterial->getAlbedo(), drawMaterial->getOpacity());
|
||||||
outColor = proceduralDrawMaterial->getColor(outColor);
|
outColor = proceduralDrawMaterial->getColor(outColor);
|
||||||
proceduralDrawMaterial->prepare(batch, transform.getTranslation(), transform.getScale(),
|
proceduralDrawMaterial->prepare(batch, transform.getTranslation(), transform.getScale(),
|
||||||
transform.getRotation(), _created, ProceduralProgramKey(outColor.a < 1.0f));
|
transform.getRotation(), _created, ProceduralProgramKey(outColor.a < 1.0f));
|
||||||
|
|
||||||
|
const uint32_t compactColor = GeometryCache::toCompactColor(glm::vec4(outColor));
|
||||||
|
_colorBuffer->setData(sizeof(compactColor), (const gpu::Byte*) &compactColor);
|
||||||
if (render::ShapeKey(args->_globalShapeKey).isWireframe() || _primitiveMode == PrimitiveMode::LINES) {
|
if (render::ShapeKey(args->_globalShapeKey).isWireframe() || _primitiveMode == PrimitiveMode::LINES) {
|
||||||
DependencyManager::get<GeometryCache>()->renderWireSphere(batch, outColor);
|
DependencyManager::get<GeometryCache>()->renderWireShape(batch, GeometryCache::Shape::Sphere, _colorBuffer);
|
||||||
} else {
|
} else {
|
||||||
DependencyManager::get<GeometryCache>()->renderSphere(batch, outColor);
|
DependencyManager::get<GeometryCache>()->renderShape(batch, GeometryCache::Shape::Sphere, _colorBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
args->_details._trianglesRendered += (int)DependencyManager::get<GeometryCache>()->getSphereTriangleCount();
|
args->_details._trianglesRendered += (int)DependencyManager::get<GeometryCache>()->getShapeTriangleCount(GeometryCache::Shape::Sphere);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaterialEntityRenderer::setCurrentMaterialName(const std::string& currentMaterialName) {
|
void MaterialEntityRenderer::setCurrentMaterialName(const std::string& currentMaterialName) {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user