mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 20:58:38 +02:00
Merge branch 'master' into M22147
This commit is contained in:
commit
9c12a39368
50 changed files with 781 additions and 488 deletions
|
@ -89,7 +89,7 @@ if (APPLE)
|
||||||
string(REGEX MATCH "^[0-9]+\\.[0-9]+" OSX_VERSION ${OSX_VERSION})
|
string(REGEX MATCH "^[0-9]+\\.[0-9]+" OSX_VERSION ${OSX_VERSION})
|
||||||
message(STATUS "Detected OS X version = ${OSX_VERSION}")
|
message(STATUS "Detected OS X version = ${OSX_VERSION}")
|
||||||
|
|
||||||
set(OSX_SDK "${OSX_VERSION}" CACHE String "OS X SDK version to look for inside Xcode bundle or at OSX_SDK_PATH")
|
set(OSX_SDK "${OSX_VERSION}" CACHE STRING "OS X SDK version to look for inside Xcode bundle or at OSX_SDK_PATH")
|
||||||
|
|
||||||
# set our OS X deployment target
|
# set our OS X deployment target
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
|
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
|
||||||
|
|
22
cmake/externals/LibOVR/CMakeLists.txt
vendored
22
cmake/externals/LibOVR/CMakeLists.txt
vendored
|
@ -27,12 +27,12 @@ if (WIN32)
|
||||||
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
||||||
ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
|
ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
|
||||||
set(LIBOVR_DIR ${INSTALL_DIR})
|
set(LIBOVR_DIR ${INSTALL_DIR})
|
||||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${LIBOVR_DIR}/Include CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${LIBOVR_DIR}/Include CACHE STRING INTERNAL)
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_DEBUG ${LIBOVR_DIR}/Lib/LibOVRd.lib CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_DEBUG ${LIBOVR_DIR}/Lib/LibOVRd.lib CACHE STRING INTERNAL)
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${LIBOVR_DIR}/Lib/LibOVR.lib CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${LIBOVR_DIR}/Lib/LibOVR.lib CACHE STRING INTERNAL)
|
||||||
include(SelectLibraryConfigurations)
|
include(SelectLibraryConfigurations)
|
||||||
select_library_configurations(LIBOVR)
|
select_library_configurations(LIBOVR)
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${${EXTERNAL_NAME_UPPER}_LIBRARIES} CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${${EXTERNAL_NAME_UPPER}_LIBRARIES} CACHE STRING INTERNAL)
|
||||||
|
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
|
|
||||||
|
@ -50,11 +50,11 @@ elseif(APPLE)
|
||||||
# In theory we should use the Headers path inside the framework, as seen here
|
# In theory we should use the Headers path inside the framework, as seen here
|
||||||
# but unfortunately Oculus doesn't seem to have figured out automated testing
|
# but unfortunately Oculus doesn't seem to have figured out automated testing
|
||||||
# so they released a framework with missing headers.
|
# so they released a framework with missing headers.
|
||||||
#set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/LibOVR/Lib/Mac/Release/LibOVR.framework/Headers/ CACHE TYPE INTERNAL)
|
#set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/LibOVR/Lib/Mac/Release/LibOVR.framework/Headers/ CACHE STRING INTERNAL)
|
||||||
|
|
||||||
# Work around the broken framework by using a different path for the headers.
|
# Work around the broken framework by using a different path for the headers.
|
||||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/LibOVR/Include CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/LibOVR/Include CACHE STRING INTERNAL)
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/LibOVR/Lib/Mac/Release/LibOVR.framework/LibOVR CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/LibOVR/Lib/Mac/Release/LibOVR.framework/LibOVR CACHE STRING INTERNAL)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,8 +74,8 @@ elseif(NOT ANDROID)
|
||||||
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
||||||
ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
|
ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
|
||||||
|
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${INSTALL_DIR}/lib/libovr.a CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${INSTALL_DIR}/lib/libovr.a CACHE STRING INTERNAL)
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_DEBUG "" CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_DEBUG "" CACHE STRING INTERNAL)
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
find_package(X11 REQUIRED)
|
find_package(X11 REQUIRED)
|
||||||
|
@ -89,8 +89,8 @@ elseif(NOT ANDROID)
|
||||||
|
|
||||||
select_library_configurations(${EXTERNAL_NAME_UPPER})
|
select_library_configurations(${EXTERNAL_NAME_UPPER})
|
||||||
|
|
||||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/LibOVR/Include ${SOURCE_DIR}/LibOVR/Src CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/LibOVR/Include ${SOURCE_DIR}/LibOVR/Src CACHE STRING INTERNAL)
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${${EXTERNAL_NAME_UPPER}_LIBRARY} ${${EXTERNAL_NAME_UPPER}_LIBRARY_EXTRAS} CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${${EXTERNAL_NAME_UPPER}_LIBRARY} ${${EXTERNAL_NAME_UPPER}_LIBRARY_EXTRAS} CACHE STRING INTERNAL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Hide this external target (for ide users)
|
# Hide this external target (for ide users)
|
||||||
|
|
|
@ -20,12 +20,12 @@ if (WIN32)
|
||||||
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
||||||
|
|
||||||
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/Windows/LibOVRPlatform64_1.lib CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/Windows/LibOVRPlatform64_1.lib CACHE STRING INTERNAL)
|
||||||
else()
|
else()
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/Windows/LibOVRPlatform32_1.lib CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/Windows/LibOVRPlatform32_1.lib CACHE STRING INTERNAL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/Include CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/Include CACHE STRING INTERNAL)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Hide this external target (for ide users)
|
# Hide this external target (for ide users)
|
||||||
|
|
|
@ -36,10 +36,10 @@ set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
|
||||||
|
|
||||||
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
||||||
|
|
||||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE STRING INTERNAL)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/Release/audio.lib CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/Release/audio.lib CACHE STRING INTERNAL)
|
||||||
else()
|
else()
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/Release/libaudio.a CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${SOURCE_DIR}/Release/libaudio.a CACHE STRING INTERNAL)
|
||||||
endif()
|
endif()
|
||||||
|
|
12
cmake/externals/neuron/CMakeLists.txt
vendored
12
cmake/externals/neuron/CMakeLists.txt
vendored
|
@ -21,9 +21,9 @@ set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
|
||||||
|
|
||||||
# set include dir
|
# set include dir
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS "${SOURCE_DIR}/NeuronDataReader_Windows/include" CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS "${SOURCE_DIR}/NeuronDataReader_Windows/include" CACHE STRING INTERNAL)
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS "${SOURCE_DIR}/NeuronDataReader_Mac/include" CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS "${SOURCE_DIR}/NeuronDataReader_Mac/include" CACHE STRING INTERNAL)
|
||||||
else()
|
else()
|
||||||
# Unsupported
|
# Unsupported
|
||||||
endif()
|
endif()
|
||||||
|
@ -37,16 +37,16 @@ if(WIN32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIB_PATH "${SOURCE_DIR}/NeuronDataReader_Windows/lib/${ARCH_DIR}")
|
set(${EXTERNAL_NAME_UPPER}_LIB_PATH "${SOURCE_DIR}/NeuronDataReader_Windows/lib/${ARCH_DIR}")
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.lib" CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.lib" CACHE STRING INTERNAL)
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARIES "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.lib" CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARIES "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.lib" CACHE STRING INTERNAL)
|
||||||
|
|
||||||
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_LIB_PATH}")
|
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_LIB_PATH}")
|
||||||
|
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
|
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIB_PATH "${SOURCE_DIR}/NeuronDataReader_Mac/dylib")
|
set(${EXTERNAL_NAME_UPPER}_LIB_PATH "${SOURCE_DIR}/NeuronDataReader_Mac/dylib")
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.dylib" CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.dylib" CACHE STRING INTERNAL)
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARIES "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.dylib" CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARIES "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/NeuronDataReader.dylib" CACHE STRING INTERNAL)
|
||||||
|
|
||||||
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_LIB_PATH}")
|
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_LIB_PATH}")
|
||||||
|
|
||||||
|
|
6
cmake/externals/sixense/CMakeLists.txt
vendored
6
cmake/externals/sixense/CMakeLists.txt
vendored
|
@ -30,7 +30,7 @@ set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
|
||||||
|
|
||||||
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
||||||
|
|
||||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE STRING INTERNAL)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ if (WIN32)
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIB_PATH "${SOURCE_DIR}/lib/${ARCH_DIR}/release_dll")
|
set(${EXTERNAL_NAME_UPPER}_LIB_PATH "${SOURCE_DIR}/lib/${ARCH_DIR}/release_dll")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/sixense${ARCH_SUFFIX}.lib" CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/sixense${ARCH_SUFFIX}.lib" CACHE STRING INTERNAL)
|
||||||
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_DLL_PATH}")
|
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_DLL_PATH}")
|
||||||
|
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
|
@ -62,7 +62,7 @@ elseif(APPLE)
|
||||||
elseif(NOT ANDROID)
|
elseif(NOT ANDROID)
|
||||||
|
|
||||||
# FIXME need to account for different architectures
|
# FIXME need to account for different architectures
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/lib/linux_x64/release/libsixense_x64.so CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/lib/linux_x64/release/libsixense_x64.so CACHE STRING INTERNAL)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
8
cmake/externals/steamworks/CMakeLists.txt
vendored
8
cmake/externals/steamworks/CMakeLists.txt
vendored
|
@ -21,7 +21,7 @@ set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
|
||||||
|
|
||||||
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
||||||
|
|
||||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/public CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/public CACHE STRING INTERNAL)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|
||||||
|
@ -36,12 +36,12 @@ if (WIN32)
|
||||||
set(${EXTERNAL_NAME_UPPER}_DLL_PATH ${ARCH_DIR})
|
set(${EXTERNAL_NAME_UPPER}_DLL_PATH ${ARCH_DIR})
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIB_PATH ${ARCH_DIR})
|
set(${EXTERNAL_NAME_UPPER}_LIB_PATH ${ARCH_DIR})
|
||||||
|
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/steam_api${ARCH_SUFFIX}.lib" CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/steam_api${ARCH_SUFFIX}.lib" CACHE STRING INTERNAL)
|
||||||
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_DLL_PATH}")
|
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_DLL_PATH}")
|
||||||
|
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
|
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/redistributable_bin/osx32/libsteam_api.dylib CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/redistributable_bin/osx32/libsteam_api.dylib CACHE STRING INTERNAL)
|
||||||
|
|
||||||
set(_STEAMWORKS_LIB_DIR "${SOURCE_DIR}/redistributable_bin/osx32")
|
set(_STEAMWORKS_LIB_DIR "${SOURCE_DIR}/redistributable_bin/osx32")
|
||||||
ExternalProject_Add_Step(
|
ExternalProject_Add_Step(
|
||||||
|
@ -57,6 +57,6 @@ elseif(APPLE)
|
||||||
elseif(NOT ANDROID)
|
elseif(NOT ANDROID)
|
||||||
|
|
||||||
# FIXME need to account for different architectures
|
# FIXME need to account for different architectures
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/redistributable_bin/linux64/libsteam_api.so CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/redistributable_bin/linux64/libsteam_api.so CACHE STRING INTERNAL)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
2
cmake/externals/tbb/CMakeLists.txt
vendored
2
cmake/externals/tbb/CMakeLists.txt
vendored
|
@ -102,6 +102,6 @@ if (DEFINED _TBB_LIB_DIR)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (DEFINED ${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE)
|
if (DEFINED ${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE)
|
||||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE TYPE "List of tbb include directories")
|
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE STRING "List of tbb include directories")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
macro(TARGET_BREAKPAD)
|
macro(TARGET_BREAKPAD)
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/breakpad)
|
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/breakpad)
|
||||||
set(BREAKPAD_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE TYPE INTERNAL)
|
set(BREAKPAD_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE STRING INTERNAL)
|
||||||
set(LIB_DIR ${INSTALL_DIR}/lib)
|
set(LIB_DIR ${INSTALL_DIR}/lib)
|
||||||
list(APPEND BREAKPAD_LIBRARIES ${LIB_DIR}/libbreakpad_client.a)
|
list(APPEND BREAKPAD_LIBRARIES ${LIB_DIR}/libbreakpad_client.a)
|
||||||
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BREAKPAD_INCLUDE_DIRS})
|
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BREAKPAD_INCLUDE_DIRS})
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
macro(TARGET_BULLET)
|
macro(TARGET_BULLET)
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/bullet)
|
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/bullet)
|
||||||
set(BULLET_INCLUDE_DIRS "${INSTALL_DIR}/include/bullet" CACHE TYPE INTERNAL)
|
set(BULLET_INCLUDE_DIRS "${INSTALL_DIR}/include/bullet" CACHE STRING INTERNAL)
|
||||||
|
|
||||||
set(LIB_DIR ${INSTALL_DIR}/lib)
|
set(LIB_DIR ${INSTALL_DIR}/lib)
|
||||||
list(APPEND BULLET_LIBRARIES ${LIB_DIR}/libBulletDynamics.a)
|
list(APPEND BULLET_LIBRARIES ${LIB_DIR}/libBulletDynamics.a)
|
||||||
|
|
|
@ -3,7 +3,7 @@ macro(TARGET_DRACO)
|
||||||
find_library(LIBPATH ${LIB} PATHS )
|
find_library(LIBPATH ${LIB} PATHS )
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/draco)
|
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/draco)
|
||||||
set(DRACO_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE TYPE INTERNAL)
|
set(DRACO_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE STRING INTERNAL)
|
||||||
set(LIB_DIR ${INSTALL_DIR}/lib)
|
set(LIB_DIR ${INSTALL_DIR}/lib)
|
||||||
list(APPEND DRACO_LIBRARIES ${LIB_DIR}/libdraco.a)
|
list(APPEND DRACO_LIBRARIES ${LIB_DIR}/libdraco.a)
|
||||||
list(APPEND DRACO_LIBRARIES ${LIB_DIR}/libdracodec.a)
|
list(APPEND DRACO_LIBRARIES ${LIB_DIR}/libdracodec.a)
|
||||||
|
@ -21,4 +21,4 @@ macro(TARGET_DRACO)
|
||||||
select_library_configurations(DRACO)
|
select_library_configurations(DRACO)
|
||||||
target_link_libraries(${TARGET_NAME} ${DRACO_LIBRARY})
|
target_link_libraries(${TARGET_NAME} ${DRACO_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
|
@ -9,9 +9,9 @@ macro(TARGET_HIFIAUDIOCODEC)
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set(HIFIAC_INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/hifiAC/codecSDK)
|
set(HIFIAC_INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/hifiAC/codecSDK)
|
||||||
set(HIFIAC_LIB_DIR "${HIFIAC_INSTALL_DIR}/Release")
|
set(HIFIAC_LIB_DIR "${HIFIAC_INSTALL_DIR}/Release")
|
||||||
set(HIFIAC_INCLUDE_DIRS "${HIFIAC_INSTALL_DIR}/include" CACHE TYPE INTERNAL)
|
set(HIFIAC_INCLUDE_DIRS "${HIFIAC_INSTALL_DIR}/include" CACHE STRING INTERNAL)
|
||||||
list(APPEND HIFIAC_LIBS "${HIFIAC_LIB_DIR}/libaudio.a")
|
list(APPEND HIFIAC_LIBS "${HIFIAC_LIB_DIR}/libaudio.a")
|
||||||
set(HIFIAC_LIBRARIES ${HIFIAC_LIBS} CACHE TYPE INTERNAL)
|
set(HIFIAC_LIBRARIES ${HIFIAC_LIBS} CACHE STRING INTERNAL)
|
||||||
else()
|
else()
|
||||||
add_dependency_external_projects(hifiAudioCodec)
|
add_dependency_external_projects(hifiAudioCodec)
|
||||||
target_include_directories(${TARGET_NAME} PRIVATE ${HIFIAUDIOCODEC_INCLUDE_DIRS})
|
target_include_directories(${TARGET_NAME} PRIVATE ${HIFIAUDIOCODEC_INCLUDE_DIRS})
|
||||||
|
|
|
@ -9,12 +9,12 @@ macro(TARGET_NVTT)
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set(NVTT_INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/nvtt)
|
set(NVTT_INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/nvtt)
|
||||||
set(NVTT_LIB_DIR "${NVTT_INSTALL_DIR}/lib")
|
set(NVTT_LIB_DIR "${NVTT_INSTALL_DIR}/lib")
|
||||||
set(NVTT_INCLUDE_DIRS "${NVTT_INSTALL_DIR}/include" CACHE TYPE INTERNAL)
|
set(NVTT_INCLUDE_DIRS "${NVTT_INSTALL_DIR}/include" CACHE STRING INTERNAL)
|
||||||
list(APPEND NVTT_LIBS "${NVTT_LIB_DIR}/libnvcore.so")
|
list(APPEND NVTT_LIBS "${NVTT_LIB_DIR}/libnvcore.so")
|
||||||
list(APPEND NVTT_LIBS "${NVTT_LIB_DIR}/libnvmath.so")
|
list(APPEND NVTT_LIBS "${NVTT_LIB_DIR}/libnvmath.so")
|
||||||
list(APPEND NVTT_LIBS "${NVTT_LIB_DIR}/libnvimage.so")
|
list(APPEND NVTT_LIBS "${NVTT_LIB_DIR}/libnvimage.so")
|
||||||
list(APPEND NVTT_LIBS "${NVTT_LIB_DIR}/libnvtt.so")
|
list(APPEND NVTT_LIBS "${NVTT_LIB_DIR}/libnvtt.so")
|
||||||
set(NVTT_LIBRARIES ${NVTT_LIBS} CACHE TYPE INTERNAL)
|
set(NVTT_LIBRARIES ${NVTT_LIBS} CACHE STRING INTERNAL)
|
||||||
target_include_directories(${TARGET_NAME} PRIVATE ${NVTT_INCLUDE_DIRS})
|
target_include_directories(${TARGET_NAME} PRIVATE ${NVTT_INCLUDE_DIRS})
|
||||||
else()
|
else()
|
||||||
find_library(NVTT_LIBRARY_RELEASE nvtt PATHS ${VCPKG_INSTALL_ROOT}/lib NO_DEFAULT_PATH)
|
find_library(NVTT_LIBRARY_RELEASE nvtt PATHS ${VCPKG_INSTALL_ROOT}/lib NO_DEFAULT_PATH)
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
macro(TARGET_OPENSSL)
|
macro(TARGET_OPENSSL)
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set(OPENSSL_INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/openssl)
|
set(OPENSSL_INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/openssl)
|
||||||
set(OPENSSL_INCLUDE_DIR "${OPENSSL_INSTALL_DIR}/include" CACHE TYPE INTERNAL)
|
set(OPENSSL_INCLUDE_DIR "${OPENSSL_INSTALL_DIR}/include" CACHE STRING INTERNAL)
|
||||||
set(OPENSSL_LIBRARIES "${OPENSSL_INSTALL_DIR}/lib/libcrypto.a;${OPENSSL_INSTALL_DIR}/lib/libssl.a" CACHE TYPE INTERNAL)
|
set(OPENSSL_LIBRARIES "${OPENSSL_INSTALL_DIR}/lib/libcrypto.a;${OPENSSL_INSTALL_DIR}/lib/libssl.a" CACHE STRING INTERNAL)
|
||||||
else()
|
else()
|
||||||
# using VCPKG for OpenSSL
|
# using VCPKG for OpenSSL
|
||||||
find_package(OpenSSL REQUIRED)
|
find_package(OpenSSL REQUIRED)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
macro(TARGET_POLYVOX)
|
macro(TARGET_POLYVOX)
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/polyvox)
|
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/polyvox)
|
||||||
set(POLYVOX_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE TYPE INTERNAL)
|
set(POLYVOX_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE STRING INTERNAL)
|
||||||
set(LIB_DIR ${INSTALL_DIR}/lib)
|
set(LIB_DIR ${INSTALL_DIR}/lib)
|
||||||
list(APPEND POLYVOX_LIBRARIES ${LIB_DIR}/libPolyVoxUtil.so)
|
list(APPEND POLYVOX_LIBRARIES ${LIB_DIR}/libPolyVoxUtil.so)
|
||||||
list(APPEND POLYVOX_LIBRARIES ${LIB_DIR}/Release/libPolyVoxCore.so)
|
list(APPEND POLYVOX_LIBRARIES ${LIB_DIR}/Release/libPolyVoxCore.so)
|
||||||
|
|
|
@ -664,9 +664,10 @@ private:
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* <p>The <code>Controller.Hardware.Application</code> object has properties representing Interface's state. The property
|
* <p>The <code>Controller.Hardware.Application</code> object has properties representing Interface's state. The property
|
||||||
* values are integer IDs, uniquely identifying each output. <em>Read-only.</em> These can be mapped to actions or functions or
|
* values are integer IDs, uniquely identifying each output. <em>Read-only.</em></p>
|
||||||
* <code>Controller.Standard</code> items in a {@link RouteObject} mapping (e.g., using the {@link RouteObject#when} method).
|
* <p>These states can be mapped to actions or functions or <code>Controller.Standard</code> items in a {@link RouteObject}
|
||||||
* Each data value is either <code>1.0</code> for "true" or <code>0.0</code> for "false".</p>
|
* mapping (e.g., using the {@link RouteObject#when} method). Each data value is either <code>1.0</code> for "true" or
|
||||||
|
* <code>0.0</code> for "false".</p>
|
||||||
* <table>
|
* <table>
|
||||||
* <thead>
|
* <thead>
|
||||||
* <tr><th>Property</th><th>Type</th><th>Data</th><th>Description</th></tr>
|
* <tr><th>Property</th><th>Type</th><th>Data</th><th>Description</th></tr>
|
||||||
|
@ -680,13 +681,17 @@ private:
|
||||||
* <tr><td><code>CameraIndependent</code></td><td>number</td><td>number</td><td>The camera is in independent mode.</td></tr>
|
* <tr><td><code>CameraIndependent</code></td><td>number</td><td>number</td><td>The camera is in independent mode.</td></tr>
|
||||||
* <tr><td><code>CameraEntity</code></td><td>number</td><td>number</td><td>The camera is in entity mode.</td></tr>
|
* <tr><td><code>CameraEntity</code></td><td>number</td><td>number</td><td>The camera is in entity mode.</td></tr>
|
||||||
* <tr><td><code>InHMD</code></td><td>number</td><td>number</td><td>The user is in HMD mode.</td></tr>
|
* <tr><td><code>InHMD</code></td><td>number</td><td>number</td><td>The user is in HMD mode.</td></tr>
|
||||||
* <tr><td><code>AdvancedMovement</code></td><td>number</td><td>number</td><td>Advanced movement controls are enabled.
|
* <tr><td><code>AdvancedMovement</code></td><td>number</td><td>number</td><td>Advanced movement (walking) controls are
|
||||||
* </td></tr>
|
* enabled.</td></tr>
|
||||||
|
* <tr><td><code>StrafeEnabled</code></td><td>number</td><td>number</td><td>Strafing is enabled</td></tr>
|
||||||
* <tr><td><code>LeftHandDominant</code></td><td>number</td><td>number</td><td>Dominant hand set to left.</td></tr>
|
* <tr><td><code>LeftHandDominant</code></td><td>number</td><td>number</td><td>Dominant hand set to left.</td></tr>
|
||||||
* <tr><td><code>RightHandDominant</code></td><td>number</td><td>number</td><td>Dominant hand set to right.</td></tr>
|
* <tr><td><code>RightHandDominant</code></td><td>number</td><td>number</td><td>Dominant hand set to right.</td></tr>
|
||||||
* <tr><td><code>SnapTurn</code></td><td>number</td><td>number</td><td>Snap turn is enabled.</td></tr>
|
* <tr><td><code>SnapTurn</code></td><td>number</td><td>number</td><td>Snap turn is enabled.</td></tr>
|
||||||
* <tr><td><code>Grounded</code></td><td>number</td><td>number</td><td>The user's avatar is on the ground.</td></tr>
|
* <tr><td><code>Grounded</code></td><td>number</td><td>number</td><td>The user's avatar is on the ground.</td></tr>
|
||||||
* <tr><td><code>NavigationFocused</code></td><td>number</td><td>number</td><td><em>Not used.</em></td></tr>
|
* <tr><td><code>NavigationFocused</code></td><td>number</td><td>number</td><td><em>Not used.</em></td></tr>
|
||||||
|
* <tr><td><code>PlatformWindows</code></td><td>number</td><td>number</td><td>The operating system is Windows.</td></tr>
|
||||||
|
* <tr><td><code>PlatformMac</code></td><td>number</td><td>number</td><td>The operating system is Mac.</td></tr>
|
||||||
|
* <tr><td><code>PlatformAndroid</code></td><td>number</td><td>number</td><td>The operating system is Android.</td></tr>
|
||||||
* </tbody>
|
* </tbody>
|
||||||
* </table>
|
* </table>
|
||||||
* @typedef {object} Controller.Hardware-Application
|
* @typedef {object} Controller.Hardware-Application
|
||||||
|
@ -1330,7 +1335,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
setCrashAnnotation("avatar", avatarURL.toString().toStdString());
|
setCrashAnnotation("avatar", avatarURL.toString().toStdString());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Inititalize sample before registering
|
// Inititalize sample before registering
|
||||||
_sampleSound = DependencyManager::get<SoundCache>()->getSound(PathUtils::resourcesUrl("sounds/sample.wav"));
|
_sampleSound = DependencyManager::get<SoundCache>()->getSound(PathUtils::resourcesUrl("sounds/sample.wav"));
|
||||||
|
|
||||||
|
@ -1421,6 +1425,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
initializeDisplayPlugins();
|
initializeDisplayPlugins();
|
||||||
qCDebug(interfaceapp, "Initialized Display");
|
qCDebug(interfaceapp, "Initialized Display");
|
||||||
|
|
||||||
|
if (_displayPlugin && !_displayPlugin->isHmd()) {
|
||||||
|
_preferredCursor.set(Cursor::Manager::getIconName(Cursor::Icon::SYSTEM));
|
||||||
|
showCursor(Cursor::Manager::lookupIcon(_preferredCursor.get()));
|
||||||
|
}
|
||||||
// An audio device changed signal received before the display plugins are set up will cause a crash,
|
// An audio device changed signal received before the display plugins are set up will cause a crash,
|
||||||
// so we defer the setup of the `scripting::Audio` class until this point
|
// so we defer the setup of the `scripting::Audio` class until this point
|
||||||
{
|
{
|
||||||
|
@ -1440,8 +1448,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
audioScriptingInterface->environmentMuted();
|
audioScriptingInterface->environmentMuted();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(this, &Application::activeDisplayPluginChanged,
|
QSharedPointer<scripting::Audio> scriptingAudioSharedPointer = qSharedPointerDynamicCast<scripting::Audio>(DependencyManager::get<AudioScriptingInterface>());
|
||||||
reinterpret_cast<scripting::Audio*>(audioScriptingInterface.data()), &scripting::Audio::onContextChanged);
|
if (scriptingAudioSharedPointer) {
|
||||||
|
connect(this, &Application::activeDisplayPluginChanged,
|
||||||
|
scriptingAudioSharedPointer.data(), &scripting::Audio::onContextChanged);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the rendering engine. This can be slow on some machines due to lots of
|
// Create the rendering engine. This can be slow on some machines due to lots of
|
||||||
|
@ -1634,7 +1645,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
connect(userInputMapper.data(), &UserInputMapper::actionEvent, [this](int action, float state) {
|
connect(userInputMapper.data(), &UserInputMapper::actionEvent, [this](int action, float state) {
|
||||||
using namespace controller;
|
using namespace controller;
|
||||||
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||||
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
|
QSharedPointer<scripting::Audio> audioScriptingInterface = qSharedPointerDynamicCast<scripting::Audio>(DependencyManager::get<AudioScriptingInterface>());
|
||||||
{
|
{
|
||||||
auto actionEnum = static_cast<Action>(action);
|
auto actionEnum = static_cast<Action>(action);
|
||||||
int key = Qt::Key_unknown;
|
int key = Qt::Key_unknown;
|
||||||
|
@ -1642,10 +1653,12 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
bool navAxis = false;
|
bool navAxis = false;
|
||||||
switch (actionEnum) {
|
switch (actionEnum) {
|
||||||
case Action::TOGGLE_PUSHTOTALK:
|
case Action::TOGGLE_PUSHTOTALK:
|
||||||
if (state > 0.0f) {
|
if (audioScriptingInterface) {
|
||||||
audioScriptingInterface->setPushingToTalk(true);
|
if (state > 0.0f) {
|
||||||
} else if (state <= 0.0f) {
|
audioScriptingInterface->setPushingToTalk(true);
|
||||||
audioScriptingInterface->setPushingToTalk(false);
|
} else if (state <= 0.0f) {
|
||||||
|
audioScriptingInterface->setPushingToTalk(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -3591,7 +3604,14 @@ void Application::setPreferAvatarFingerOverStylus(bool value) {
|
||||||
|
|
||||||
void Application::setPreferredCursor(const QString& cursorName) {
|
void Application::setPreferredCursor(const QString& cursorName) {
|
||||||
qCDebug(interfaceapp) << "setPreferredCursor" << cursorName;
|
qCDebug(interfaceapp) << "setPreferredCursor" << cursorName;
|
||||||
_preferredCursor.set(cursorName.isEmpty() ? DEFAULT_CURSOR_NAME : cursorName);
|
|
||||||
|
if (_displayPlugin && _displayPlugin->isHmd()) {
|
||||||
|
_preferredCursor.set(cursorName.isEmpty() ? DEFAULT_CURSOR_NAME : cursorName);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_preferredCursor.set(cursorName.isEmpty() ? Cursor::Manager::getIconName(Cursor::Icon::SYSTEM) : cursorName);
|
||||||
|
}
|
||||||
|
|
||||||
showCursor(Cursor::Manager::lookupIcon(_preferredCursor.get()));
|
showCursor(Cursor::Manager::lookupIcon(_preferredCursor.get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4057,9 +4077,6 @@ bool Application::event(QEvent* event) {
|
||||||
case QEvent::KeyRelease:
|
case QEvent::KeyRelease:
|
||||||
keyReleaseEvent(static_cast<QKeyEvent*>(event));
|
keyReleaseEvent(static_cast<QKeyEvent*>(event));
|
||||||
return true;
|
return true;
|
||||||
case QEvent::FocusIn:
|
|
||||||
focusInEvent(static_cast<QFocusEvent*>(event));
|
|
||||||
return true;
|
|
||||||
case QEvent::FocusOut:
|
case QEvent::FocusOut:
|
||||||
focusOutEvent(static_cast<QFocusEvent*>(event));
|
focusOutEvent(static_cast<QFocusEvent*>(event));
|
||||||
return true;
|
return true;
|
||||||
|
@ -4102,6 +4119,11 @@ bool Application::eventFilter(QObject* object, QEvent* event) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto eventType = event->type();
|
||||||
|
if (eventType == QEvent::KeyPress || eventType == QEvent::KeyRelease || eventType == QEvent::MouseMove) {
|
||||||
|
getRefreshRateManager().resetInactiveTimer();
|
||||||
|
}
|
||||||
|
|
||||||
if (event->type() == QEvent::Leave) {
|
if (event->type() == QEvent::Leave) {
|
||||||
getApplicationCompositor().handleLeaveEvent();
|
getApplicationCompositor().handleLeaveEvent();
|
||||||
}
|
}
|
||||||
|
@ -4291,6 +4313,10 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
||||||
if (isMeta) {
|
if (isMeta) {
|
||||||
auto audioClient = DependencyManager::get<AudioClient>();
|
auto audioClient = DependencyManager::get<AudioClient>();
|
||||||
audioClient->setMuted(!audioClient->isMuted());
|
audioClient->setMuted(!audioClient->isMuted());
|
||||||
|
QSharedPointer<scripting::Audio> audioScriptingInterface = qSharedPointerDynamicCast<scripting::Audio>(DependencyManager::get<AudioScriptingInterface>());
|
||||||
|
if (audioScriptingInterface && audioScriptingInterface->getPTT()) {
|
||||||
|
audioScriptingInterface->setPushingToTalk(!audioClient->isMuted());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -4413,13 +4439,6 @@ void Application::keyReleaseEvent(QKeyEvent* event) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::focusInEvent(QFocusEvent* event) {
|
|
||||||
if (!_aboutToQuit && _startUpFinished) {
|
|
||||||
getRefreshRateManager().setRefreshRateRegime(RefreshRateManager::RefreshRateRegime::RUNNING);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Application::focusOutEvent(QFocusEvent* event) {
|
void Application::focusOutEvent(QFocusEvent* event) {
|
||||||
auto inputPlugins = PluginManager::getInstance()->getInputPlugins();
|
auto inputPlugins = PluginManager::getInstance()->getInputPlugins();
|
||||||
foreach(auto inputPlugin, inputPlugins) {
|
foreach(auto inputPlugin, inputPlugins) {
|
||||||
|
@ -4427,10 +4446,6 @@ void Application::focusOutEvent(QFocusEvent* event) {
|
||||||
inputPlugin->pluginFocusOutEvent();
|
inputPlugin->pluginFocusOutEvent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_aboutToQuit && _startUpFinished) {
|
|
||||||
getRefreshRateManager().setRefreshRateRegime(RefreshRateManager::RefreshRateRegime::UNFOCUS);
|
|
||||||
}
|
|
||||||
// FIXME spacemouse code still needs cleanup
|
// FIXME spacemouse code still needs cleanup
|
||||||
#if 0
|
#if 0
|
||||||
//SpacemouseDevice::getInstance().focusOutEvent();
|
//SpacemouseDevice::getInstance().focusOutEvent();
|
||||||
|
@ -5041,7 +5056,7 @@ void Application::idle() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
checkChangeCursor();
|
checkChangeCursor();
|
||||||
|
|
||||||
#if !defined(DISABLE_QML)
|
#if !defined(DISABLE_QML)
|
||||||
|
@ -5352,8 +5367,10 @@ void Application::loadSettings() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
|
QSharedPointer<scripting::Audio> audioScriptingInterface = qSharedPointerDynamicCast<scripting::Audio>(DependencyManager::get<AudioScriptingInterface>());
|
||||||
audioScriptingInterface->loadData();
|
if (audioScriptingInterface) {
|
||||||
|
audioScriptingInterface->loadData();
|
||||||
|
}
|
||||||
|
|
||||||
getMyAvatar()->loadData();
|
getMyAvatar()->loadData();
|
||||||
_settingsLoaded = true;
|
_settingsLoaded = true;
|
||||||
|
@ -5364,8 +5381,10 @@ void Application::saveSettings() const {
|
||||||
DependencyManager::get<AudioClient>()->saveSettings();
|
DependencyManager::get<AudioClient>()->saveSettings();
|
||||||
DependencyManager::get<LODManager>()->saveSettings();
|
DependencyManager::get<LODManager>()->saveSettings();
|
||||||
|
|
||||||
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
|
QSharedPointer<scripting::Audio> audioScriptingInterface = qSharedPointerDynamicCast<scripting::Audio>(DependencyManager::get<AudioScriptingInterface>());
|
||||||
audioScriptingInterface->saveData();
|
if (audioScriptingInterface) {
|
||||||
|
audioScriptingInterface->saveData();
|
||||||
|
}
|
||||||
|
|
||||||
Menu::getInstance()->saveSettings();
|
Menu::getInstance()->saveSettings();
|
||||||
getMyAvatar()->saveData();
|
getMyAvatar()->saveData();
|
||||||
|
@ -5599,7 +5618,7 @@ void Application::resumeAfterLoginDialogActionTaken() {
|
||||||
_myCamera.setMode(_previousCameraMode);
|
_myCamera.setMode(_previousCameraMode);
|
||||||
cameraModeChanged();
|
cameraModeChanged();
|
||||||
_startUpFinished = true;
|
_startUpFinished = true;
|
||||||
getRefreshRateManager().setRefreshRateRegime(RefreshRateManager::RefreshRateRegime::RUNNING);
|
getRefreshRateManager().setRefreshRateRegime(RefreshRateManager::RefreshRateRegime::FOCUS_ACTIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::loadAvatarScripts(const QVector<QString>& urls) {
|
void Application::loadAvatarScripts(const QVector<QString>& urls) {
|
||||||
|
@ -8456,28 +8475,30 @@ bool Application::takeSnapshotOperators(std::queue<SnapshotOperator>& snapshotOp
|
||||||
|
|
||||||
void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio, const QString& filename) {
|
void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio, const QString& filename) {
|
||||||
addSnapshotOperator(std::make_tuple([notify, includeAnimated, aspectRatio, filename](const QImage& snapshot) {
|
addSnapshotOperator(std::make_tuple([notify, includeAnimated, aspectRatio, filename](const QImage& snapshot) {
|
||||||
QString path = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation());
|
qApp->postLambdaEvent([snapshot, notify, includeAnimated, aspectRatio, filename] {
|
||||||
|
QString path = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation());
|
||||||
|
|
||||||
// If we're not doing an animated snapshot as well...
|
// If we're not doing an animated snapshot as well...
|
||||||
if (!includeAnimated) {
|
if (!includeAnimated) {
|
||||||
if (!path.isEmpty()) {
|
if (!path.isEmpty()) {
|
||||||
// Tell the dependency manager that the capture of the still snapshot has taken place.
|
// Tell the dependency manager that the capture of the still snapshot has taken place.
|
||||||
emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(path, notify);
|
emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(path, notify);
|
||||||
}
|
}
|
||||||
} else if (!SnapshotAnimated::isAlreadyTakingSnapshotAnimated()) {
|
} else if (!SnapshotAnimated::isAlreadyTakingSnapshotAnimated()) {
|
||||||
qApp->postLambdaEvent([path, aspectRatio] {
|
|
||||||
// Get an animated GIF snapshot and save it
|
// Get an animated GIF snapshot and save it
|
||||||
SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, DependencyManager::get<WindowScriptingInterface>());
|
SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, DependencyManager::get<WindowScriptingInterface>());
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
}, aspectRatio, true));
|
}, aspectRatio, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::takeSecondaryCameraSnapshot(const bool& notify, const QString& filename) {
|
void Application::takeSecondaryCameraSnapshot(const bool& notify, const QString& filename) {
|
||||||
addSnapshotOperator(std::make_tuple([notify, filename](const QImage& snapshot) {
|
addSnapshotOperator(std::make_tuple([notify, filename](const QImage& snapshot) {
|
||||||
QString snapshotPath = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation());
|
qApp->postLambdaEvent([snapshot, notify, filename] {
|
||||||
|
QString snapshotPath = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation());
|
||||||
|
|
||||||
emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, notify);
|
emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, notify);
|
||||||
|
});
|
||||||
}, 0.0f, false));
|
}, 0.0f, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8542,11 +8563,20 @@ void Application::activeChanged(Qt::ApplicationState state) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case Qt::ApplicationActive:
|
case Qt::ApplicationActive:
|
||||||
_isForeground = true;
|
_isForeground = true;
|
||||||
|
if (!_aboutToQuit && _startUpFinished) {
|
||||||
|
getRefreshRateManager().setRefreshRateRegime(RefreshRateManager::RefreshRateRegime::FOCUS_ACTIVE);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Qt::ApplicationSuspended:
|
case Qt::ApplicationSuspended:
|
||||||
|
break;
|
||||||
case Qt::ApplicationHidden:
|
case Qt::ApplicationHidden:
|
||||||
|
break;
|
||||||
case Qt::ApplicationInactive:
|
case Qt::ApplicationInactive:
|
||||||
|
if (!_aboutToQuit && _startUpFinished) {
|
||||||
|
getRefreshRateManager().setRefreshRateRegime(RefreshRateManager::RefreshRateRegime::UNFOCUS);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
_isForeground = false;
|
_isForeground = false;
|
||||||
break;
|
break;
|
||||||
|
@ -8877,7 +8907,7 @@ void Application::setDisplayPlugin(DisplayPluginPointer newDisplayPlugin) {
|
||||||
RefreshRateManager& refreshRateManager = getRefreshRateManager();
|
RefreshRateManager& refreshRateManager = getRefreshRateManager();
|
||||||
refreshRateManager.setRefreshRateOperator(OpenGLDisplayPlugin::getRefreshRateOperator());
|
refreshRateManager.setRefreshRateOperator(OpenGLDisplayPlugin::getRefreshRateOperator());
|
||||||
bool isHmd = newDisplayPlugin->isHmd();
|
bool isHmd = newDisplayPlugin->isHmd();
|
||||||
RefreshRateManager::UXMode uxMode = isHmd ? RefreshRateManager::UXMode::HMD :
|
RefreshRateManager::UXMode uxMode = isHmd ? RefreshRateManager::UXMode::VR :
|
||||||
RefreshRateManager::UXMode::DESKTOP;
|
RefreshRateManager::UXMode::DESKTOP;
|
||||||
|
|
||||||
refreshRateManager.setUXMode(uxMode);
|
refreshRateManager.setUXMode(uxMode);
|
||||||
|
|
|
@ -20,37 +20,40 @@
|
||||||
|
|
||||||
#include <display-plugins/hmd/HmdDisplayPlugin.h>
|
#include <display-plugins/hmd/HmdDisplayPlugin.h>
|
||||||
|
|
||||||
static const int HMD_TARGET_RATE = 90;
|
static const int VR_TARGET_RATE = 90;
|
||||||
|
|
||||||
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" } };
|
||||||
|
|
||||||
static const std::array<std::string, RefreshRateManager::RefreshRateRegime::REGIME_NUM> REFRESH_RATE_REGIME_TO_STRING =
|
static const std::array<std::string, RefreshRateManager::RefreshRateRegime::REGIME_NUM> REFRESH_RATE_REGIME_TO_STRING =
|
||||||
{ { "Running", "Unfocus", "Minimized", "StartUp", "ShutDown" } };
|
{ { "FocusActive", "FocusInactive", "Unfocus", "Minimized", "StartUp", "ShutDown" } };
|
||||||
|
|
||||||
static const std::array<std::string, RefreshRateManager::UXMode::UX_NUM> UX_MODE_TO_STRING =
|
static const std::array<std::string, RefreshRateManager::UXMode::UX_NUM> UX_MODE_TO_STRING =
|
||||||
{ { "Desktop", "HMD" } };
|
{ { "Desktop", "VR" } };
|
||||||
|
|
||||||
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 } };
|
||||||
|
|
||||||
static const std::array<int, RefreshRateManager::RefreshRateProfile::PROFILE_NUM> RUNNING_REGIME_PROFILES =
|
|
||||||
{ { 5, 20, 60 } };
|
|
||||||
|
|
||||||
static const std::array<int, RefreshRateManager::RefreshRateProfile::PROFILE_NUM> UNFOCUS_REGIME_PROFILES =
|
// Porfile regimes are:
|
||||||
{ { 5, 5, 10 } };
|
// { { "FocusActive", "FocusInactive", "Unfocus", "Minimized", "StartUp", "ShutDown" } }
|
||||||
|
|
||||||
static const std::array<int, RefreshRateManager::RefreshRateProfile::PROFILE_NUM> MINIMIZED_REGIME_PROFILE =
|
static const std::array<int, RefreshRateManager::RefreshRateRegime::REGIME_NUM> ECO_PROFILE =
|
||||||
{ { 2, 2, 2 } };
|
{ { 20, 10, 5, 2, 30, 30 } };
|
||||||
|
|
||||||
static const std::array<int, RefreshRateManager::RefreshRateProfile::PROFILE_NUM> START_AND_SHUTDOWN_REGIME_PROFILES =
|
static const std::array<int, RefreshRateManager::RefreshRateRegime::REGIME_NUM> INTERACTIVE_PROFILE =
|
||||||
{ { 30, 30, 30 } };
|
{ { 30, 20, 10, 2, 30, 30 } };
|
||||||
|
|
||||||
static const std::array<std::array<int, RefreshRateManager::RefreshRateProfile::PROFILE_NUM>, RefreshRateManager::RefreshRateRegime::REGIME_NUM> REFRESH_RATE_REGIMES =
|
static const std::array<int, RefreshRateManager::RefreshRateRegime::REGIME_NUM> REALTIME_PROFILE =
|
||||||
{ { RUNNING_REGIME_PROFILES, UNFOCUS_REGIME_PROFILES, MINIMIZED_REGIME_PROFILE,
|
{ { 60, 60, 10, 2, 30, 30} };
|
||||||
START_AND_SHUTDOWN_REGIME_PROFILES, START_AND_SHUTDOWN_REGIME_PROFILES } };
|
|
||||||
|
static const std::array<std::array<int, RefreshRateManager::RefreshRateRegime::REGIME_NUM>, RefreshRateManager::RefreshRateProfile::PROFILE_NUM> REFRESH_RATE_PROFILES =
|
||||||
|
{ { ECO_PROFILE, INTERACTIVE_PROFILE, REALTIME_PROFILE } };
|
||||||
|
|
||||||
|
|
||||||
|
static const int INACTIVE_TIMER_LIMIT = 3000;
|
||||||
|
|
||||||
|
|
||||||
std::string RefreshRateManager::refreshRateProfileToString(RefreshRateManager::RefreshRateProfile refreshRateProfile) {
|
std::string RefreshRateManager::refreshRateProfileToString(RefreshRateManager::RefreshRateProfile refreshRateProfile) {
|
||||||
|
@ -70,14 +73,36 @@ std::string RefreshRateManager::uxModeToString(RefreshRateManager::RefreshRateMa
|
||||||
}
|
}
|
||||||
|
|
||||||
RefreshRateManager::RefreshRateManager() {
|
RefreshRateManager::RefreshRateManager() {
|
||||||
_refreshRateProfile = (RefreshRateManager::RefreshRateProfile) _refreshRateMode.get();
|
_refreshRateProfile = (RefreshRateManager::RefreshRateProfile) _refreshRateProfileSetting.get();
|
||||||
|
_inactiveTimer->setInterval(INACTIVE_TIMER_LIMIT);
|
||||||
|
_inactiveTimer->setSingleShot(true);
|
||||||
|
QObject::connect(_inactiveTimer.get(), &QTimer::timeout, [&] {
|
||||||
|
toggleInactive();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void RefreshRateManager::resetInactiveTimer() {
|
||||||
|
if (_uxMode == RefreshRateManager::UXMode::DESKTOP) {
|
||||||
|
auto regime = getRefreshRateRegime();
|
||||||
|
if (regime == RefreshRateRegime::FOCUS_ACTIVE || regime == RefreshRateRegime::FOCUS_INACTIVE) {
|
||||||
|
_inactiveTimer->start();
|
||||||
|
setRefreshRateRegime(RefreshRateManager::RefreshRateRegime::FOCUS_ACTIVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RefreshRateManager::toggleInactive() {
|
||||||
|
if (_uxMode == RefreshRateManager::UXMode::DESKTOP &&
|
||||||
|
getRefreshRateRegime() == RefreshRateManager::RefreshRateRegime::FOCUS_ACTIVE) {
|
||||||
|
setRefreshRateRegime(RefreshRateManager::RefreshRateRegime::FOCUS_INACTIVE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefreshRateManager::setRefreshRateProfile(RefreshRateManager::RefreshRateProfile refreshRateProfile) {
|
void RefreshRateManager::setRefreshRateProfile(RefreshRateManager::RefreshRateProfile refreshRateProfile) {
|
||||||
if (_refreshRateProfile != refreshRateProfile) {
|
if (_refreshRateProfile != refreshRateProfile) {
|
||||||
_refreshRateModeLock.withWriteLock([&] {
|
_refreshRateProfileSettingLock.withWriteLock([&] {
|
||||||
_refreshRateProfile = refreshRateProfile;
|
_refreshRateProfile = refreshRateProfile;
|
||||||
_refreshRateMode.set((int) refreshRateProfile);
|
_refreshRateProfileSetting.set((int) refreshRateProfile);
|
||||||
});
|
});
|
||||||
updateRefreshRateController();
|
updateRefreshRateController();
|
||||||
}
|
}
|
||||||
|
@ -86,9 +111,9 @@ void RefreshRateManager::setRefreshRateProfile(RefreshRateManager::RefreshRatePr
|
||||||
RefreshRateManager::RefreshRateProfile RefreshRateManager::getRefreshRateProfile() const {
|
RefreshRateManager::RefreshRateProfile RefreshRateManager::getRefreshRateProfile() const {
|
||||||
RefreshRateManager::RefreshRateProfile profile = RefreshRateManager::RefreshRateProfile::REALTIME;
|
RefreshRateManager::RefreshRateProfile profile = RefreshRateManager::RefreshRateProfile::REALTIME;
|
||||||
|
|
||||||
if (getUXMode() != RefreshRateManager::UXMode::HMD) {
|
if (getUXMode() != RefreshRateManager::UXMode::VR) {
|
||||||
profile =(RefreshRateManager::RefreshRateProfile) _refreshRateModeLock.resultWithReadLock<int>([&] {
|
profile =(RefreshRateManager::RefreshRateProfile) _refreshRateProfileSettingLock.resultWithReadLock<int>([&] {
|
||||||
return _refreshRateMode.get();
|
return _refreshRateProfileSetting.get();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,8 +121,11 @@ RefreshRateManager::RefreshRateProfile RefreshRateManager::getRefreshRateProfile
|
||||||
}
|
}
|
||||||
|
|
||||||
RefreshRateManager::RefreshRateRegime RefreshRateManager::getRefreshRateRegime() const {
|
RefreshRateManager::RefreshRateRegime RefreshRateManager::getRefreshRateRegime() const {
|
||||||
return getUXMode() == RefreshRateManager::UXMode::HMD ? RefreshRateManager::RefreshRateRegime::RUNNING :
|
if (getUXMode() == RefreshRateManager::UXMode::VR) {
|
||||||
_refreshRateRegime;
|
return RefreshRateManager::RefreshRateRegime::FOCUS_ACTIVE;
|
||||||
|
} else {
|
||||||
|
return _refreshRateRegime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefreshRateManager::setRefreshRateRegime(RefreshRateManager::RefreshRateRegime refreshRateRegime) {
|
void RefreshRateManager::setRefreshRateRegime(RefreshRateManager::RefreshRateRegime refreshRateRegime) {
|
||||||
|
@ -119,31 +147,12 @@ void RefreshRateManager::updateRefreshRateController() const {
|
||||||
if (_refreshRateOperator) {
|
if (_refreshRateOperator) {
|
||||||
int targetRefreshRate;
|
int targetRefreshRate;
|
||||||
if (_uxMode == RefreshRateManager::UXMode::DESKTOP) {
|
if (_uxMode == RefreshRateManager::UXMode::DESKTOP) {
|
||||||
if (_refreshRateRegime == RefreshRateManager::RefreshRateRegime::RUNNING &&
|
targetRefreshRate = REFRESH_RATE_PROFILES[_refreshRateProfile][_refreshRateRegime];
|
||||||
_refreshRateProfile == RefreshRateManager::RefreshRateProfile::INTERACTIVE) {
|
|
||||||
targetRefreshRate = getInteractiveRefreshRate();
|
|
||||||
} else {
|
|
||||||
targetRefreshRate = REFRESH_RATE_REGIMES[_refreshRateRegime][_refreshRateProfile];
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
targetRefreshRate = HMD_TARGET_RATE;
|
targetRefreshRate = VR_TARGET_RATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_refreshRateOperator(targetRefreshRate);
|
_refreshRateOperator(targetRefreshRate);
|
||||||
_activeRefreshRate = targetRefreshRate;
|
_activeRefreshRate = targetRefreshRate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefreshRateManager::setInteractiveRefreshRate(int refreshRate) {
|
|
||||||
_refreshRateLock.withWriteLock([&] {
|
|
||||||
_interactiveRefreshRate.set(refreshRate);
|
|
||||||
});
|
|
||||||
updateRefreshRateController();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int RefreshRateManager::getInteractiveRefreshRate() const {
|
|
||||||
return _refreshRateLock.resultWithReadLock<int>([&] {
|
|
||||||
return _interactiveRefreshRate.get();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
#include <SettingHandle.h>
|
#include <SettingHandle.h>
|
||||||
#include <shared/ReadWriteLockable.h>
|
#include <shared/ReadWriteLockable.h>
|
||||||
|
|
||||||
|
@ -28,7 +30,8 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
enum RefreshRateRegime {
|
enum RefreshRateRegime {
|
||||||
RUNNING = 0,
|
FOCUS_ACTIVE = 0,
|
||||||
|
FOCUS_INACTIVE,
|
||||||
UNFOCUS,
|
UNFOCUS,
|
||||||
MINIMIZED,
|
MINIMIZED,
|
||||||
STARTUP,
|
STARTUP,
|
||||||
|
@ -38,7 +41,7 @@ public:
|
||||||
|
|
||||||
enum UXMode {
|
enum UXMode {
|
||||||
DESKTOP = 0,
|
DESKTOP = 0,
|
||||||
HMD,
|
VR,
|
||||||
UX_NUM
|
UX_NUM
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,8 +60,9 @@ public:
|
||||||
void setRefreshRateOperator(std::function<void(int)> refreshRateOperator) { _refreshRateOperator = refreshRateOperator; }
|
void setRefreshRateOperator(std::function<void(int)> refreshRateOperator) { _refreshRateOperator = refreshRateOperator; }
|
||||||
int getActiveRefreshRate() const { return _activeRefreshRate; }
|
int getActiveRefreshRate() const { return _activeRefreshRate; }
|
||||||
void updateRefreshRateController() const;
|
void updateRefreshRateController() const;
|
||||||
void setInteractiveRefreshRate(int refreshRate);
|
|
||||||
int getInteractiveRefreshRate() const;
|
void resetInactiveTimer();
|
||||||
|
void toggleInactive();
|
||||||
|
|
||||||
static std::string refreshRateProfileToString(RefreshRateProfile refreshRateProfile);
|
static std::string refreshRateProfileToString(RefreshRateProfile refreshRateProfile);
|
||||||
static RefreshRateProfile refreshRateProfileFromString(std::string refreshRateProfile);
|
static RefreshRateProfile refreshRateProfileFromString(std::string refreshRateProfile);
|
||||||
|
@ -66,18 +70,17 @@ public:
|
||||||
static std::string refreshRateRegimeToString(RefreshRateRegime refreshRateRegime);
|
static std::string refreshRateRegimeToString(RefreshRateRegime refreshRateRegime);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable ReadWriteLockable _refreshRateLock;
|
|
||||||
mutable ReadWriteLockable _refreshRateModeLock;
|
|
||||||
|
|
||||||
mutable int _activeRefreshRate { 20 };
|
mutable int _activeRefreshRate { 20 };
|
||||||
RefreshRateProfile _refreshRateProfile { RefreshRateProfile::INTERACTIVE};
|
RefreshRateProfile _refreshRateProfile { RefreshRateProfile::INTERACTIVE};
|
||||||
RefreshRateRegime _refreshRateRegime { RefreshRateRegime::STARTUP };
|
RefreshRateRegime _refreshRateRegime { RefreshRateRegime::STARTUP };
|
||||||
UXMode _uxMode;
|
UXMode _uxMode;
|
||||||
|
|
||||||
Setting::Handle<int> _interactiveRefreshRate { "interactiveRefreshRate", 20};
|
mutable ReadWriteLockable _refreshRateProfileSettingLock;
|
||||||
Setting::Handle<int> _refreshRateMode { "refreshRateProfile", INTERACTIVE };
|
Setting::Handle<int> _refreshRateProfileSetting { "refreshRateProfile", RefreshRateProfile::INTERACTIVE };
|
||||||
|
|
||||||
std::function<void(int)> _refreshRateOperator { nullptr };
|
std::function<void(int)> _refreshRateOperator { nullptr };
|
||||||
|
|
||||||
|
std::shared_ptr<QTimer> _inactiveTimer { std::make_shared<QTimer>() };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include <EntityItemID.h>
|
#include <EntityItemID.h>
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* The Clipboard API enables you to export and import entities to and from JSON files.
|
* The <code>Clipboard</code> API enables you to export and import entities to and from JSON files.
|
||||||
*
|
*
|
||||||
* @namespace Clipboard
|
* @namespace Clipboard
|
||||||
*
|
*
|
||||||
|
@ -33,56 +33,92 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Compute the extents of the contents held in the clipboard.
|
* Gets the extents of the entities held in the clipboard.
|
||||||
* @function Clipboard.getContentsDimensions
|
* @function Clipboard.getContentsDimensions
|
||||||
* @returns {Vec3} The extents of the contents held in the clipboard.
|
* @returns {Vec3} The extents of the content held in the clipboard.
|
||||||
|
* @example <caption>Import entities to the clipboard and report their overall dimensions.</caption>
|
||||||
|
* var filename = Window.browse("Import entities to clipboard", "", "*.json");
|
||||||
|
* if (filename) {
|
||||||
|
* if (Clipboard.importEntities(filename)) {
|
||||||
|
* print("Clipboard dimensions: " + JSON.stringify(Clipboard.getContentsDimensions()));
|
||||||
|
* }
|
||||||
|
* }
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE glm::vec3 getContentsDimensions();
|
Q_INVOKABLE glm::vec3 getContentsDimensions();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Compute the largest dimension of the extents of the contents held in the clipboard.
|
* Gets the largest dimension of the extents of the entities held in the clipboard.
|
||||||
* @function Clipboard.getClipboardContentsLargestDimension
|
* @function Clipboard.getClipboardContentsLargestDimension
|
||||||
* @returns {number} The largest dimension computed.
|
* @returns {number} The largest dimension of the extents of the content held in the clipboard.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE float getClipboardContentsLargestDimension();
|
Q_INVOKABLE float getClipboardContentsLargestDimension();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Import entities from a JSON file containing entity data into the clipboard.
|
* Imports entities from a JSON file into the clipboard.
|
||||||
* You can generate a JSON file using {@link Clipboard.exportEntities}.
|
|
||||||
* @function Clipboard.importEntities
|
* @function Clipboard.importEntities
|
||||||
* @param {string} filename Path and name of file to import.
|
* @param {string} filename - The path and name of the JSON file to import.
|
||||||
* @param {boolean} does the ResourceRequestObserver observe this request?
|
* @param {boolean} [isObservable=true] - <code>true</code> if the {@link ResourceRequestObserver} can observe this
|
||||||
* @param {number} optional internal id of object causing this import.
|
* request, <code>false</code> if it can't.
|
||||||
|
* @param {number} [callerID=-1] - An integer ID that is passed through to the {@link ResourceRequestObserver}.
|
||||||
* @returns {boolean} <code>true</code> if the import was successful, otherwise <code>false</code>.
|
* @returns {boolean} <code>true</code> if the import was successful, otherwise <code>false</code>.
|
||||||
|
* @example <caption>Import entities and paste into the domain.</caption>
|
||||||
|
* var filename = Window.browse("Import entities to clipboard", "", "*.json");
|
||||||
|
* if (filename) {
|
||||||
|
* if (Clipboard.importEntities(filename)) {
|
||||||
|
* pastedEntities = Clipboard.pasteEntities(Vec3.sum(MyAvatar.position,
|
||||||
|
* Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })));
|
||||||
|
* print("Entities pasted: " + JSON.stringify(pastedEntities));
|
||||||
|
* }
|
||||||
|
* }
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE bool importEntities(const QString& filename, const bool isObservable = true, const qint64 callerId = -1);
|
Q_INVOKABLE bool importEntities(const QString& filename, const bool isObservable = true, const qint64 callerId = -1);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Export the entities specified to a JSON file.
|
* Exports specified entities to a JSON file.
|
||||||
* @function Clipboard.exportEntities
|
* @function Clipboard.exportEntities
|
||||||
* @param {string} filename Path and name of the file to export the entities to. Should have the extension ".json".
|
* @param {string} filename - Path and name of the file to export the entities to. Should have the extension ".json".
|
||||||
* @param {Uuid[]} entityIDs Array of IDs of the entities to export.
|
* @param {Uuid[]} entityIDs - The IDs of the entities to export.
|
||||||
* @returns {boolean} <code>true</code> if the export was successful, otherwise <code>false</code>.
|
* @returns {boolean} <code>true</code> if entities were found and the file was written, otherwise <code>false</code>.
|
||||||
|
* @example <caption>Create and export a cube and a sphere.</caption>
|
||||||
|
* // Create entities.
|
||||||
|
* var box = Entities.addEntity({
|
||||||
|
* type: "Box",
|
||||||
|
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: -0.2, y: 0, z: -3 })),
|
||||||
|
* lifetime: 300 // Delete after 5 minutes.
|
||||||
|
* });
|
||||||
|
* var sphere = Entities.addEntity({
|
||||||
|
* type: "Sphere",
|
||||||
|
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0.2, y: 0, z: -3 })),
|
||||||
|
* lifetime: 300 // Delete after 5 minutes.
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* // Export entities.
|
||||||
|
* var filename = Window.save("Export entities to JSON file", Paths.resources, "*.json");
|
||||||
|
* if (filename) {
|
||||||
|
* Clipboard.exportEntities(filename, [box, sphere]);
|
||||||
|
* }
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE bool exportEntities(const QString& filename, const QVector<QUuid>& entityIDs);
|
Q_INVOKABLE bool exportEntities(const QString& filename, const QVector<QUuid>& entityIDs);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Export the entities with centers within a cube to a JSON file.
|
* Exports all entities that have centers within a cube to a JSON file.
|
||||||
* @function Clipboard.exportEntities
|
* @function Clipboard.exportEntities
|
||||||
* @param {string} filename Path and name of the file to export the entities to. Should have the extension ".json".
|
* @variation 0
|
||||||
* @param {number} x X-coordinate of the cube center.
|
* @param {string} filename - Path and name of the file to export the entities to. Should have the extension ".json".
|
||||||
* @param {number} y Y-coordinate of the cube center.
|
* @param {number} x - X-coordinate of the cube center.
|
||||||
* @param {number} z Z-coordinate of the cube center.
|
* @param {number} y - Y-coordinate of the cube center.
|
||||||
* @param {number} scale Half dimension of the cube.
|
* @param {number} z - Z-coordinate of the cube center.
|
||||||
* @returns {boolean} <code>true</code> if the export was successful, otherwise <code>false</code>.
|
* @param {number} scale - Half dimension of the cube.
|
||||||
|
* @returns {boolean} <code>true</code> if entities were found and the file was written, otherwise <code>false</code>.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE bool exportEntities(const QString& filename, float x, float y, float z, float scale);
|
Q_INVOKABLE bool exportEntities(const QString& filename, float x, float y, float z, float scale);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Paste the contents of the clipboard into the world.
|
* Pastes the contents of the clipboard into the domain.
|
||||||
* @function Clipboard.pasteEntities
|
* @function Clipboard.pasteEntities
|
||||||
* @param {Vec3} position Position to paste the clipboard contents at.
|
* @param {Vec3} position - The position to paste the clipboard contents at.
|
||||||
* @returns {Uuid[]} Array of entity IDs for the new entities that were created as a result of the paste operation.
|
* @returns {Uuid[]} The IDs of the new entities that were created as a result of the paste operation. If entities couldn't
|
||||||
|
* be created then an empty array is returned.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE QVector<EntityItemID> pasteEntities(glm::vec3 position);
|
Q_INVOKABLE QVector<EntityItemID> pasteEntities(glm::vec3 position);
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,18 +26,20 @@ class ScriptEngine;
|
||||||
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* The Controller API provides facilities to interact with computer and controller hardware.
|
* The <code>Controller</code> API provides facilities to interact with computer and controller hardware.
|
||||||
*
|
*
|
||||||
* <h5>Functions</h5>
|
* <h3>Facilities</h3>
|
||||||
*
|
*
|
||||||
* <p>Properties</p>
|
* <h4>Properties</h4>
|
||||||
|
* <p>Get <code>Controller</code> property trees.</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link Controller.getActions|getActions}</li>
|
* <li>{@link Controller.getActions|getActions}</li>
|
||||||
* <li>{@link Controller.getHardware|getHardware}</li>
|
* <li>{@link Controller.getHardware|getHardware}</li>
|
||||||
* <li>{@link Controller.getStandard|getStandard}</li>
|
* <li>{@link Controller.getStandard|getStandard}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p>Mappings</p>
|
* <h4>Mappings</h4>
|
||||||
|
* <p>Create and enable or disable <code>Controller</code> mappings.</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link Controller.disableMapping|disableMapping}</li>
|
* <li>{@link Controller.disableMapping|disableMapping}</li>
|
||||||
* <li>{@link Controller.enableMapping|enableMapping}</li>
|
* <li>{@link Controller.enableMapping|enableMapping}</li>
|
||||||
|
@ -46,7 +48,8 @@ class ScriptEngine;
|
||||||
* <li>{@link Controller.parseMapping|parseMapping}</li>
|
* <li>{@link Controller.parseMapping|parseMapping}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p>Input, Hardware, and Action Reflection</p>
|
* <h4>Input, Hardware, and Action Reflection</h4>
|
||||||
|
* <p>Information on the devices and actions available.</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link Controller.findAction|findAction}</li>
|
* <li>{@link Controller.findAction|findAction}</li>
|
||||||
* <li>{@link Controller.findDevice|findDevice}</li>
|
* <li>{@link Controller.findDevice|findDevice}</li>
|
||||||
|
@ -55,16 +58,20 @@ class ScriptEngine;
|
||||||
* <li>{@link Controller.getAvailableInputs|getAvailableInputs}</li>
|
* <li>{@link Controller.getAvailableInputs|getAvailableInputs}</li>
|
||||||
* <li>{@link Controller.getDeviceName|getDeviceName}</li>
|
* <li>{@link Controller.getDeviceName|getDeviceName}</li>
|
||||||
* <li>{@link Controller.getDeviceNames|getDeviceNames}</li>
|
* <li>{@link Controller.getDeviceNames|getDeviceNames}</li>
|
||||||
|
* <li>{@link Controller.getRunningInputDevices|getRunningInputDevices}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p>Input, Hardware, and Action Events</p>
|
* <h4>Input, Hardware, and Action Signals</h4>
|
||||||
|
* <p>Notifications of device and action events.</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link Controller.actionEvent|actionEvent}</li>
|
* <li>{@link Controller.actionEvent|actionEvent}</li>
|
||||||
* <li>{@link Controller.hardwareChanged|hardwareChanged}</li>
|
* <li>{@link Controller.hardwareChanged|hardwareChanged}</li>
|
||||||
|
* <li>{@link Controller.inputDeviceRunningChanged|inputDeviceRunningChanged}</li>
|
||||||
* <li>{@link Controller.inputEvent|inputEvent}</li>
|
* <li>{@link Controller.inputEvent|inputEvent}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p>Mouse, Keyboard, and Touch Events</p>
|
* <h4>Mouse, Keyboard, and Touch Signals</h4>
|
||||||
|
* <p>Notifications of mouse, keyboard, and touch events.</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link Controller.keyPressEvent|keyPressEvent}</li>
|
* <li>{@link Controller.keyPressEvent|keyPressEvent}</li>
|
||||||
* <li>{@link Controller.keyReleaseEvent|keyReleaseEvent}</li>
|
* <li>{@link Controller.keyReleaseEvent|keyReleaseEvent}</li>
|
||||||
|
@ -78,29 +85,32 @@ class ScriptEngine;
|
||||||
* <li>{@link Controller.wheelEvent|wheelEvent}</li>
|
* <li>{@link Controller.wheelEvent|wheelEvent}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p>Control Capturing</p>
|
* <h4>Control Capturing</h4>
|
||||||
|
* <p>Disable and enable the processing of mouse and touch events.</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link Controller.captureMouseEvents|captureMouseEvents}</li>
|
* <li>{@link Controller.captureMouseEvents|captureMouseEvents}</li>
|
||||||
* <li>{@link Controller.captureTouchEvents|captureTouchEvents}</li>
|
|
||||||
* <li>{@link Controller.captureWheelEvents|captureWheelEvents}</li>
|
* <li>{@link Controller.captureWheelEvents|captureWheelEvents}</li>
|
||||||
|
* <li>{@link Controller.captureTouchEvents|captureTouchEvents}</li>
|
||||||
* <li>{@link Controller.releaseMouseEvents|releaseMouseEvents}</li>
|
* <li>{@link Controller.releaseMouseEvents|releaseMouseEvents}</li>
|
||||||
* <li>{@link Controller.releaseTouchEvents|releaseTouchEvents}</li>
|
|
||||||
* <li>{@link Controller.releaseWheelEvents|releaseWheelEvents}</li>
|
* <li>{@link Controller.releaseWheelEvents|releaseWheelEvents}</li>
|
||||||
|
* <li>{@link Controller.releaseTouchEvents|releaseTouchEvents}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p>Action Capturing</p>
|
* <h4>Action Capturing</h4>
|
||||||
|
* <p>Disable and enable controller actions.</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link Controller.captureActionEvents|captureActionEvents}</li>
|
* <li>{@link Controller.captureActionEvents|captureActionEvents}</li>
|
||||||
* <li>{@link Controller.captureEntityClickEvents|captureEntityClickEvents}</li>
|
|
||||||
* <li>{@link Controller.captureJoystick|captureJoystick}</li>
|
|
||||||
* <li>{@link Controller.captureKeyEvents|captureKeyEvents}</li>
|
* <li>{@link Controller.captureKeyEvents|captureKeyEvents}</li>
|
||||||
|
* <li>{@link Controller.captureJoystick|captureJoystick}</li>
|
||||||
|
* <li>{@link Controller.captureEntityClickEvents|captureEntityClickEvents}</li>
|
||||||
* <li>{@link Controller.releaseActionEvents|releaseActionEvents}</li>
|
* <li>{@link Controller.releaseActionEvents|releaseActionEvents}</li>
|
||||||
* <li>{@link Controller.releaseEntityClickEvents|releaseEntityClickEvents}</li>
|
|
||||||
* <li>{@link Controller.releaseJoystick|releaseJoystick}</li>
|
|
||||||
* <li>{@link Controller.releaseKeyEvents|releaseKeyEvents}</li>
|
* <li>{@link Controller.releaseKeyEvents|releaseKeyEvents}</li>
|
||||||
|
* <li>{@link Controller.releaseJoystick|releaseJoystick}</li>
|
||||||
|
* <li>{@link Controller.releaseEntityClickEvents|releaseEntityClickEvents}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p>Controller and Action Values</p>
|
* <h4>Controller and Action Values</h4>
|
||||||
|
* <p>Get the current value of controller outputs and actions.</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link Controller.getValue|getValue}</li>
|
* <li>{@link Controller.getValue|getValue}</li>
|
||||||
* <li>{@link Controller.getAxisValue|getAxisValue}</li>
|
* <li>{@link Controller.getAxisValue|getAxisValue}</li>
|
||||||
|
@ -108,7 +118,8 @@ class ScriptEngine;
|
||||||
* <li>{@link Controller.getActionValue|getActionValue}</li>
|
* <li>{@link Controller.getActionValue|getActionValue}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p>Haptics</p>
|
* <h4>Haptics</h4>
|
||||||
|
* <p>Trigger haptic pulses.</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link Controller.triggerHapticPulse|triggerHapticPulse}</li>
|
* <li>{@link Controller.triggerHapticPulse|triggerHapticPulse}</li>
|
||||||
* <li>{@link Controller.triggerHapticPulseOnDevice|triggerHapticPulseOnDevice}</li>
|
* <li>{@link Controller.triggerHapticPulseOnDevice|triggerHapticPulseOnDevice}</li>
|
||||||
|
@ -116,20 +127,23 @@ class ScriptEngine;
|
||||||
* <li>{@link Controller.triggerShortHapticPulseOnDevice|triggerShortHapticPulseOnDevice}</li>
|
* <li>{@link Controller.triggerShortHapticPulseOnDevice|triggerShortHapticPulseOnDevice}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p>Display Information</p>
|
* <h4>Display Information</h4>
|
||||||
|
* <p>Get information on the display.</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link Controller.getViewportDimensions|getViewportDimensions}</li>
|
* <li>{@link Controller.getViewportDimensions|getViewportDimensions}</li>
|
||||||
* <li>{@link Controller.getRecommendedHUDRect|getRecommendedHUDRect}</li>
|
* <li>{@link Controller.getRecommendedHUDRect|getRecommendedHUDRect}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p>Virtual Game Pad</p>
|
* <h4>Virtual Game Pad</h4>
|
||||||
|
* <p>Use the virtual game pad which is available on some devices.</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link Controller.setVPadEnabled|setVPadEnabled}</li>
|
* <li>{@link Controller.setVPadEnabled|setVPadEnabled}</li>
|
||||||
* <li>{@link Controller.setVPadHidden|setVPadHidden}</li>
|
* <li>{@link Controller.setVPadHidden|setVPadHidden}</li>
|
||||||
* <li>{@link Controller.setVPadExtraBottomMargin|setVPadExtraBottomMargin}</li>
|
* <li>{@link Controller.setVPadExtraBottomMargin|setVPadExtraBottomMargin}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p>Input Recordings</p>
|
* <h4>Input Recordings</h4>
|
||||||
|
* <p>Create and play input recordings.</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link Controller.startInputRecording|startInputRecording}</li>
|
* <li>{@link Controller.startInputRecording|startInputRecording}</li>
|
||||||
* <li>{@link Controller.stopInputRecording|stopInputRecording}</li>
|
* <li>{@link Controller.stopInputRecording|stopInputRecording}</li>
|
||||||
|
@ -140,10 +154,10 @@ class ScriptEngine;
|
||||||
* <li>{@link Controller.stopInputPlayback|stopInputPlayback}</li>
|
* <li>{@link Controller.stopInputPlayback|stopInputPlayback}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <h5>Entity Methods:</h5>
|
* <h3>Entity Methods</h3>
|
||||||
*
|
*
|
||||||
* <p>The default scripts implement hand controller actions that use {@link Entities.callEntityMethod} to call entity script
|
* <p>The default scripts implement hand controller actions that use {@link Entities.callEntityMethod} to call entity script
|
||||||
* methods, if present in the entity being interacted with.</p>
|
* methods, if present, in the entity being interacted with.</p>
|
||||||
*
|
*
|
||||||
* <table>
|
* <table>
|
||||||
* <thead>
|
* <thead>
|
||||||
|
@ -203,7 +217,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>.
|
||||||
* <em>Read-only.</em><br />
|
* <em>Read-only.</em><br /><br />
|
||||||
* Default mappings are provided from the <code>Controller.Hardware.Keyboard</code> and <code>Controller.Standard</code> to
|
* Default mappings are provided from the <code>Controller.Hardware.Keyboard</code> and <code>Controller.Standard</code> to
|
||||||
* actions in
|
* actions in
|
||||||
* <a href="https://github.com/highfidelity/hifi/blob/master/interface/resources/controllers/keyboardMouse.json">
|
* <a href="https://github.com/highfidelity/hifi/blob/master/interface/resources/controllers/keyboardMouse.json">
|
||||||
|
@ -217,7 +231,7 @@ class ScriptEngine;
|
||||||
* controller outputs. <em>Read-only.</em>
|
* 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><br />
|
* functions in a {@link RouteObject} mapping. <em>Read-only.</em><br /><br />
|
||||||
* Each hardware device has a mapping from its outputs to <code>Controller.Standard</code> items, specified in a JSON file.
|
* Each hardware device has a mapping from its outputs to <code>Controller.Standard</code> items, specified in a JSON file.
|
||||||
* 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
|
||||||
|
@ -253,7 +267,7 @@ public:
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Disable default Interface actions for a particular key event.
|
* Disables default Interface actions for a particular key event.
|
||||||
* @function Controller.captureKeyEvents
|
* @function Controller.captureKeyEvents
|
||||||
* @param {KeyEvent} event - Details of the key event to be captured. The <code>key</code> property must be specified. The
|
* @param {KeyEvent} event - Details of the key event to be captured. The <code>key</code> property must be specified. The
|
||||||
* <code>text</code> property is ignored. The other properties default to <code>false</code>.
|
* <code>text</code> property is ignored. The other properties default to <code>false</code>.
|
||||||
|
@ -272,7 +286,7 @@ public slots:
|
||||||
virtual void captureKeyEvents(const KeyEvent& event);
|
virtual void captureKeyEvents(const KeyEvent& event);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Re-enable default Interface actions for a particular key event that has been disabled using
|
* Re-enables default Interface actions for a particular key event that has been disabled using
|
||||||
* {@link Controller.captureKeyEvents|captureKeyEvents}.
|
* {@link Controller.captureKeyEvents|captureKeyEvents}.
|
||||||
* @function Controller.releaseKeyEvents
|
* @function Controller.releaseKeyEvents
|
||||||
* @param {KeyEvent} event - Details of the key event to release from capture. The <code>key</code> property must be
|
* @param {KeyEvent} event - Details of the key event to release from capture. The <code>key</code> property must be
|
||||||
|
@ -281,7 +295,7 @@ public slots:
|
||||||
virtual void releaseKeyEvents(const KeyEvent& event);
|
virtual void releaseKeyEvents(const KeyEvent& event);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Disable default Interface actions for a joystick.
|
* Disables default Interface actions for a joystick.
|
||||||
* @function Controller.captureJoystick
|
* @function Controller.captureJoystick
|
||||||
* @param {number} joystickID - The integer ID of the joystick.
|
* @param {number} joystickID - The integer ID of the joystick.
|
||||||
* @deprecated This function is deprecated and will be removed. It no longer has any effect.
|
* @deprecated This function is deprecated and will be removed. It no longer has any effect.
|
||||||
|
@ -289,7 +303,7 @@ public slots:
|
||||||
virtual void captureJoystick(int joystickIndex);
|
virtual void captureJoystick(int joystickIndex);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Re-enable default Interface actions for a joystick that has been disabled using
|
* Re-enables default Interface actions for a joystick that has been disabled using
|
||||||
* {@link Controller.captureJoystick|captureJoystick}.
|
* {@link Controller.captureJoystick|captureJoystick}.
|
||||||
* @function Controller.releaseJoystick
|
* @function Controller.releaseJoystick
|
||||||
* @param {number} joystickID - The integer ID of the joystick.
|
* @param {number} joystickID - The integer ID of the joystick.
|
||||||
|
@ -298,7 +312,7 @@ public slots:
|
||||||
virtual void releaseJoystick(int joystickIndex);
|
virtual void releaseJoystick(int joystickIndex);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Disable {@link Entities.mousePressOnEntity} and {@link Entities.mouseDoublePressOnEntity} events on entities.
|
* Disables {@link Entities.mousePressOnEntity} and {@link Entities.mouseDoublePressOnEntity} events on entities.
|
||||||
* @function Controller.captureEntityClickEvents
|
* @function Controller.captureEntityClickEvents
|
||||||
* @example <caption>Disable entity click events for a short period.</caption>
|
* @example <caption>Disable entity click events for a short period.</caption>
|
||||||
* Entities.mousePressOnEntity.connect(function (entityID, event) {
|
* Entities.mousePressOnEntity.connect(function (entityID, event) {
|
||||||
|
@ -316,7 +330,7 @@ public slots:
|
||||||
virtual void captureEntityClickEvents();
|
virtual void captureEntityClickEvents();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Re-enable {@link Entities.mousePressOnEntity} and {@link Entities.mouseDoublePressOnEntity} events on entities that were
|
* Re-enables {@link Entities.mousePressOnEntity} and {@link Entities.mouseDoublePressOnEntity} events on entities that were
|
||||||
* disabled using {@link Controller.captureEntityClickEvents|captureEntityClickEvents}.
|
* disabled using {@link Controller.captureEntityClickEvents|captureEntityClickEvents}.
|
||||||
* @function Controller.releaseEntityClickEvents
|
* @function Controller.releaseEntityClickEvents
|
||||||
*/
|
*/
|
||||||
|
@ -324,14 +338,14 @@ public slots:
|
||||||
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get the dimensions of the Interface window's interior if in desktop mode or the HUD surface if in HMD mode.
|
* Gets the dimensions of the Interface window's interior if in desktop mode or the HUD surface if in HMD mode.
|
||||||
* @function Controller.getViewportDimensions
|
* @function Controller.getViewportDimensions
|
||||||
* @returns {Vec2} The dimensions of the Interface window interior if in desktop mode or HUD surface if in HMD mode.
|
* @returns {Vec2} The dimensions of the Interface window interior if in desktop mode or HUD surface if in HMD mode.
|
||||||
*/
|
*/
|
||||||
virtual glm::vec2 getViewportDimensions() const;
|
virtual glm::vec2 getViewportDimensions() const;
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get the recommended area to position UI on the HUD surface if in HMD mode or Interface's window interior if in desktop
|
* Gets the recommended area to position UI on the HUD surface if in HMD mode or Interface's window interior if in desktop
|
||||||
* mode.
|
* mode.
|
||||||
* @function Controller.getRecommendedHUDRect
|
* @function Controller.getRecommendedHUDRect
|
||||||
* @returns {Rect} The recommended area in which to position UI.
|
* @returns {Rect} The recommended area in which to position UI.
|
||||||
|
|
|
@ -1428,7 +1428,7 @@ int Avatar::getJointIndex(const QString& name) const {
|
||||||
|
|
||||||
withValidJointIndicesCache([&]() {
|
withValidJointIndicesCache([&]() {
|
||||||
if (_modelJointIndicesCache.contains(name)) {
|
if (_modelJointIndicesCache.contains(name)) {
|
||||||
result = _modelJointIndicesCache[name] - 1;
|
result = _modelJointIndicesCache.value(name) - 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
|
@ -1439,9 +1439,7 @@ QStringList Avatar::getJointNames() const {
|
||||||
withValidJointIndicesCache([&]() {
|
withValidJointIndicesCache([&]() {
|
||||||
// find out how large the vector needs to be
|
// find out how large the vector needs to be
|
||||||
int maxJointIndex = -1;
|
int maxJointIndex = -1;
|
||||||
QHashIterator<QString, int> k(_modelJointIndicesCache);
|
for (auto k = _modelJointIndicesCache.constBegin(); k != _modelJointIndicesCache.constEnd(); k++) {
|
||||||
while (k.hasNext()) {
|
|
||||||
k.next();
|
|
||||||
int index = k.value();
|
int index = k.value();
|
||||||
if (index > maxJointIndex) {
|
if (index > maxJointIndex) {
|
||||||
maxJointIndex = index;
|
maxJointIndex = index;
|
||||||
|
@ -1450,9 +1448,7 @@ QStringList Avatar::getJointNames() const {
|
||||||
// iterate through the hash and put joint names
|
// iterate through the hash and put joint names
|
||||||
// into the vector at their indices
|
// into the vector at their indices
|
||||||
QVector<QString> resultVector(maxJointIndex+1);
|
QVector<QString> resultVector(maxJointIndex+1);
|
||||||
QHashIterator<QString, int> i(_modelJointIndicesCache);
|
for (auto i = _modelJointIndicesCache.constBegin(); i != _modelJointIndicesCache.constEnd(); i++) {
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
int index = i.value();
|
int index = i.value();
|
||||||
resultVector[index] = i.key();
|
resultVector[index] = i.key();
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ void SkeletonModel::simulate(float deltaTime, bool fullUpdate) {
|
||||||
Parent::simulate(deltaTime, fullUpdate);
|
Parent::simulate(deltaTime, fullUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: This texture loading logic should probably live in Avatar, to mirror RenderableModelEntityItem and ModelOverlay,
|
// FIXME: This texture loading logic should probably live in Avatar, to mirror RenderableModelEntityItem,
|
||||||
// but Avatars don't get updates in the same way
|
// but Avatars don't get updates in the same way
|
||||||
if (!_texturesLoaded && getGeometry() && getGeometry()->areTexturesLoaded()) {
|
if (!_texturesLoaded && getGeometry() && getGeometry()->areTexturesLoaded()) {
|
||||||
_texturesLoaded = true;
|
_texturesLoaded = true;
|
||||||
|
|
|
@ -35,9 +35,9 @@ namespace controller {
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* <p>The <code>Controller.Actions</code> object has properties representing predefined actions on the user's avatar and
|
* <p>The <code>Controller.Actions</code> object has properties representing predefined actions on the user's avatar and
|
||||||
* Interface. The property values are integer IDs, uniquely identifying each action. <em>Read-only.</em> These can be used
|
* Interface. The property values are integer IDs, uniquely identifying each action. <em>Read-only.</em></p>
|
||||||
* as end points in the routes of a {@link MappingObject}. The data routed to each action is either a number or a
|
* <p>These actions can be used as end points in the routes of a {@link MappingObject}. The data item routed to each action
|
||||||
* {@link Pose}.</p>
|
* is either a number or a {@link Pose}.</p>
|
||||||
*
|
*
|
||||||
* <table>
|
* <table>
|
||||||
* <thead>
|
* <thead>
|
||||||
|
@ -178,7 +178,7 @@ namespace controller {
|
||||||
* person view.</td></tr>
|
* person view.</td></tr>
|
||||||
* <tr><td><code>CycleCamera</code></td><td>number</td><td>number</td><td>Cycle the camera view from first person, to
|
* <tr><td><code>CycleCamera</code></td><td>number</td><td>number</td><td>Cycle the camera view from first person, to
|
||||||
* third person, to full screen mirror, then back to first person and repeat.</td></tr>
|
* third person, to full screen mirror, then back to first person and repeat.</td></tr>
|
||||||
* <tr><td><code>ContextMenu</code></td><td>number</td><td>number</td><td>Show / hide the tablet.</td></tr>
|
* <tr><td><code>ContextMenu</code></td><td>number</td><td>number</td><td>Show/hide the tablet.</td></tr>
|
||||||
* <tr><td><code>ToggleMute</code></td><td>number</td><td>number</td><td>Toggle the microphone mute.</td></tr>
|
* <tr><td><code>ToggleMute</code></td><td>number</td><td>number</td><td>Toggle the microphone mute.</td></tr>
|
||||||
* <tr><td><code>TogglePushToTalk</code></td><td>number</td><td>number</td><td>Toggle push to talk.</td></tr>
|
* <tr><td><code>TogglePushToTalk</code></td><td>number</td><td>number</td><td>Toggle push to talk.</td></tr>
|
||||||
* <tr><td><code>ToggleOverlay</code></td><td>number</td><td>number</td><td>Toggle the display of overlays.</td></tr>
|
* <tr><td><code>ToggleOverlay</code></td><td>number</td><td>number</td><td>Toggle the display of overlays.</td></tr>
|
||||||
|
@ -238,71 +238,49 @@ namespace controller {
|
||||||
* <tr><td><code>LEFT_HAND</code></td><td>number</td><td>{@link Pose}</td><td><span class="important">Deprecated: This
|
* <tr><td><code>LEFT_HAND</code></td><td>number</td><td>{@link Pose}</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use <code>LeftHand</code> instead.</span></td></tr>
|
* action is deprecated and will be removed. Use <code>LeftHand</code> instead.</span></td></tr>
|
||||||
* <tr><td><code>RIGHT_HAND</code></td><td>number</td><td>{@link Pose}</td><td><span class="important">Deprecated: This
|
* <tr><td><code>RIGHT_HAND</code></td><td>number</td><td>{@link Pose}</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>RightHand</code> instead.</span></td></tr>
|
||||||
* <code>RightHand</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>BOOM_IN</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>BOOM_IN</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>BoomIn</code> instead.</span></td></tr>
|
||||||
* <code>BoomIn</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>BOOM_OUT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>BOOM_OUT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>BoomOut</code> instead.</span></td></tr>
|
||||||
* <code>BoomOut</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>CONTEXT_MENU</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>CONTEXT_MENU</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>ContextMenu</code> instead.</span></td></tr>
|
||||||
* <code>ContextMenu</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>TOGGLE_MUTE</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>TOGGLE_MUTE</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>ToggleMute</code> instead.</span></td></tr>
|
||||||
* <code>ToggleMute</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>TOGGLE_PUSHTOTALK</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>TOGGLE_PUSHTOTALK</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>TogglePushToTalk</code> instead.</span></td></tr>
|
||||||
* <code>TogglePushToTalk</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>SPRINT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>SPRINT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>Sprint</code> instead.</span></td></tr>
|
||||||
* <code>Sprint</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>LONGITUDINAL_BACKWARD</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>LONGITUDINAL_BACKWARD</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>Backward</code> instead.</span></td></tr>
|
||||||
* <code>Backward</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>LONGITUDINAL_FORWARD</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>LONGITUDINAL_FORWARD</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>Forward</code> instead.</span></td></tr>
|
||||||
* <code>Forward</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>LATERAL_LEFT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>LATERAL_LEFT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>StrafeLeft</code> instead.</span></td></tr>
|
||||||
* <code>StrafeLeft</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>LATERAL_RIGHT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>LATERAL_RIGHT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>StrafeRight</code> instead.</span></td></tr>
|
||||||
* <code>StrafeRight</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>VERTICAL_UP</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>VERTICAL_UP</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>Up</code> instead.</span></td></tr>
|
||||||
* <code>Up</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>VERTICAL_DOWN</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>VERTICAL_DOWN</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>Down</code> instead.</span></td></tr>
|
||||||
* <code>Down</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>PITCH_DOWN</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>PITCH_DOWN</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>PitchDown</code> instead.</span></td></tr>
|
||||||
* <code>PitchDown</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>PITCH_UP</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>PITCH_UP</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>PitchUp</code> instead.</span></td></tr>
|
||||||
* <code>PitchUp</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>YAW_LEFT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>YAW_LEFT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>YawLeft</code> instead.</span></td></tr>
|
||||||
* <code>YawLeft</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>YAW_RIGHT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>YAW_RIGHT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>YawRight</code> instead.</span></td></tr>
|
||||||
* <code>YawRight</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>LEFT_HAND_CLICK</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>LEFT_HAND_CLICK</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>LeftHandClick</code> instead.</span></td></tr>
|
||||||
* <code>LeftHandClick</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>RIGHT_HAND_CLICK</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>RIGHT_HAND_CLICK</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>RightHandClick</code> instead.</span></td></tr>
|
||||||
* <code>RightHandClick</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>SHIFT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>SHIFT</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>Shift</code> instead.</span></td></tr>
|
||||||
* <code>Shift</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>ACTION1</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>ACTION1</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>PrimaryAction</code> instead.</span></td></tr>
|
||||||
* <code>PrimaryAction</code> instead.</span></td></tr>
|
|
||||||
* <tr><td><code>ACTION2</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
* <tr><td><code>ACTION2</code></td><td>number</td><td>number</td><td><span class="important">Deprecated: This
|
||||||
* action is deprecated and will be removed. Use
|
* action is deprecated and will be removed. Use <code>SecondaryAction</code> instead.</span></td></tr>
|
||||||
* <code>SecondaryAction</code> instead.</span></td></tr>
|
|
||||||
*
|
*
|
||||||
* <tr><td colSpan=4><strong>Deprecated Trackers</strong></td>
|
* <tr><td colSpan=4><strong>Deprecated Trackers</strong></td>
|
||||||
* <tr><td><code>TrackedObject00</code></td><td>number</td><td>{@link Pose}</td><td><span class="important">Deprecated:
|
* <tr><td><code>TrackedObject00</code></td><td>number</td><td>{@link Pose}</td><td><span class="important">Deprecated:
|
||||||
|
|
|
@ -54,10 +54,9 @@ enum Hand {
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* <p>The <code>Controller.Hardware</code> object has properties representing standard and hardware-specific controller and
|
* <p>The <code>Controller.Hardware</code> object has properties representing standard and hardware-specific controller and
|
||||||
* computer outputs, plus predefined actions on Interface and the user's avatar. <em>Read-only.</em> The outputs can be mapped
|
* computer outputs, plus predefined actions on Interface and the user's avatar. <em>Read-only.</em></p>
|
||||||
* to actions or functions in a {@link RouteObject} mapping. Additionally, hardware-specific controller outputs can be mapped
|
* <p>The outputs can be mapped to actions or functions in a {@link RouteObject} mapping. Additionally, hardware-specific
|
||||||
* to standard controller outputs.
|
* controller outputs can be mapped to standard controller outputs.
|
||||||
*
|
|
||||||
* <p>Controllers typically implement a subset of the {@link Controller.Standard} controls, plus they may implement some extras.
|
* <p>Controllers typically implement a subset of the {@link Controller.Standard} controls, plus they may implement some extras.
|
||||||
* Some common controllers are included in the table. You can see the outputs provided by these and others by
|
* Some common controllers are included in the table. You can see the outputs provided by these and others by
|
||||||
* viewing their {@link Controller.MappingJSON|MappingJSON} files at
|
* viewing their {@link Controller.MappingJSON|MappingJSON} files at
|
||||||
|
|
|
@ -227,6 +227,7 @@ namespace controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
QObject* ScriptingInterface::loadMapping(const QString& jsonUrl) {
|
QObject* ScriptingInterface::loadMapping(const QString& jsonUrl) {
|
||||||
|
// FIXME: Implement. https://highfidelity.manuscript.com/f/cases/14188/Implement-Controller-loadMappping
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace controller {
|
||||||
virtual ~ScriptingInterface() {};
|
virtual ~ScriptingInterface() {};
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get a list of all available actions.
|
* Gets a list of all available actions.
|
||||||
* @function Controller.getAllActions
|
* @function Controller.getAllActions
|
||||||
* @returns {Action[]} All available actions.
|
* @returns {Action[]} All available actions.
|
||||||
* @deprecated This function is deprecated and will be removed. It no longer works.
|
* @deprecated This function is deprecated and will be removed. It no longer works.
|
||||||
|
@ -82,7 +82,7 @@ namespace controller {
|
||||||
Q_INVOKABLE QVector<Action> getAllActions();
|
Q_INVOKABLE QVector<Action> getAllActions();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get a list of all available inputs for a hardware device.
|
* Gets a list of all available inputs for a hardware device.
|
||||||
* @function Controller.getAvailableInputs
|
* @function Controller.getAvailableInputs
|
||||||
* @param {number} deviceID - Integer ID of the hardware device.
|
* @param {number} deviceID - Integer ID of the hardware device.
|
||||||
* @returns {NamedPair[]} All available inputs for the device.
|
* @returns {NamedPair[]} All available inputs for the device.
|
||||||
|
@ -92,7 +92,7 @@ namespace controller {
|
||||||
Q_INVOKABLE QVector<Input::NamedPair> getAvailableInputs(unsigned int device);
|
Q_INVOKABLE QVector<Input::NamedPair> getAvailableInputs(unsigned int device);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Find the name of a particular controller from its device ID.
|
* Finds the name of a particular controller from its device ID.
|
||||||
* @function Controller.getDeviceName
|
* @function Controller.getDeviceName
|
||||||
* @param {number} deviceID - The integer ID of the device.
|
* @param {number} deviceID - The integer ID of the device.
|
||||||
* @returns {string} The name of the device if found, otherwise <code>"unknown"</code>.
|
* @returns {string} The name of the device if found, otherwise <code>"unknown"</code>.
|
||||||
|
@ -106,7 +106,7 @@ namespace controller {
|
||||||
Q_INVOKABLE QString getDeviceName(unsigned int device);
|
Q_INVOKABLE QString getDeviceName(unsigned int device);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get the current value of an action.
|
* Gets the current value of an action.
|
||||||
* @function Controller.getActionValue
|
* @function Controller.getActionValue
|
||||||
* @param {number} actionID - The integer ID of the action.
|
* @param {number} actionID - The integer ID of the action.
|
||||||
* @returns {number} The current value of the action.
|
* @returns {number} The current value of the action.
|
||||||
|
@ -121,7 +121,7 @@ namespace controller {
|
||||||
Q_INVOKABLE float getActionValue(int action);
|
Q_INVOKABLE float getActionValue(int action);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Find the ID of a specific controller from its device name.
|
* Finds the ID of a specific controller from its device name.
|
||||||
* @function Controller.findDevice
|
* @function Controller.findDevice
|
||||||
* @param {string} deviceName - The name of the device to find.
|
* @param {string} deviceName - The name of the device to find.
|
||||||
* @returns {number} The integer ID of the device if available, otherwise <code>65535</code>.
|
* @returns {number} The integer ID of the device if available, otherwise <code>65535</code>.
|
||||||
|
@ -132,7 +132,7 @@ namespace controller {
|
||||||
Q_INVOKABLE int findDevice(QString name);
|
Q_INVOKABLE int findDevice(QString name);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get the names of all currently available controller devices plus "Actions", "Application", and "Standard".
|
* Gets the names of all currently available controller devices plus "Actions", "Application", and "Standard".
|
||||||
* @function Controller.getDeviceNames
|
* @function Controller.getDeviceNames
|
||||||
* @returns {string[]} An array of device names.
|
* @returns {string[]} An array of device names.
|
||||||
* @example <caption>Get the names of all currently available controller devices.</caption>
|
* @example <caption>Get the names of all currently available controller devices.</caption>
|
||||||
|
@ -143,7 +143,7 @@ namespace controller {
|
||||||
Q_INVOKABLE QVector<QString> getDeviceNames();
|
Q_INVOKABLE QVector<QString> getDeviceNames();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Find the ID of an action from its name.
|
* Finds the ID of an action from its name.
|
||||||
* @function Controller.findAction
|
* @function Controller.findAction
|
||||||
* @param {string} actionName - The name of the action: one of the {@link Controller.Actions} property names.
|
* @param {string} actionName - The name of the action: one of the {@link Controller.Actions} property names.
|
||||||
* @returns {number} The integer ID of the action if found, otherwise <code>4095</code>. Note that this value is not
|
* @returns {number} The integer ID of the action if found, otherwise <code>4095</code>. Note that this value is not
|
||||||
|
@ -156,7 +156,7 @@ namespace controller {
|
||||||
Q_INVOKABLE int findAction(QString actionName);
|
Q_INVOKABLE int findAction(QString actionName);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get the names of all actions available as properties of {@link Controller.Actions}.
|
* Gets the names of all actions available as properties of {@link Controller.Actions}.
|
||||||
* @function Controller.getActionNames
|
* @function Controller.getActionNames
|
||||||
* @returns {string[]} An array of action names.
|
* @returns {string[]} An array of action names.
|
||||||
* @example <caption>Get the names of all actions.</caption>
|
* @example <caption>Get the names of all actions.</caption>
|
||||||
|
@ -167,7 +167,7 @@ namespace controller {
|
||||||
Q_INVOKABLE QVector<QString> getActionNames() const;
|
Q_INVOKABLE QVector<QString> getActionNames() const;
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get the value of a controller button or axis output. Note: Also gets the value of a controller axis output.
|
* Gets the value of a controller button or axis output. Note: Also gets the value of a controller axis output.
|
||||||
* @function Controller.getValue
|
* @function Controller.getValue
|
||||||
* @param {number} source - The {@link Controller.Standard} or {@link Controller.Hardware} item.
|
* @param {number} source - The {@link Controller.Standard} or {@link Controller.Hardware} item.
|
||||||
* @returns {number} The current value of the controller item output if <code>source</code> is valid, otherwise
|
* @returns {number} The current value of the controller item output if <code>source</code> is valid, otherwise
|
||||||
|
@ -186,7 +186,7 @@ namespace controller {
|
||||||
Q_INVOKABLE float getValue(const int& source) const;
|
Q_INVOKABLE float getValue(const int& source) const;
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get the value of a controller axis output. Note: Also gets the value of a controller button output.
|
* Gets the value of a controller axis output. Note: Also gets the value of a controller button output.
|
||||||
* @function Controller.getAxisValue
|
* @function Controller.getAxisValue
|
||||||
* @param {number} source - The {@link Controller.Standard} or {@link Controller.Hardware} item.
|
* @param {number} source - The {@link Controller.Standard} or {@link Controller.Hardware} item.
|
||||||
* @returns {number} The current value of the controller item output if <code>source</code> is valid, otherwise
|
* @returns {number} The current value of the controller item output if <code>source</code> is valid, otherwise
|
||||||
|
@ -196,7 +196,7 @@ namespace controller {
|
||||||
Q_INVOKABLE float getAxisValue(int source) const;
|
Q_INVOKABLE float getAxisValue(int source) const;
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get the value of a controller pose output.
|
* Gets the value of a controller pose output.
|
||||||
* @function Controller.getPoseValue
|
* @function Controller.getPoseValue
|
||||||
* @param {number} source - The {@link Controller.Standard} or {@link Controller.Hardware} pose output.
|
* @param {number} source - The {@link Controller.Standard} or {@link Controller.Hardware} pose output.
|
||||||
* @returns {Pose} The current value of the controller pose output if <code>source</code> is a pose output, otherwise
|
* @returns {Pose} The current value of the controller pose output if <code>source</code> is a pose output, otherwise
|
||||||
|
@ -210,9 +210,9 @@ namespace controller {
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Triggers a haptic pulse on connected and enabled devices that have the capability.
|
* Triggers a haptic pulse on connected and enabled devices that have the capability.
|
||||||
* @function Controller.triggerHapticPulse
|
* @function Controller.triggerHapticPulse
|
||||||
* @param {number} strength - The strength of the haptic pulse, <code>0.0</code> – <code>1.0</code>.
|
* @param {number} strength - The strength of the haptic pulse, range <code>0.0</code> – <code>1.0</code>.
|
||||||
* @param {number} duration - The duration of the haptic pulse, in milliseconds.
|
* @param {number} duration - The duration of the haptic pulse, in milliseconds.
|
||||||
* @param {Controller.Hand} hand=2 - The hand or hands to trigger the haptic pulse on.
|
* @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on.
|
||||||
* @example <caption>Trigger a haptic pulse on the right hand.</caption>
|
* @example <caption>Trigger a haptic pulse on the right hand.</caption>
|
||||||
* var HAPTIC_STRENGTH = 0.5;
|
* var HAPTIC_STRENGTH = 0.5;
|
||||||
* var HAPTIC_DURATION = 10;
|
* var HAPTIC_DURATION = 10;
|
||||||
|
@ -224,8 +224,8 @@ namespace controller {
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Triggers a 250ms haptic pulse on connected and enabled devices that have the capability.
|
* Triggers a 250ms haptic pulse on connected and enabled devices that have the capability.
|
||||||
* @function Controller.triggerShortHapticPulse
|
* @function Controller.triggerShortHapticPulse
|
||||||
* @param {number} strength - The strength of the haptic pulse, <code>0.0</code> – <code>1.0</code>.
|
* @param {number} strength - The strength of the haptic pulse, range <code>0.0</code> – <code>1.0</code>.
|
||||||
* @param {Controller.Hand} hand=2 - The hand or hands to trigger the haptic pulse on.
|
* @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE bool triggerShortHapticPulse(float strength, controller::Hand hand = BOTH) const;
|
Q_INVOKABLE bool triggerShortHapticPulse(float strength, controller::Hand hand = BOTH) const;
|
||||||
|
|
||||||
|
@ -233,9 +233,9 @@ namespace controller {
|
||||||
* Triggers a haptic pulse on a particular device if connected and enabled and it has the capability.
|
* Triggers a haptic pulse on a particular device if connected and enabled and it has the capability.
|
||||||
* @function Controller.triggerHapticPulseOnDevice
|
* @function Controller.triggerHapticPulseOnDevice
|
||||||
* @param {number} deviceID - The ID of the device to trigger the haptic pulse on.
|
* @param {number} deviceID - The ID of the device to trigger the haptic pulse on.
|
||||||
* @param {number} strength - The strength of the haptic pulse, <code>0.0</code> – <code>1.0</code>.
|
* @param {number} strength - The strength of the haptic pulse, range <code>0.0</code> – <code>1.0</code>.
|
||||||
* @param {number} duration - The duration of the haptic pulse, in milliseconds.
|
* @param {number} duration - The duration of the haptic pulse, in milliseconds.
|
||||||
* @param {Controller.Hand} hand=2 - The hand or hands to trigger the haptic pulse on.
|
* @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on.
|
||||||
* @example <caption>Trigger a haptic pulse on an Oculus Touch controller.</caption>
|
* @example <caption>Trigger a haptic pulse on an Oculus Touch controller.</caption>
|
||||||
* var HAPTIC_STRENGTH = 0.5;
|
* var HAPTIC_STRENGTH = 0.5;
|
||||||
* var deviceID = Controller.findDevice("OculusTouch");
|
* var deviceID = Controller.findDevice("OculusTouch");
|
||||||
|
@ -250,19 +250,19 @@ namespace controller {
|
||||||
* Triggers a 250ms haptic pulse on a particular device if connected and enabled and it has the capability.
|
* Triggers a 250ms haptic pulse on a particular device if connected and enabled and it has the capability.
|
||||||
* @function Controller.triggerShortHapticPulseOnDevice
|
* @function Controller.triggerShortHapticPulseOnDevice
|
||||||
* @param {number} deviceID - The ID of the device to trigger the haptic pulse on.
|
* @param {number} deviceID - The ID of the device to trigger the haptic pulse on.
|
||||||
* @param {number} strength - The strength of the haptic pulse, <code>0.0</code> – <code>1.0</code>.
|
* @param {number} strength - The strength of the haptic pulse, range <code>0.0</code> – <code>1.0</code>.
|
||||||
* @param {Controller.Hand} hand=2 - The hand or hands to trigger the haptic pulse on.
|
* @param {Controller.Hand} [hand=2] - The hand or hands to trigger the haptic pulse on.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE bool triggerShortHapticPulseOnDevice(unsigned int device, float strength, controller::Hand hand = BOTH)
|
Q_INVOKABLE bool triggerShortHapticPulseOnDevice(unsigned int device, float strength, controller::Hand hand = BOTH)
|
||||||
const;
|
const;
|
||||||
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Create a new controller mapping. Routes can then be added to the mapping using {@link MappingObject} methods and
|
* Creates a new controller mapping. Routes can then be added to the mapping using {@link MappingObject} methods and
|
||||||
* routed to <code>Standard</code> controls, <code>Actions</code>, or script functions using {@link RouteObject}
|
* routed to <code>Standard</code> controls, <code>Actions</code>, or script functions using {@link RouteObject}
|
||||||
* methods. The mapping can then be enabled using {@link Controller.enableMapping|enableMapping} for it to take effect.
|
* methods. The mapping can then be enabled using {@link Controller.enableMapping|enableMapping} for it to take effect.
|
||||||
* @function Controller.newMapping
|
* @function Controller.newMapping
|
||||||
* @param {string} mappingName=Uuid.generate() - A unique name for the mapping. If not specified a new UUID generated
|
* @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.generate} is used.
|
||||||
* @returns {MappingObject} A controller mapping object.
|
* @returns {MappingObject} A controller mapping object.
|
||||||
* @example <caption>Create a simple mapping that makes the right trigger move your avatar up.</caption>
|
* @example <caption>Create a simple mapping that makes the right trigger move your avatar up.</caption>
|
||||||
|
@ -279,22 +279,22 @@ namespace controller {
|
||||||
Q_INVOKABLE QObject* newMapping(const QString& mappingName = QUuid::createUuid().toString());
|
Q_INVOKABLE QObject* newMapping(const QString& mappingName = QUuid::createUuid().toString());
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Enable or disable a controller mapping. When enabled, the routes in the mapping have effect.
|
* Enables or disables a controller mapping. When enabled, the routes in the mapping have effect.
|
||||||
* @function Controller.enableMapping
|
* @function Controller.enableMapping
|
||||||
* @param {string} mappingName - The name of the mapping.
|
* @param {string} mappingName - The name of the mapping.
|
||||||
* @param {boolean} enable=true - If <code>true</code> then the mapping is enabled, otherwise it is disabled.
|
* @param {boolean} [[enable=true] - If <code>true</code> then the mapping is enabled, otherwise it is disabled.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void enableMapping(const QString& mappingName, bool enable = true);
|
Q_INVOKABLE void enableMapping(const QString& mappingName, bool enable = true);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Disable a controller mapping. When disabled, the routes in the mapping have no effect.
|
* Disables a controller mapping. When disabled, the routes in the mapping have no effect.
|
||||||
* @function Controller.disableMapping
|
* @function Controller.disableMapping
|
||||||
* @param {string} mappingName - The name of the mapping.
|
* @param {string} mappingName - The name of the mapping.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void disableMapping(const QString& mappingName) { enableMapping(mappingName, false); }
|
Q_INVOKABLE void disableMapping(const QString& mappingName) { enableMapping(mappingName, false); }
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Create a new controller mapping from a {@link Controller.MappingJSON|MappingJSON} string. Use
|
* Creates a new controller mapping from a {@link Controller.MappingJSON|MappingJSON} string. Use
|
||||||
* {@link Controller.enableMapping|enableMapping} to enable the mapping for it to take effect.
|
* {@link Controller.enableMapping|enableMapping} to enable the mapping for it to take effect.
|
||||||
* @function Controller.parseMapping
|
* @function Controller.parseMapping
|
||||||
* @param {string} jsonString - A JSON string of the {@link Controller.MappingJSON|MappingJSON}.
|
* @param {string} jsonString - A JSON string of the {@link Controller.MappingJSON|MappingJSON}.
|
||||||
|
@ -317,19 +317,19 @@ namespace controller {
|
||||||
Q_INVOKABLE QObject* parseMapping(const QString& json);
|
Q_INVOKABLE QObject* parseMapping(const QString& json);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Create a new controller mapping from a {@link Controller.MappingJSON|MappingJSON} JSON file at a URL. Use
|
* Creates a new controller mapping from a {@link Controller.MappingJSON|MappingJSON} JSON file at a URL. Use
|
||||||
* {@link Controller.enableMapping|enableMapping} to enable the mapping for it to take effect.
|
* {@link Controller.enableMapping|enableMapping} to enable the mapping for it to take effect.
|
||||||
|
* <p><strong>Warning:</strong> This function is not yet implemented; it doesn't load a mapping and just returns
|
||||||
|
* <code>null</code>.
|
||||||
* @function Controller.loadMapping
|
* @function Controller.loadMapping
|
||||||
* @param {string} jsonURL - The URL the {@link Controller.MappingJSON|MappingJSON} JSON file.
|
* @param {string} jsonURL - The URL the {@link Controller.MappingJSON|MappingJSON} JSON file.
|
||||||
* @returns {MappingObject} A controller mapping object.
|
* @returns {MappingObject} A controller mapping object.
|
||||||
* @todo <em>Implement this function. It currently does not load the mapping from the file; it just returns
|
|
||||||
* <code>null</code>.</em>
|
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE QObject* loadMapping(const QString& jsonUrl);
|
Q_INVOKABLE QObject* loadMapping(const QString& jsonUrl);
|
||||||
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get the {@link Controller.Hardware} property tree. Calling this function is the same as using the {@link Controller}
|
* Gets the {@link Controller.Hardware} property tree. Calling this function is the same as using the {@link Controller}
|
||||||
* property, <code>Controller.Hardware</code>.
|
* property, <code>Controller.Hardware</code>.
|
||||||
* @function Controller.getHardware
|
* @function Controller.getHardware
|
||||||
* @returns {Controller.Hardware} The {@link Controller.Hardware} property tree.
|
* @returns {Controller.Hardware} The {@link Controller.Hardware} property tree.
|
||||||
|
@ -337,7 +337,7 @@ namespace controller {
|
||||||
Q_INVOKABLE const QVariantMap getHardware() { return _hardware; }
|
Q_INVOKABLE const QVariantMap getHardware() { return _hardware; }
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get the {@link Controller.Actions} property tree. Calling this function is the same as using the {@link Controller}
|
* Gets the {@link Controller.Actions} property tree. Calling this function is the same as using the {@link Controller}
|
||||||
* property, <code>Controller.Actions</code>.
|
* property, <code>Controller.Actions</code>.
|
||||||
* @function Controller.getActions
|
* @function Controller.getActions
|
||||||
* @returns {Controller.Actions} The {@link Controller.Actions} property tree.
|
* @returns {Controller.Actions} The {@link Controller.Actions} property tree.
|
||||||
|
@ -345,7 +345,7 @@ namespace controller {
|
||||||
Q_INVOKABLE const QVariantMap getActions() { return _actions; } //undefined
|
Q_INVOKABLE const QVariantMap getActions() { return _actions; } //undefined
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get the {@link Controller.Standard} property tree. Calling this function is the same as using the {@link Controller}
|
* Gets the {@link Controller.Standard} property tree. Calling this function is the same as using the {@link Controller}
|
||||||
* property, <code>Controller.Standard</code>.
|
* property, <code>Controller.Standard</code>.
|
||||||
* @function Controller.getStandard
|
* @function Controller.getStandard
|
||||||
* @returns {Controller.Standard} The {@link Controller.Standard} property tree.
|
* @returns {Controller.Standard} The {@link Controller.Standard} property tree.
|
||||||
|
@ -354,7 +354,7 @@ namespace controller {
|
||||||
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Start making a recording of currently active controllers.
|
* Starts making a recording of currently active controllers.
|
||||||
* @function Controller.startInputRecording
|
* @function Controller.startInputRecording
|
||||||
* @example <caption>Make a controller recording.</caption>
|
* @example <caption>Make a controller recording.</caption>
|
||||||
* // Delay start of recording for 2s.
|
* // Delay start of recording for 2s.
|
||||||
|
@ -374,13 +374,13 @@ namespace controller {
|
||||||
Q_INVOKABLE void startInputRecording();
|
Q_INVOKABLE void startInputRecording();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Stop making a recording started by {@link Controller.startInputRecording|startInputRecording}.
|
* Stops making a recording started by {@link Controller.startInputRecording|startInputRecording}.
|
||||||
* @function Controller.stopInputRecording
|
* @function Controller.stopInputRecording
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void stopInputRecording();
|
Q_INVOKABLE void stopInputRecording();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Play back the current recording from the beginning. The current recording may have been recorded by
|
* Plays back the current recording from the beginning. The current recording may have been recorded by
|
||||||
* {@link Controller.startInputRecording|startInputRecording} and
|
* {@link Controller.startInputRecording|startInputRecording} and
|
||||||
* {@link Controller.stopInputRecording|stopInputRecording}, or loaded by
|
* {@link Controller.stopInputRecording|stopInputRecording}, or loaded by
|
||||||
* {@link Controller.loadInputRecording|loadInputRecording}. Playback repeats in a loop until
|
* {@link Controller.loadInputRecording|loadInputRecording}. Playback repeats in a loop until
|
||||||
|
@ -403,13 +403,13 @@ namespace controller {
|
||||||
Q_INVOKABLE void startInputPlayback();
|
Q_INVOKABLE void startInputPlayback();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Stop play back of a recording started by {@link Controller.startInputPlayback|startInputPlayback}.
|
* Stops play back of a recording started by {@link Controller.startInputPlayback|startInputPlayback}.
|
||||||
* @function Controller.stopInputPlayback
|
* @function Controller.stopInputPlayback
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void stopInputPlayback();
|
Q_INVOKABLE void stopInputPlayback();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Save the current recording to a file. The current recording may have been recorded by
|
* Saves the current recording to a file. The current recording may have been recorded by
|
||||||
* {@link Controller.startInputRecording|startInputRecording} and
|
* {@link Controller.startInputRecording|startInputRecording} and
|
||||||
* {@link Controller.stopInputRecording|stopInputRecording}, or loaded by
|
* {@link Controller.stopInputRecording|stopInputRecording}, or loaded by
|
||||||
* {@link Controller.loadInputRecording|loadInputRecording}. It is saved in the directory returned by
|
* {@link Controller.loadInputRecording|loadInputRecording}. It is saved in the directory returned by
|
||||||
|
@ -419,24 +419,26 @@ namespace controller {
|
||||||
Q_INVOKABLE void saveInputRecording();
|
Q_INVOKABLE void saveInputRecording();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Load an input recording, ready for play back.
|
* Loads an input recording, ready for play back.
|
||||||
* @function Controller.loadInputRecording
|
* @function Controller.loadInputRecording
|
||||||
* @param {string} file - The path to the recording file, prefixed by <code>"file:///"</code>.
|
* @param {string} file - The path to the recording file, prefixed by <code>"file:///"</code>.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void loadInputRecording(const QString& file);
|
Q_INVOKABLE void loadInputRecording(const QString& file);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get the directory in which input recordings are saved.
|
* Gets the directory in which input recordings are saved.
|
||||||
* @function Controller.getInputRecorderSaveDirectory
|
* @function Controller.getInputRecorderSaveDirectory
|
||||||
* @returns {string} The directory in which input recordings are saved.
|
* @returns {string} The directory in which input recordings are saved.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE QString getInputRecorderSaveDirectory();
|
Q_INVOKABLE QString getInputRecorderSaveDirectory();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get all the active and enabled (running) input devices
|
* Gets the names of all the active and running (enabled) input devices.
|
||||||
* @function Controller.getRunningInputDevices
|
* @function Controller.getRunningInputDevices
|
||||||
* @returns {string[]} An array of strings with the names
|
* @returns {string[]} The list of current active and running input devices.
|
||||||
*/
|
* @example <caption>List all active and running input devices.</caption>
|
||||||
|
* print("Running devices: " + JSON.stringify(Controller.getRunningInputDeviceNames()));
|
||||||
|
*/
|
||||||
Q_INVOKABLE QStringList getRunningInputDeviceNames();
|
Q_INVOKABLE QStringList getRunningInputDeviceNames();
|
||||||
|
|
||||||
bool isMouseCaptured() const { return _mouseCaptured; }
|
bool isMouseCaptured() const { return _mouseCaptured; }
|
||||||
|
@ -447,7 +449,7 @@ namespace controller {
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Disable processing of mouse "move", "press", "double-press", and "release" events into
|
* Disables processing of mouse "move", "press", "double-press", and "release" events into
|
||||||
* {@link Controller.Hardware|Controller.Hardware.Keyboard} outputs.
|
* {@link Controller.Hardware|Controller.Hardware.Keyboard} outputs.
|
||||||
* @function Controller.captureMouseEvents
|
* @function Controller.captureMouseEvents
|
||||||
* @example <caption>Disable Controller.Hardware.Keyboard mouse events for a short period.</caption>
|
* @example <caption>Disable Controller.Hardware.Keyboard mouse events for a short period.</caption>
|
||||||
|
@ -475,7 +477,7 @@ namespace controller {
|
||||||
virtual void captureMouseEvents() { _mouseCaptured = true; }
|
virtual void captureMouseEvents() { _mouseCaptured = true; }
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Enable processing of mouse "move", "press", "double-press", and "release" events into
|
* Enables processing of mouse "move", "press", "double-press", and "release" events into
|
||||||
* {@link Controller.Hardware-Keyboard|Controller.Hardware.Keyboard} outputs that were disabled using
|
* {@link Controller.Hardware-Keyboard|Controller.Hardware.Keyboard} outputs that were disabled using
|
||||||
* {@link Controller.captureMouseEvents|captureMouseEvents}.
|
* {@link Controller.captureMouseEvents|captureMouseEvents}.
|
||||||
* @function Controller.releaseMouseEvents
|
* @function Controller.releaseMouseEvents
|
||||||
|
@ -484,7 +486,7 @@ namespace controller {
|
||||||
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Disable processing of touch "begin", "update", and "end" events into
|
* Disables processing of touch "begin", "update", and "end" events into
|
||||||
* {@link Controller.Hardware|Controller.Hardware.Keyboard},
|
* {@link Controller.Hardware|Controller.Hardware.Keyboard},
|
||||||
* {@link Controller.Hardware|Controller.Hardware.Touchscreen}, and
|
* {@link Controller.Hardware|Controller.Hardware.Touchscreen}, and
|
||||||
* {@link Controller.Hardware|Controller.Hardware.TouchscreenVirtualPad} outputs.
|
* {@link Controller.Hardware|Controller.Hardware.TouchscreenVirtualPad} outputs.
|
||||||
|
@ -493,7 +495,7 @@ namespace controller {
|
||||||
virtual void captureTouchEvents() { _touchCaptured = true; }
|
virtual void captureTouchEvents() { _touchCaptured = true; }
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Enable processing of touch "begin", "update", and "end" events into
|
* Enables processing of touch "begin", "update", and "end" events into
|
||||||
* {@link Controller.Hardware|Controller.Hardware.Keyboard},
|
* {@link Controller.Hardware|Controller.Hardware.Keyboard},
|
||||||
* {@link Controller.Hardware|Controller.Hardware.Touchscreen}, and
|
* {@link Controller.Hardware|Controller.Hardware.Touchscreen}, and
|
||||||
* {@link Controller.Hardware|Controller.Hardware.TouchscreenVirtualPad} outputs that were disabled using
|
* {@link Controller.Hardware|Controller.Hardware.TouchscreenVirtualPad} outputs that were disabled using
|
||||||
|
@ -504,14 +506,14 @@ namespace controller {
|
||||||
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Disable processing of mouse wheel rotation events into {@link Controller.Hardware|Controller.Hardware.Keyboard}
|
* Disables processing of mouse wheel rotation events into {@link Controller.Hardware|Controller.Hardware.Keyboard}
|
||||||
* outputs.
|
* outputs.
|
||||||
* @function Controller.captureWheelEvents
|
* @function Controller.captureWheelEvents
|
||||||
*/
|
*/
|
||||||
virtual void captureWheelEvents() { _wheelCaptured = true; }
|
virtual void captureWheelEvents() { _wheelCaptured = true; }
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Enable processing of mouse wheel rotation events into {@link Controller.Hardware|Controller.Hardware.Keyboard}
|
* Enables processing of mouse wheel rotation events into {@link Controller.Hardware|Controller.Hardware.Keyboard}
|
||||||
* outputs that wer disabled using {@link Controller.captureWheelEvents|captureWheelEvents}.
|
* outputs that wer disabled using {@link Controller.captureWheelEvents|captureWheelEvents}.
|
||||||
* @function Controller.releaseWheelEvents
|
* @function Controller.releaseWheelEvents
|
||||||
*/
|
*/
|
||||||
|
@ -519,7 +521,7 @@ namespace controller {
|
||||||
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Disable translating and rotating the user's avatar in response to keyboard and controller controls.
|
* Disables translating and rotating the user's avatar in response to keyboard and controller controls.
|
||||||
* @function Controller.captureActionEvents
|
* @function Controller.captureActionEvents
|
||||||
* @example <caption>Disable avatar translation and rotation for a short period.</caption>
|
* @example <caption>Disable avatar translation and rotation for a short period.</caption>
|
||||||
* Script.setTimeout(function () {
|
* Script.setTimeout(function () {
|
||||||
|
@ -533,12 +535,19 @@ namespace controller {
|
||||||
virtual void captureActionEvents() { _actionsCaptured = true; }
|
virtual void captureActionEvents() { _actionsCaptured = true; }
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Enable translating and rotating the user's avatar in response to keyboard and controller controls that were disabled
|
* Enables translating and rotating the user's avatar in response to keyboard and controller controls that were disabled
|
||||||
* using {@link Controller.captureActionEvents|captureActionEvents}.
|
* using {@link Controller.captureActionEvents|captureActionEvents}.
|
||||||
* @function Controller.releaseActionEvents
|
* @function Controller.releaseActionEvents
|
||||||
*/
|
*/
|
||||||
virtual void releaseActionEvents() { _actionsCaptured = false; }
|
virtual void releaseActionEvents() { _actionsCaptured = false; }
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* @function Controller.updateRunningInputDevices
|
||||||
|
* @param {string} deviceName - Device name.
|
||||||
|
* @param {boolean} isRunning - Is running.
|
||||||
|
* @param {string[]} runningDevices - Running devices.
|
||||||
|
* @deprecated This function is deprecated and will be removed.
|
||||||
|
*/
|
||||||
void updateRunningInputDevices(const QString& deviceName, bool isRunning, const QStringList& runningDevices);
|
void updateRunningInputDevices(const QString& deviceName, bool isRunning, const QStringList& runningDevices);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -593,7 +602,7 @@ namespace controller {
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Triggered when a device is registered or unregistered by a plugin. Not all plugins generate
|
* Triggered when a device is registered or unregistered by a plugin. Not all plugins generate
|
||||||
* <code>hardwareChanged</code> events: for example connecting or disconnecting a mouse will not generate an event but
|
* <code>hardwareChanged</code> events: for example, connecting or disconnecting a mouse will not generate an event but
|
||||||
* connecting or disconnecting an Xbox controller will.
|
* connecting or disconnecting an Xbox controller will.
|
||||||
* @function Controller.hardwareChanged
|
* @function Controller.hardwareChanged
|
||||||
* @returns {Signal}
|
* @returns {Signal}
|
||||||
|
@ -601,13 +610,13 @@ namespace controller {
|
||||||
void hardwareChanged();
|
void hardwareChanged();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Triggered when a device is enabled/disabled
|
* Triggered when an input device starts or stops being active and running (enabled). For example, enabling or
|
||||||
* Enabling/Disabling Leapmotion on settings/controls will trigger this signal.
|
* disabling the LeapMotion in Settings > Controls > Calibration will trigger this signal.
|
||||||
* @function Controller.deviceRunningChanged
|
* @function Controller.inputDeviceRunningChanged
|
||||||
* @param {string} deviceName - The name of the device that is getting enabled/disabled
|
* @param {string} deviceName - The name of the device.
|
||||||
* @param {boolean} isEnabled - Return if the device is enabled.
|
* @param {boolean} isRunning - <code>true</code> if the device is active and running, <code>false</code> if it isn't.
|
||||||
* @returns {Signal}
|
* @returns {Signal}
|
||||||
*/
|
*/
|
||||||
void inputDeviceRunningChanged(QString deviceName, bool isRunning);
|
void inputDeviceRunningChanged(QString deviceName, bool isRunning);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,17 +30,16 @@ void StandardController::focusOutEvent() {
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* <p>The <code>Controller.Standard</code> object has properties representing standard controller outputs. Those for physical
|
* <p>The <code>Controller.Standard</code> object has properties representing standard controller outputs. Those for physical
|
||||||
* controllers are based on the XBox controller, with aliases for PlayStation. The property values are integer IDs, uniquely
|
* controllers are based on the XBox controller, with aliases for PlayStation. The property values are integer IDs, uniquely
|
||||||
* identifying each output. <em>Read-only.</em> These can be mapped to actions or functions in a {@link RouteObject}
|
* identifying each output. <em>Read-only.</em></p>
|
||||||
* mapping.</p>
|
* <p>These outputs can be mapped to actions or functions in a {@link RouteObject} mapping. The data value provided by each
|
||||||
*
|
* control is either a number or a {@link Pose}. Numbers are typically normalized to <code>0.0</code> or <code>1.0</code> for
|
||||||
* <p>The data value provided by each control is either a number or a {@link Pose}. Numbers are typically normalized to
|
* button states, the range <code>0.0</code> – </code>1.0</code> for unidirectional scales, and the range
|
||||||
* <code>0.0</code> or <code>1.0</code> for button states, the range <code>0.0 – 1.0</code> for unidirectional scales,
|
* <code>-1.0</code> – <code>1.0</code> for bidirectional scales.</p>
|
||||||
* and the range <code>-1.0 – 1.0</code> for bidirectional scales.</p>
|
* <p>Each hardware device has a mapping from its outputs to a subset of <code>Controller.Standard</code> items, specified in a
|
||||||
*
|
* JSON file. For example,
|
||||||
* <p>Each hardware device has a mapping from its outputs to <code>Controller.Standard</code> items, specified in a JSON file.
|
* <a href="https://github.com/highfidelity/hifi/blob/master/interface/resources/controllers/vive.json">vive.json</a>
|
||||||
* For example, <a href="https://github.com/highfidelity/hifi/blob/master/interface/resources/controllers/leapmotion.json">
|
* and <a href="https://github.com/highfidelity/hifi/blob/master/interface/resources/controllers/leapmotion.json">
|
||||||
* leapmotion.json</a> and
|
* leapmotion.json</a>.</p>
|
||||||
* <a href="https://github.com/highfidelity/hifi/blob/master/interface/resources/controllers/vive.json">vive.json</a>.</p>
|
|
||||||
*
|
*
|
||||||
* <table>
|
* <table>
|
||||||
* <thead>
|
* <thead>
|
||||||
|
@ -119,12 +118,12 @@ void StandardController::focusOutEvent() {
|
||||||
* button.</td></tr>
|
* button.</td></tr>
|
||||||
* <tr><td><code>RightThumbUp</code></td><td>number</td><td>number</td><td>Right thumb not touching primary or secondary
|
* <tr><td><code>RightThumbUp</code></td><td>number</td><td>number</td><td>Right thumb not touching primary or secondary
|
||||||
* thumb buttons.</td></tr>
|
* thumb buttons.</td></tr>
|
||||||
* <tr><td><code>LeftPrimaryIndex</code></td><td>number</td><td>number</td><td>Left primary index control pressed.
|
* <tr><td><code>LeftPrimaryIndex</code></td><td>number</td><td>number</td><td>Left primary index control
|
||||||
* <strong>To Do:</strong> <em>Implement this for current controllers.</em></td></tr>
|
* pressed.</em></td></tr>
|
||||||
* <tr><td><code>LeftSecondaryIndex</code></td><td>number</td><td>number</td><td>Left secondary index control pressed.
|
* <tr><td><code>LeftSecondaryIndex</code></td><td>number</td><td>number</td><td>Left secondary index control pressed.
|
||||||
* </td></tr>
|
* </td></tr>
|
||||||
* <tr><td><code>RightPrimaryIndex</code></td><td>number</td><td>number</td><td>Right primary index control pressed.
|
* <tr><td><code>RightPrimaryIndex</code></td><td>number</td><td>number</td><td>Right primary index control pressed.
|
||||||
* <strong>To Do:</strong> <em>Implement this for current controllers.</em></td></tr>
|
* </td></tr>
|
||||||
* <tr><td><code>RightSecondaryIndex</code></td><td>number</td><td>number</td><td>Right secondary index control pressed.
|
* <tr><td><code>RightSecondaryIndex</code></td><td>number</td><td>number</td><td>Right secondary index control pressed.
|
||||||
* </td></tr>
|
* </td></tr>
|
||||||
* <tr><td><code>LeftPrimaryIndexTouch</code></td><td>number</td><td>number</td><td>Left index finger is touching primary
|
* <tr><td><code>LeftPrimaryIndexTouch</code></td><td>number</td><td>number</td><td>Left index finger is touching primary
|
||||||
|
|
|
@ -84,12 +84,12 @@ class UserInputMapper;
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* A route in a {@link Controller.MappingJSON}.
|
* A route in a {@link Controller.MappingJSON}.
|
||||||
* @typedef {object} Controller.MappingJSONRoute
|
* @typedef {object} Controller.MappingJSONRoute
|
||||||
* @property {string|Controller.MappingJSONAxis} from - The name of a {@link Controller.Hardware} property name or an axis
|
* @property {string|Controller.MappingJSONAxis} from - The name of a {@link Controller.Hardware} property or an axis made from
|
||||||
* made from them. If a property name, the leading <code>"Controller.Hardware."</code> can be omitted.
|
* them. If a property name, the leading <code>"Controller.Hardware."</code> can be omitted.
|
||||||
* @property {boolean} [peek=false] - If <codd>true</code> then peeking is enabled per {@link RouteObject#peek}.
|
* @property {boolean} [peek=false] - If <codd>true</code>, then peeking is enabled per {@link RouteObject#peek}.
|
||||||
* @property {boolean} [debug=false] - If <code>true</code> then debug is enabled per {@link RouteObject#debug}.
|
* @property {boolean} [debug=false] - If <code>true</code>, then debug is enabled per {@link RouteObject#debug}.
|
||||||
* @property {string|string[]} [when=[]] - One or more numeric {@link Controller.Hardware} property names which are evaluated
|
* @property {string|string[]} [when=[]] - One or more numeric {@link Controller.Hardware} property names which are evaluated
|
||||||
* as booleans and ANDed together. Prepend with a <code>!</code> to use the logical NOT of the property value. The leading
|
* as booleans and ANDed together. Prepend a property name with a <code>!</code> to do a logical NOT. The leading
|
||||||
* <code>"Controller.Hardware."</code> can be omitted from the property names.
|
* <code>"Controller.Hardware."</code> can be omitted from the property names.
|
||||||
* @property {Controller.MappingJSONFilter|Controller.MappingJSONFilter[]} [filters=[]] - One or more filters in the route.
|
* @property {Controller.MappingJSONFilter|Controller.MappingJSONFilter[]} [filters=[]] - One or more filters in the route.
|
||||||
* @property {string} to - The name of a {@link Controller.Actions} or {@link Controller.Standard} property. The leading
|
* @property {string} to - The name of a {@link Controller.Actions} or {@link Controller.Standard} property. The leading
|
||||||
|
@ -134,7 +134,7 @@ public:
|
||||||
: _parent(parent), _mapping(mapping) { }
|
: _parent(parent), _mapping(mapping) { }
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Create a new {@link RouteObject} from a controller output, ready to be mapped to a standard control, action, or
|
* Creates a new {@link RouteObject} from a controller output, ready to be mapped to a standard control, action, or
|
||||||
* function.<br />
|
* function.<br />
|
||||||
* This is a QML-specific version of {@link MappingObject#from|from}: use this version in QML files.
|
* This is a QML-specific version of {@link MappingObject#from|from}: use this version in QML files.
|
||||||
* @function MappingObject#fromQml
|
* @function MappingObject#fromQml
|
||||||
|
@ -145,7 +145,7 @@ public:
|
||||||
Q_INVOKABLE QObject* fromQml(const QJSValue& source);
|
Q_INVOKABLE QObject* fromQml(const QJSValue& source);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Create a new {@link RouteObject} from two numeric {@link Controller.Hardware} outputs, one applied in the negative
|
* Creates a new {@link RouteObject} from two numeric {@link Controller.Hardware} outputs, one applied in the negative
|
||||||
* direction and the other in the positive direction, ready to be mapped to a standard control, action, or function.<br />
|
* direction and the other in the positive direction, ready to be mapped to a standard control, action, or function.<br />
|
||||||
* This is a QML-specific version of {@link MappingObject#makeAxis|makeAxis}: use this version in QML files.
|
* This is a QML-specific version of {@link MappingObject#makeAxis|makeAxis}: use this version in QML files.
|
||||||
* @function MappingObject#makeAxisQml
|
* @function MappingObject#makeAxisQml
|
||||||
|
@ -157,7 +157,7 @@ public:
|
||||||
Q_INVOKABLE QObject* makeAxisQml(const QJSValue& source1, const QJSValue& source2);
|
Q_INVOKABLE QObject* makeAxisQml(const QJSValue& source1, const QJSValue& source2);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Create a new {@link RouteObject} from a controller output, ready to be mapped to a standard control, action, or
|
* Creates a new {@link RouteObject} from a controller output, ready to be mapped to a standard control, action, or
|
||||||
* function.
|
* function.
|
||||||
* @function MappingObject#from
|
* @function MappingObject#from
|
||||||
* @param {Controller.Standard|Controller.Hardware|function} source - The controller output or function that is the source
|
* @param {Controller.Standard|Controller.Hardware|function} source - The controller output or function that is the source
|
||||||
|
@ -167,7 +167,7 @@ public:
|
||||||
Q_INVOKABLE QObject* from(const QScriptValue& source);
|
Q_INVOKABLE QObject* from(const QScriptValue& source);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Create a new {@link RouteObject} from two numeric {@link Controller.Hardware} outputs, one applied in the negative
|
* Creates a new {@link RouteObject} from two numeric {@link Controller.Hardware} outputs, one applied in the negative
|
||||||
* direction and the other in the positive direction, ready to be mapped to a standard control, action, or function.
|
* direction and the other in the positive direction, ready to be mapped to a standard control, action, or function.
|
||||||
* @function MappingObject#makeAxis
|
* @function MappingObject#makeAxis
|
||||||
* @param {Controller.Hardware} source1 - The first, negative-direction controller output.
|
* @param {Controller.Hardware} source1 - The first, negative-direction controller output.
|
||||||
|
@ -189,7 +189,7 @@ public:
|
||||||
Q_INVOKABLE QObject* makeAxis(const QScriptValue& source1, const QScriptValue& source2);
|
Q_INVOKABLE QObject* makeAxis(const QScriptValue& source1, const QScriptValue& source2);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Enable or disable the mapping. When enabled, the routes in the mapping take effect.<br />
|
* Enables or disables the mapping. When enabled, the routes in the mapping take effect.<br />
|
||||||
* Synonymous with {@link Controller.enableMapping}.
|
* Synonymous with {@link Controller.enableMapping}.
|
||||||
* @function MappingObject#enable
|
* @function MappingObject#enable
|
||||||
* @param {boolean} enable=true - If <code>true</code> then the mapping is enabled, otherwise it is disabled.
|
* @param {boolean} enable=true - If <code>true</code> then the mapping is enabled, otherwise it is disabled.
|
||||||
|
@ -198,7 +198,7 @@ public:
|
||||||
Q_INVOKABLE QObject* enable(bool enable = true);
|
Q_INVOKABLE QObject* enable(bool enable = true);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Disable the mapping. When disabled, the routes in the mapping have no effect.<br />
|
* Disables the mapping. When disabled, the routes in the mapping have no effect.<br />
|
||||||
* Synonymous with {@link Controller.disableMapping}.
|
* Synonymous with {@link Controller.disableMapping}.
|
||||||
* @function MappingObject#disable
|
* @function MappingObject#disable
|
||||||
* @returns {MappingObject} The mapping object, so that further routes can be added.
|
* @returns {MappingObject} The mapping object, so that further routes can be added.
|
||||||
|
|
|
@ -66,6 +66,8 @@ QObject* RouteBuilderProxy::peek(bool enable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QObject* RouteBuilderProxy::when(const QScriptValue& expression) {
|
QObject* RouteBuilderProxy::when(const QScriptValue& expression) {
|
||||||
|
// FIXME: Support "!" conditional in simple expression and array expression.
|
||||||
|
// Note that "!" is supported when parsing a JSON file, in UserInputMapper::parseConditional().
|
||||||
auto newConditional = _parent.conditionalFor(expression);
|
auto newConditional = _parent.conditionalFor(expression);
|
||||||
if (_route->conditional) {
|
if (_route->conditional) {
|
||||||
_route->conditional = ConditionalPointer(new AndConditional(_route->conditional, newConditional));
|
_route->conditional = ConditionalPointer(new AndConditional(_route->conditional, newConditional));
|
||||||
|
|
|
@ -51,7 +51,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
: _parent(parent), _mapping(mapping), _route(route) { }
|
: _parent(parent), _mapping(mapping), _route(route) { }
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Terminate the route with a standard control, an action, or a script function. The output value from the route is
|
* Terminates the route with a standard control, an action, or a script function. The output value from the route is
|
||||||
* sent to the specified destination.<br />
|
* sent to the specified destination.<br />
|
||||||
* This is a QML-specific version of {@link MappingObject#to|to}: use this version in QML files.
|
* This is a QML-specific version of {@link MappingObject#to|to}: use this version in QML files.
|
||||||
* @function RouteObject#toQml
|
* @function RouteObject#toQml
|
||||||
|
@ -62,7 +62,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE void toQml(const QJSValue& destination);
|
Q_INVOKABLE void toQml(const QJSValue& destination);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Process the route only if a condition is satisfied. The condition is evaluated before the route input is read, and
|
* Processes the route only if a condition is satisfied. The condition is evaluated before the route input is read, and
|
||||||
* the input is read only if the condition is <code>true</code>. Thus, if the condition is not met then subsequent
|
* the input is read only if the condition is <code>true</code>. Thus, if the condition is not met then subsequent
|
||||||
* routes using the same input are processed.<br />
|
* routes using the same input are processed.<br />
|
||||||
* This is a QML-specific version of {@link MappingObject#to|to}: use this version in QML files.
|
* This is a QML-specific version of {@link MappingObject#to|to}: use this version in QML files.
|
||||||
|
@ -81,7 +81,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* whenQml(const QJSValue& expression);
|
Q_INVOKABLE QObject* whenQml(const QJSValue& expression);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Terminate the route with a standard control, an action, or a script function. The output value from the route is
|
* Terminates the route with a standard control, an action, or a script function. The output value from the route is
|
||||||
* sent to the specified destination.
|
* sent to the specified destination.
|
||||||
* @function RouteObject#to
|
* @function RouteObject#to
|
||||||
* @param {Controller.Standard|Controller.Actions|function} destination - The standard control, action, or JavaScript
|
* @param {Controller.Standard|Controller.Actions|function} destination - The standard control, action, or JavaScript
|
||||||
|
@ -117,7 +117,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE void to(const QScriptValue& destination);
|
Q_INVOKABLE void to(const QScriptValue& destination);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Enable and disabling writing debug information for a route to the program log.
|
* Enables or disables writing debug information for a route to the program log.
|
||||||
* @function RouteObject#debug
|
* @function RouteObject#debug
|
||||||
* @param {boolean} [enable=true] - If <code>true</code> then writing debug information is enabled for the route,
|
* @param {boolean} [enable=true] - If <code>true</code> then writing debug information is enabled for the route,
|
||||||
* otherwise it is disabled.
|
* otherwise it is disabled.
|
||||||
|
@ -147,7 +147,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* debug(bool enable = true);
|
Q_INVOKABLE QObject* debug(bool enable = true);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Process the route without marking the controller output as having been read, so that other routes from the same
|
* Processes the route without marking the controller output as having been read, so that other routes from the same
|
||||||
* controller output can also process.
|
* controller output can also process.
|
||||||
* @function RouteObject#peek
|
* @function RouteObject#peek
|
||||||
* @param {boolean} [enable=true] - If <code>true</code> then the route is processed without marking the route's
|
* @param {boolean} [enable=true] - If <code>true</code> then the route is processed without marking the route's
|
||||||
|
@ -157,7 +157,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* peek(bool enable = true);
|
Q_INVOKABLE QObject* peek(bool enable = true);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Process the route only if a condition is satisfied. The condition is evaluated before the route input is read, and
|
* Processes the route only if a condition is satisfied. The condition is evaluated before the route input is read, and
|
||||||
* the input is read only if the condition is <code>true</code>. Thus, if the condition is not met then subsequent
|
* the input is read only if the condition is <code>true</code>. Thus, if the condition is not met then subsequent
|
||||||
* routes using the same input are processed.
|
* routes using the same input are processed.
|
||||||
* @function RouteObject#when
|
* @function RouteObject#when
|
||||||
|
@ -170,6 +170,8 @@ class RouteBuilderProxy : public QObject {
|
||||||
* definition.</li>
|
* definition.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>If an array of conditions is provided, their values are ANDed together.</p>
|
* <p>If an array of conditions is provided, their values are ANDed together.</p>
|
||||||
|
* <p><strong>Warning:</strong> The use of <code>!</code> is not currently supported in JavaScript <code>.when()</code>
|
||||||
|
* calls.</p>
|
||||||
* @returns {RouteObject} The <code>RouteObject</code> with the condition added.
|
* @returns {RouteObject} The <code>RouteObject</code> with the condition added.
|
||||||
* @example <caption>Process the right trigger differently in HMD and desktop modes.</caption>
|
* @example <caption>Process the right trigger differently in HMD and desktop modes.</caption>
|
||||||
* var MAPPING_NAME = "com.highfidelity.controllers.example.newMapping";
|
* var MAPPING_NAME = "com.highfidelity.controllers.example.newMapping";
|
||||||
|
@ -193,7 +195,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* when(const QScriptValue& expression);
|
Q_INVOKABLE QObject* when(const QScriptValue& expression);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter numeric route values to lie between two values; values outside this range are not passed on through the
|
* Filters numeric route values to lie between two values; values outside this range are not passed on through the
|
||||||
* route.
|
* route.
|
||||||
* @function RouteObject#clamp
|
* @function RouteObject#clamp
|
||||||
* @param {number} min - The minimum value to pass through.
|
* @param {number} min - The minimum value to pass through.
|
||||||
|
@ -214,7 +216,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* clamp(float min, float max);
|
Q_INVOKABLE QObject* clamp(float min, float max);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter numeric route values such that they are rounded to <code>0</code> or <code>1</code> without output values
|
* Filters numeric route values such that they are rounded to <code>0</code> or <code>1</code> without output values
|
||||||
* flickering when the input value hovers around <code>0.5</code>. For example, this enables you to use an analog input
|
* flickering when the input value hovers around <code>0.5</code>. For example, this enables you to use an analog input
|
||||||
* as if it were a toggle.
|
* as if it were a toggle.
|
||||||
* @function RouteObject#hysteresis
|
* @function RouteObject#hysteresis
|
||||||
|
@ -239,7 +241,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* hysteresis(float min, float max);
|
Q_INVOKABLE QObject* hysteresis(float min, float max);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter numeric route values to send at a specified interval.
|
* Filters numeric route values to send at a specified interval.
|
||||||
* @function RouteObject#pulse
|
* @function RouteObject#pulse
|
||||||
* @param {number} interval - The interval between sending values, in seconds.
|
* @param {number} interval - The interval between sending values, in seconds.
|
||||||
* @returns {RouteObject} The <code>RouteObject</code> with the filter applied.
|
* @returns {RouteObject} The <code>RouteObject</code> with the filter applied.
|
||||||
|
@ -258,7 +260,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* pulse(float interval);
|
Q_INVOKABLE QObject* pulse(float interval);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter numeric and {@link Pose} route values to be scaled by a constant amount.
|
* Filters numeric and {@link Pose} route values to be scaled by a constant amount.
|
||||||
* @function RouteObject#scale
|
* @function RouteObject#scale
|
||||||
* @param {number} multiplier - The scale to multiply the value by.
|
* @param {number} multiplier - The scale to multiply the value by.
|
||||||
* @returns {RouteObject} The <code>RouteObject</code> with the filter applied.
|
* @returns {RouteObject} The <code>RouteObject</code> with the filter applied.
|
||||||
|
@ -280,7 +282,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* scale(float multiplier);
|
Q_INVOKABLE QObject* scale(float multiplier);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter numeric and {@link Pose} route values to have the opposite sign, e.g., <code>0.5</code> is changed to
|
* Filters numeric and {@link Pose} route values to have the opposite sign, e.g., <code>0.5</code> is changed to
|
||||||
* <code>-0.5</code>.
|
* <code>-0.5</code>.
|
||||||
* @function RouteObject#invert
|
* @function RouteObject#invert
|
||||||
* @returns {RouteObject} The <code>RouteObject</code> with the filter applied.
|
* @returns {RouteObject} The <code>RouteObject</code> with the filter applied.
|
||||||
|
@ -302,7 +304,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* invert();
|
Q_INVOKABLE QObject* invert();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter numeric route values such that they're sent only when the input value is outside a dead-zone. When the input
|
* Filters numeric route values such that they're sent only when the input value is outside a dead-zone. When the input
|
||||||
* passes the dead-zone value, output is sent starting at <code>0.0</code> and catching up with the input value. As the
|
* passes the dead-zone value, output is sent starting at <code>0.0</code> and catching up with the input value. As the
|
||||||
* input returns toward the dead-zone value, output values reduce to <code>0.0</code> at the dead-zone value.
|
* input returns toward the dead-zone value, output values reduce to <code>0.0</code> at the dead-zone value.
|
||||||
* @function RouteObject#deadZone
|
* @function RouteObject#deadZone
|
||||||
|
@ -324,7 +326,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* deadZone(float min);
|
Q_INVOKABLE QObject* deadZone(float min);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter numeric route values such that they are rounded to <code>-1</code>, <code>0</code>, or <code>1</code>.
|
* Filters numeric route values such that they are rounded to <code>-1</code>, <code>0</code>, or <code>1</code>.
|
||||||
* For example, this enables you to use an analog input as if it were a toggle or, in the case of a bidirectional axis,
|
* For example, this enables you to use an analog input as if it were a toggle or, in the case of a bidirectional axis,
|
||||||
* a tri-state switch.
|
* a tri-state switch.
|
||||||
* @function RouteObject#constrainToInteger
|
* @function RouteObject#constrainToInteger
|
||||||
|
@ -345,7 +347,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* constrainToInteger();
|
Q_INVOKABLE QObject* constrainToInteger();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter numeric route values such that they are rounded to <code>0</code> or <code>1</code>. For example, this
|
* Filters numeric route values such that they are rounded to <code>0</code> or <code>1</code>. For example, this
|
||||||
* enables you to use an analog input as if it were a toggle.
|
* enables you to use an analog input as if it were a toggle.
|
||||||
* @function RouteObject#constrainToPositiveInteger
|
* @function RouteObject#constrainToPositiveInteger
|
||||||
* @returns {RouteObject} The <code>RouteObject</code> with the filter applied.
|
* @returns {RouteObject} The <code>RouteObject</code> with the filter applied.
|
||||||
|
@ -364,7 +366,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* constrainToPositiveInteger();
|
Q_INVOKABLE QObject* constrainToPositiveInteger();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter {@link Pose} route values to have a pre-translation applied.
|
* Filters {@link Pose} route values to have a pre-translation applied.
|
||||||
* @function RouteObject#translate
|
* @function RouteObject#translate
|
||||||
* @param {Vec3} translate - The pre-translation to add to the pose.
|
* @param {Vec3} translate - The pre-translation to add to the pose.
|
||||||
* @returns {RouteObject} The <code>RouteObject</code> with the pre-translation applied.
|
* @returns {RouteObject} The <code>RouteObject</code> with the pre-translation applied.
|
||||||
|
@ -373,7 +375,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* translate(glm::vec3 translate);
|
Q_INVOKABLE QObject* translate(glm::vec3 translate);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter {@link Pose} route values to have a pre-transform applied.
|
* Filters {@link Pose} route values to have a pre-transform applied.
|
||||||
* @function RouteObject#transform
|
* @function RouteObject#transform
|
||||||
* @param {Mat4} transform - The pre-transform to apply.
|
* @param {Mat4} transform - The pre-transform to apply.
|
||||||
* @returns {RouteObject} The <code>RouteObject</code> with the pre-transform applied.
|
* @returns {RouteObject} The <code>RouteObject</code> with the pre-transform applied.
|
||||||
|
@ -382,7 +384,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* transform(glm::mat4 transform);
|
Q_INVOKABLE QObject* transform(glm::mat4 transform);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter {@link Pose} route values to have a post-transform applied.
|
* Filters {@link Pose} route values to have a post-transform applied.
|
||||||
* @function RouteObject#postTransform
|
* @function RouteObject#postTransform
|
||||||
* @param {Mat4} transform - The post-transform to apply.
|
* @param {Mat4} transform - The post-transform to apply.
|
||||||
* @returns {RouteObject} The <code>RouteObject</code> with the post-transform applied.
|
* @returns {RouteObject} The <code>RouteObject</code> with the post-transform applied.
|
||||||
|
@ -391,7 +393,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* postTransform(glm::mat4 transform);
|
Q_INVOKABLE QObject* postTransform(glm::mat4 transform);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter {@link Pose} route values to have a pre-rotation applied.
|
* Filters {@link Pose} route values to have a pre-rotation applied.
|
||||||
* @function RouteObject#rotate
|
* @function RouteObject#rotate
|
||||||
* @param {Quat} rotation - The pre-rotation to add to the pose.
|
* @param {Quat} rotation - The pre-rotation to add to the pose.
|
||||||
* @returns {RouteObject} The <code>RouteObject</code> with the pre-rotation applied.
|
* @returns {RouteObject} The <code>RouteObject</code> with the pre-rotation applied.
|
||||||
|
@ -400,7 +402,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* rotate(glm::quat rotation);
|
Q_INVOKABLE QObject* rotate(glm::quat rotation);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter {@link Pose} route values to be smoothed by a low velocity filter. The filter's rotation and translation
|
* Filters {@link Pose} route values to be smoothed by a low velocity filter. The filter's rotation and translation
|
||||||
* values are calculated as: <code>(1 - f) * currentValue + f * previousValue</code> where
|
* values are calculated as: <code>(1 - f) * currentValue + f * previousValue</code> where
|
||||||
* <code>f = currentVelocity / filterConstant</code>. At low velocities, the filter value is largely the previous
|
* <code>f = currentVelocity / filterConstant</code>. At low velocities, the filter value is largely the previous
|
||||||
* value; at high velocities the value is wholly the current controller value.
|
* value; at high velocities the value is wholly the current controller value.
|
||||||
|
@ -415,7 +417,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* lowVelocity(float rotationConstant, float translationConstant);
|
Q_INVOKABLE QObject* lowVelocity(float rotationConstant, float translationConstant);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter {@link Pose} route values to be smoothed by an exponential decay filter. The filter's rotation and
|
* Filters {@link Pose} route values to be smoothed by an exponential decay filter. The filter's rotation and
|
||||||
* translation values are calculated as: <code>filterConstant * currentValue + (1 - filterConstant) *
|
* translation values are calculated as: <code>filterConstant * currentValue + (1 - filterConstant) *
|
||||||
* previousValue</code>. Values near 1 are less smooth with lower latency; values near 0 are more smooth with higher
|
* previousValue</code>. Values near 1 are less smooth with lower latency; values near 0 are more smooth with higher
|
||||||
* latency.
|
* latency.
|
||||||
|
@ -428,7 +430,7 @@ class RouteBuilderProxy : public QObject {
|
||||||
Q_INVOKABLE QObject* exponentialSmoothing(float rotationConstant, float translationConstant);
|
Q_INVOKABLE QObject* exponentialSmoothing(float rotationConstant, float translationConstant);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Filter numeric route values such that a value of <code>0.0</code> is changed to <code>1.0</code>, and other values
|
* Filters numeric route values such that a value of <code>0.0</code> is changed to <code>1.0</code>, and other values
|
||||||
* are changed to <code>0.0</code>.
|
* are changed to <code>0.0</code>.
|
||||||
* @function RouteObject#logicalNot
|
* @function RouteObject#logicalNot
|
||||||
* @returns {RouteObject} The <code>RouteObject</code> with the filter applied.
|
* @returns {RouteObject} The <code>RouteObject</code> with the filter applied.
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include <gpu/gl/GLBackend.h>
|
#include <gpu/gl/GLBackend.h>
|
||||||
#include <GeometryCache.h>
|
#include <GeometryCache.h>
|
||||||
|
|
||||||
|
#include <CursorManager.h>
|
||||||
#include <FramebufferCache.h>
|
#include <FramebufferCache.h>
|
||||||
#include <shared/NsightHelpers.h>
|
#include <shared/NsightHelpers.h>
|
||||||
#include <ui-plugins/PluginContainer.h>
|
#include <ui-plugins/PluginContainer.h>
|
||||||
|
@ -681,11 +682,14 @@ void OpenGLDisplayPlugin::compositeLayers() {
|
||||||
compositeExtra();
|
compositeExtra();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the pointer last so it's on top of everything
|
auto& cursorManager = Cursor::Manager::instance();
|
||||||
auto compositorHelper = DependencyManager::get<CompositorHelper>();
|
if (isHmd() || cursorManager.getCursor()->getIcon() == Cursor::RETICLE) {
|
||||||
if (compositorHelper->getReticleVisible()) {
|
auto compositorHelper = DependencyManager::get<CompositorHelper>();
|
||||||
PROFILE_RANGE_EX(render_detail, "compositePointer", 0xff0077ff, (uint64_t)presentCount())
|
// Draw the pointer last so it's on top of everything
|
||||||
|
if (compositorHelper->getReticleVisible()) {
|
||||||
|
PROFILE_RANGE_EX(render_detail, "compositePointer", 0xff0077ff, (uint64_t)presentCount())
|
||||||
compositePointer();
|
compositePointer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -205,8 +205,11 @@ void EntityTreeRenderer::stopDomainAndNonOwnedEntities() {
|
||||||
foreach (const EntityItemID& entityID, entitiesWithEntityScripts) {
|
foreach (const EntityItemID& entityID, entitiesWithEntityScripts) {
|
||||||
EntityItemPointer entityItem = getTree()->findEntityByEntityItemID(entityID);
|
EntityItemPointer entityItem = getTree()->findEntityByEntityItemID(entityID);
|
||||||
|
|
||||||
if (entityItem) {
|
if (entityItem && !entityItem->getScript().isEmpty()) {
|
||||||
if (!(entityItem->isLocalEntity() || (entityItem->isAvatarEntity() && entityItem->getOwningAvatarID() == getTree()->getMyAvatarSessionUUID()))) {
|
if (!(entityItem->isLocalEntity() || (entityItem->isAvatarEntity() && entityItem->getOwningAvatarID() == getTree()->getMyAvatarSessionUUID()))) {
|
||||||
|
if (entityItem->contains(_avatarPosition)) {
|
||||||
|
_entitiesScriptEngine->callEntityScriptMethod(entityID, "leaveEntity");
|
||||||
|
}
|
||||||
_entitiesScriptEngine->unloadEntityScript(entityID, true);
|
_entitiesScriptEngine->unloadEntityScript(entityID, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -534,7 +537,7 @@ void EntityTreeRenderer::handleSpaceUpdate(std::pair<int32_t, glm::vec4> proxyUp
|
||||||
_spaceUpdates.emplace_back(proxyUpdate.first, proxyUpdate.second);
|
_spaceUpdates.emplace_back(proxyUpdate.first, proxyUpdate.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EntityTreeRenderer::findBestZoneAndMaybeContainingEntities(QVector<EntityItemID>* entitiesContainingAvatar) {
|
bool EntityTreeRenderer::findBestZoneAndMaybeContainingEntities(QSet<EntityItemID>& entitiesContainingAvatar) {
|
||||||
bool didUpdate = false;
|
bool didUpdate = false;
|
||||||
float radius = 0.01f; // for now, assume 0.01 meter radius, because we actually check the point inside later
|
float radius = 0.01f; // for now, assume 0.01 meter radius, because we actually check the point inside later
|
||||||
QVector<QUuid> entityIDs;
|
QVector<QUuid> entityIDs;
|
||||||
|
@ -580,9 +583,7 @@ bool EntityTreeRenderer::findBestZoneAndMaybeContainingEntities(QVector<EntityIt
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!hasScript && isZone) || scriptHasLoaded) {
|
if ((!hasScript && isZone) || scriptHasLoaded) {
|
||||||
if (entitiesContainingAvatar) {
|
entitiesContainingAvatar << entity->getEntityItemID();
|
||||||
*entitiesContainingAvatar << entity->getEntityItemID();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -616,36 +617,36 @@ bool EntityTreeRenderer::checkEnterLeaveEntities() {
|
||||||
auto movedEnough = glm::distance(avatarPosition, _avatarPosition) > ZONE_CHECK_DISTANCE;
|
auto movedEnough = glm::distance(avatarPosition, _avatarPosition) > ZONE_CHECK_DISTANCE;
|
||||||
auto enoughTimeElapsed = (now - _lastZoneCheck) > ZONE_CHECK_INTERVAL;
|
auto enoughTimeElapsed = (now - _lastZoneCheck) > ZONE_CHECK_INTERVAL;
|
||||||
|
|
||||||
if (movedEnough || enoughTimeElapsed) {
|
if (_forceRecheckEntities || movedEnough || enoughTimeElapsed) {
|
||||||
_avatarPosition = avatarPosition;
|
_avatarPosition = avatarPosition;
|
||||||
_lastZoneCheck = now;
|
_lastZoneCheck = now;
|
||||||
QVector<EntityItemID> entitiesContainingAvatar;
|
_forceRecheckEntities = false;
|
||||||
didUpdate = findBestZoneAndMaybeContainingEntities(&entitiesContainingAvatar);
|
|
||||||
|
QSet<EntityItemID> entitiesContainingAvatar;
|
||||||
|
didUpdate = findBestZoneAndMaybeContainingEntities(entitiesContainingAvatar);
|
||||||
|
|
||||||
// Note: at this point we don't need to worry about the tree being locked, because we only deal with
|
// Note: at this point we don't need to worry about the tree being locked, because we only deal with
|
||||||
// EntityItemIDs from here. The callEntityScriptMethod() method is robust against attempting to call scripts
|
// EntityItemIDs from here. The callEntityScriptMethod() method is robust against attempting to call scripts
|
||||||
// for entity IDs that no longer exist.
|
// for entity IDs that no longer exist.
|
||||||
|
|
||||||
// for all of our previous containing entities, if they are no longer containing then send them a leave event
|
if (_entitiesScriptEngine) {
|
||||||
foreach(const EntityItemID& entityID, _currentEntitiesInside) {
|
// for all of our previous containing entities, if they are no longer containing then send them a leave event
|
||||||
if (!entitiesContainingAvatar.contains(entityID)) {
|
foreach(const EntityItemID& entityID, _currentEntitiesInside) {
|
||||||
emit leaveEntity(entityID);
|
if (!entitiesContainingAvatar.contains(entityID)) {
|
||||||
if (_entitiesScriptEngine) {
|
emit leaveEntity(entityID);
|
||||||
_entitiesScriptEngine->callEntityScriptMethod(entityID, "leaveEntity");
|
_entitiesScriptEngine->callEntityScriptMethod(entityID, "leaveEntity");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// for all of our new containing entities, if they weren't previously containing then send them an enter event
|
// for all of our new containing entities, if they weren't previously containing then send them an enter event
|
||||||
foreach(const EntityItemID& entityID, entitiesContainingAvatar) {
|
foreach(const EntityItemID& entityID, entitiesContainingAvatar) {
|
||||||
if (!_currentEntitiesInside.contains(entityID)) {
|
if (!_currentEntitiesInside.contains(entityID)) {
|
||||||
emit enterEntity(entityID);
|
emit enterEntity(entityID);
|
||||||
if (_entitiesScriptEngine) {
|
|
||||||
_entitiesScriptEngine->callEntityScriptMethod(entityID, "enterEntity");
|
_entitiesScriptEngine->callEntityScriptMethod(entityID, "enterEntity");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_currentEntitiesInside = entitiesContainingAvatar;
|
||||||
}
|
}
|
||||||
_currentEntitiesInside = entitiesContainingAvatar;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return didUpdate;
|
return didUpdate;
|
||||||
|
@ -653,7 +654,7 @@ bool EntityTreeRenderer::checkEnterLeaveEntities() {
|
||||||
|
|
||||||
void EntityTreeRenderer::leaveDomainAndNonOwnedEntities() {
|
void EntityTreeRenderer::leaveDomainAndNonOwnedEntities() {
|
||||||
if (_tree && !_shuttingDown) {
|
if (_tree && !_shuttingDown) {
|
||||||
QVector<EntityItemID> currentEntitiesInsideToSave;
|
QSet<EntityItemID> currentEntitiesInsideToSave;
|
||||||
foreach (const EntityItemID& entityID, _currentEntitiesInside) {
|
foreach (const EntityItemID& entityID, _currentEntitiesInside) {
|
||||||
EntityItemPointer entityItem = getTree()->findEntityByEntityItemID(entityID);
|
EntityItemPointer entityItem = getTree()->findEntityByEntityItemID(entityID);
|
||||||
if (!(entityItem->isLocalEntity() || (entityItem->isAvatarEntity() && entityItem->getOwningAvatarID() == getTree()->getMyAvatarSessionUUID()))) {
|
if (!(entityItem->isLocalEntity() || (entityItem->isAvatarEntity() && entityItem->getOwningAvatarID() == getTree()->getMyAvatarSessionUUID()))) {
|
||||||
|
@ -662,7 +663,7 @@ void EntityTreeRenderer::leaveDomainAndNonOwnedEntities() {
|
||||||
_entitiesScriptEngine->callEntityScriptMethod(entityID, "leaveEntity");
|
_entitiesScriptEngine->callEntityScriptMethod(entityID, "leaveEntity");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
currentEntitiesInsideToSave.push_back(entityID);
|
currentEntitiesInsideToSave.insert(entityID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -687,9 +688,7 @@ void EntityTreeRenderer::leaveAllEntities() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityTreeRenderer::forceRecheckEntities() {
|
void EntityTreeRenderer::forceRecheckEntities() {
|
||||||
// make sure our "last avatar position" is something other than our current position,
|
_forceRecheckEntities = true;
|
||||||
// so that on our next chance, we'll check for enter/leave entity events.
|
|
||||||
_avatarPosition = _viewState->getAvatarPosition() + glm::vec3((float)TREE_SCALE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EntityTreeRenderer::applyLayeredZones() {
|
bool EntityTreeRenderer::applyLayeredZones() {
|
||||||
|
@ -992,7 +991,10 @@ void EntityTreeRenderer::deletingEntity(const EntityItemID& entityID) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_tree && !_shuttingDown && _entitiesScriptEngine) {
|
if (_tree && !_shuttingDown && _entitiesScriptEngine && !itr->second->getEntity()->getScript().isEmpty()) {
|
||||||
|
if (itr->second->getEntity()->contains(_avatarPosition)) {
|
||||||
|
_entitiesScriptEngine->callEntityScriptMethod(entityID, "leaveEntity");
|
||||||
|
}
|
||||||
_entitiesScriptEngine->unloadEntityScript(entityID, true);
|
_entitiesScriptEngine->unloadEntityScript(entityID, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1038,6 +1040,9 @@ void EntityTreeRenderer::checkAndCallPreload(const EntityItemID& entityID, bool
|
||||||
QString scriptUrl = entity->getScript();
|
QString scriptUrl = entity->getScript();
|
||||||
if ((shouldLoad && unloadFirst) || scriptUrl.isEmpty()) {
|
if ((shouldLoad && unloadFirst) || scriptUrl.isEmpty()) {
|
||||||
if (_entitiesScriptEngine) {
|
if (_entitiesScriptEngine) {
|
||||||
|
if (entity->contains(_avatarPosition)) {
|
||||||
|
_entitiesScriptEngine->callEntityScriptMethod(entityID, "leaveEntity");
|
||||||
|
}
|
||||||
_entitiesScriptEngine->unloadEntityScript(entityID);
|
_entitiesScriptEngine->unloadEntityScript(entityID);
|
||||||
}
|
}
|
||||||
entity->scriptHasUnloaded();
|
entity->scriptHasUnloaded();
|
||||||
|
|
|
@ -169,7 +169,7 @@ private:
|
||||||
|
|
||||||
void resetEntitiesScriptEngine();
|
void resetEntitiesScriptEngine();
|
||||||
|
|
||||||
bool findBestZoneAndMaybeContainingEntities(QVector<EntityItemID>* entitiesContainingAvatar = nullptr);
|
bool findBestZoneAndMaybeContainingEntities(QSet<EntityItemID>& entitiesContainingAvatar);
|
||||||
|
|
||||||
bool applyLayeredZones();
|
bool applyLayeredZones();
|
||||||
void stopDomainAndNonOwnedEntities();
|
void stopDomainAndNonOwnedEntities();
|
||||||
|
@ -186,7 +186,8 @@ private:
|
||||||
void forceRecheckEntities();
|
void forceRecheckEntities();
|
||||||
|
|
||||||
glm::vec3 _avatarPosition { 0.0f };
|
glm::vec3 _avatarPosition { 0.0f };
|
||||||
QVector<EntityItemID> _currentEntitiesInside;
|
bool _forceRecheckEntities { true };
|
||||||
|
QSet<EntityItemID> _currentEntitiesInside;
|
||||||
|
|
||||||
bool _wantScripts;
|
bool _wantScripts;
|
||||||
ScriptEnginePointer _entitiesScriptEngine;
|
ScriptEnginePointer _entitiesScriptEngine;
|
||||||
|
|
|
@ -219,9 +219,10 @@ controller::Input KeyboardMouseDevice::InputDevice::makeInput(KeyboardMouseDevic
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* <p>The <code>Controller.Hardware.Keyboard</code> object has properties representing keyboard, mouse, and display touch
|
* <p>The <code>Controller.Hardware.Keyboard</code> object has properties representing keyboard, mouse, and display touch
|
||||||
* events. The property values are integer IDs, uniquely identifying each output. <em>Read-only.</em> These can be mapped to
|
* events. The property values are integer IDs, uniquely identifying each output. <em>Read-only.</em></p>
|
||||||
* actions or functions or <code>Controller.Standard</code> items in a {@link RouteObject} mapping. For presses, each data
|
* <p>These events can be mapped to actions or functions or <code>Controller.Standard</code> items in a {@link RouteObject}
|
||||||
* value is either <code>1.0</code> for "true" or <code>0.0</code> for "false".</p>
|
* mapping. For presses, each data value is either <code>1.0</code> for "true" or <code>0.0</code> for "false".</p>
|
||||||
|
*
|
||||||
* <table>
|
* <table>
|
||||||
* <thead>
|
* <thead>
|
||||||
* <tr><th>Property</th><th>Type</th><td>Data</th><th>Description</th></tr>
|
* <tr><th>Property</th><th>Type</th><td>Data</th><th>Description</th></tr>
|
||||||
|
@ -269,14 +270,18 @@ controller::Input KeyboardMouseDevice::InputDevice::makeInput(KeyboardMouseDevic
|
||||||
* new x-coordinate value.</td></tr>
|
* new x-coordinate value.</td></tr>
|
||||||
* <tr><td><code>MouseY</code></td><td>number</td><td>number</td><td>The mouse y-coordinate changed. The data value is its
|
* <tr><td><code>MouseY</code></td><td>number</td><td>number</td><td>The mouse y-coordinate changed. The data value is its
|
||||||
* new y-coordinate value.</td></tr>
|
* new y-coordinate value.</td></tr>
|
||||||
* <tr><td><code>MouseWheelRight</code></td><td>number</td><td>number</td><td>The mouse wheel rotated left. The data value
|
* <tr><td><code>MouseWheelRight</code></td><td>number</td><td>number</td><td>The mouse wheel rotated right. The data value
|
||||||
* is the number of units rotated (typically <code>1.0</code>).</td></tr>
|
* is the number of units rotated (typically <code>1.0</code>).</td></tr>
|
||||||
* <tr><td><code>MouseWheelLeft</code></td><td>number</td><td>number</td><td>The mouse wheel rotated left. The data value
|
* <tr><td><code>MouseWheelLeft</code></td><td>number</td><td>number</td><td>The mouse wheel rotated left. The data value
|
||||||
* is the number of units rotated (typically <code>1.0</code>).</td></tr>
|
* is the number of units rotated (typically <code>1.0</code>).</td></tr>
|
||||||
* <tr><td><code>MouseWheelUp</code></td><td>number</td><td>number</td><td>The mouse wheel rotated up. The data value
|
* <tr><td><code>MouseWheelUp</code></td><td>number</td><td>number</td><td>The mouse wheel rotated up. The data value
|
||||||
* is the number of units rotated (typically <code>1.0</code>).</td></tr>
|
* is the number of units rotated (typically <code>1.0</code>).<br />
|
||||||
|
* <strong>Warning:</strong> The mouse wheel in an ordinary mouse generates left/right wheel events instead of
|
||||||
|
* up/down.</td></tr>
|
||||||
* <tr><td><code>MouseWheelDown</code></td><td>number</td><td>number</td><td>The mouse wheel rotated down. The data value
|
* <tr><td><code>MouseWheelDown</code></td><td>number</td><td>number</td><td>The mouse wheel rotated down. The data value
|
||||||
* is the number of units rotated (typically <code>1.0</code>).</td></tr>
|
* is the number of units rotated (typically <code>1.0</code>).<br />
|
||||||
|
* <strong>Warning:</strong> The mouse wheel in an ordinary mouse generates left/right wheel events instead of
|
||||||
|
* up/down.</td></tr>
|
||||||
* <tr><td><code>TouchpadRight</code></td><td>number</td><td>number</td><td>The average touch on a touch-enabled device
|
* <tr><td><code>TouchpadRight</code></td><td>number</td><td>number</td><td>The average touch on a touch-enabled device
|
||||||
* moved right. The data value is how far the average position of all touch points moved.</td></tr>
|
* moved right. The data value is how far the average position of all touch points moved.</td></tr>
|
||||||
* <tr><td><code>TouchpadLeft</code></td><td>number</td><td>number</td><td>The average touch on a touch-enabled device
|
* <tr><td><code>TouchpadLeft</code></td><td>number</td><td>number</td><td>The average touch on a touch-enabled device
|
||||||
|
@ -288,7 +293,6 @@ controller::Input KeyboardMouseDevice::InputDevice::makeInput(KeyboardMouseDevic
|
||||||
* </tbody>
|
* </tbody>
|
||||||
* </table>
|
* </table>
|
||||||
* @typedef {object} Controller.Hardware-Keyboard
|
* @typedef {object} Controller.Hardware-Keyboard
|
||||||
* @todo <em>Currently, the mouse wheel in an ordinary mouse generates left/right wheel events instead of up/down.</em>
|
|
||||||
*/
|
*/
|
||||||
controller::Input::NamedVector KeyboardMouseDevice::InputDevice::getAvailableInputs() const {
|
controller::Input::NamedVector KeyboardMouseDevice::InputDevice::getAvailableInputs() const {
|
||||||
using namespace controller;
|
using namespace controller;
|
||||||
|
|
|
@ -261,6 +261,61 @@ void Midi::MidiCleanup() {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* A MIDI message.
|
||||||
|
* <p><strong>Warning:</strong> The <code>status</code> property is NOT a MIDI status value.</p>
|
||||||
|
* @typedef {object} Midi.MidiMessage
|
||||||
|
* @property {number} device - Device number.
|
||||||
|
* @property {Midi.RawMidiMessage} raw - Raw MIDI message.
|
||||||
|
* @property {number} status - Channel + status. <em>Legacy value.</em>
|
||||||
|
* @property {number} channel - Channel: <code>1</code> – <code>16</code>.
|
||||||
|
* @property {number} type - Status: {@link Midi.MidiStatus}; <code>8</code> – <code>15</code>.
|
||||||
|
* @property {number} note - Note: <code>0</code> – <code>127</code>.
|
||||||
|
* @property {number} velocity - Note velocity: <code>0</code> – <code>127</code>. (<code>0</code> means "note off".)
|
||||||
|
* @property {number} bend - Pitch bend: <code>-8192</code> – <code>8191</code>.
|
||||||
|
* @property {number} program - Program change: <code>0</code> – <code>127</code>.
|
||||||
|
*/
|
||||||
|
/**jsdoc
|
||||||
|
* An integer DWORD (unsigned 32 bit) message with bits having values as follows:
|
||||||
|
* <table>
|
||||||
|
* <tbody>
|
||||||
|
* <tr>
|
||||||
|
* <td width=25%><code>00000000</code></td>
|
||||||
|
* <td width=25%><code>0vvvvvvv</code></td>
|
||||||
|
* <td width=25%><code>0nnnnnnn</code></td>
|
||||||
|
* <td width=12%><code>1sss</code></td>
|
||||||
|
* <td width=12%><code>cccc</code></td>
|
||||||
|
* </tbody>
|
||||||
|
* </table>
|
||||||
|
* <p>Where:</p>
|
||||||
|
* <ul>
|
||||||
|
* <li><code>v</code> = Velocity.
|
||||||
|
* <li><code>n</code> = Note.
|
||||||
|
* <li><code>s</code> = Status - {@link Midi.MidiStatus}
|
||||||
|
* <li><code>c</code> = Channel.
|
||||||
|
* </ul>
|
||||||
|
* <p>The number in the first bit of each byte denotes whether it is a command (1) or data (0).
|
||||||
|
* @typedef {number} Midi.RawMidiMessage
|
||||||
|
*/
|
||||||
|
/**jsdoc
|
||||||
|
* <p>A MIDI status value. The following MIDI status values are supported:</p>
|
||||||
|
* <table>
|
||||||
|
* <thead>
|
||||||
|
* <tr><th>Value</th><th>Description</th>
|
||||||
|
* </thead>
|
||||||
|
* <tbody>
|
||||||
|
* <tr><td><code>8</code></td><td>Note off.</td></tr>
|
||||||
|
* <tr><td><code>9</code></td><td>Note on.</td></tr>
|
||||||
|
* <tr><td><code>10</code></td><td>Polyphonic key pressure.</td></tr>
|
||||||
|
* <tr><td><code>11</code></td><td>Control change.</td></tr>
|
||||||
|
* <tr><td><code>12</code></td><td>Program change.</td></tr>
|
||||||
|
* <tr><td><code>13</code></td><td>Channel pressure.</td></tr>
|
||||||
|
* <tr><td><code>14</code></td><td>Pitch bend.</td></tr>
|
||||||
|
* <tr><td><code>15</code></td><td>System message.</td></tr>
|
||||||
|
* </tbody>
|
||||||
|
* </table>
|
||||||
|
* @typedef {number} Midi.MidiStatus
|
||||||
|
*/
|
||||||
void Midi::midiReceived(int device, int raw, int channel, int status, int type, int note, int velocity, int bend, int program) {
|
void Midi::midiReceived(int device, int raw, int channel, int status, int type, int note, int velocity, int bend, int program) {
|
||||||
QVariantMap eventData;
|
QVariantMap eventData;
|
||||||
eventData["device"] = device;
|
eventData["device"] = device;
|
||||||
|
|
|
@ -21,6 +21,12 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
* The <code>Midi</code> API provides the ability to connect Interface with musical instruments and other external or virtual
|
||||||
|
* devices via the MIDI protocol. For further information and examples, see the tutorial:
|
||||||
|
* <a href="https://docs.highfidelity.com/en/rc81/script/midi-tutorial.html">Use MIDI to Control Your Environment</a>.</p>
|
||||||
|
*
|
||||||
|
* <p><strong>Note:</strong> Only works on Windows.</p>
|
||||||
|
*
|
||||||
* @namespace Midi
|
* @namespace Midi
|
||||||
*
|
*
|
||||||
* @hifi-interface
|
* @hifi-interface
|
||||||
|
@ -49,88 +55,112 @@ private:
|
||||||
void MidiCleanup();
|
void MidiCleanup();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void midiNote(QVariantMap eventData);
|
|
||||||
void midiMessage(QVariantMap eventData);
|
|
||||||
void midiReset();
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Send Raw MIDI packet to a particular device.
|
* Triggered when a connected device sends an output.
|
||||||
|
* @function Midi.midiNote
|
||||||
|
* @param {Midi.MidiMessage} message - The MIDI message.
|
||||||
|
* @returns {Signal}
|
||||||
|
* @deprecated This signal is deprecated and will be removed. Use {@link Midi.midiMessage|midiMessage} instead.
|
||||||
|
*/
|
||||||
|
void midiNote(QVariantMap eventData);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when a connected device sends an output.
|
||||||
|
* @function Midi.midiMessage
|
||||||
|
* @param {Midi.MidiMessage} message - The MIDI message.
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void midiMessage(QVariantMap eventData);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when the system detects there was a reset such as when a device is plugged in or unplugged.
|
||||||
|
* @function Midi.midiReset
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void midiReset();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Sends a raw MIDI packet to a particular device.
|
||||||
* @function Midi.sendRawDword
|
* @function Midi.sendRawDword
|
||||||
* @param {number} device - Integer device number.
|
* @param {number} device - Integer device number.
|
||||||
* @param {number} raw - Integer (DWORD) raw MIDI message.
|
* @param {Midi.RawMidiMessage} raw - Raw MIDI message.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void sendRawDword(int device, int raw);
|
Q_INVOKABLE void sendRawDword(int device, int raw);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Send MIDI message to a particular device.
|
* Sends a MIDI message to a particular device.
|
||||||
* @function Midi.sendMidiMessage
|
* @function Midi.sendMidiMessage
|
||||||
* @param {number} device - Integer device number.
|
* @param {number} device - Integer device number.
|
||||||
* @param {number} channel - Integer channel number.
|
* @param {number} channel - Integer channel number.
|
||||||
* @param {number} type - 0x8 is note off, 0x9 is note on (if velocity=0, note off), etc.
|
* @param {Midi.MidiStatus} type - Integer status value.
|
||||||
* @param {number} note - MIDI note number.
|
* @param {number} note - Note number.
|
||||||
* @param {number} velocity - Note velocity (0 means note off).
|
* @param {number} velocity - Note velocity. (<code>0</code> means "note off".)
|
||||||
|
* @comment The "type" parameter has that name to match up with {@link Midi.MidiMessage}.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void sendMidiMessage(int device, int channel, int type, int note, int velocity);
|
Q_INVOKABLE void sendMidiMessage(int device, int channel, int type, int note, int velocity);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Play a note on all connected devices.
|
* Plays a note on all connected devices.
|
||||||
* @function Midi.playMidiNote
|
* @function Midi.playMidiNote
|
||||||
* @param {number} status - 0x80 is note off, 0x90 is note on (if velocity=0, note off), etc.
|
* @param {MidiStatus} status - Note status.
|
||||||
* @param {number} note - MIDI note number.
|
* @param {number} note - Note number.
|
||||||
* @param {number} velocity - Note velocity (0 means note off).
|
* @param {number} velocity - Note velocity. (<code>0</code> means "note off".)
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void playMidiNote(int status, int note, int velocity);
|
Q_INVOKABLE void playMidiNote(int status, int note, int velocity);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Turn off all notes on all connected devices.
|
* Turns off all notes on all connected MIDI devices.
|
||||||
* @function Midi.allNotesOff
|
* @function Midi.allNotesOff
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void allNotesOff();
|
Q_INVOKABLE void allNotesOff();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Clean up and re-discover attached devices.
|
* Cleans up and rediscovers attached MIDI devices.
|
||||||
* @function Midi.resetDevices
|
* @function Midi.resetDevices
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void resetDevices();
|
Q_INVOKABLE void resetDevices();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Get a list of inputs/outputs.
|
* Gets a list of MIDI input or output devices.
|
||||||
* @function Midi.listMidiDevices
|
* @function Midi.listMidiDevices
|
||||||
* @param {boolean} output
|
* @param {boolean} output - <code>true</code> to list output devices, <code>false</code> to list input devices.
|
||||||
* @returns {string[]}
|
* @returns {string[]}
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE QStringList listMidiDevices(bool output);
|
Q_INVOKABLE QStringList listMidiDevices(bool output);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Block an input/output by name.
|
* Blocks a MIDI device's input or output.
|
||||||
* @function Midi.blockMidiDevice
|
* @function Midi.blockMidiDevice
|
||||||
* @param {string} name
|
* @param {string} name - The name of the MIDI device to block.
|
||||||
* @param {boolean} output
|
* @param {boolean} output - <code>true</code> to block the device's output, <code>false</code> to block its input.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void blockMidiDevice(QString name, bool output);
|
Q_INVOKABLE void blockMidiDevice(QString name, bool output);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Unblock an input/output by name.
|
* Unblocks a MIDI device's input or output.
|
||||||
* @function Midi.unblockMidiDevice
|
* @function Midi.unblockMidiDevice
|
||||||
* @param {string} name
|
* @param {string} name- The name of the MIDI device to unblock.
|
||||||
* @param {boolean} output
|
* @param {boolean} output - <code>true</code> to unblock the device's output, <code>false</code> to unblock its input.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void unblockMidiDevice(QString name, bool output);
|
Q_INVOKABLE void unblockMidiDevice(QString name, bool output);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Repeat all incoming notes to all outputs (default disabled).
|
* Enables or disables repeating all incoming notes to all outputs. (Default is disabled.)
|
||||||
* @function Midi.thruModeEnable
|
* @function Midi.thruModeEnable
|
||||||
* @param {boolean} enable
|
* @param {boolean} enable - <code>true</code> to enable repeating all incoming notes to all output, <code>false</code> to
|
||||||
|
* disable.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void thruModeEnable(bool enable);
|
Q_INVOKABLE void thruModeEnable(bool enable);
|
||||||
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Broadcast on all unblocked devices.
|
* Enables or disables broadcasts to all unblocked devices.
|
||||||
* @function Midi.broadcastEnable
|
* @function Midi.broadcastEnable
|
||||||
* @param {boolean} enable
|
* @param {boolean} enable - <code>true</code> to have "send" functions broadcast to all devices, <code>false</code> to
|
||||||
|
* have them send to specific output devices.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void broadcastEnable(bool enable);
|
Q_INVOKABLE void broadcastEnable(bool enable);
|
||||||
|
|
||||||
|
@ -138,50 +168,58 @@ signals:
|
||||||
/// filter by event types
|
/// filter by event types
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
* Enables or disables note off events.
|
||||||
* @function Midi.typeNoteOffEnable
|
* @function Midi.typeNoteOffEnable
|
||||||
* @param {boolean} enable
|
* @param {boolean} enable - <code>true</code> to enable, <code>false</code> to disable.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void typeNoteOffEnable(bool enable);
|
Q_INVOKABLE void typeNoteOffEnable(bool enable);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
* Enables or disables note on events.
|
||||||
* @function Midi.typeNoteOnEnable
|
* @function Midi.typeNoteOnEnable
|
||||||
* @param {boolean} enable
|
* @param {boolean} enable - <code>true</code> to enable, <code>false</code> to disable.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void typeNoteOnEnable(bool enable);
|
Q_INVOKABLE void typeNoteOnEnable(bool enable);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
* Enables or disables poly key pressure events.
|
||||||
* @function Midi.typePolyKeyPressureEnable
|
* @function Midi.typePolyKeyPressureEnable
|
||||||
* @param {boolean} enable
|
* @param {boolean} enable - <code>true</code> to enable, <code>false</code> to disable.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void typePolyKeyPressureEnable(bool enable);
|
Q_INVOKABLE void typePolyKeyPressureEnable(bool enable);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
* Enables or disables control change events.
|
||||||
* @function Midi.typeControlChangeEnable
|
* @function Midi.typeControlChangeEnable
|
||||||
* @param {boolean} enable
|
* @param {boolean} enable - <code>true</code> to enable, <code>false</code> to disable.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void typeControlChangeEnable(bool enable);
|
Q_INVOKABLE void typeControlChangeEnable(bool enable);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
* Enables or disables program change events.
|
||||||
* @function Midi.typeProgramChangeEnable
|
* @function Midi.typeProgramChangeEnable
|
||||||
* @param {boolean} enable
|
* @param {boolean} enable - <code>true</code> to enable, <code>false</code> to disable.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void typeProgramChangeEnable(bool enable);
|
Q_INVOKABLE void typeProgramChangeEnable(bool enable);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
* Enables or disables channel pressure events.
|
||||||
* @function Midi.typeChanPressureEnable
|
* @function Midi.typeChanPressureEnable
|
||||||
* @param {boolean} enable
|
* @param {boolean} enable - <code>true</code> to enable, <code>false</code> to disable.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void typeChanPressureEnable(bool enable);
|
Q_INVOKABLE void typeChanPressureEnable(bool enable);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
* Enables or disables pitch bend events.
|
||||||
* @function Midi.typePitchBendEnable
|
* @function Midi.typePitchBendEnable
|
||||||
* @param {boolean} enable
|
* @param {boolean} enable - <code>true</code> to enable, <code>false</code> to disable.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void typePitchBendEnable(bool enable);
|
Q_INVOKABLE void typePitchBendEnable(bool enable);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
* Enables or disables system message events.
|
||||||
* @function Midi.typeSystemMessageEnable
|
* @function Midi.typeSystemMessageEnable
|
||||||
* @param {boolean} enable
|
* @param {boolean} enable - <code>true</code> to enable, <code>false</code> to disable.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void typeSystemMessageEnable(bool enable);
|
Q_INVOKABLE void typeSystemMessageEnable(bool enable);
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ void CongestionControl::setMaxBandwidth(int maxBandwidth) {
|
||||||
void CongestionControl::setPacketSendPeriod(double newSendPeriod) {
|
void CongestionControl::setPacketSendPeriod(double newSendPeriod) {
|
||||||
Q_ASSERT_X(newSendPeriod >= 0, "CongestionControl::setPacketPeriod", "Can not set a negative packet send period");
|
Q_ASSERT_X(newSendPeriod >= 0, "CongestionControl::setPacketPeriod", "Can not set a negative packet send period");
|
||||||
|
|
||||||
auto packetsPerSecond = (double)_maxBandwidth / (BITS_PER_BYTE * _mss);
|
auto packetsPerSecond = _mss > 0 ? (double)_maxBandwidth / (BITS_PER_BYTE * _mss) : -1.0;
|
||||||
if (packetsPerSecond > 0.0) {
|
if (packetsPerSecond > 0.0) {
|
||||||
// anytime the packet send period is about to be increased, make sure it stays below the minimum period,
|
// anytime the packet send period is about to be increased, make sure it stays below the minimum period,
|
||||||
// calculated based on the maximum desired bandwidth
|
// calculated based on the maximum desired bandwidth
|
||||||
|
|
|
@ -237,9 +237,11 @@ void CauterizedModel::updateRenderItems() {
|
||||||
if (useDualQuaternionSkinning) {
|
if (useDualQuaternionSkinning) {
|
||||||
data.updateClusterBuffer(meshState.clusterDualQuaternions,
|
data.updateClusterBuffer(meshState.clusterDualQuaternions,
|
||||||
cauterizedMeshState.clusterDualQuaternions);
|
cauterizedMeshState.clusterDualQuaternions);
|
||||||
|
data.computeAdjustedLocalBound(meshState.clusterDualQuaternions);
|
||||||
} else {
|
} else {
|
||||||
data.updateClusterBuffer(meshState.clusterMatrices,
|
data.updateClusterBuffer(meshState.clusterMatrices,
|
||||||
cauterizedMeshState.clusterMatrices);
|
cauterizedMeshState.clusterMatrices);
|
||||||
|
data.computeAdjustedLocalBound(meshState.clusterMatrices);
|
||||||
}
|
}
|
||||||
|
|
||||||
Transform renderTransform = modelTransform;
|
Transform renderTransform = modelTransform;
|
||||||
|
|
|
@ -450,9 +450,9 @@ void ModelMeshPartPayload::render(RenderArgs* args) {
|
||||||
void ModelMeshPartPayload::computeAdjustedLocalBound(const std::vector<glm::mat4>& clusterMatrices) {
|
void ModelMeshPartPayload::computeAdjustedLocalBound(const std::vector<glm::mat4>& clusterMatrices) {
|
||||||
_adjustedLocalBound = _localBound;
|
_adjustedLocalBound = _localBound;
|
||||||
if (clusterMatrices.size() > 0) {
|
if (clusterMatrices.size() > 0) {
|
||||||
_adjustedLocalBound.transform(clusterMatrices[0]);
|
_adjustedLocalBound.transform(clusterMatrices.back());
|
||||||
|
|
||||||
for (int i = 1; i < (int)clusterMatrices.size(); ++i) {
|
for (int i = 0; i < (int)clusterMatrices.size() - 1; ++i) {
|
||||||
AABox clusterBound = _localBound;
|
AABox clusterBound = _localBound;
|
||||||
clusterBound.transform(clusterMatrices[i]);
|
clusterBound.transform(clusterMatrices[i]);
|
||||||
_adjustedLocalBound += clusterBound;
|
_adjustedLocalBound += clusterBound;
|
||||||
|
@ -463,12 +463,12 @@ void ModelMeshPartPayload::computeAdjustedLocalBound(const std::vector<glm::mat4
|
||||||
void ModelMeshPartPayload::computeAdjustedLocalBound(const std::vector<Model::TransformDualQuaternion>& clusterDualQuaternions) {
|
void ModelMeshPartPayload::computeAdjustedLocalBound(const std::vector<Model::TransformDualQuaternion>& clusterDualQuaternions) {
|
||||||
_adjustedLocalBound = _localBound;
|
_adjustedLocalBound = _localBound;
|
||||||
if (clusterDualQuaternions.size() > 0) {
|
if (clusterDualQuaternions.size() > 0) {
|
||||||
Transform rootTransform(clusterDualQuaternions[0].getRotation(),
|
Transform rootTransform(clusterDualQuaternions.back().getRotation(),
|
||||||
clusterDualQuaternions[0].getScale(),
|
clusterDualQuaternions.back().getScale(),
|
||||||
clusterDualQuaternions[0].getTranslation());
|
clusterDualQuaternions.back().getTranslation());
|
||||||
_adjustedLocalBound.transform(rootTransform);
|
_adjustedLocalBound.transform(rootTransform);
|
||||||
|
|
||||||
for (int i = 1; i < (int)clusterDualQuaternions.size(); ++i) {
|
for (int i = 0; i < (int)clusterDualQuaternions.size() - 1; ++i) {
|
||||||
AABox clusterBound = _localBound;
|
AABox clusterBound = _localBound;
|
||||||
Transform transform(clusterDualQuaternions[i].getRotation(),
|
Transform transform(clusterDualQuaternions[i].getRotation(),
|
||||||
clusterDualQuaternions[i].getScale(),
|
clusterDualQuaternions[i].getScale(),
|
||||||
|
|
|
@ -241,8 +241,10 @@ void Model::updateRenderItems() {
|
||||||
invalidatePayloadShapeKey, primitiveMode, renderItemKeyGlobalFlags, cauterized](ModelMeshPartPayload& data) {
|
invalidatePayloadShapeKey, primitiveMode, renderItemKeyGlobalFlags, cauterized](ModelMeshPartPayload& data) {
|
||||||
if (useDualQuaternionSkinning) {
|
if (useDualQuaternionSkinning) {
|
||||||
data.updateClusterBuffer(meshState.clusterDualQuaternions);
|
data.updateClusterBuffer(meshState.clusterDualQuaternions);
|
||||||
|
data.computeAdjustedLocalBound(meshState.clusterDualQuaternions);
|
||||||
} else {
|
} else {
|
||||||
data.updateClusterBuffer(meshState.clusterMatrices);
|
data.updateClusterBuffer(meshState.clusterMatrices);
|
||||||
|
data.computeAdjustedLocalBound(meshState.clusterMatrices);
|
||||||
}
|
}
|
||||||
|
|
||||||
Transform renderTransform = modelTransform;
|
Transform renderTransform = modelTransform;
|
||||||
|
@ -774,11 +776,14 @@ scriptable::ScriptableModelBase Model::getScriptableModel() {
|
||||||
auto& materialName = _modelMeshMaterialNames[shapeID];
|
auto& materialName = _modelMeshMaterialNames[shapeID];
|
||||||
result.appendMaterial(graphics::MaterialLayer(getGeometry()->getShapeMaterial(shapeID), 0), shapeID, materialName);
|
result.appendMaterial(graphics::MaterialLayer(getGeometry()->getShapeMaterial(shapeID), 0), shapeID, materialName);
|
||||||
|
|
||||||
auto mappedMaterialIter = _materialMapping.find(shapeID);
|
{
|
||||||
if (mappedMaterialIter != _materialMapping.end()) {
|
std::unique_lock<std::mutex> lock(_materialMappingMutex);
|
||||||
auto mappedMaterials = mappedMaterialIter->second;
|
auto mappedMaterialIter = _materialMapping.find(shapeID);
|
||||||
for (auto& mappedMaterial : mappedMaterials) {
|
if (mappedMaterialIter != _materialMapping.end()) {
|
||||||
result.appendMaterial(mappedMaterial, shapeID, materialName);
|
auto mappedMaterials = mappedMaterialIter->second;
|
||||||
|
for (auto& mappedMaterial : mappedMaterials) {
|
||||||
|
result.appendMaterial(mappedMaterial, shapeID, materialName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
shapeID++;
|
shapeID++;
|
||||||
|
@ -1367,8 +1372,6 @@ void Model::simulate(float deltaTime, bool fullUpdate) {
|
||||||
// update the world space transforms for all joints
|
// update the world space transforms for all joints
|
||||||
glm::mat4 parentTransform = glm::scale(_scale) * glm::translate(_offset);
|
glm::mat4 parentTransform = glm::scale(_scale) * glm::translate(_offset);
|
||||||
updateRig(deltaTime, parentTransform);
|
updateRig(deltaTime, parentTransform);
|
||||||
|
|
||||||
computeMeshPartLocalBounds();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1379,17 +1382,6 @@ void Model::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
||||||
_rig.updateAnimations(deltaTime, parentTransform, rigToWorldTransform);
|
_rig.updateAnimations(deltaTime, parentTransform, rigToWorldTransform);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Model::computeMeshPartLocalBounds() {
|
|
||||||
for (auto& part : _modelMeshRenderItems) {
|
|
||||||
const Model::MeshState& state = _meshStates.at(part->_meshIndex);
|
|
||||||
if (_useDualQuaternionSkinning) {
|
|
||||||
part->computeAdjustedLocalBound(state.clusterDualQuaternions);
|
|
||||||
} else {
|
|
||||||
part->computeAdjustedLocalBound(state.clusterMatrices);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
void Model::updateClusterMatrices() {
|
void Model::updateClusterMatrices() {
|
||||||
DETAILED_PERFORMANCE_TIMER("Model::updateClusterMatrices");
|
DETAILED_PERFORMANCE_TIMER("Model::updateClusterMatrices");
|
||||||
|
@ -1569,6 +1561,13 @@ void Model::applyMaterialMapping() {
|
||||||
auto renderItemsKey = _renderItemKeyGlobalFlags;
|
auto renderItemsKey = _renderItemKeyGlobalFlags;
|
||||||
PrimitiveMode primitiveMode = getPrimitiveMode();
|
PrimitiveMode primitiveMode = getPrimitiveMode();
|
||||||
bool useDualQuaternionSkinning = _useDualQuaternionSkinning;
|
bool useDualQuaternionSkinning = _useDualQuaternionSkinning;
|
||||||
|
auto modelMeshRenderItemIDs = _modelMeshRenderItemIDs;
|
||||||
|
auto modelMeshRenderItemShapes = _modelMeshRenderItemShapes;
|
||||||
|
std::unordered_map<int, bool> shouldInvalidatePayloadShapeKeyMap;
|
||||||
|
|
||||||
|
for (auto& shape : _modelMeshRenderItemShapes) {
|
||||||
|
shouldInvalidatePayloadShapeKeyMap[shape.meshIndex] = shouldInvalidatePayloadShapeKey(shape.meshIndex);
|
||||||
|
}
|
||||||
|
|
||||||
auto& materialMapping = getMaterialMapping();
|
auto& materialMapping = getMaterialMapping();
|
||||||
for (auto& mapping : materialMapping) {
|
for (auto& mapping : materialMapping) {
|
||||||
|
@ -1588,7 +1587,8 @@ void Model::applyMaterialMapping() {
|
||||||
priorityMapPerResource[shapeID] = ++_priorityMap[shapeID];
|
priorityMapPerResource[shapeID] = ++_priorityMap[shapeID];
|
||||||
}
|
}
|
||||||
|
|
||||||
auto materialLoaded = [this, networkMaterialResource, shapeIDs, priorityMapPerResource, renderItemsKey, primitiveMode, useDualQuaternionSkinning]() {
|
auto materialLoaded = [this, networkMaterialResource, shapeIDs, priorityMapPerResource, renderItemsKey, primitiveMode, useDualQuaternionSkinning,
|
||||||
|
modelMeshRenderItemIDs, modelMeshRenderItemShapes, shouldInvalidatePayloadShapeKeyMap]() {
|
||||||
if (networkMaterialResource->isFailed() || networkMaterialResource->parsedMaterials.names.size() == 0) {
|
if (networkMaterialResource->isFailed() || networkMaterialResource->parsedMaterials.names.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1611,12 +1611,15 @@ void Model::applyMaterialMapping() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (auto shapeID : shapeIDs) {
|
for (auto shapeID : shapeIDs) {
|
||||||
if (shapeID < _modelMeshRenderItemIDs.size()) {
|
if (shapeID < modelMeshRenderItemIDs.size()) {
|
||||||
auto itemID = _modelMeshRenderItemIDs[shapeID];
|
auto itemID = modelMeshRenderItemIDs[shapeID];
|
||||||
auto meshIndex = _modelMeshRenderItemShapes[shapeID].meshIndex;
|
auto meshIndex = modelMeshRenderItemShapes[shapeID].meshIndex;
|
||||||
bool invalidatePayloadShapeKey = shouldInvalidatePayloadShapeKey(meshIndex);
|
bool invalidatePayloadShapeKey = shouldInvalidatePayloadShapeKeyMap.at(meshIndex);
|
||||||
graphics::MaterialLayer material = graphics::MaterialLayer(networkMaterial, priorityMapPerResource.at(shapeID));
|
graphics::MaterialLayer material = graphics::MaterialLayer(networkMaterial, priorityMapPerResource.at(shapeID));
|
||||||
_materialMapping[shapeID].push_back(material);
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(_materialMappingMutex);
|
||||||
|
_materialMapping[shapeID].push_back(material);
|
||||||
|
}
|
||||||
transaction.updateItem<ModelMeshPartPayload>(itemID, [material, renderItemsKey,
|
transaction.updateItem<ModelMeshPartPayload>(itemID, [material, renderItemsKey,
|
||||||
invalidatePayloadShapeKey, primitiveMode, useDualQuaternionSkinning](ModelMeshPartPayload& data) {
|
invalidatePayloadShapeKey, primitiveMode, useDualQuaternionSkinning](ModelMeshPartPayload& data) {
|
||||||
data.addMaterial(material);
|
data.addMaterial(material);
|
||||||
|
|
|
@ -379,6 +379,7 @@ protected:
|
||||||
|
|
||||||
std::unordered_map<unsigned int, quint16> _priorityMap; // only used for materialMapping
|
std::unordered_map<unsigned int, quint16> _priorityMap; // only used for materialMapping
|
||||||
std::unordered_map<unsigned int, std::vector<graphics::MaterialLayer>> _materialMapping; // generated during applyMaterialMapping
|
std::unordered_map<unsigned int, std::vector<graphics::MaterialLayer>> _materialMapping; // generated during applyMaterialMapping
|
||||||
|
std::mutex _materialMappingMutex;
|
||||||
void applyMaterialMapping();
|
void applyMaterialMapping();
|
||||||
|
|
||||||
void setBlendshapeCoefficients(const QVector<float>& coefficients) { _blendshapeCoefficients = coefficients; }
|
void setBlendshapeCoefficients(const QVector<float>& coefficients) { _blendshapeCoefficients = coefficients; }
|
||||||
|
@ -427,7 +428,6 @@ protected:
|
||||||
void setScaleInternal(const glm::vec3& scale);
|
void setScaleInternal(const glm::vec3& scale);
|
||||||
void snapToRegistrationPoint();
|
void snapToRegistrationPoint();
|
||||||
|
|
||||||
void computeMeshPartLocalBounds();
|
|
||||||
virtual void updateRig(float deltaTime, glm::mat4 parentTransform);
|
virtual void updateRig(float deltaTime, glm::mat4 parentTransform);
|
||||||
|
|
||||||
/// Allow sub classes to force invalidating the bboxes
|
/// Allow sub classes to force invalidating the bboxes
|
||||||
|
|
|
@ -392,6 +392,10 @@ void Scene::updateItems(const Transaction::Updates& transactions) {
|
||||||
void Scene::transitionItems(const Transaction::TransitionAdds& transactions) {
|
void Scene::transitionItems(const Transaction::TransitionAdds& transactions) {
|
||||||
auto transitionStage = getStage<TransitionStage>(TransitionStage::getName());
|
auto transitionStage = getStage<TransitionStage>(TransitionStage::getName());
|
||||||
|
|
||||||
|
if (!transitionStage) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto& add : transactions) {
|
for (auto& add : transactions) {
|
||||||
auto itemId = std::get<0>(add);
|
auto itemId = std::get<0>(add);
|
||||||
// Access the true item
|
// Access the true item
|
||||||
|
@ -433,6 +437,10 @@ void Scene::reApplyTransitions(const Transaction::TransitionReApplies& transacti
|
||||||
void Scene::queryTransitionItems(const Transaction::TransitionQueries& transactions) {
|
void Scene::queryTransitionItems(const Transaction::TransitionQueries& transactions) {
|
||||||
auto transitionStage = getStage<TransitionStage>(TransitionStage::getName());
|
auto transitionStage = getStage<TransitionStage>(TransitionStage::getName());
|
||||||
|
|
||||||
|
if (!transitionStage) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto& query : transactions) {
|
for (auto& query : transactions) {
|
||||||
auto itemId = std::get<0>(query);
|
auto itemId = std::get<0>(query);
|
||||||
// Access the true item
|
// Access the true item
|
||||||
|
@ -553,11 +561,14 @@ void Scene::setItemTransition(ItemID itemId, Index transitionId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::resetItemTransition(ItemID itemId) {
|
void Scene::resetItemTransition(ItemID itemId) {
|
||||||
|
auto transitionStage = getStage<TransitionStage>(TransitionStage::getName());
|
||||||
|
if (!transitionStage) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto& item = _items[itemId];
|
auto& item = _items[itemId];
|
||||||
TransitionStage::Index transitionId = item.getTransitionId();
|
TransitionStage::Index transitionId = item.getTransitionId();
|
||||||
if (!render::TransitionStage::isIndexInvalid(transitionId)) {
|
if (!render::TransitionStage::isIndexInvalid(transitionId)) {
|
||||||
auto transitionStage = getStage<TransitionStage>(TransitionStage::getName());
|
|
||||||
|
|
||||||
auto finishedOperators = _transitionFinishedOperatorMap[transitionId];
|
auto finishedOperators = _transitionFinishedOperatorMap[transitionId];
|
||||||
for (auto finishedOperator : finishedOperators) {
|
for (auto finishedOperator : finishedOperators) {
|
||||||
if (finishedOperator) {
|
if (finishedOperator) {
|
||||||
|
|
|
@ -16,6 +16,13 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Information about a resource request.
|
||||||
|
* @typedef {object} ResourceRequestObserver.ResourceRequest
|
||||||
|
* @property {string} url - The URL of the resource request.
|
||||||
|
* @property {number} callerId - An ID identifying the request.
|
||||||
|
* @property {string} extra - Extra information about the request.
|
||||||
|
*/
|
||||||
void ResourceRequestObserver::update(const QUrl& requestUrl,
|
void ResourceRequestObserver::update(const QUrl& requestUrl,
|
||||||
const qint64 callerId,
|
const qint64 callerId,
|
||||||
const QString& extra) {
|
const QString& extra) {
|
||||||
|
|
|
@ -16,7 +16,15 @@
|
||||||
|
|
||||||
#include "DependencyManager.h"
|
#include "DependencyManager.h"
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* The <code>ResourceRequestObserver</code> API provides notifications when an observable resource request is made.
|
||||||
|
*
|
||||||
|
* @namespace ResourceRequestObserver
|
||||||
|
*
|
||||||
|
* @hifi-interface
|
||||||
|
* @hifi-client-entity
|
||||||
|
* @hifi-avatar
|
||||||
|
*/
|
||||||
class ResourceRequestObserver : public QObject, public Dependency {
|
class ResourceRequestObserver : public QObject, public Dependency {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
SINGLETON_DEPENDENCY
|
SINGLETON_DEPENDENCY
|
||||||
|
@ -25,5 +33,29 @@ public:
|
||||||
void update(const QUrl& requestUrl, const qint64 callerId = -1, const QString& extra = "");
|
void update(const QUrl& requestUrl, const qint64 callerId = -1, const QString& extra = "");
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when an observable resource request is made.
|
||||||
|
* @function ResourceRequestObserver.resourceRequestEvent
|
||||||
|
* @param {ResourceRequestObserver.ResourceRequest} request - Information about the resource request.
|
||||||
|
* @returns {Signal}
|
||||||
|
* @example <caption>Report when a particular Clipboard.importEntities() resource request is made.</caption>
|
||||||
|
* ResourceRequestObserver.resourceRequestEvent.connect(function (request) {
|
||||||
|
* if (request.callerId === 100) {
|
||||||
|
* print("Resource request: " + JSON.stringify(request));
|
||||||
|
* }
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* function importEntities() {
|
||||||
|
* var filename = Window.browse("Import entities to clipboard", "", "*.json");
|
||||||
|
* if (filename) {
|
||||||
|
* Clipboard.importEntities(filename, true, 100);
|
||||||
|
* pastedEntities = Clipboard.pasteEntities(Vec3.sum(MyAvatar.position,
|
||||||
|
* Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })));
|
||||||
|
* print("Entities pasted: " + JSON.stringify(pastedEntities));
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* Script.setTimeout(importEntities, 2000);
|
||||||
|
*/
|
||||||
void resourceRequestEvent(QVariantMap result);
|
void resourceRequestEvent(QVariantMap result);
|
||||||
};
|
};
|
||||||
|
|
|
@ -252,7 +252,9 @@ private slots:
|
||||||
_finished = true;
|
_finished = true;
|
||||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
emit response(_result);
|
emit response(_result);
|
||||||
offscreenUi->removeModalDialog(qobject_cast<QObject*>(this));
|
if (!offscreenUi.isNull()) {
|
||||||
|
offscreenUi->removeModalDialog(qobject_cast<QObject*>(this));
|
||||||
|
}
|
||||||
disconnect(_dialog);
|
disconnect(_dialog);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -409,9 +409,10 @@ void OculusControllerManager::TouchDevice::stopHapticPulse(bool leftHand) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* <p>The <code>Controller.Hardware.OculusTouch</code> object has properties representing Oculus Rift. The property values are
|
* <p>The <code>Controller.Hardware.OculusTouch</code> object has properties representing the Oculus Rift. The property values
|
||||||
* integer IDs, uniquely identifying each output. <em>Read-only.</em> These can be mapped to actions or functions or
|
* are integer IDs, uniquely identifying each output. <em>Read-only.</em></p>
|
||||||
* <code>Controller.Standard</code> items in a {@link RouteObject} mapping.</p>
|
* <p>These outputs can be mapped to actions or functions or <code>Controller.Standard</code> items in a {@link RouteObject}
|
||||||
|
* mapping.</p>
|
||||||
* <table>
|
* <table>
|
||||||
* <thead>
|
* <thead>
|
||||||
* <tr><th>Property</th><th>Type</th><th>Data</th><th>Description</th></tr>
|
* <tr><th>Property</th><th>Type</th><th>Data</th><th>Description</th></tr>
|
||||||
|
|
|
@ -1299,14 +1299,20 @@ void ViveControllerManager::InputDevice::setConfigFromString(const QString& valu
|
||||||
}
|
}
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* <p>The <code>Controller.Hardware.Vive</code> object has properties representing Vive. The property values are integer IDs,
|
* <p>The <code>Controller.Hardware.Vive</code> object has properties representing the Vive. The property values are integer
|
||||||
* uniquely identifying each output. <em>Read-only.</em> These can be mapped to actions or functions or
|
* IDs, uniquely identifying each output. <em>Read-only.</em></p>
|
||||||
* <code>Controller.Standard</code> items in a {@link RouteObject} mapping.</p>
|
* <p>These outputs can be mapped to actions or functions or <code>Controller.Standard</code> items in a {@link RouteObject}
|
||||||
|
* mapping.</p>
|
||||||
* <table>
|
* <table>
|
||||||
* <thead>
|
* <thead>
|
||||||
* <tr><th>Property</th><th>Type</th><th>Data</th><th>Description</th></tr>
|
* <tr><th>Property</th><th>Type</th><th>Data</th><th>Description</th></tr>
|
||||||
* </thead>
|
* </thead>
|
||||||
* <tbody>
|
* <tbody>
|
||||||
|
* <tr><td colspan="4"><strong>Buttons</strong></td></tr>
|
||||||
|
* <tr><td><code>LeftApplicationMenu</code></td><td>number</td><td>number</td><td>Left application menu button pressed.
|
||||||
|
* </td></tr>
|
||||||
|
* <tr><td><code>RightApplicationMenu</code></td><td>number</td><td>number</td><td>Right application menu button pressed.
|
||||||
|
* </td></tr>
|
||||||
* <tr><td colspan="4"><strong>Touch Pad (Sticks)</strong></td></tr>
|
* <tr><td colspan="4"><strong>Touch Pad (Sticks)</strong></td></tr>
|
||||||
* <tr><td><code>LX</code></td><td>number</td><td>number</td><td>Left touch pad x-axis scale.</td></tr>
|
* <tr><td><code>LX</code></td><td>number</td><td>number</td><td>Left touch pad x-axis scale.</td></tr>
|
||||||
* <tr><td><code>LY</code></td><td>number</td><td>number</td><td>Left touch pad y-axis scale.</td></tr>
|
* <tr><td><code>LY</code></td><td>number</td><td>number</td><td>Left touch pad y-axis scale.</td></tr>
|
||||||
|
|
|
@ -94,7 +94,7 @@ def parse_args():
|
||||||
parser.add_argument('--vcpkg-root', type=str, help='The location of the vcpkg distribution')
|
parser.add_argument('--vcpkg-root', type=str, help='The location of the vcpkg distribution')
|
||||||
parser.add_argument('--build-root', required=True, type=str, help='The location of the cmake build')
|
parser.add_argument('--build-root', required=True, type=str, help='The location of the cmake build')
|
||||||
parser.add_argument('--ports-path', type=str, default=defaultPortsPath)
|
parser.add_argument('--ports-path', type=str, default=defaultPortsPath)
|
||||||
parser.add_argument('--ci-build', action='store_true')
|
parser.add_argument('--ci-build', action='store_true', default=os.getenv('CI_BUILD') is not None)
|
||||||
if True:
|
if True:
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -203,7 +203,7 @@ function setAwayProperties() {
|
||||||
if (!wasMuted) {
|
if (!wasMuted) {
|
||||||
Audio.muted = !Audio.muted;
|
Audio.muted = !Audio.muted;
|
||||||
}
|
}
|
||||||
MyAvatar.setEnableMeshVisible(false); // just for our own display, without changing point of view
|
MyAvatar.setEnableMeshVisible(false); // just for our own display, without changing point of view
|
||||||
playAwayAnimation(); // animation is still seen by others
|
playAwayAnimation(); // animation is still seen by others
|
||||||
showOverlay();
|
showOverlay();
|
||||||
|
|
||||||
|
@ -223,8 +223,8 @@ function setAwayProperties() {
|
||||||
|
|
||||||
function setActiveProperties() {
|
function setActiveProperties() {
|
||||||
isAway = false;
|
isAway = false;
|
||||||
if (!wasMuted) {
|
if (Audio.muted && !wasMuted) {
|
||||||
Audio.muted = !Audio.muted;
|
Audio.muted = false;
|
||||||
}
|
}
|
||||||
MyAvatar.setEnableMeshVisible(true); // IWBNI we respected Developer->Avatar->Draw Mesh setting.
|
MyAvatar.setEnableMeshVisible(true); // IWBNI we respected Developer->Avatar->Draw Mesh setting.
|
||||||
stopAwayAnimation();
|
stopAwayAnimation();
|
||||||
|
@ -254,7 +254,7 @@ function setActiveProperties() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function maybeGoActive(event) {
|
function maybeGoActive(event) {
|
||||||
if (event.isAutoRepeat) { // isAutoRepeat is true when held down (or when Windows feels like it)
|
if (event.isAutoRepeat) { // isAutoRepeat is true when held down (or when Windows feels like it)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isAway && (event.text === 'ESC')) {
|
if (!isAway && (event.text === 'ESC')) {
|
||||||
|
@ -314,6 +314,13 @@ function setEnabled(value) {
|
||||||
isEnabled = value;
|
isEnabled = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkAudioToggled() {
|
||||||
|
if (isAway && !Audio.muted) {
|
||||||
|
goActive();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var CHANNEL_AWAY_ENABLE = "Hifi-Away-Enable";
|
var CHANNEL_AWAY_ENABLE = "Hifi-Away-Enable";
|
||||||
var handleMessage = function(channel, message, sender) {
|
var handleMessage = function(channel, message, sender) {
|
||||||
if (channel === CHANNEL_AWAY_ENABLE && sender === MyAvatar.sessionUUID) {
|
if (channel === CHANNEL_AWAY_ENABLE && sender === MyAvatar.sessionUUID) {
|
||||||
|
@ -324,9 +331,10 @@ var handleMessage = function(channel, message, sender) {
|
||||||
Messages.subscribe(CHANNEL_AWAY_ENABLE);
|
Messages.subscribe(CHANNEL_AWAY_ENABLE);
|
||||||
Messages.messageReceived.connect(handleMessage);
|
Messages.messageReceived.connect(handleMessage);
|
||||||
|
|
||||||
var maybeIntervalTimer = Script.setInterval(function(){
|
var maybeIntervalTimer = Script.setInterval(function() {
|
||||||
maybeMoveOverlay();
|
maybeMoveOverlay();
|
||||||
maybeGoAway();
|
maybeGoAway();
|
||||||
|
checkAudioToggled();
|
||||||
}, BASIC_TIMER_INTERVAL);
|
}, BASIC_TIMER_INTERVAL);
|
||||||
|
|
||||||
|
|
||||||
|
|
36
tools/ci-scripts/hifi_backtrace_post.py
Normal file
36
tools/ci-scripts/hifi_backtrace_post.py
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# Parameters:
|
||||||
|
# 1 - $BACKTRACE_UPLOAD_TOKEN
|
||||||
|
# 2 - $SYMBOLS_ARCHIVE
|
||||||
|
# 3 - $RELEASE_NUMBER
|
||||||
|
#
|
||||||
|
import sys
|
||||||
|
import urllib.request
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
|
print("Running python script to upload to BackTrace")
|
||||||
|
|
||||||
|
post_headers = {}
|
||||||
|
post_headers['Content-Type'] = 'application/json'
|
||||||
|
post_headers['Expect'] = ''
|
||||||
|
|
||||||
|
post_url = 'https://highfidelity.sp.backtrace.io:6098/post?format=symbols&token=' + sys.argv[1] + '&upload_file=' + sys.argv[2] + '&tag=' + sys.argv[3]
|
||||||
|
|
||||||
|
try:
|
||||||
|
post_data = open(sys.argv[2], 'rb')
|
||||||
|
except:
|
||||||
|
print('file ' + sys.argv[2] + ' not found')
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
try:
|
||||||
|
post_request = urllib.request.Request(post_url, post_data, post_headers)
|
||||||
|
except:
|
||||||
|
print('urllib.request.Request failed')
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
try:
|
||||||
|
post_response = urllib.request.urlopen(post_request)
|
||||||
|
except:
|
||||||
|
print('urllib.request.urlopen failed')
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
print("Upload to BackTrace completed without errors")
|
Loading…
Reference in a new issue