mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into bugz516
This commit is contained in:
commit
9fb43b4930
50 changed files with 464 additions and 295 deletions
29
BUILD_WIN.md
29
BUILD_WIN.md
|
@ -34,7 +34,18 @@ If you do not wish to use the Python installation bundled with Visual Studio, yo
|
|||
Download and install the latest version of CMake 3.9.
|
||||
|
||||
Download the file named win64-x64 Installer from the [CMake Website](https://cmake.org/download/). You can access the installer on this [3.9 Version page](https://cmake.org/files/v3.9/). During installation, make sure to check "Add CMake to system PATH for all users" when prompted.
|
||||
### Step 5. Running CMake to Generate Build Files
|
||||
|
||||
### Step 3. Create VCPKG environment variable
|
||||
In the next step, you will use CMake to build High Fidelity. By default, the CMake process builds dependency files in Windows' `%TEMP%` directory, which is periodically cleared by the operating system. To prevent you from having to re-build the dependencies in the event that Windows clears that directory, we recommend that you create a `HIFI_VCPKG_BASE` environment variable linked to a directory somewhere on your machine. That directory will contain all dependency files until you manually remove them.
|
||||
|
||||
To create this variable:
|
||||
* Naviagte to 'Edit the System Environment Variables' Through the start menu.
|
||||
* Click on 'Environment Variables'
|
||||
* Select 'New'
|
||||
* Set "Variable name" to HIFI_VCPKG_BASE
|
||||
* Set "Variable value" to any directory that you have control over.
|
||||
|
||||
### Step 4. Running CMake to Generate Build Files
|
||||
|
||||
Run Command Prompt from Start and run the following commands:
|
||||
`cd "%HIFI_DIR%"`
|
||||
|
@ -49,24 +60,28 @@ Run `cmake .. -G "Visual Studio 16 2019" -A x64`.
|
|||
|
||||
Where `%HIFI_DIR%` is the directory for the highfidelity repository.
|
||||
|
||||
### Step 6. Making a Build
|
||||
### Step 5. Making a Build
|
||||
|
||||
Open `%HIFI_DIR%\build\hifi.sln` using Visual Studio.
|
||||
|
||||
Change the Solution Configuration (menu ribbon under the menu bar, next to the green play button) from "Debug" to "Release" for best performance.
|
||||
|
||||
Create another environment variable (see Step #4)
|
||||
Create another environment variable (see Step #3)
|
||||
* Set "Variable name": `PreferredToolArchitecture`
|
||||
* Set "Variable value": `x64`
|
||||
|
||||
Restart Visual Studio for the new variable to take effect.
|
||||
|
||||
Run from the menu bar `Build > Build Solution`.
|
||||
|
||||
### Step 7. Testing Interface
|
||||
### Step 6. Testing Interface
|
||||
|
||||
Create another environment variable (see Step #4)
|
||||
Create another environment variable (see Step #3)
|
||||
* Set "Variable name": `_NO_DEBUG_HEAP`
|
||||
* Set "Variable value": `1`
|
||||
|
||||
Restart Visual Studio again.
|
||||
|
||||
In Visual Studio, right+click "interface" under the Apps folder in Solution Explorer and select "Set as Startup Project". Run from the menu bar `Debug > Start Debugging`.
|
||||
|
||||
Now, you should have a full build of High Fidelity and be able to run the Interface using Visual Studio. Please check our [Docs](https://wiki.highfidelity.com/wiki/Main_Page) for more information regarding the programming workflow.
|
||||
|
@ -75,11 +90,11 @@ Note: You can also run Interface by launching it from command line or File Explo
|
|||
|
||||
## Troubleshooting
|
||||
|
||||
For any problems after Step #7, first try this:
|
||||
For any problems after Step #6, first try this:
|
||||
* Delete your locally cloned copy of the highfidelity repository
|
||||
* Restart your computer
|
||||
* Redownload the [repository](https://github.com/highfidelity/hifi)
|
||||
* Restart directions from Step #7
|
||||
* Restart directions from Step #6
|
||||
|
||||
#### CMake gives you the same error message repeatedly after the build fails
|
||||
|
||||
|
|
|
@ -365,7 +365,7 @@ void AvatarMixer::manageIdentityData(const SharedNodePointer& node) {
|
|||
|
||||
// there is no need to manage identity data we haven't received yet
|
||||
// so bail early if we've never received an identity packet for this avatar
|
||||
if (!nodeData || !nodeData->getAvatar().hasProcessedFirstIdentity()) {
|
||||
if (!nodeData || !nodeData->getAvatar().hasProcessedFirstIdentity() || !node->getActiveSocket()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
76
debian/patches/hifi_use_system_qt.diff
vendored
76
debian/patches/hifi_use_system_qt.diff
vendored
|
@ -1,43 +1,41 @@
|
|||
Index: hifi-interface-84/cmake/macros/SetupQt.cmake
|
||||
Index: hifi/cmake/macros/SetupQt.cmake
|
||||
===================================================================
|
||||
--- hifi-interface-84.orig/cmake/macros/SetupQt.cmake
|
||||
+++ hifi-interface-84/cmake/macros/SetupQt.cmake
|
||||
@@ -18,19 +18,19 @@ function(calculate_default_qt_dir _QT_VE
|
||||
elseif(WIN32)
|
||||
set(QT_DEFAULT_ARCH "msvc2017_64")
|
||||
else()
|
||||
- set(QT_DEFAULT_ARCH "gcc_64")
|
||||
+ set(QT_DEFAULT_ARCH "x86_64-linux-gnu")
|
||||
endif()
|
||||
--- hifi.orig/cmake/macros/SetupQt.cmake
|
||||
+++ hifi/cmake/macros/SetupQt.cmake
|
||||
@@ -27,7 +27,7 @@ function(calculate_qt5_version result _Q
|
||||
set(_QT_CORE_DIR "${_QT_DIR}/include/QtCore")
|
||||
endif()
|
||||
if(NOT EXISTS "${_QT_CORE_DIR}")
|
||||
- message(FATAL_ERROR "Could not find 'include/QtCore' in '${_QT_DIR}'")
|
||||
+ message("Could not find 'include/QtCore' in '${_QT_DIR}'")
|
||||
endif()
|
||||
set(subdirs "")
|
||||
get_sub_directories(subdirs ${_QT_CORE_DIR})
|
||||
@@ -71,13 +71,13 @@ macro(setup_qt)
|
||||
|
||||
if (WIN32 OR (ANDROID AND ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")))
|
||||
set(QT_DEFAULT_ROOT "c:/Qt")
|
||||
else()
|
||||
- set(QT_DEFAULT_ROOT "$ENV{HOME}/Qt")
|
||||
+ set(QT_DEFAULT_ROOT "/usr/lib")
|
||||
endif()
|
||||
message("QT_CMAKE_PREFIX_PATH = " ${QT_CMAKE_PREFIX_PATH})
|
||||
|
||||
set_from_env(QT_ROOT QT_ROOT ${QT_DEFAULT_ROOT})
|
||||
set_from_env(QT_ARCH QT_ARCH ${QT_DEFAULT_ARCH})
|
||||
- # figure out where the qt dir is
|
||||
- get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE)
|
||||
- set(QT_VERSION "unknown")
|
||||
- calculate_qt5_version(QT_VERSION "${QT_DIR}")
|
||||
- if (QT_VERSION STREQUAL "unknown")
|
||||
- message(FATAL_ERROR "Could not determine QT_VERSION")
|
||||
- endif()
|
||||
+ # # figure out where the qt dir is
|
||||
+ # get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE)
|
||||
+ # set(QT_VERSION "unknown")
|
||||
+ # calculate_qt5_version(QT_VERSION "${QT_DIR}")
|
||||
+ # if (QT_VERSION STREQUAL "unknown")
|
||||
+ # message(FATAL_ERROR "Could not determine QT_VERSION")
|
||||
+ # endif()
|
||||
|
||||
- set(${_RESULT_NAME} "${QT_ROOT}/${_QT_VERSION}/${QT_ARCH}" PARENT_SCOPE)
|
||||
+ set(${_RESULT_NAME} "${QT_ROOT}/${QT_ARCH}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Sets the QT_CMAKE_PREFIX_PATH and QT_DIR variables
|
||||
@@ -44,7 +44,7 @@ macro(setup_qt)
|
||||
endif()
|
||||
if (("QT_CMAKE_PREFIX_PATH" STREQUAL "") OR (NOT EXISTS "${QT_CMAKE_PREFIX_PATH}"))
|
||||
calculate_default_qt_dir(${QT_VERSION} QT_DIR)
|
||||
- set(QT_CMAKE_PREFIX_PATH "${QT_DIR}/lib/cmake")
|
||||
+ set(QT_CMAKE_PREFIX_PATH "${QT_DIR}/cmake")
|
||||
else()
|
||||
# figure out where the qt dir is
|
||||
get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE)
|
||||
Index: hifi-interface-84/interface/CMakeLists.txt
|
||||
if(WIN32)
|
||||
# windows shell does not like backslashes expanded on the command line,
|
||||
Index: hifi/interface/CMakeLists.txt
|
||||
===================================================================
|
||||
--- hifi-interface-84.orig/interface/CMakeLists.txt
|
||||
+++ hifi-interface-84/interface/CMakeLists.txt
|
||||
--- hifi.orig/interface/CMakeLists.txt
|
||||
+++ hifi/interface/CMakeLists.txt
|
||||
@@ -35,7 +35,7 @@ else ()
|
||||
add_custom_command(
|
||||
OUTPUT ${RESOURCES_RCC}
|
||||
|
@ -60,11 +58,11 @@ Index: hifi-interface-84/interface/CMakeLists.txt
|
|||
+
|
||||
endif()
|
||||
|
||||
if (SCRIPTS_INSTALL_DIR)
|
||||
Index: hifi-interface-84/tools/nitpick/CMakeLists.txt
|
||||
if (DEV_BUILD AND (APPLE OR UNIX))
|
||||
Index: hifi/tools/nitpick/CMakeLists.txt
|
||||
===================================================================
|
||||
--- hifi-interface-84.orig/tools/nitpick/CMakeLists.txt
|
||||
+++ hifi-interface-84/tools/nitpick/CMakeLists.txt
|
||||
--- hifi.orig/tools/nitpick/CMakeLists.txt
|
||||
+++ hifi/tools/nitpick/CMakeLists.txt
|
||||
@@ -12,7 +12,7 @@ generate_qrc(OUTPUT ${RESOURCES_QRC} PAT
|
||||
add_custom_command(
|
||||
OUTPUT ${RESOURCES_RCC}
|
||||
|
|
|
@ -1311,12 +1311,12 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
accountManager->setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL());
|
||||
|
||||
// use our MyAvatar position and quat for address manager path
|
||||
addressManager->setPositionGetter([this] {
|
||||
addressManager->setPositionGetter([] {
|
||||
auto avatarManager = DependencyManager::get<AvatarManager>();
|
||||
auto myAvatar = avatarManager ? avatarManager->getMyAvatar() : nullptr;
|
||||
return myAvatar ? myAvatar->getWorldFeetPosition() : Vectors::ZERO;
|
||||
});
|
||||
addressManager->setOrientationGetter([this] {
|
||||
addressManager->setOrientationGetter([] {
|
||||
auto avatarManager = DependencyManager::get<AvatarManager>();
|
||||
auto myAvatar = avatarManager ? avatarManager->getMyAvatar() : nullptr;
|
||||
return myAvatar ? myAvatar->getWorldOrientation() : glm::quat();
|
||||
|
@ -5375,25 +5375,13 @@ void Application::loadSettings() {
|
|||
}
|
||||
}
|
||||
|
||||
if (_firstRun.get()) {
|
||||
// If this is our first run, evalute the Platform Tier and assign the matching Performance profile by default.
|
||||
// A bunch of Performance, Simulation and Render settings will be set to a matching default value from this
|
||||
// Load settings of the RenderScritpingInterface
|
||||
// Do that explicitely before being used
|
||||
RenderScriptingInterface::getInstance()->loadSettings();
|
||||
|
||||
// Here is the mapping between pelatformTIer and performance profile
|
||||
const std::array<PerformanceManager::PerformancePreset, platform::Profiler::NumTiers> platformToPerformancePresetMap = {{
|
||||
PerformanceManager::PerformancePreset::MID, // platform::Profiler::UNKNOWN
|
||||
PerformanceManager::PerformancePreset::LOW, // platform::Profiler::LOW
|
||||
PerformanceManager::PerformancePreset::MID, // platform::Profiler::MID
|
||||
PerformanceManager::PerformancePreset::HIGH // platform::Profiler::HIGH
|
||||
}};
|
||||
|
||||
// What is our profile?
|
||||
auto platformTier = platform::Profiler::profilePlatform();
|
||||
|
||||
// Then let's assign the performance preset setting from it
|
||||
getPerformanceManager().setPerformancePreset(platformToPerformancePresetMap[platformTier]);
|
||||
|
||||
}
|
||||
// Setup the PerformanceManager which will enforce the several settings to match the Preset
|
||||
// On the first run, the Preset is evaluated from the
|
||||
getPerformanceManager().setupPerformancePresetSettings(_firstRun.get());
|
||||
|
||||
// finish initializing the camera, based on everything we checked above. Third person camera will be used if no settings
|
||||
// dictated that we should be in first person
|
||||
|
|
|
@ -10,10 +10,34 @@
|
|||
//
|
||||
#include "PerformanceManager.h"
|
||||
|
||||
#include <platform/Profiler.h>
|
||||
|
||||
#include "scripting/RenderScriptingInterface.h"
|
||||
|
||||
PerformanceManager::PerformanceManager()
|
||||
{
|
||||
setPerformancePreset((PerformancePreset) _performancePresetSetting.get());
|
||||
}
|
||||
|
||||
void PerformanceManager::setupPerformancePresetSettings(bool evaluatePlatformTier) {
|
||||
if (evaluatePlatformTier || (getPerformancePreset() == UNKNOWN)) {
|
||||
// If evaluatePlatformTier, evalute the Platform Tier and assign the matching Performance profile by default.
|
||||
// A bunch of Performance, Simulation and Render settings will be set to a matching default value from this
|
||||
|
||||
// Here is the mapping between pelatformTIer and performance profile
|
||||
const std::array<PerformanceManager::PerformancePreset, platform::Profiler::NumTiers> platformToPerformancePresetMap = { {
|
||||
PerformanceManager::PerformancePreset::MID, // platform::Profiler::UNKNOWN
|
||||
PerformanceManager::PerformancePreset::LOW, // platform::Profiler::LOW
|
||||
PerformanceManager::PerformancePreset::MID, // platform::Profiler::MID
|
||||
PerformanceManager::PerformancePreset::HIGH // platform::Profiler::HIGH
|
||||
} };
|
||||
|
||||
// What is our profile?
|
||||
auto platformTier = platform::Profiler::profilePlatform();
|
||||
|
||||
// Then let's assign the performance preset setting from it
|
||||
setPerformancePreset(platformToPerformancePresetMap[platformTier]);
|
||||
}
|
||||
}
|
||||
|
||||
void PerformanceManager::setPerformancePreset(PerformanceManager::PerformancePreset preset) {
|
||||
|
@ -27,7 +51,7 @@ void PerformanceManager::setPerformancePreset(PerformanceManager::PerformancePre
|
|||
}
|
||||
|
||||
PerformanceManager::PerformancePreset PerformanceManager::getPerformancePreset() const {
|
||||
PerformancePreset preset = PerformancePreset::MID;
|
||||
PerformancePreset preset = PerformancePreset::UNKNOWN;
|
||||
|
||||
preset = (PerformancePreset) _performancePresetSettingLock.resultWithReadLock<int>([&] {
|
||||
return _performancePresetSetting.get();
|
||||
|
@ -42,7 +66,7 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP
|
|||
case PerformancePreset::HIGH:
|
||||
RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::DEFERRED);
|
||||
RenderScriptingInterface::getInstance()->setShadowsEnabled(true);
|
||||
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::INTERACTIVE);
|
||||
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME);
|
||||
|
||||
break;
|
||||
case PerformancePreset::MID:
|
||||
|
@ -57,7 +81,9 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP
|
|||
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::ECO);
|
||||
|
||||
break;
|
||||
case PerformancePreset::UNKNOWN:
|
||||
default:
|
||||
// Do nothing anymore
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
class PerformanceManager {
|
||||
public:
|
||||
enum PerformancePreset {
|
||||
LOW = 0,
|
||||
UNKNOWN = 0, // Matching the platform Tier profiles enumeration for coherence
|
||||
LOW,
|
||||
MID,
|
||||
HIGH,
|
||||
PROFILE_COUNT
|
||||
|
@ -29,12 +30,16 @@ public:
|
|||
PerformanceManager();
|
||||
~PerformanceManager() = default;
|
||||
|
||||
// Setup the PerformanceManager which will enforce the several settings to match the Preset
|
||||
// If evaluatePlatformTier is true, the Preset is evaluated from the Platform::Profiler::profilePlatform()
|
||||
void setupPerformancePresetSettings(bool evaluatePlatformTier);
|
||||
|
||||
void setPerformancePreset(PerformancePreset performancePreset);
|
||||
PerformancePreset getPerformancePreset() const;
|
||||
|
||||
private:
|
||||
mutable ReadWriteLockable _performancePresetSettingLock;
|
||||
Setting::Handle<int> _performancePresetSetting { "performancePreset", PerformanceManager::PerformancePreset::MID };
|
||||
Setting::Handle<int> _performancePresetSetting { "performancePreset", PerformanceManager::PerformancePreset::UNKNOWN };
|
||||
|
||||
// The concrete performance preset changes
|
||||
void applyPerformancePreset(PerformanceManager::PerformancePreset performancePreset);
|
||||
|
|
2
interface/src/avatar/MyAvatar.h
Executable file → Normal file
2
interface/src/avatar/MyAvatar.h
Executable file → Normal file
|
@ -2603,7 +2603,7 @@ private:
|
|||
bool _enableDebugDrawIKChains { false };
|
||||
bool _enableDebugDrawDetailedCollision { false };
|
||||
|
||||
mutable bool _cauterizationNeedsUpdate; // do we need to scan children and update their "cauterized" state?
|
||||
mutable bool _cauterizationNeedsUpdate { false }; // do we need to scan children and update their "cauterized" state?
|
||||
|
||||
AudioListenerMode _audioListenerMode;
|
||||
glm::vec3 _customListenPosition;
|
||||
|
|
|
@ -21,6 +21,7 @@ PerformanceScriptingInterface::PerformanceScriptingInterface() {
|
|||
|
||||
void PerformanceScriptingInterface::setPerformancePreset(PerformancePreset performancePreset) {
|
||||
qApp->getPerformanceManager().setPerformancePreset((PerformanceManager::PerformancePreset)performancePreset);
|
||||
emit settingsChanged();
|
||||
}
|
||||
|
||||
PerformanceScriptingInterface::PerformancePreset PerformanceScriptingInterface::getPerformancePreset() const {
|
||||
|
@ -28,12 +29,13 @@ PerformanceScriptingInterface::PerformancePreset PerformanceScriptingInterface::
|
|||
}
|
||||
|
||||
QStringList PerformanceScriptingInterface::getPerformancePresetNames() const {
|
||||
static const QStringList performancePresetNames = { "Low", "Mid", "High" };
|
||||
static const QStringList performancePresetNames = { "UNKNOWN", "LOW", "MID", "HIGH" };
|
||||
return performancePresetNames;
|
||||
}
|
||||
|
||||
void PerformanceScriptingInterface::setRefreshRateProfile(RefreshRateProfile refreshRateProfile) {
|
||||
qApp->getRefreshRateManager().setRefreshRateProfile((RefreshRateManager::RefreshRateProfile)refreshRateProfile);
|
||||
emit settingsChanged();
|
||||
}
|
||||
|
||||
PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface::getRefreshRateProfile() const {
|
||||
|
@ -41,7 +43,7 @@ PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface:
|
|||
}
|
||||
|
||||
QStringList PerformanceScriptingInterface::getRefreshRateProfileNames() const {
|
||||
static const QStringList refreshRateProfileNames = { "Eco", "Interactive", "Realtime" };
|
||||
static const QStringList refreshRateProfileNames = { "ECO", "INTERACTIVE", "REALTIME" };
|
||||
return refreshRateProfileNames;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,10 +20,14 @@
|
|||
|
||||
class PerformanceScriptingInterface : public QObject {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(PerformancePreset performancePreset READ getPerformancePreset WRITE setPerformancePreset NOTIFY settingsChanged)
|
||||
Q_PROPERTY(RefreshRateProfile refreshRateProfile READ getRefreshRateProfile WRITE setRefreshRateProfile NOTIFY settingsChanged)
|
||||
|
||||
public:
|
||||
|
||||
// PerformanceManager PerformancePreset tri state level enums
|
||||
enum PerformancePreset {
|
||||
UNKNOWN = PerformanceManager::PerformancePreset::UNKNOWN,
|
||||
LOW = PerformanceManager::PerformancePreset::LOW,
|
||||
MID = PerformanceManager::PerformancePreset::MID,
|
||||
HIGH = PerformanceManager::PerformancePreset::HIGH,
|
||||
|
@ -55,6 +59,9 @@ public slots:
|
|||
RefreshRateManager::UXMode getUXMode() const;
|
||||
RefreshRateManager::RefreshRateRegime getRefreshRateRegime() const;
|
||||
|
||||
signals:
|
||||
void settingsChanged();
|
||||
|
||||
private:
|
||||
static std::once_flag registry_flag;
|
||||
};
|
||||
|
|
|
@ -186,8 +186,8 @@ public slots:
|
|||
|
||||
/**jsdoc
|
||||
* Get the Platform TIer profiled on startup of the Computer
|
||||
* Platform Tier is an ineger/enum value:
|
||||
* LOW = 0, MID = 1, HIGH = 2
|
||||
* Platform Tier is an integer/enum value:
|
||||
* UNKNOWN = 0, LOW = 1, MID = 2, HIGH = 3
|
||||
* @function PlatformInfo.getTierProfiled
|
||||
* @returns {number} The Platform Tier profiled on startup.
|
||||
*/
|
||||
|
@ -195,8 +195,8 @@ public slots:
|
|||
|
||||
/**jsdoc
|
||||
* Get the Platform Tier possible Names as an array of strings
|
||||
* Platform Tier is an ineger/enum value:
|
||||
* LOW = 0, MID = 1, HIGH = 2
|
||||
* Platform Tier names are:
|
||||
* [ "UNKNOWN", "LOW", "MID", "HIGH" ]
|
||||
* @function PlatformInfo.getPlatformTierNames
|
||||
* @returns {string} The array of names matching the number returned from PlatformInfo.getTierProfiled
|
||||
*/
|
||||
|
|
|
@ -10,118 +10,138 @@
|
|||
#include "LightingModel.h"
|
||||
#include "AntialiasingEffect.h"
|
||||
|
||||
const QString DEFERRED = "deferred";
|
||||
const QString FORWARD = "forward";
|
||||
|
||||
RenderScriptingInterface* RenderScriptingInterface::getInstance() {
|
||||
static RenderScriptingInterface sharedInstance;
|
||||
return &sharedInstance;
|
||||
}
|
||||
|
||||
std::once_flag RenderScriptingInterface::registry_flag;
|
||||
|
||||
RenderScriptingInterface::RenderScriptingInterface() {
|
||||
setRenderMethod((RenderMethod)_renderMethodSetting.get() == RenderMethod::DEFERRED ? RenderMethod::DEFERRED : RenderMethod::FORWARD);
|
||||
setShadowsEnabled(_shadowsEnabledSetting.get());
|
||||
setAmbientOcclusionEnabled(_ambientOcclusionEnabledSetting.get());
|
||||
setAntialiasingEnabled(_antialiasingEnabledSetting.get());
|
||||
std::call_once(registry_flag, [] {
|
||||
qmlRegisterType<RenderScriptingInterface>("RenderEnums", 1, 0, "RenderEnums");
|
||||
});
|
||||
}
|
||||
|
||||
void RenderScriptingInterface::loadSettings() {
|
||||
_renderSettingLock.withReadLock([&] {
|
||||
_renderMethod = (_renderMethodSetting.get());
|
||||
_shadowsEnabled = (_shadowsEnabledSetting.get());
|
||||
_ambientOcclusionEnabled = (_ambientOcclusionEnabledSetting.get());
|
||||
_antialiasingEnabled = (_antialiasingEnabledSetting.get());
|
||||
});
|
||||
forceRenderMethod((RenderMethod)_renderMethod);
|
||||
forceShadowsEnabled(_shadowsEnabled);
|
||||
forceAmbientOcclusionEnabled(_ambientOcclusionEnabled);
|
||||
forceAntialiasingEnabled(_antialiasingEnabled);
|
||||
}
|
||||
|
||||
RenderScriptingInterface::RenderMethod RenderScriptingInterface::getRenderMethod() {
|
||||
return (RenderMethod)_renderMethodSetting.get() == RenderMethod::DEFERRED ? RenderMethod::DEFERRED : RenderMethod::FORWARD;
|
||||
return (RenderMethod) _renderMethod;
|
||||
}
|
||||
|
||||
void RenderScriptingInterface::setRenderMethod(RenderScriptingInterface::RenderMethod renderMethod) {
|
||||
RenderMethod newMethod = renderMethod == RenderMethod::FORWARD ? RenderMethod::FORWARD : RenderMethod::DEFERRED;
|
||||
if (_renderMethodSetting.get() == newMethod) {
|
||||
return;
|
||||
void RenderScriptingInterface::setRenderMethod(RenderMethod renderMethod) {
|
||||
if (_renderMethod != (int) renderMethod) {
|
||||
forceRenderMethod(renderMethod);
|
||||
emit settingsChanged();
|
||||
}
|
||||
}
|
||||
void RenderScriptingInterface::forceRenderMethod(RenderMethod renderMethod) {
|
||||
_renderSettingLock.withWriteLock([&] {
|
||||
_renderMethod = (int)renderMethod;
|
||||
_renderMethodSetting.set((int)renderMethod);
|
||||
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "setRenderMethod", Q_ARG(RenderScriptingInterface::RenderMethod, renderMethod));
|
||||
return;
|
||||
}
|
||||
|
||||
auto config = dynamic_cast<task::SwitchConfig*>(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch"));
|
||||
if (config) {
|
||||
_renderMethodSetting.set(newMethod);
|
||||
config->setBranch(newMethod);
|
||||
emit config->dirtyEnabled();
|
||||
}
|
||||
auto config = dynamic_cast<task::SwitchConfig*>(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch"));
|
||||
if (config) {
|
||||
config->setBranch((int)renderMethod);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
QStringList RenderScriptingInterface::getRenderMethodNames() const {
|
||||
static const QStringList refrenderMethodNames = { "Deferred", "Forward" };
|
||||
static const QStringList refrenderMethodNames = { "DEFERRED", "FORWARD" };
|
||||
return refrenderMethodNames;
|
||||
}
|
||||
|
||||
bool RenderScriptingInterface::getShadowsEnabled() {
|
||||
return _shadowsEnabledSetting.get();
|
||||
return _shadowsEnabled;
|
||||
}
|
||||
|
||||
void RenderScriptingInterface::setShadowsEnabled(bool enabled) {
|
||||
if (_shadowsEnabledSetting.get() == enabled) {
|
||||
return;
|
||||
if (_shadowsEnabled != enabled) {
|
||||
forceShadowsEnabled(enabled);
|
||||
emit settingsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "setShadowsEnabled", Q_ARG(bool, enabled));
|
||||
return;
|
||||
}
|
||||
|
||||
auto lightingModelConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<MakeLightingModel>("RenderMainView.LightingModel");
|
||||
if (lightingModelConfig) {
|
||||
Menu::getInstance()->setIsOptionChecked(MenuOption::Shadows, enabled);
|
||||
void RenderScriptingInterface::forceShadowsEnabled(bool enabled) {
|
||||
_renderSettingLock.withWriteLock([&] {
|
||||
_shadowsEnabled = (enabled);
|
||||
_shadowsEnabledSetting.set(enabled);
|
||||
lightingModelConfig->setShadow(enabled);
|
||||
}
|
||||
|
||||
auto lightingModelConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<MakeLightingModel>("RenderMainView.LightingModel");
|
||||
if (lightingModelConfig) {
|
||||
Menu::getInstance()->setIsOptionChecked(MenuOption::Shadows, enabled);
|
||||
lightingModelConfig->setShadow(enabled);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bool RenderScriptingInterface::getAmbientOcclusionEnabled() {
|
||||
return _ambientOcclusionEnabledSetting.get();
|
||||
return _ambientOcclusionEnabled;
|
||||
}
|
||||
|
||||
void RenderScriptingInterface::setAmbientOcclusionEnabled(bool enabled) {
|
||||
if (_ambientOcclusionEnabledSetting.get() == enabled) {
|
||||
return;
|
||||
if (_ambientOcclusionEnabled != enabled) {
|
||||
forceAmbientOcclusionEnabled(enabled);
|
||||
emit settingsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "setAmbientOcclusionEnabled", Q_ARG(bool, enabled));
|
||||
return;
|
||||
}
|
||||
|
||||
auto lightingModelConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<MakeLightingModel>("RenderMainView.LightingModel");
|
||||
if (lightingModelConfig) {
|
||||
Menu::getInstance()->setIsOptionChecked(MenuOption::AmbientOcclusion, enabled);
|
||||
void RenderScriptingInterface::forceAmbientOcclusionEnabled(bool enabled) {
|
||||
_renderSettingLock.withWriteLock([&] {
|
||||
_ambientOcclusionEnabled = (enabled);
|
||||
_ambientOcclusionEnabledSetting.set(enabled);
|
||||
lightingModelConfig->setAmbientOcclusion(enabled);
|
||||
}
|
||||
|
||||
auto lightingModelConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<MakeLightingModel>("RenderMainView.LightingModel");
|
||||
if (lightingModelConfig) {
|
||||
Menu::getInstance()->setIsOptionChecked(MenuOption::AmbientOcclusion, enabled);
|
||||
lightingModelConfig->setAmbientOcclusion(enabled);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bool RenderScriptingInterface::getAntialiasingEnabled() {
|
||||
return _antialiasingEnabledSetting.get();
|
||||
return _antialiasingEnabled;
|
||||
}
|
||||
|
||||
void RenderScriptingInterface::setAntialiasingEnabled(bool enabled) {
|
||||
if (_antialiasingEnabledSetting.get() == enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "setAntialiasingEnabled", Q_ARG(bool, enabled));
|
||||
return;
|
||||
}
|
||||
|
||||
auto mainViewJitterCamConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<JitterSample>("RenderMainView.JitterCam");
|
||||
auto mainViewAntialiasingConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<Antialiasing>("RenderMainView.Antialiasing");
|
||||
if (mainViewJitterCamConfig && mainViewAntialiasingConfig) {
|
||||
Menu::getInstance()->setIsOptionChecked(MenuOption::AntiAliasing, enabled);
|
||||
_antialiasingEnabledSetting.set(enabled);
|
||||
if (enabled) {
|
||||
mainViewJitterCamConfig->play();
|
||||
mainViewAntialiasingConfig->setDebugFXAA(false);
|
||||
} else {
|
||||
mainViewJitterCamConfig->none();
|
||||
mainViewAntialiasingConfig->setDebugFXAA(true);
|
||||
}
|
||||
if (_antialiasingEnabled != enabled) {
|
||||
forceAntialiasingEnabled(enabled);
|
||||
emit settingsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void RenderScriptingInterface::forceAntialiasingEnabled(bool enabled) {
|
||||
_renderSettingLock.withWriteLock([&] {
|
||||
_antialiasingEnabled = (enabled);
|
||||
_antialiasingEnabledSetting.set(enabled);
|
||||
|
||||
auto mainViewJitterCamConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<JitterSample>("RenderMainView.JitterCam");
|
||||
auto mainViewAntialiasingConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<Antialiasing>("RenderMainView.Antialiasing");
|
||||
if (mainViewJitterCamConfig && mainViewAntialiasingConfig) {
|
||||
Menu::getInstance()->setIsOptionChecked(MenuOption::AntiAliasing, enabled);
|
||||
if (enabled) {
|
||||
mainViewJitterCamConfig->play();
|
||||
mainViewAntialiasingConfig->setDebugFXAA(false);
|
||||
}
|
||||
else {
|
||||
mainViewJitterCamConfig->none();
|
||||
mainViewAntialiasingConfig->setDebugFXAA(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -25,10 +25,10 @@
|
|||
*/
|
||||
class RenderScriptingInterface : public QObject {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(RenderMethod renderMethod READ getRenderMethod WRITE setRenderMethod)
|
||||
Q_PROPERTY(bool shadowsEnabled READ getShadowsEnabled WRITE setShadowsEnabled)
|
||||
Q_PROPERTY(bool ambientOcclusionEnabled READ getAmbientOcclusionEnabled WRITE setAmbientOcclusionEnabled)
|
||||
Q_PROPERTY(bool antialiasingEnabled READ getAntialiasingEnabled WRITE setAntialiasingEnabled)
|
||||
Q_PROPERTY(RenderMethod renderMethod READ getRenderMethod WRITE setRenderMethod NOTIFY settingsChanged)
|
||||
Q_PROPERTY(bool shadowsEnabled READ getShadowsEnabled WRITE setShadowsEnabled NOTIFY settingsChanged)
|
||||
Q_PROPERTY(bool ambientOcclusionEnabled READ getAmbientOcclusionEnabled WRITE setAmbientOcclusionEnabled NOTIFY settingsChanged)
|
||||
Q_PROPERTY(bool antialiasingEnabled READ getAntialiasingEnabled WRITE setAntialiasingEnabled NOTIFY settingsChanged)
|
||||
|
||||
public:
|
||||
RenderScriptingInterface();
|
||||
|
@ -36,11 +36,17 @@ public:
|
|||
static RenderScriptingInterface* getInstance();
|
||||
|
||||
// RenderMethod enum type
|
||||
enum RenderMethod {
|
||||
enum class RenderMethod {
|
||||
DEFERRED = render::Args::RenderMethod::DEFERRED,
|
||||
FORWARD = render::Args::RenderMethod::FORWARD,
|
||||
};
|
||||
Q_ENUM(RenderMethod);
|
||||
Q_ENUM(RenderMethod)
|
||||
|
||||
|
||||
// Load Settings
|
||||
// Synchronize the runtime value to the actual setting
|
||||
// Need to be called on start up to re-initialize the runtime to the saved setting states
|
||||
void loadSettings();
|
||||
|
||||
public slots:
|
||||
/**jsdoc
|
||||
|
@ -132,12 +138,32 @@ public slots:
|
|||
*/
|
||||
// void setViewportResolutionScale(float resolutionScale);
|
||||
|
||||
signals:
|
||||
void settingsChanged();
|
||||
|
||||
private:
|
||||
// One lock to serialize and access safely all the settings
|
||||
mutable ReadWriteLockable _renderSettingLock;
|
||||
|
||||
// Runtime value of each settings
|
||||
int _renderMethod{ RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED };
|
||||
bool _shadowsEnabled{ true };
|
||||
bool _ambientOcclusionEnabled{ false };
|
||||
bool _antialiasingEnabled { true };
|
||||
|
||||
// Actual settings saved on disk
|
||||
Setting::Handle<int> _renderMethodSetting { "renderMethod", RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED };
|
||||
Setting::Handle<bool> _shadowsEnabledSetting { "shadowsEnabled", true };
|
||||
Setting::Handle<bool> _ambientOcclusionEnabledSetting { "ambientOcclusionEnabled", false };
|
||||
Setting::Handle<bool> _antialiasingEnabledSetting { "antialiasingEnabled", true };
|
||||
Setting::Handle<float> _viewportResolutionScaleSetting{ "viewportResolutionScale", 1.0f };
|
||||
|
||||
// Force assign both setting AND runtime value to the parameter value
|
||||
void forceRenderMethod(RenderMethod renderMethod);
|
||||
void forceShadowsEnabled(bool enabled);
|
||||
void forceAmbientOcclusionEnabled(bool enabled);
|
||||
void forceAntialiasingEnabled(bool enabled);
|
||||
|
||||
static std::once_flag registry_flag;
|
||||
};
|
||||
|
||||
#endif // hifi_RenderScriptingInterface_h
|
||||
|
|
|
@ -77,7 +77,7 @@ public:
|
|||
* @hifi-avatar
|
||||
*
|
||||
* @property {Uuid} keyboardFocusOverlay - Get or set the {@link Entities.EntityTypes|Web} entity that has keyboard focus.
|
||||
* If no entity has keyboard focus, get returns <code>null</code>; set to <code>null</code> or {@link Uuid|Uuid.NULL} to
|
||||
* If no entity has keyboard focus, get returns <code>null</code>; set to <code>null</code> or {@link Uuid(0)|Uuid.NULL} to
|
||||
* clear keyboard focus.
|
||||
*/
|
||||
|
||||
|
@ -122,7 +122,7 @@ public slots:
|
|||
* @function Overlays.addOverlay
|
||||
* @param {Overlays.OverlayType} type - The type of the overlay to add.
|
||||
* @param {Overlays.OverlayProperties} properties - The properties of the overlay to add.
|
||||
* @returns {Uuid} The ID of the newly created overlay if successful, otherwise {@link Uuid|Uuid.NULL}.
|
||||
* @returns {Uuid} The ID of the newly created overlay if successful, otherwise {@link Uuid(0)|Uuid.NULL}.
|
||||
* @example <caption>Add a cube overlay in front of your avatar.</caption>
|
||||
* var overlay = Overlays.addOverlay("cube", {
|
||||
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })),
|
||||
|
@ -137,7 +137,7 @@ public slots:
|
|||
* Create a clone of an existing entity (or 2D overlay).
|
||||
* @function Overlays.cloneOverlay
|
||||
* @param {Uuid} id - The ID of the entity/2D overlay to clone.
|
||||
* @returns {Uuid} The ID of the new object if successful, otherwise {@link Uuid|Uuid.NULL}.
|
||||
* @returns {Uuid} The ID of the new object if successful, otherwise {@link Uuid(0)|Uuid.NULL}.
|
||||
*/
|
||||
QUuid cloneOverlay(const QUuid& id);
|
||||
|
||||
|
@ -562,7 +562,7 @@ public slots:
|
|||
* Set the Web3D entity that has keyboard focus.
|
||||
* @function Overlays.setKeyboardFocusOverlay
|
||||
* @param {Uuid} id - The ID of the {@link Entities.EntityTypes|Web} entity to set keyboard focus to. Use
|
||||
* <code>null</code> or {@link Uuid|Uuid.NULL} to unset keyboard focus from an overlay.
|
||||
* <code>null</code> or {@link Uuid(0)|Uuid.NULL} to unset keyboard focus from an overlay.
|
||||
*/
|
||||
void setKeyboardFocusOverlay(const QUuid& id) { DependencyManager::get<EntityScriptingInterface>()->setKeyboardFocusEntity(id); }
|
||||
|
||||
|
|
|
@ -136,7 +136,6 @@ void Animation::downloadFinished(const QByteArray& data) {
|
|||
}
|
||||
|
||||
void Animation::animationParseSuccess(HFMModel::Pointer hfmModel) {
|
||||
qCDebug(animation) << "Animation parse success";
|
||||
_hfmModel = hfmModel;
|
||||
finishedLoading(true);
|
||||
}
|
||||
|
|
|
@ -616,23 +616,25 @@ bool adjustedFormatForAudioDevice(const QAudioDeviceInfo& audioDevice,
|
|||
|
||||
qCDebug(audioclient) << "The desired format for audio I/O is" << desiredAudioFormat;
|
||||
|
||||
#if defined(Q_OS_ANDROID) || defined(Q_OS_OSX)
|
||||
// As of Qt5.6, Android returns the native OpenSLES sample rate when possible, else 48000
|
||||
// Mac OSX returns the preferred CoreAudio format
|
||||
if (nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat)) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
if (IsWindows8OrGreater()) {
|
||||
// On Windows using WASAPI shared-mode, returns the internal mix format
|
||||
if (nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat);
|
||||
} // else enumerate formats
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
// Mac OSX returns the preferred CoreAudio format
|
||||
return nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat);
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
// As of Qt5.6, Android returns the native OpenSLES sample rate when possible, else 48000
|
||||
if (nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat)) {
|
||||
return true;
|
||||
} // else enumerate formats
|
||||
#endif
|
||||
|
||||
adjustedAudioFormat = desiredAudioFormat;
|
||||
|
||||
//
|
||||
|
|
|
@ -441,7 +441,7 @@ public:
|
|||
/**jsdoc
|
||||
* Gets the ID of the entity of avatar that the avatar is parented to.
|
||||
* @function MyAvatar.getParentID
|
||||
* @returns {Uuid} The ID of the entity or avatar that the avatar is parented to. {@link Uuid|Uuid.NULL} if not parented.
|
||||
* @returns {Uuid} The ID of the entity or avatar that the avatar is parented to. {@link Uuid(0)|Uuid.NULL} if not parented.
|
||||
*/
|
||||
// This calls through to the SpatiallyNestable versions, but is here to expose these to JavaScript.
|
||||
Q_INVOKABLE virtual const QUuid getParentID() const override { return SpatiallyNestable::getParentID(); }
|
||||
|
@ -450,7 +450,7 @@ public:
|
|||
* Sets the ID of the entity of avatar that the avatar is parented to.
|
||||
* @function MyAvatar.setParentID
|
||||
* @param {Uuid} parentID - The ID of the entity or avatar that the avatar should be parented to. Set to
|
||||
* {@link Uuid|Uuid.NULL} to unparent.
|
||||
* {@link Uuid(0)|Uuid.NULL} to unparent.
|
||||
*/
|
||||
// This calls through to the SpatiallyNestable versions, but is here to expose these to JavaScript.
|
||||
Q_INVOKABLE virtual void setParentID(const QUuid& parentID) override;
|
||||
|
|
|
@ -230,7 +230,11 @@ void Head::applyEyelidOffset(glm::quat headOrientation) {
|
|||
const float OPEN_DOWN_MULTIPLIER = 0.3f;
|
||||
const float BROW_UP_MULTIPLIER = 0.5f;
|
||||
|
||||
glm::vec3 lookAt = glm::normalize(getLookAtPosition() - _eyePosition);
|
||||
glm::vec3 lookAtVector = getLookAtPosition() - _eyePosition;
|
||||
if (glm::length2(lookAtVector) == 0.0f) {
|
||||
return;
|
||||
}
|
||||
glm::vec3 lookAt = glm::normalize(lookAtVector);
|
||||
glm::vec3 headUp = headOrientation * Vectors::UNIT_Y;
|
||||
float eyePitch = (PI / 2.0f) - acos(glm::dot(lookAt, headUp));
|
||||
float eyelidOffset = glm::clamp(abs(eyePitch * EYE_PITCH_TO_COEFFICIENT), 0.0f, MAX_EYELID_OFFSET);
|
||||
|
|
|
@ -263,7 +263,7 @@ namespace controller {
|
|||
* methods. The mapping can then be enabled using {@link Controller.enableMapping|enableMapping} for it to take effect.
|
||||
* @function Controller.newMapping
|
||||
* @param {string} [mappingName=Uuid.generate()] - A unique name for the mapping. If not specified a new UUID generated
|
||||
* by {@link Uuid.generate} is used.
|
||||
* by {@link Uuid(0).generate|Uuid.generate} is used.
|
||||
* @returns {MappingObject} A controller mapping object.
|
||||
* @example <caption>Create a simple mapping that makes the right trigger move your avatar up.</caption>
|
||||
* var MAPPING_NAME = "com.highfidelity.controllers.example.newMapping";
|
||||
|
|
|
@ -33,7 +33,7 @@ private:
|
|||
virtual void doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) override;
|
||||
virtual void doRender(RenderArgs* args) override;
|
||||
|
||||
GizmoType _gizmoType;
|
||||
GizmoType _gizmoType { UNSET_GIZMO_TYPE };
|
||||
RingGizmoPropertyGroup _ringProperties;
|
||||
PrimitiveMode _prevPrimitiveMode;
|
||||
|
||||
|
|
|
@ -41,8 +41,8 @@ private:
|
|||
quint16 _priority;
|
||||
QUuid _parentID;
|
||||
|
||||
MaterialMappingMode _materialMappingMode;
|
||||
bool _materialRepeat;
|
||||
MaterialMappingMode _materialMappingMode { UNSET_MATERIAL_MAPPING_MODE };
|
||||
bool _materialRepeat { false };
|
||||
glm::vec2 _materialMappingPos;
|
||||
glm::vec2 _materialMappingScale;
|
||||
float _materialMappingRot;
|
||||
|
|
|
@ -177,6 +177,9 @@ void PolyLineEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer&
|
|||
|
||||
void PolyLineEntityRenderer::updateGeometry() {
|
||||
int maxNumVertices = std::min(_points.length(), _normals.length());
|
||||
if (maxNumVertices < 1) {
|
||||
return;
|
||||
}
|
||||
bool doesStrokeWidthVary = false;
|
||||
if (_widths.size() > 0) {
|
||||
float prevWidth = _widths[0];
|
||||
|
|
|
@ -51,9 +51,9 @@ protected:
|
|||
float _textureAspectRatio { 1.0f };
|
||||
bool _textureLoaded { false };
|
||||
|
||||
bool _isUVModeStretch;
|
||||
bool _faceCamera;
|
||||
bool _glow;
|
||||
bool _isUVModeStretch { false };
|
||||
bool _faceCamera { false };
|
||||
bool _glow { false };
|
||||
|
||||
size_t _numVertices;
|
||||
gpu::BufferPointer _polylineDataBuffer;
|
||||
|
|
|
@ -630,7 +630,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
|
|||
* The value can only be set at entity creation by using the <code>entityHostType</code> parameter in
|
||||
* {@link Entities.addEntity}. Read-only.
|
||||
* @property {Uuid} owningAvatarID=Uuid.NULL - The session ID of the owning avatar if <code>avatarEntity</code> is
|
||||
* <code>true</code>, otherwise {@link Uuid|Uuid.NULL}. <em>Read-only.</em>
|
||||
* <code>true</code>, otherwise {@link Uuid(0)|Uuid.NULL}. <em>Read-only.</em>
|
||||
*
|
||||
* @property {string} created - The UTC date and time that the entity was created, in ISO 8601 format as
|
||||
* <code>yyyy-MM-ddTHH:mm:ssZ</code>. <em>Read-only.</em>
|
||||
|
@ -728,7 +728,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
|
|||
* button beside the "script URL" field in properties tab of the Create app works.
|
||||
* @property {string} serverScripts="" - The URL of the server entity script, if any, that is attached to the entity.
|
||||
*
|
||||
* @property {Uuid} parentID=Uuid.NULL - The ID of the entity or avatar that this entity is parented to. {@link Uuid|Uuid.NULL}
|
||||
* @property {Uuid} parentID=Uuid.NULL - The ID of the entity or avatar that this entity is parented to. {@link Uuid(0)|Uuid.NULL}
|
||||
* if the entity is not parented.
|
||||
* @property {number} parentJointIndex=65535 - The joint of the entity or avatar that this entity is parented to. Use
|
||||
* <code>65535</code> or <code>-1</code> to parent to the entity or avatar's position and orientation rather than a joint.
|
||||
|
@ -1174,17 +1174,17 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
|
|||
* @property {string} zTextureURL="" - URL of the texture to map to surfaces perpendicular to the entity's local z-axis. JPG or
|
||||
* PNG format. If no texture is specified the surfaces display white.
|
||||
* @property {Uuid} xNNeighborID=Uuid.NULL - ID of the neighboring PolyVox entity in the entity's -ve local x-axis direction,
|
||||
* if you want them joined. Set to {@link Uuid|Uuid.NULL} if there is none or you don't want to join them.
|
||||
* if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them.
|
||||
* @property {Uuid} yNNeighborID=Uuid.NULL - ID of the neighboring PolyVox entity in the entity's -ve local y-axis direction,
|
||||
* if you want them joined. Set to {@link Uuid|Uuid.NULL} if there is none or you don't want to join them.
|
||||
* if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them.
|
||||
* @property {Uuid} zNNeighborID=Uuid.NULL - ID of the neighboring PolyVox entity in the entity's -ve local z-axis direction,
|
||||
* if you want them joined. Set to {@link Uuid|Uuid.NULL} if there is none or you don't want to join them.
|
||||
* if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them.
|
||||
* @property {Uuid} xPNeighborID=Uuid.NULL - ID of the neighboring PolyVox entity in the entity's +ve local x-axis direction,
|
||||
* if you want them joined. Set to {@link Uuid|Uuid.NULL} if there is none or you don't want to join them.
|
||||
* if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them.
|
||||
* @property {Uuid} yPNeighborID=Uuid.NULL - ID of the neighboring PolyVox entity in the entity's +ve local y-axis direction,
|
||||
* if you want them joined. Set to {@link Uuid|Uuid.NULL} if there is none or you don't want to join them.
|
||||
* if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them.
|
||||
* @property {Uuid} zPNeighborID=Uuid.NULL - ID of the neighboring PolyVox entity in the entity's +ve local z-axis direction,
|
||||
* if you want them joined. Set to {@link Uuid|Uuid.NULL} if there is none or you don't want to join them.
|
||||
* if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them.
|
||||
* @example <caption>Create a textured PolyVox sphere.</caption>
|
||||
* var position = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.5, z: -8 }));
|
||||
* var texture = "http://public.highfidelity.com/cozza13/tuscany/Concrete2.jpg";
|
||||
|
|
|
@ -114,7 +114,7 @@ public:
|
|||
* @hifi-assignment-client
|
||||
*
|
||||
* @property {Uuid} keyboardFocusEntity - Get or set the {@link Entities.EntityType|Web} entity that has keyboard focus.
|
||||
* If no entity has keyboard focus, get returns <code>null</code>; set to <code>null</code> or {@link Uuid|Uuid.NULL} to
|
||||
* If no entity has keyboard focus, get returns <code>null</code>; set to <code>null</code> or {@link Uuid(0)|Uuid.NULL} to
|
||||
* clear keyboard focus.
|
||||
*/
|
||||
/// handles scripting of Entity commands from JS passed to assigned clients
|
||||
|
@ -267,7 +267,7 @@ public slots:
|
|||
* follows you to each domain you visit, rendering at the same world coordinates unless it's parented to your avatar.
|
||||
* If <code>"local"</code>, the entity is created as a local entity, which will only render for you and isn't sent over the wire.
|
||||
* Otherwise it is created as a normal entity and sent over the entity server.
|
||||
* @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid|Uuid.NULL}.
|
||||
* @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid(0)|Uuid.NULL}.
|
||||
* @example <caption>Create a box entity in front of your avatar.</caption>
|
||||
* var entityID = Entities.addEntity({
|
||||
* type: "Box",
|
||||
|
@ -294,7 +294,7 @@ public slots:
|
|||
* @function Entities.addEntity
|
||||
* @param {Entities.EntityProperties} properties - The properties of the entity to create.
|
||||
* @param {boolean} [avatarEntity=false] - Whether to create an avatar entity or a domain entity
|
||||
* @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid|Uuid.NULL}.
|
||||
* @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid(0)|Uuid.NULL}.
|
||||
*/
|
||||
Q_INVOKABLE QUuid addEntity(const EntityItemProperties& properties, bool avatarEntity = false) {
|
||||
entity::HostType entityHostType = avatarEntity ? entity::HostType::AVATAR : entity::HostType::DOMAIN;
|
||||
|
@ -312,7 +312,7 @@ public slots:
|
|||
* properties set per its clone related-properties, and its clone-related properties are set to defaults.
|
||||
* @function Entities.cloneEntity
|
||||
* @param {Uuid} entityID - The ID of the entity to clone.
|
||||
* @returns {Uuid} The ID of the new entity if successfully cloned, otherwise {@link Uuid|Uuid.NULL}.
|
||||
* @returns {Uuid} The ID of the new entity if successfully cloned, otherwise {@link Uuid(0)|Uuid.NULL}.
|
||||
*/
|
||||
Q_INVOKABLE QUuid cloneEntity(const QUuid& entityID);
|
||||
|
||||
|
@ -1446,7 +1446,7 @@ public slots:
|
|||
* Set the {@link Entities.EntityType|Web} entity that has keyboard focus.
|
||||
* @function Entities.setKeyboardFocusEntity
|
||||
* @param {Uuid} id - The ID of the {@link Entities.EntityType|Web} entity to set keyboard focus to. Use
|
||||
* <code>null</code> or {@link Uuid|Uuid.NULL} to unset keyboard focus from an entity.
|
||||
* <code>null</code> or {@link Uuid(0)|Uuid.NULL} to unset keyboard focus from an entity.
|
||||
*/
|
||||
Q_INVOKABLE void setKeyboardFocusEntity(const QUuid& id);
|
||||
|
||||
|
|
|
@ -827,7 +827,12 @@ EntityItemID EntityTree::evalRayIntersection(const glm::vec3& origin, const glm:
|
|||
PickFilter searchFilter, OctreeElementPointer& element, float& distance,
|
||||
BoxFace& face, glm::vec3& surfaceNormal, QVariantMap& extraInfo,
|
||||
Octree::lockType lockType, bool* accurateResult) {
|
||||
RayArgs args = { origin, direction, 1.0f / direction, entityIdsToInclude, entityIdsToDiscard,
|
||||
|
||||
// calculate dirReciprocal like this rather than with glm's scalar / vec3 template to avoid NaNs.
|
||||
vec3 dirReciprocal = glm::vec3(direction.x == 0.0f ? 0.0f : 1.0f / direction.x,
|
||||
direction.y == 0.0f ? 0.0f : 1.0f / direction.y,
|
||||
direction.z == 0.0f ? 0.0f : 1.0f / direction.z);
|
||||
RayArgs args = { origin, direction, dirReciprocal, entityIdsToInclude, entityIdsToDiscard,
|
||||
searchFilter, element, distance, face, surfaceNormal, extraInfo, EntityItemID() };
|
||||
distance = FLT_MAX;
|
||||
|
||||
|
|
|
@ -385,7 +385,6 @@ FBXNode FBXSerializer::parseFBX(QIODevice* device) {
|
|||
quint32 fileVersion;
|
||||
in >> fileVersion;
|
||||
position += sizeof(fileVersion);
|
||||
qCDebug(modelformat) << "fileVersion:" << fileVersion;
|
||||
bool has64BitPositions = (fileVersion >= FBX_VERSION_2016);
|
||||
|
||||
// parse the top-level node
|
||||
|
|
|
@ -128,7 +128,7 @@ namespace image {
|
|||
QImage _packedData;
|
||||
FloatPixels _floatData;
|
||||
glm::ivec2 _dims;
|
||||
Format _format;
|
||||
Format _format { Format_Invalid };
|
||||
};
|
||||
|
||||
} // namespace image
|
||||
|
|
|
@ -96,7 +96,7 @@ private:
|
|||
friend class KTXReader;
|
||||
friend class ImageReader;
|
||||
|
||||
image::TextureUsage::Type _type;
|
||||
image::TextureUsage::Type _type { image::TextureUsage::UNUSED_TEXTURE };
|
||||
image::ColorChannel _sourceChannel;
|
||||
|
||||
enum class ResourceType {
|
||||
|
|
|
@ -46,7 +46,7 @@ const QString GET_PLACE = "/api/v1/places/%1";
|
|||
* @hifi-avatar
|
||||
* @hifi-assignment-client
|
||||
*
|
||||
* @property {Uuid} domainID - A UUID uniquely identifying the domain you're visiting. Is {@link Uuid|Uuid.NULL} if you're not
|
||||
* @property {Uuid} domainID - A UUID uniquely identifying the domain you're visiting. Is {@link Uuid(0)|Uuid.NULL} if you're not
|
||||
* connected to the domain or are in a serverless domain.
|
||||
* <em>Read-only.</em>
|
||||
* @property {string} hostname - The name of the domain for your current metaverse address (e.g., <code>"AvatarIsland"</code>,
|
||||
|
|
|
@ -43,15 +43,6 @@ static Setting::Handle<quint16> LIMITED_NODELIST_LOCAL_PORT("LimitedNodeList.Loc
|
|||
using namespace std::chrono_literals;
|
||||
static const std::chrono::milliseconds CONNECTION_RATE_INTERVAL_MS = 1s;
|
||||
|
||||
const std::set<NodeType_t> SOLO_NODE_TYPES = {
|
||||
NodeType::AvatarMixer,
|
||||
NodeType::AudioMixer,
|
||||
NodeType::AssetServer,
|
||||
NodeType::EntityServer,
|
||||
NodeType::MessagesMixer,
|
||||
NodeType::EntityScriptServer
|
||||
};
|
||||
|
||||
LimitedNodeList::LimitedNodeList(int socketListenPort, int dtlsListenPort) :
|
||||
_nodeSocket(this),
|
||||
_packetReceiver(new PacketReceiver(this))
|
||||
|
|
|
@ -53,8 +53,6 @@ const quint64 NODE_SILENCE_THRESHOLD_MSECS = 10 * 1000;
|
|||
|
||||
static const size_t DEFAULT_MAX_CONNECTION_RATE { std::numeric_limits<size_t>::max() };
|
||||
|
||||
extern const std::set<NodeType_t> SOLO_NODE_TYPES;
|
||||
|
||||
const char DEFAULT_ASSIGNMENT_SERVER_HOSTNAME[] = "localhost";
|
||||
|
||||
const char STUN_SERVER_HOSTNAME[] = "stun.highfidelity.io";
|
||||
|
@ -330,6 +328,15 @@ public:
|
|||
float getInboundKbps() const { return _inboundKbps; }
|
||||
float getOutboundKbps() const { return _outboundKbps; }
|
||||
|
||||
const std::set<NodeType_t> SOLO_NODE_TYPES = {
|
||||
NodeType::AvatarMixer,
|
||||
NodeType::AudioMixer,
|
||||
NodeType::AssetServer,
|
||||
NodeType::EntityServer,
|
||||
NodeType::MessagesMixer,
|
||||
NodeType::EntityScriptServer
|
||||
};
|
||||
|
||||
public slots:
|
||||
void reset();
|
||||
void eraseAllNodes();
|
||||
|
|
|
@ -673,6 +673,13 @@ void NodeList::processDomainServerList(QSharedPointer<ReceivedMessage> message)
|
|||
// refuse to process this packet if we aren't currently connected to the DS
|
||||
return;
|
||||
}
|
||||
#ifdef DEBUG_EVENT_QUEUE
|
||||
{
|
||||
int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread());
|
||||
qCDebug(networking) << "DomainList received, pending count =" << _domainHandler.getCheckInPacketsSinceLastReply()
|
||||
<< "NodeList thread event queue size =" << nodeListQueueSize;
|
||||
}
|
||||
#endif
|
||||
|
||||
// warn if ping lag is getting long
|
||||
if (pingLagTime > qint64(MSECS_PER_SECOND)) {
|
||||
|
|
|
@ -334,7 +334,11 @@ void Socket::readPendingDatagrams() {
|
|||
if (system_clock::now() > abortTime) {
|
||||
// We've been running for too long, stop processing packets for now
|
||||
// Once we've processed the event queue, we'll come back to packet processing
|
||||
qCDebug(networking) << "Socket::readPendingDatagrams() running too long, aborting to process event queue";
|
||||
#ifdef DEBUG_EVENT_QUEUE
|
||||
int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread());
|
||||
qCDebug(networking) << "Overran timebox by" << duration_cast<milliseconds>(system_clock::now() - abortTime).count()
|
||||
<< "ms; NodeList thread event queue size =" << nodeListQueueSize;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -474,6 +474,10 @@ void AmbientOcclusionEffect::updateBlurParameters() {
|
|||
}
|
||||
const auto occlusionSize = frameSize >> resolutionLevel;
|
||||
|
||||
if (occlusionSize.x == 0 || occlusionSize.y == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Occlusion UV limit
|
||||
hblur._blurAxis.z = occlusionSize.x / float(frameSize.x);
|
||||
hblur._blurAxis.w = occlusionSize.y / float(frameSize.y);
|
||||
|
|
|
@ -623,7 +623,7 @@ public:
|
|||
/**jsdoc
|
||||
* @function Script.generateUUID
|
||||
* @returns {Uuid} A new UUID.
|
||||
* @deprecated This function is deprecated and will be removed. Use {@link Uuid.generate} instead.
|
||||
* @deprecated This function is deprecated and will be removed. Use {@link Uuid(0).generate|Uuid.generate} instead.
|
||||
*/
|
||||
Q_INVOKABLE QUuid generateUUID() { return QUuid::createUuid(); }
|
||||
|
||||
|
|
|
@ -19,11 +19,10 @@
|
|||
#include <QtScript/QScriptable>
|
||||
|
||||
/**jsdoc
|
||||
* A UUID (Universally Unique IDentifier) is used to uniquely identify entities, avatars, and the like. It is
|
||||
* represented in JavaScript as a string in the format, <code>{nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn}</code>, where the "n"s are
|
||||
* hexadecimal digits.
|
||||
* The <code>Uuid</code> API provides facilities for working with UUIDs.
|
||||
*
|
||||
* @namespace Uuid
|
||||
* @variation 0
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
|
@ -31,7 +30,7 @@
|
|||
* @hifi-server-entity
|
||||
* @hifi-assignment-client
|
||||
*
|
||||
* @property {Uuid} NULL - The null UUID, <code>{00000000-0000-0000-0000-000000000000}</code>.
|
||||
* @property {Uuid} NULL - The null UUID, <code>"{00000000-0000-0000-0000-000000000000}"</code>.
|
||||
*/
|
||||
|
||||
/// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API
|
||||
|
@ -42,7 +41,7 @@ class ScriptUUID : public QObject, protected QScriptable {
|
|||
public slots:
|
||||
/**jsdoc
|
||||
* Generates a UUID from a string representation of the UUID.
|
||||
* @function Uuid.fromString
|
||||
* @function Uuid(0).fromString
|
||||
* @param {string} string - A string representation of a UUID. The curly braces are optional.
|
||||
* @returns {Uuid} A UUID if the given <code>string</code> is valid, <code>null</code> otherwise.
|
||||
* @example <caption>Valid and invalid parameters.</caption>
|
||||
|
@ -60,15 +59,15 @@ public slots:
|
|||
/**jsdoc
|
||||
* Generates a string representation of a UUID. However, because UUIDs are represented in JavaScript as strings, this is in
|
||||
* effect a no-op.
|
||||
* @function Uuid.toString
|
||||
* @function Uuid(0).toString
|
||||
* @param {Uuid} id - The UUID to generate a string from.
|
||||
* @returns {string} - A string representation of the UUID.
|
||||
*/
|
||||
QString toString(const QUuid& id);
|
||||
|
||||
/**jsdoc
|
||||
* Generate a new UUID.
|
||||
* @function Uuid.generate
|
||||
* Generates a new UUID.
|
||||
* @function Uuid(0).generate
|
||||
* @returns {Uuid} A new UUID.
|
||||
* @example <caption>Generate a new UUID and reports its JavaScript type.</caption>
|
||||
* var uuid = Uuid.generate();
|
||||
|
@ -78,8 +77,8 @@ public slots:
|
|||
QUuid generate();
|
||||
|
||||
/**jsdoc
|
||||
* Test whether two given UUIDs are equal.
|
||||
* @function Uuid.isEqual
|
||||
* Tests whether two UUIDs are equal.
|
||||
* @function Uuid(0).isEqual
|
||||
* @param {Uuid} idA - The first UUID to compare.
|
||||
* @param {Uuid} idB - The second UUID to compare.
|
||||
* @returns {boolean} <code>true</code> if the two UUIDs are equal, otherwise <code>false</code>.
|
||||
|
@ -93,10 +92,11 @@ public slots:
|
|||
bool isEqual(const QUuid& idA, const QUuid& idB);
|
||||
|
||||
/**jsdoc
|
||||
* Test whether a given UUID is null.
|
||||
* @function Uuid.isNull
|
||||
* Tests whether a UUID is null.
|
||||
* @function Uuid(0).isNull
|
||||
* @param {Uuid} id - The UUID to test.
|
||||
* @returns {boolean} <code>true</code> if the UUID equals Uuid.NULL or is <code>null</code>, otherwise <code>false</code>.
|
||||
* @returns {boolean} <code>true</code> if the UUID equals <code>Uuid.NULL</code> or is <code>null</code>, otherwise
|
||||
* <code>false</code>.
|
||||
* @example <caption>Demonstrate <code>true</code> and <code>false</code> cases.</caption>
|
||||
* var uuid; // undefined
|
||||
* print(Uuid.isNull(uuid)); // false
|
||||
|
@ -110,8 +110,8 @@ public slots:
|
|||
bool isNull(const QUuid& id);
|
||||
|
||||
/**jsdoc
|
||||
* Print to the program log a text label followed by the UUID value.
|
||||
* @function Uuid.print
|
||||
* Prints a UUID to the program log, as a text label followed by the UUID value.
|
||||
* @function Uuid(0).print
|
||||
* @param {string} label - The label to print.
|
||||
* @param {Uuid} id - The UUID to print.
|
||||
* @example <caption>Two ways of printing a label plus UUID.</caption>
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
enum GizmoType {
|
||||
RING = 0,
|
||||
// put new gizmo-types before this line.
|
||||
UNSET_GIZMO_TYPE
|
||||
};
|
||||
|
||||
class GizmoTypeHelpers {
|
||||
|
|
|
@ -13,7 +13,9 @@
|
|||
|
||||
enum MaterialMappingMode {
|
||||
UV = 0,
|
||||
PROJECTED
|
||||
PROJECTED,
|
||||
// put new mapping-modes before this line.
|
||||
UNSET_MATERIAL_MAPPING_MODE
|
||||
};
|
||||
|
||||
class MaterialMappingModeHelpers {
|
||||
|
|
|
@ -640,6 +640,12 @@ Q_DECLARE_METATYPE(Collision)
|
|||
QScriptValue collisionToScriptValue(QScriptEngine* engine, const Collision& collision);
|
||||
void collisionFromScriptValue(const QScriptValue &object, Collision& collision);
|
||||
|
||||
/**jsdoc
|
||||
* UUIDs (Universally Unique IDentifiers) are used to uniquely identify entities, avatars, and the like. They are represented
|
||||
* in JavaScript as strings in the format, <code>"{nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn}"</code>, where the "n"s are
|
||||
* hexadecimal digits.
|
||||
* @typedef {string} Uuid
|
||||
*/
|
||||
//Q_DECLARE_METATYPE(QUuid) // don't need to do this for QUuid since it's already a meta type
|
||||
QScriptValue quuidToScriptValue(QScriptEngine* engine, const QUuid& uuid);
|
||||
void quuidFromScriptValue(const QScriptValue& object, QUuid& uuid);
|
||||
|
|
|
@ -75,7 +75,12 @@ Prop.PropGroup {
|
|||
filled: root.jobEnabled
|
||||
fillColor: (root.jobEnabled ? global.colorGreenHighlight : global.colorOrangeAccent)
|
||||
icon: 5
|
||||
iconMouseArea.onClicked: { toggleJobActivation() }
|
||||
|
||||
MouseArea{
|
||||
id: mousearea
|
||||
anchors.fill: parent
|
||||
onClicked: { root.toggleJobActivation() }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ PropItem {
|
|||
property alias enums : valueCombo.model
|
||||
|
||||
Component.onCompleted: {
|
||||
// valueVar = root.valueVarGetter();
|
||||
valueVar = root.valueVarGetter();
|
||||
}
|
||||
|
||||
PropComboBox {
|
||||
|
|
|
@ -29,6 +29,7 @@ Item {
|
|||
readonly property color colorBackHighlight: hifi.colors.baseGrayHighlight
|
||||
readonly property color colorBorderLight: hifi.colors.lightGray
|
||||
readonly property color colorBorderHighight: hifi.colors.blueHighlight
|
||||
readonly property color colorBorderLighter: hifi.colors.faintGray
|
||||
|
||||
readonly property color colorOrangeAccent: "#FF6309"
|
||||
readonly property color colorRedAccent: "#C62147"
|
||||
|
|
|
@ -29,11 +29,19 @@ Canvas {
|
|||
}
|
||||
|
||||
property var fillColor: global.colorBorderHighight
|
||||
onFillColorChanged: function () { //console.log("fillColor changed to: " + filled );
|
||||
onFillColorChanged: function () { //console.log("fillColor changed to: " + fillColor );
|
||||
requestPaint()
|
||||
}
|
||||
|
||||
property alias iconMouseArea: mousearea
|
||||
property var stroked: true
|
||||
onStrokedChanged: function () { //console.log("Stroked changed to: " + stroked );
|
||||
requestPaint()
|
||||
}
|
||||
|
||||
property var strokeColor: global.colorBorderLight
|
||||
onStrokeColorChanged: function () { //console.log("strokeColor changed to: " + strokeColor );
|
||||
requestPaint()
|
||||
}
|
||||
|
||||
contextType: "2d"
|
||||
onPaint: {
|
||||
|
@ -86,14 +94,10 @@ Canvas {
|
|||
if (filled) {
|
||||
context.fillStyle = fillColor;
|
||||
context.fill();
|
||||
} else {
|
||||
context.strokeStyle = fillColor;
|
||||
}
|
||||
if (stroked) {
|
||||
context.strokeStyle = strokeColor;
|
||||
context.stroke();
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea{
|
||||
id: mousearea
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
|
@ -9,15 +9,47 @@
|
|||
//
|
||||
|
||||
import QtQuick 2.7
|
||||
import controlsUit 1.0 as HifiControls
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
HifiControls.CheckBox {
|
||||
CheckBox {
|
||||
Global { id: global }
|
||||
|
||||
color: global.fontColor
|
||||
id: control
|
||||
text: ""
|
||||
checked: true
|
||||
spacing: 0
|
||||
|
||||
//anchors.left: root.splitter.right
|
||||
//anchors.verticalCenter: root.verticalCenter
|
||||
//width: root.width * global.valueAreaWidthScale
|
||||
indicator: Rectangle {
|
||||
color: global.colorBack
|
||||
border.color: control.down ? global.colorBorderLighter : global.colorBorderLight
|
||||
border.width: global.valueBorderWidth
|
||||
radius: global.valueBorderRadius / 2
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
implicitWidth: global.iconWidth
|
||||
implicitHeight: global.iconWidth
|
||||
|
||||
Rectangle {
|
||||
visible: control.checked
|
||||
|
||||
color: global.colorBorderHighight
|
||||
radius: global.valueBorderRadius / 4
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
implicitWidth: global.iconWidth - 2
|
||||
implicitHeight: global.iconHeight - 2
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: PiText {
|
||||
text: control.text
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
horizontalAlignment: Text.AlignHLeft
|
||||
anchors.left: control.indicator.right
|
||||
leftPadding: global.horizontalMargin
|
||||
}
|
||||
|
||||
height: global.slimHeight
|
||||
}
|
|
@ -28,7 +28,7 @@ ComboBox {
|
|||
horizontalAlignment: global.valueTextAlign
|
||||
}
|
||||
background: Rectangle {
|
||||
color:highlighted?global.colorBackHighlight:global.color;
|
||||
color:highlighted ? global.colorBackHighlight : global.colorBack;
|
||||
}
|
||||
highlighted: valueCombo.highlightedIndex === index
|
||||
}
|
||||
|
@ -38,11 +38,8 @@ ComboBox {
|
|||
x: valueCombo.width - width - valueCombo.rightPadding
|
||||
y: valueCombo.topPadding + (valueCombo.availableHeight - height) / 2
|
||||
|
||||
icon: 1
|
||||
/*Connections {
|
||||
target: valueCombo
|
||||
onPressedChanged: { canvas.icon = control.down + 1 }
|
||||
}*/
|
||||
strokeColor: (valueCombo.down ? global.colorBorderLighter : global.colorBorderLight )
|
||||
icon: 1 + valueCombo.down
|
||||
}
|
||||
|
||||
contentItem: PiText {
|
||||
|
@ -56,8 +53,8 @@ ComboBox {
|
|||
background: Rectangle {
|
||||
implicitWidth: 120
|
||||
implicitHeight: 40
|
||||
color: global.color
|
||||
border.color: valueCombo.popup.visible ? global.colorBorderHighight : global.colorBorderLight
|
||||
color: global.colorBack
|
||||
border.color: valueCombo.popup.visible ? global.colorBorderLighter : global.colorBorderLight
|
||||
border.width: global.valueBorderWidth
|
||||
radius: global.valueBorderRadius
|
||||
}
|
||||
|
@ -78,7 +75,7 @@ ComboBox {
|
|||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: global.color
|
||||
color: global.colorBack
|
||||
border.color: global.colorBorderHighight
|
||||
radius: global.valueBorderRadius
|
||||
}
|
||||
|
|
|
@ -72,7 +72,12 @@ Item {
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
fillColor: global.colorOrangeAccent
|
||||
iconMouseArea.onClicked: { root.isUnfold = !root.isUnfold }
|
||||
|
||||
MouseArea{
|
||||
id: mousearea
|
||||
anchors.fill: parent
|
||||
onClicked: { root.isUnfold = !root.isUnfold }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ Column {
|
|||
|
||||
Prop.PropString {
|
||||
label: "Platform Tier"
|
||||
//object: Performance
|
||||
valueVarSetter: function (v) {}
|
||||
valueVarGetter: function () {
|
||||
return PlatformInfo.getPlatformTierNames()[PlatformInfo.getTierProfiled()]; }
|
||||
|
@ -27,17 +26,15 @@ Column {
|
|||
|
||||
Prop.PropEnum {
|
||||
label: "Performance Preset"
|
||||
//object: Performance
|
||||
valueVarSetter: Performance.setPerformancePreset
|
||||
valueVarGetter: Performance.getPerformancePreset
|
||||
object: Performance
|
||||
property: "performancePreset"
|
||||
enums: Performance.getPerformancePresetNames()
|
||||
}
|
||||
|
||||
Prop.PropEnum {
|
||||
label: "Refresh Rate Profile"
|
||||
//object: Performance
|
||||
valueVarSetter: Performance.setRefreshRateProfile
|
||||
valueVarGetter: Performance.getRefreshRateProfile
|
||||
object: Performance
|
||||
property: "refreshRateProfile"
|
||||
enums: Performance.getRefreshRateProfileNames()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,8 @@ import controlsUit 1.0 as HifiControls
|
|||
import "../../lib/prop" as Prop
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
Prop.PropGroup {
|
||||
id: computer
|
||||
|
|
|
@ -24,33 +24,42 @@ Rectangle {
|
|||
color: global.colorBack
|
||||
|
||||
ScrollView {
|
||||
anchors.fill: parent
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
Column {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
Column {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
Prop.PropFolderPanel {
|
||||
label: "Performance Settings"
|
||||
isUnfold: true
|
||||
panelFrameData: Component {
|
||||
PerformanceSettings {}
|
||||
Prop.PropFolderPanel {
|
||||
label: "Performance Settings"
|
||||
isUnfold: true
|
||||
panelFrameData: Component {
|
||||
PerformanceSettings {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Prop.PropFolderPanel {
|
||||
label: "Render Settings"
|
||||
isUnfold: true
|
||||
panelFrameData: Component {
|
||||
RenderSettings {}
|
||||
Prop.PropFolderPanel {
|
||||
label: "Render Settings"
|
||||
isUnfold: true
|
||||
panelFrameData: Component {
|
||||
RenderSettings {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Prop.PropFolderPanel {
|
||||
label: "Platform"
|
||||
panelFrameData: Component {
|
||||
Platform {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
Prop.PropFolderPanel {
|
||||
label: "Platform"
|
||||
panelFrameData: Component {
|
||||
Platform {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,11 +42,7 @@ function runNewDefaultsTogether() {
|
|||
}
|
||||
|
||||
|
||||
// Uncomment this out once the work is actually complete.
|
||||
// Until then, users are required to access some functionality from the top menu bar.
|
||||
//var MENU_NAMES = ["File", "Edit", "Display", "View", "Navigate", "Settings", "Developer", "Help"];
|
||||
var MENU_NAMES = ["File", "Edit", "Display", "View", "Navigate", "Help",
|
||||
"Settings > General...", "Settings > Controls...", "Settings > Audio...", "Settings > Graphics...", "Settings > Security..."];
|
||||
var MENU_NAMES = ["File", "Edit", "Display", "View", "Navigate", "Settings", "Developer", "Help"];
|
||||
var keepMenusSetting = Settings.getValue("simplifiedUI/keepMenus", false);
|
||||
function maybeRemoveDesktopMenu() {
|
||||
if (!keepMenusSetting) {
|
||||
|
@ -535,7 +531,7 @@ function shutdown() {
|
|||
restoreScripts();
|
||||
|
||||
if (!keepExistingUIAndScriptsSetting) {
|
||||
Window.confirm("You'll have to restart Interface to get full functionality back. Clicking yes or no will dismiss this dialog.");
|
||||
console.log("The Simplified UI script has been shut down. If you notice any strangeness with user interface, please restart this application.");
|
||||
|
||||
if (!HMD.active) {
|
||||
var toolbar = Toolbars.getToolbar(TOOLBAR_NAME);
|
||||
|
|
Loading…
Reference in a new issue