Include the Oculus SDK instead of downloading it
This commit is contained in:
+13
-19
@@ -58,14 +58,6 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Cache Oculus SDK
|
||||
id: cache-oculus-sdk
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
ovr_openxr_mobile_sdk_46.0.zip
|
||||
key: oculus-sdk-46
|
||||
|
||||
- name: set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
@@ -78,26 +70,28 @@ jobs:
|
||||
sudo apt-get update && sudo apt-get install glslang-tools
|
||||
|
||||
- name: Secrets
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
env:
|
||||
WIVRNBOTKEY: ${{ secrets.WIVRNBOTKEY }}
|
||||
APK_SIGNINGKEYPASSWORD: ${{ secrets.APK_SIGNINGKEYPASSWORD }}
|
||||
APK_KEYSTORE_BASE64: ${{ secrets.APK_KEYSTORE_BASE64 }}
|
||||
run: |
|
||||
echo "$WIVRNBOTKEY" > id_ed25519
|
||||
chmod 600 id_ed25519
|
||||
echo signingKeyPassword="$APK_SIGNINGKEYPASSWORD" > gradle.properties
|
||||
echo "$APK_KEYSTORE_BASE64" | base64 --decode --ignore-garbage > ks.keystore
|
||||
|
||||
- name: Download Oculus SDK
|
||||
if: steps.cache-oculus-sdk.outputs.cache-hit != 'true'
|
||||
run: sftp -i id_ed25519 -o StrictHostKeyChecking=no wivrn-bot@meumeu.org:data/ovr_openxr_mobile_sdk_46.0.zip .
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Build with Gradle
|
||||
- name: Build (debug only)
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: |
|
||||
chmod +x gradlew
|
||||
./gradlew assembleOculusDebug assembleOculusDebugWithValidationLayer
|
||||
|
||||
- name: Build
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
run: |
|
||||
chmod +x gradlew
|
||||
./gradlew build
|
||||
|
||||
- name: Prepare before archiving artifacts
|
||||
run: |
|
||||
mkdir apk
|
||||
mv $(find build/outputs/apk/ -name "*.apk") apk/
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ if(ANDROID)
|
||||
target_link_libraries(wivrn ${ANDROID_LIBRARY} ${MEDIA_LIBRARY})
|
||||
|
||||
if(OCULUS)
|
||||
set(OCULUS_SDK_PATH ${CMAKE_CURRENT_BINARY_DIR}/OculusSDK)
|
||||
set(OCULUS_SDK_PATH ${CMAKE_SOURCE_DIR}/external/oculus)
|
||||
|
||||
if(NOT EXISTS ${OCULUS_SDK_PATH})
|
||||
file(GLOB OCULUS_SDK_ZIP ${CMAKE_SOURCE_DIR}/ovr_openxr_mobile_sdk_*.zip)
|
||||
@@ -29,11 +29,17 @@ if(ANDROID)
|
||||
message(FATAL_ERROR "Download the Oculus SDK from https://developer.oculus.com/downloads/package/oculus-openxr-mobile-sdk in ${CMAKE_SOURCE_DIR}/ovr_openxr_mobile_sdk_*.zip")
|
||||
endif()
|
||||
|
||||
file(ARCHIVE_EXTRACT INPUT ${OCULUS_SDK_ZIP} DESTINATION ${OCULUS_SDK_PATH})
|
||||
file(ARCHIVE_EXTRACT
|
||||
INPUT ${OCULUS_SDK_ZIP}
|
||||
DESTINATION ${OCULUS_SDK_PATH}
|
||||
PATTERNS 3rdParty/khronos/openxr/OpenXR-SDK/include/openxr OpenXR/Include OpenXR/Libs/Android
|
||||
VERBOSE)
|
||||
endif()
|
||||
|
||||
add_library(OpenXR SHARED IMPORTED)
|
||||
target_include_directories(OpenXR INTERFACE ${OCULUS_SDK_PATH}/3rdParty/khronos/openxr/OpenXR-SDK/include)
|
||||
target_include_directories(OpenXR INTERFACE
|
||||
${OCULUS_SDK_PATH}/3rdParty/khronos/openxr/OpenXR-SDK/include
|
||||
${OCULUS_SDK_PATH}/OpenXR/Include)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
set_property(TARGET OpenXR
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
# Copyright (c) 2017-2022, The Khronos Group Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# Author:
|
||||
#
|
||||
|
||||
# Copy the openxr_platform_defines.h file and place it in the binary (build) directory.
|
||||
configure_file(openxr_platform_defines.h ${CMAKE_CURRENT_BINARY_DIR}/openxr_platform_defines.h COPYONLY)
|
||||
|
||||
# Generate OpenXR header files.
|
||||
|
||||
|
||||
set(HEADERS
|
||||
openxr.h
|
||||
openxr_platform.h
|
||||
openxr_reflection.h)
|
||||
set(HAVE_PREGENERATED TRUE)
|
||||
set(SOURCE_HEADERS)
|
||||
foreach(output ${HEADERS})
|
||||
list(APPEND SOURCE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/${output})
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${output})
|
||||
set(HAVE_PREGENERATED FALSE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(XR_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
|
||||
if(HAVE_PREGENERATED AND NOT BUILD_FORCE_GENERATION)
|
||||
add_custom_target(generate_openxr_header
|
||||
COMMENT "Using found pre-generated OpenXR headers.")
|
||||
|
||||
set(INSTALL_HEADERS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/openxr_platform_defines.h
|
||||
${SOURCE_HEADERS})
|
||||
else()
|
||||
|
||||
set(GENERATED_HEADERS)
|
||||
set(OUTPUT_STAMPS)
|
||||
# Copy the openxr_platform_defines.h file and place it in the binary (build) directory.
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openxr_platform_defines.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/openxr_platform_defines.h
|
||||
COPYONLY)
|
||||
|
||||
# Generate the header files and place it in the binary (build) directory.
|
||||
foreach(output ${HEADERS})
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${output}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${XR_ROOT}/specification/scripts/genxr.py
|
||||
-registry ${XR_ROOT}/specification/registry/xr.xml
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR} ${output}
|
||||
DEPENDS
|
||||
${XR_ROOT}/specification/scripts/genxr.py
|
||||
${XR_ROOT}/specification/scripts/cgenerator.py
|
||||
${XR_ROOT}/specification/scripts/creflectiongenerator.py
|
||||
${XR_ROOT}/specification/scripts/generator.py
|
||||
${XR_ROOT}/specification/scripts/reg.py
|
||||
${XR_ROOT}/specification/registry/xr.xml
|
||||
COMMENT "Generating ${CMAKE_CURRENT_BINARY_DIR}/${output}"
|
||||
)
|
||||
list(APPEND GENERATED_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/${output}")
|
||||
endforeach()
|
||||
|
||||
set_source_files_properties(
|
||||
${GENERATED_HEADERS}
|
||||
PROPERTIES GENERATED TRUE
|
||||
)
|
||||
|
||||
set(INSTALL_HEADERS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/openxr_platform_defines.h
|
||||
${GENERATED_HEADERS})
|
||||
|
||||
|
||||
# Define generate_openxr_header target to generate the OpenXR header files.
|
||||
# Other targets that need the OpenXR headers should use generate_openxr_header as a dependency.
|
||||
add_custom_target(generate_openxr_header
|
||||
SOURCES ${XR_ROOT}/specification/registry/xr.xml
|
||||
DEPENDS
|
||||
${GENERATED_HEADERS}
|
||||
${OUTPUT_STAMPS}
|
||||
)
|
||||
endif()
|
||||
set_target_properties(generate_openxr_header PROPERTIES FOLDER ${CODEGEN_FOLDER})
|
||||
if(NOT CMAKE_INSTALL_INCDIR)
|
||||
set(CMAKE_INSTALL_INCDIR include)
|
||||
endif()
|
||||
|
||||
INSTALL(FILES ${INSTALL_HEADERS}
|
||||
DESTINATION ${CMAKE_INSTALL_INCDIR}/openxr
|
||||
COMPONENT Headers
|
||||
)
|
||||
+4560
File diff suppressed because it is too large
Load Diff
Vendored
Executable
+690
@@ -0,0 +1,690 @@
|
||||
#ifndef OPENXR_PLATFORM_H_
|
||||
#define OPENXR_PLATFORM_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright (c) 2017-2022, The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos OpenXR XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
#include "openxr.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef XR_USE_PLATFORM_ANDROID
|
||||
|
||||
#define XR_KHR_android_thread_settings 1
|
||||
#define XR_KHR_android_thread_settings_SPEC_VERSION 5
|
||||
#define XR_KHR_ANDROID_THREAD_SETTINGS_EXTENSION_NAME "XR_KHR_android_thread_settings"
|
||||
|
||||
typedef enum XrAndroidThreadTypeKHR {
|
||||
XR_ANDROID_THREAD_TYPE_APPLICATION_MAIN_KHR = 1,
|
||||
XR_ANDROID_THREAD_TYPE_APPLICATION_WORKER_KHR = 2,
|
||||
XR_ANDROID_THREAD_TYPE_RENDERER_MAIN_KHR = 3,
|
||||
XR_ANDROID_THREAD_TYPE_RENDERER_WORKER_KHR = 4,
|
||||
XR_ANDROID_THREAD_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF
|
||||
} XrAndroidThreadTypeKHR;
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrSetAndroidApplicationThreadKHR)(XrSession session, XrAndroidThreadTypeKHR threadType, uint32_t threadId);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrSetAndroidApplicationThreadKHR(
|
||||
XrSession session,
|
||||
XrAndroidThreadTypeKHR threadType,
|
||||
uint32_t threadId);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_USE_PLATFORM_ANDROID */
|
||||
|
||||
#ifdef XR_USE_PLATFORM_ANDROID
|
||||
|
||||
#define XR_KHR_android_surface_swapchain 1
|
||||
#define XR_KHR_android_surface_swapchain_SPEC_VERSION 4
|
||||
#define XR_KHR_ANDROID_SURFACE_SWAPCHAIN_EXTENSION_NAME "XR_KHR_android_surface_swapchain"
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrCreateSwapchainAndroidSurfaceKHR)(XrSession session, const XrSwapchainCreateInfo* info, XrSwapchain* swapchain, jobject* surface);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateSwapchainAndroidSurfaceKHR(
|
||||
XrSession session,
|
||||
const XrSwapchainCreateInfo* info,
|
||||
XrSwapchain* swapchain,
|
||||
jobject* surface);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_USE_PLATFORM_ANDROID */
|
||||
|
||||
#ifdef XR_USE_PLATFORM_ANDROID
|
||||
|
||||
#define XR_KHR_android_create_instance 1
|
||||
#define XR_KHR_android_create_instance_SPEC_VERSION 3
|
||||
#define XR_KHR_ANDROID_CREATE_INSTANCE_EXTENSION_NAME "XR_KHR_android_create_instance"
|
||||
// XrInstanceCreateInfoAndroidKHR extends XrInstanceCreateInfo
|
||||
typedef struct XrInstanceCreateInfoAndroidKHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
void* XR_MAY_ALIAS applicationVM;
|
||||
void* XR_MAY_ALIAS applicationActivity;
|
||||
} XrInstanceCreateInfoAndroidKHR;
|
||||
|
||||
#endif /* XR_USE_PLATFORM_ANDROID */
|
||||
|
||||
#ifdef XR_USE_GRAPHICS_API_VULKAN
|
||||
|
||||
#define XR_KHR_vulkan_swapchain_format_list 1
|
||||
#define XR_KHR_vulkan_swapchain_format_list_SPEC_VERSION 4
|
||||
#define XR_KHR_VULKAN_SWAPCHAIN_FORMAT_LIST_EXTENSION_NAME "XR_KHR_vulkan_swapchain_format_list"
|
||||
typedef struct XrVulkanSwapchainFormatListCreateInfoKHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
uint32_t viewFormatCount;
|
||||
const VkFormat* viewFormats;
|
||||
} XrVulkanSwapchainFormatListCreateInfoKHR;
|
||||
|
||||
#endif /* XR_USE_GRAPHICS_API_VULKAN */
|
||||
|
||||
#ifdef XR_USE_GRAPHICS_API_OPENGL
|
||||
|
||||
#define XR_KHR_opengl_enable 1
|
||||
#define XR_KHR_opengl_enable_SPEC_VERSION 10
|
||||
#define XR_KHR_OPENGL_ENABLE_EXTENSION_NAME "XR_KHR_opengl_enable"
|
||||
#ifdef XR_USE_PLATFORM_WIN32
|
||||
// XrGraphicsBindingOpenGLWin32KHR extends XrSessionCreateInfo
|
||||
typedef struct XrGraphicsBindingOpenGLWin32KHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
HDC hDC;
|
||||
HGLRC hGLRC;
|
||||
} XrGraphicsBindingOpenGLWin32KHR;
|
||||
#endif // XR_USE_PLATFORM_WIN32
|
||||
|
||||
#ifdef XR_USE_PLATFORM_XLIB
|
||||
// XrGraphicsBindingOpenGLXlibKHR extends XrSessionCreateInfo
|
||||
typedef struct XrGraphicsBindingOpenGLXlibKHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
Display* xDisplay;
|
||||
uint32_t visualid;
|
||||
GLXFBConfig glxFBConfig;
|
||||
GLXDrawable glxDrawable;
|
||||
GLXContext glxContext;
|
||||
} XrGraphicsBindingOpenGLXlibKHR;
|
||||
#endif // XR_USE_PLATFORM_XLIB
|
||||
|
||||
#ifdef XR_USE_PLATFORM_XCB
|
||||
// XrGraphicsBindingOpenGLXcbKHR extends XrSessionCreateInfo
|
||||
typedef struct XrGraphicsBindingOpenGLXcbKHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
xcb_connection_t* connection;
|
||||
uint32_t screenNumber;
|
||||
xcb_glx_fbconfig_t fbconfigid;
|
||||
xcb_visualid_t visualid;
|
||||
xcb_glx_drawable_t glxDrawable;
|
||||
xcb_glx_context_t glxContext;
|
||||
} XrGraphicsBindingOpenGLXcbKHR;
|
||||
#endif // XR_USE_PLATFORM_XCB
|
||||
|
||||
#ifdef XR_USE_PLATFORM_WAYLAND
|
||||
// XrGraphicsBindingOpenGLWaylandKHR extends XrSessionCreateInfo
|
||||
typedef struct XrGraphicsBindingOpenGLWaylandKHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
struct wl_display* display;
|
||||
} XrGraphicsBindingOpenGLWaylandKHR;
|
||||
#endif // XR_USE_PLATFORM_WAYLAND
|
||||
|
||||
typedef struct XrSwapchainImageOpenGLKHR {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
uint32_t image;
|
||||
} XrSwapchainImageOpenGLKHR;
|
||||
|
||||
typedef struct XrGraphicsRequirementsOpenGLKHR {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrVersion minApiVersionSupported;
|
||||
XrVersion maxApiVersionSupported;
|
||||
} XrGraphicsRequirementsOpenGLKHR;
|
||||
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetOpenGLGraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsOpenGLKHR* graphicsRequirements);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetOpenGLGraphicsRequirementsKHR(
|
||||
XrInstance instance,
|
||||
XrSystemId systemId,
|
||||
XrGraphicsRequirementsOpenGLKHR* graphicsRequirements);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_USE_GRAPHICS_API_OPENGL */
|
||||
|
||||
#ifdef XR_USE_GRAPHICS_API_OPENGL_ES
|
||||
|
||||
#define XR_KHR_opengl_es_enable 1
|
||||
#define XR_KHR_opengl_es_enable_SPEC_VERSION 8
|
||||
#define XR_KHR_OPENGL_ES_ENABLE_EXTENSION_NAME "XR_KHR_opengl_es_enable"
|
||||
#ifdef XR_USE_PLATFORM_ANDROID
|
||||
// XrGraphicsBindingOpenGLESAndroidKHR extends XrSessionCreateInfo
|
||||
typedef struct XrGraphicsBindingOpenGLESAndroidKHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
EGLDisplay display;
|
||||
EGLConfig config;
|
||||
EGLContext context;
|
||||
} XrGraphicsBindingOpenGLESAndroidKHR;
|
||||
#endif // XR_USE_PLATFORM_ANDROID
|
||||
|
||||
typedef struct XrSwapchainImageOpenGLESKHR {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
uint32_t image;
|
||||
} XrSwapchainImageOpenGLESKHR;
|
||||
|
||||
typedef struct XrGraphicsRequirementsOpenGLESKHR {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrVersion minApiVersionSupported;
|
||||
XrVersion maxApiVersionSupported;
|
||||
} XrGraphicsRequirementsOpenGLESKHR;
|
||||
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetOpenGLESGraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsOpenGLESKHR* graphicsRequirements);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetOpenGLESGraphicsRequirementsKHR(
|
||||
XrInstance instance,
|
||||
XrSystemId systemId,
|
||||
XrGraphicsRequirementsOpenGLESKHR* graphicsRequirements);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_USE_GRAPHICS_API_OPENGL_ES */
|
||||
|
||||
#ifdef XR_USE_GRAPHICS_API_VULKAN
|
||||
|
||||
#define XR_KHR_vulkan_enable 1
|
||||
#define XR_KHR_vulkan_enable_SPEC_VERSION 8
|
||||
#define XR_KHR_VULKAN_ENABLE_EXTENSION_NAME "XR_KHR_vulkan_enable"
|
||||
// XrGraphicsBindingVulkanKHR extends XrSessionCreateInfo
|
||||
typedef struct XrGraphicsBindingVulkanKHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
VkInstance instance;
|
||||
VkPhysicalDevice physicalDevice;
|
||||
VkDevice device;
|
||||
uint32_t queueFamilyIndex;
|
||||
uint32_t queueIndex;
|
||||
} XrGraphicsBindingVulkanKHR;
|
||||
|
||||
typedef struct XrSwapchainImageVulkanKHR {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
VkImage image;
|
||||
} XrSwapchainImageVulkanKHR;
|
||||
|
||||
typedef struct XrGraphicsRequirementsVulkanKHR {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrVersion minApiVersionSupported;
|
||||
XrVersion maxApiVersionSupported;
|
||||
} XrGraphicsRequirementsVulkanKHR;
|
||||
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanInstanceExtensionsKHR)(XrInstance instance, XrSystemId systemId, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanDeviceExtensionsKHR)(XrInstance instance, XrSystemId systemId, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsDeviceKHR)(XrInstance instance, XrSystemId systemId, VkInstance vkInstance, VkPhysicalDevice* vkPhysicalDevice);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsVulkanKHR* graphicsRequirements);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanInstanceExtensionsKHR(
|
||||
XrInstance instance,
|
||||
XrSystemId systemId,
|
||||
uint32_t bufferCapacityInput,
|
||||
uint32_t* bufferCountOutput,
|
||||
char* buffer);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanDeviceExtensionsKHR(
|
||||
XrInstance instance,
|
||||
XrSystemId systemId,
|
||||
uint32_t bufferCapacityInput,
|
||||
uint32_t* bufferCountOutput,
|
||||
char* buffer);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsDeviceKHR(
|
||||
XrInstance instance,
|
||||
XrSystemId systemId,
|
||||
VkInstance vkInstance,
|
||||
VkPhysicalDevice* vkPhysicalDevice);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsRequirementsKHR(
|
||||
XrInstance instance,
|
||||
XrSystemId systemId,
|
||||
XrGraphicsRequirementsVulkanKHR* graphicsRequirements);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_USE_GRAPHICS_API_VULKAN */
|
||||
|
||||
#ifdef XR_USE_GRAPHICS_API_D3D11
|
||||
|
||||
#define XR_KHR_D3D11_enable 1
|
||||
#define XR_KHR_D3D11_enable_SPEC_VERSION 9
|
||||
#define XR_KHR_D3D11_ENABLE_EXTENSION_NAME "XR_KHR_D3D11_enable"
|
||||
// XrGraphicsBindingD3D11KHR extends XrSessionCreateInfo
|
||||
typedef struct XrGraphicsBindingD3D11KHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
ID3D11Device* device;
|
||||
} XrGraphicsBindingD3D11KHR;
|
||||
|
||||
typedef struct XrSwapchainImageD3D11KHR {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
ID3D11Texture2D* texture;
|
||||
} XrSwapchainImageD3D11KHR;
|
||||
|
||||
typedef struct XrGraphicsRequirementsD3D11KHR {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
LUID adapterLuid;
|
||||
D3D_FEATURE_LEVEL minFeatureLevel;
|
||||
} XrGraphicsRequirementsD3D11KHR;
|
||||
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetD3D11GraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsD3D11KHR* graphicsRequirements);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetD3D11GraphicsRequirementsKHR(
|
||||
XrInstance instance,
|
||||
XrSystemId systemId,
|
||||
XrGraphicsRequirementsD3D11KHR* graphicsRequirements);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_USE_GRAPHICS_API_D3D11 */
|
||||
|
||||
#ifdef XR_USE_GRAPHICS_API_D3D12
|
||||
|
||||
#define XR_KHR_D3D12_enable 1
|
||||
#define XR_KHR_D3D12_enable_SPEC_VERSION 9
|
||||
#define XR_KHR_D3D12_ENABLE_EXTENSION_NAME "XR_KHR_D3D12_enable"
|
||||
// XrGraphicsBindingD3D12KHR extends XrSessionCreateInfo
|
||||
typedef struct XrGraphicsBindingD3D12KHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
ID3D12Device* device;
|
||||
ID3D12CommandQueue* queue;
|
||||
} XrGraphicsBindingD3D12KHR;
|
||||
|
||||
typedef struct XrSwapchainImageD3D12KHR {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
ID3D12Resource* texture;
|
||||
} XrSwapchainImageD3D12KHR;
|
||||
|
||||
typedef struct XrGraphicsRequirementsD3D12KHR {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
LUID adapterLuid;
|
||||
D3D_FEATURE_LEVEL minFeatureLevel;
|
||||
} XrGraphicsRequirementsD3D12KHR;
|
||||
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetD3D12GraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsD3D12KHR* graphicsRequirements);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetD3D12GraphicsRequirementsKHR(
|
||||
XrInstance instance,
|
||||
XrSystemId systemId,
|
||||
XrGraphicsRequirementsD3D12KHR* graphicsRequirements);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_USE_GRAPHICS_API_D3D12 */
|
||||
|
||||
#ifdef XR_USE_PLATFORM_WIN32
|
||||
|
||||
#define XR_KHR_win32_convert_performance_counter_time 1
|
||||
#define XR_KHR_win32_convert_performance_counter_time_SPEC_VERSION 1
|
||||
#define XR_KHR_WIN32_CONVERT_PERFORMANCE_COUNTER_TIME_EXTENSION_NAME "XR_KHR_win32_convert_performance_counter_time"
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrConvertWin32PerformanceCounterToTimeKHR)(XrInstance instance, const LARGE_INTEGER* performanceCounter, XrTime* time);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrConvertTimeToWin32PerformanceCounterKHR)(XrInstance instance, XrTime time, LARGE_INTEGER* performanceCounter);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrConvertWin32PerformanceCounterToTimeKHR(
|
||||
XrInstance instance,
|
||||
const LARGE_INTEGER* performanceCounter,
|
||||
XrTime* time);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimeToWin32PerformanceCounterKHR(
|
||||
XrInstance instance,
|
||||
XrTime time,
|
||||
LARGE_INTEGER* performanceCounter);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_USE_PLATFORM_WIN32 */
|
||||
|
||||
#ifdef XR_USE_TIMESPEC
|
||||
|
||||
#define XR_KHR_convert_timespec_time 1
|
||||
#define XR_KHR_convert_timespec_time_SPEC_VERSION 1
|
||||
#define XR_KHR_CONVERT_TIMESPEC_TIME_EXTENSION_NAME "XR_KHR_convert_timespec_time"
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrConvertTimespecTimeToTimeKHR)(XrInstance instance, const struct timespec* timespecTime, XrTime* time);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrConvertTimeToTimespecTimeKHR)(XrInstance instance, XrTime time, struct timespec* timespecTime);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimespecTimeToTimeKHR(
|
||||
XrInstance instance,
|
||||
const struct timespec* timespecTime,
|
||||
XrTime* time);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimeToTimespecTimeKHR(
|
||||
XrInstance instance,
|
||||
XrTime time,
|
||||
struct timespec* timespecTime);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_USE_TIMESPEC */
|
||||
|
||||
#ifdef XR_USE_PLATFORM_ANDROID
|
||||
|
||||
#define XR_KHR_loader_init_android 1
|
||||
#define XR_KHR_loader_init_android_SPEC_VERSION 1
|
||||
#define XR_KHR_LOADER_INIT_ANDROID_EXTENSION_NAME "XR_KHR_loader_init_android"
|
||||
typedef struct XrLoaderInitInfoAndroidKHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
void* XR_MAY_ALIAS applicationVM;
|
||||
void* XR_MAY_ALIAS applicationContext;
|
||||
} XrLoaderInitInfoAndroidKHR;
|
||||
|
||||
#endif /* XR_USE_PLATFORM_ANDROID */
|
||||
|
||||
#ifdef XR_USE_GRAPHICS_API_VULKAN
|
||||
|
||||
#define XR_KHR_vulkan_enable2 1
|
||||
#define XR_KHR_vulkan_enable2_SPEC_VERSION 2
|
||||
#define XR_KHR_VULKAN_ENABLE2_EXTENSION_NAME "XR_KHR_vulkan_enable2"
|
||||
typedef XrFlags64 XrVulkanInstanceCreateFlagsKHR;
|
||||
|
||||
// Flag bits for XrVulkanInstanceCreateFlagsKHR
|
||||
|
||||
typedef XrFlags64 XrVulkanDeviceCreateFlagsKHR;
|
||||
|
||||
// Flag bits for XrVulkanDeviceCreateFlagsKHR
|
||||
|
||||
typedef struct XrVulkanInstanceCreateInfoKHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSystemId systemId;
|
||||
XrVulkanInstanceCreateFlagsKHR createFlags;
|
||||
PFN_vkGetInstanceProcAddr pfnGetInstanceProcAddr;
|
||||
const VkInstanceCreateInfo* vulkanCreateInfo;
|
||||
const VkAllocationCallbacks* vulkanAllocator;
|
||||
} XrVulkanInstanceCreateInfoKHR;
|
||||
|
||||
typedef struct XrVulkanDeviceCreateInfoKHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSystemId systemId;
|
||||
XrVulkanDeviceCreateFlagsKHR createFlags;
|
||||
PFN_vkGetInstanceProcAddr pfnGetInstanceProcAddr;
|
||||
VkPhysicalDevice vulkanPhysicalDevice;
|
||||
const VkDeviceCreateInfo* vulkanCreateInfo;
|
||||
const VkAllocationCallbacks* vulkanAllocator;
|
||||
} XrVulkanDeviceCreateInfoKHR;
|
||||
|
||||
typedef XrGraphicsBindingVulkanKHR XrGraphicsBindingVulkan2KHR;
|
||||
|
||||
typedef struct XrVulkanGraphicsDeviceGetInfoKHR {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSystemId systemId;
|
||||
VkInstance vulkanInstance;
|
||||
} XrVulkanGraphicsDeviceGetInfoKHR;
|
||||
|
||||
typedef XrSwapchainImageVulkanKHR XrSwapchainImageVulkan2KHR;
|
||||
|
||||
typedef XrGraphicsRequirementsVulkanKHR XrGraphicsRequirementsVulkan2KHR;
|
||||
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrCreateVulkanInstanceKHR)(XrInstance instance, const XrVulkanInstanceCreateInfoKHR* createInfo, VkInstance* vulkanInstance, VkResult* vulkanResult);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrCreateVulkanDeviceKHR)(XrInstance instance, const XrVulkanDeviceCreateInfoKHR* createInfo, VkDevice* vulkanDevice, VkResult* vulkanResult);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsDevice2KHR)(XrInstance instance, const XrVulkanGraphicsDeviceGetInfoKHR* getInfo, VkPhysicalDevice* vulkanPhysicalDevice);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsRequirements2KHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsVulkanKHR* graphicsRequirements);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateVulkanInstanceKHR(
|
||||
XrInstance instance,
|
||||
const XrVulkanInstanceCreateInfoKHR* createInfo,
|
||||
VkInstance* vulkanInstance,
|
||||
VkResult* vulkanResult);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateVulkanDeviceKHR(
|
||||
XrInstance instance,
|
||||
const XrVulkanDeviceCreateInfoKHR* createInfo,
|
||||
VkDevice* vulkanDevice,
|
||||
VkResult* vulkanResult);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsDevice2KHR(
|
||||
XrInstance instance,
|
||||
const XrVulkanGraphicsDeviceGetInfoKHR* getInfo,
|
||||
VkPhysicalDevice* vulkanPhysicalDevice);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsRequirements2KHR(
|
||||
XrInstance instance,
|
||||
XrSystemId systemId,
|
||||
XrGraphicsRequirementsVulkanKHR* graphicsRequirements);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_USE_GRAPHICS_API_VULKAN */
|
||||
|
||||
#ifdef XR_USE_PLATFORM_EGL
|
||||
|
||||
#define XR_MNDX_egl_enable 1
|
||||
#define XR_MNDX_egl_enable_SPEC_VERSION 1
|
||||
#define XR_MNDX_EGL_ENABLE_EXTENSION_NAME "XR_MNDX_egl_enable"
|
||||
// XrGraphicsBindingEGLMNDX extends XrSessionCreateInfo
|
||||
typedef struct XrGraphicsBindingEGLMNDX {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
PFNEGLGETPROCADDRESSPROC getProcAddress;
|
||||
EGLDisplay display;
|
||||
EGLConfig config;
|
||||
EGLContext context;
|
||||
} XrGraphicsBindingEGLMNDX;
|
||||
|
||||
#endif /* XR_USE_PLATFORM_EGL */
|
||||
|
||||
#ifdef XR_USE_PLATFORM_WIN32
|
||||
|
||||
#define XR_MSFT_perception_anchor_interop 1
|
||||
#define XR_MSFT_perception_anchor_interop_SPEC_VERSION 1
|
||||
#define XR_MSFT_PERCEPTION_ANCHOR_INTEROP_EXTENSION_NAME "XR_MSFT_perception_anchor_interop"
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialAnchorFromPerceptionAnchorMSFT)(XrSession session, IUnknown* perceptionAnchor, XrSpatialAnchorMSFT* anchor);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrTryGetPerceptionAnchorFromSpatialAnchorMSFT)(XrSession session, XrSpatialAnchorMSFT anchor, IUnknown** perceptionAnchor);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorFromPerceptionAnchorMSFT(
|
||||
XrSession session,
|
||||
IUnknown* perceptionAnchor,
|
||||
XrSpatialAnchorMSFT* anchor);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrTryGetPerceptionAnchorFromSpatialAnchorMSFT(
|
||||
XrSession session,
|
||||
XrSpatialAnchorMSFT anchor,
|
||||
IUnknown** perceptionAnchor);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_USE_PLATFORM_WIN32 */
|
||||
|
||||
#ifdef XR_USE_PLATFORM_WIN32
|
||||
|
||||
#define XR_MSFT_holographic_window_attachment 1
|
||||
#define XR_MSFT_holographic_window_attachment_SPEC_VERSION 1
|
||||
#define XR_MSFT_HOLOGRAPHIC_WINDOW_ATTACHMENT_EXTENSION_NAME "XR_MSFT_holographic_window_attachment"
|
||||
#ifdef XR_USE_PLATFORM_WIN32
|
||||
// XrHolographicWindowAttachmentMSFT extends XrSessionCreateInfo
|
||||
typedef struct XrHolographicWindowAttachmentMSFT {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
IUnknown* holographicSpace;
|
||||
IUnknown* coreWindow;
|
||||
} XrHolographicWindowAttachmentMSFT;
|
||||
#endif // XR_USE_PLATFORM_WIN32
|
||||
|
||||
#endif /* XR_USE_PLATFORM_WIN32 */
|
||||
|
||||
#ifdef XR_USE_PLATFORM_ANDROID
|
||||
|
||||
#define XR_FB_android_surface_swapchain_create 1
|
||||
#define XR_FB_android_surface_swapchain_create_SPEC_VERSION 1
|
||||
#define XR_FB_ANDROID_SURFACE_SWAPCHAIN_CREATE_EXTENSION_NAME "XR_FB_android_surface_swapchain_create"
|
||||
typedef XrFlags64 XrAndroidSurfaceSwapchainFlagsFB;
|
||||
|
||||
// Flag bits for XrAndroidSurfaceSwapchainFlagsFB
|
||||
static const XrAndroidSurfaceSwapchainFlagsFB XR_ANDROID_SURFACE_SWAPCHAIN_SYNCHRONOUS_BIT_FB = 0x00000001;
|
||||
static const XrAndroidSurfaceSwapchainFlagsFB XR_ANDROID_SURFACE_SWAPCHAIN_USE_TIMESTAMPS_BIT_FB = 0x00000002;
|
||||
|
||||
#ifdef XR_USE_PLATFORM_ANDROID
|
||||
// XrAndroidSurfaceSwapchainCreateInfoFB extends XrSwapchainCreateInfo
|
||||
typedef struct XrAndroidSurfaceSwapchainCreateInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrAndroidSurfaceSwapchainFlagsFB createFlags;
|
||||
} XrAndroidSurfaceSwapchainCreateInfoFB;
|
||||
#endif // XR_USE_PLATFORM_ANDROID
|
||||
|
||||
#endif /* XR_USE_PLATFORM_ANDROID */
|
||||
|
||||
#ifdef XR_USE_PLATFORM_WIN32
|
||||
|
||||
#define XR_OCULUS_audio_device_guid 1
|
||||
#define XR_OCULUS_audio_device_guid_SPEC_VERSION 1
|
||||
#define XR_OCULUS_AUDIO_DEVICE_GUID_EXTENSION_NAME "XR_OCULUS_audio_device_guid"
|
||||
#define XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS 128
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetAudioOutputDeviceGuidOculus)(XrInstance instance, wchar_t buffer[XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS]);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetAudioInputDeviceGuidOculus)(XrInstance instance, wchar_t buffer[XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS]);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetAudioOutputDeviceGuidOculus(
|
||||
XrInstance instance,
|
||||
wchar_t buffer[XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS]);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetAudioInputDeviceGuidOculus(
|
||||
XrInstance instance,
|
||||
wchar_t buffer[XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS]);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_USE_PLATFORM_WIN32 */
|
||||
|
||||
#ifdef XR_USE_GRAPHICS_API_VULKAN
|
||||
|
||||
#define XR_FB_foveation_vulkan 1
|
||||
#define XR_FB_foveation_vulkan_SPEC_VERSION 1
|
||||
#define XR_FB_FOVEATION_VULKAN_EXTENSION_NAME "XR_FB_foveation_vulkan"
|
||||
// XrSwapchainImageFoveationVulkanFB extends XrSwapchainImageVulkanKHR
|
||||
typedef struct XrSwapchainImageFoveationVulkanFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
VkImage image;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
} XrSwapchainImageFoveationVulkanFB;
|
||||
|
||||
#endif /* XR_USE_GRAPHICS_API_VULKAN */
|
||||
|
||||
#ifdef XR_USE_PLATFORM_ANDROID
|
||||
|
||||
#define XR_FB_swapchain_update_state_android_surface 1
|
||||
#define XR_FB_swapchain_update_state_android_surface_SPEC_VERSION 1
|
||||
#define XR_FB_SWAPCHAIN_UPDATE_STATE_ANDROID_SURFACE_EXTENSION_NAME "XR_FB_swapchain_update_state_android_surface"
|
||||
#ifdef XR_USE_PLATFORM_ANDROID
|
||||
typedef struct XrSwapchainStateAndroidSurfaceDimensionsFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
} XrSwapchainStateAndroidSurfaceDimensionsFB;
|
||||
#endif // XR_USE_PLATFORM_ANDROID
|
||||
|
||||
#endif /* XR_USE_PLATFORM_ANDROID */
|
||||
|
||||
#ifdef XR_USE_GRAPHICS_API_OPENGL_ES
|
||||
|
||||
#define XR_FB_swapchain_update_state_opengl_es 1
|
||||
#define XR_FB_swapchain_update_state_opengl_es_SPEC_VERSION 1
|
||||
#define XR_FB_SWAPCHAIN_UPDATE_STATE_OPENGL_ES_EXTENSION_NAME "XR_FB_swapchain_update_state_opengl_es"
|
||||
#ifdef XR_USE_GRAPHICS_API_OPENGL_ES
|
||||
typedef struct XrSwapchainStateSamplerOpenGLESFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
EGLenum minFilter;
|
||||
EGLenum magFilter;
|
||||
EGLenum wrapModeS;
|
||||
EGLenum wrapModeT;
|
||||
EGLenum swizzleRed;
|
||||
EGLenum swizzleGreen;
|
||||
EGLenum swizzleBlue;
|
||||
EGLenum swizzleAlpha;
|
||||
float maxAnisotropy;
|
||||
XrColor4f borderColor;
|
||||
} XrSwapchainStateSamplerOpenGLESFB;
|
||||
#endif // XR_USE_GRAPHICS_API_OPENGL_ES
|
||||
|
||||
#endif /* XR_USE_GRAPHICS_API_OPENGL_ES */
|
||||
|
||||
#ifdef XR_USE_GRAPHICS_API_VULKAN
|
||||
|
||||
#define XR_FB_swapchain_update_state_vulkan 1
|
||||
#define XR_FB_swapchain_update_state_vulkan_SPEC_VERSION 1
|
||||
#define XR_FB_SWAPCHAIN_UPDATE_STATE_VULKAN_EXTENSION_NAME "XR_FB_swapchain_update_state_vulkan"
|
||||
#ifdef XR_USE_GRAPHICS_API_VULKAN
|
||||
typedef struct XrSwapchainStateSamplerVulkanFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
VkFilter minFilter;
|
||||
VkFilter magFilter;
|
||||
VkSamplerMipmapMode mipmapMode;
|
||||
VkSamplerAddressMode wrapModeS;
|
||||
VkSamplerAddressMode wrapModeT;
|
||||
VkComponentSwizzle swizzleRed;
|
||||
VkComponentSwizzle swizzleGreen;
|
||||
VkComponentSwizzle swizzleBlue;
|
||||
VkComponentSwizzle swizzleAlpha;
|
||||
float maxAnisotropy;
|
||||
XrColor4f borderColor;
|
||||
} XrSwapchainStateSamplerVulkanFB;
|
||||
#endif // XR_USE_GRAPHICS_API_VULKAN
|
||||
|
||||
#endif /* XR_USE_GRAPHICS_API_VULKAN */
|
||||
|
||||
#ifdef XR_USE_GRAPHICS_API_VULKAN
|
||||
|
||||
#define XR_META_vulkan_swapchain_create_info 1
|
||||
#define XR_META_vulkan_swapchain_create_info_SPEC_VERSION 1
|
||||
#define XR_META_VULKAN_SWAPCHAIN_CREATE_INFO_EXTENSION_NAME "XR_META_vulkan_swapchain_create_info"
|
||||
// XrVulkanSwapchainCreateInfoMETA extends XrSwapchainCreateInfo
|
||||
typedef struct XrVulkanSwapchainCreateInfoMETA {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
VkImageCreateFlags additionalCreateFlags;
|
||||
VkImageUsageFlags additionalUsageFlags;
|
||||
} XrVulkanSwapchainCreateInfoMETA;
|
||||
|
||||
#endif /* XR_USE_GRAPHICS_API_VULKAN */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
Executable
+110
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
** Copyright (c) 2017-2022, The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
#ifndef OPENXR_PLATFORM_DEFINES_H_
|
||||
#define OPENXR_PLATFORM_DEFINES_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Platform-specific calling convention macros.
|
||||
*
|
||||
* Platforms should define these so that OpenXR clients call OpenXR functions
|
||||
* with the same calling conventions that the OpenXR implementation expects.
|
||||
*
|
||||
* XRAPI_ATTR - Placed before the return type in function declarations.
|
||||
* Useful for C++11 and GCC/Clang-style function attribute syntax.
|
||||
* XRAPI_CALL - Placed after the return type in function declarations.
|
||||
* Useful for MSVC-style calling convention syntax.
|
||||
* XRAPI_PTR - Placed between the '(' and '*' in function pointer types.
|
||||
*
|
||||
* Function declaration: XRAPI_ATTR void XRAPI_CALL xrFunction(void);
|
||||
* Function pointer type: typedef void (XRAPI_PTR *PFN_xrFunction)(void);
|
||||
*/
|
||||
#if defined(_WIN32)
|
||||
#define XRAPI_ATTR
|
||||
// On Windows, functions use the stdcall convention
|
||||
#define XRAPI_CALL __stdcall
|
||||
#define XRAPI_PTR XRAPI_CALL
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
|
||||
#error "API not supported for the 'armeabi' NDK ABI"
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
|
||||
// On Android 32-bit ARM targets, functions use the "hardfloat"
|
||||
// calling convention, i.e. float parameters are passed in registers. This
|
||||
// is true even if the rest of the application passes floats on the stack,
|
||||
// as it does by default when compiling for the armeabi-v7a NDK ABI.
|
||||
#define XRAPI_ATTR __attribute__((pcs("aapcs-vfp")))
|
||||
#define XRAPI_CALL
|
||||
#define XRAPI_PTR XRAPI_ATTR
|
||||
#else
|
||||
// On other platforms, use the default calling convention
|
||||
#define XRAPI_ATTR
|
||||
#define XRAPI_CALL
|
||||
#define XRAPI_PTR
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#if !defined(XR_NO_STDINT_H)
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
typedef signed __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#endif // !defined( XR_NO_STDINT_H )
|
||||
|
||||
// XR_PTR_SIZE (in bytes)
|
||||
#if (defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__))
|
||||
#define XR_PTR_SIZE 8
|
||||
#else
|
||||
#define XR_PTR_SIZE 4
|
||||
#endif
|
||||
|
||||
// Needed so we can use clang __has_feature portably.
|
||||
#if !defined(XR_COMPILER_HAS_FEATURE)
|
||||
#if defined(__clang__)
|
||||
#define XR_COMPILER_HAS_FEATURE(x) __has_feature(x)
|
||||
#else
|
||||
#define XR_COMPILER_HAS_FEATURE(x) 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Identifies if the current compiler has C++11 support enabled.
|
||||
// Does not by itself identify if any given C++11 feature is present.
|
||||
#if !defined(XR_CPP11_ENABLED) && defined(__cplusplus)
|
||||
#if defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
#define XR_CPP11_ENABLED 1
|
||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||
#define XR_CPP11_ENABLED 1
|
||||
#elif (__cplusplus >= 201103L) // 201103 is the first C++11 version.
|
||||
#define XR_CPP11_ENABLED 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Identifies if the current compiler supports C++11 nullptr.
|
||||
#if !defined(XR_CPP_NULLPTR_SUPPORTED)
|
||||
#if defined(XR_CPP11_ENABLED) && \
|
||||
((defined(__clang__) && XR_COMPILER_HAS_FEATURE(cxx_nullptr)) || \
|
||||
(defined(__GNUC__) && (((__GNUC__ * 1000) + __GNUC_MINOR__) >= 4006)) || \
|
||||
(defined(_MSC_VER) && (_MSC_VER >= 1600)) || \
|
||||
(defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 403)))
|
||||
#define XR_CPP_NULLPTR_SUPPORTED 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
Executable
+3144
File diff suppressed because it is too large
Load Diff
+187
@@ -0,0 +1,187 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "openxr_extension_helpers.h"
|
||||
|
||||
/*
|
||||
|
||||
Last Modified Date :
|
||||
2022-05-17
|
||||
IP Status :
|
||||
No known IP claims.
|
||||
Contributors :
|
||||
Bryce Hutchings, Microsoft
|
||||
Yin Li, Microsoft
|
||||
Jonathan Wright, Meta Platforms
|
||||
Brandon Furtwangler, Meta Platforms
|
||||
Wenlin Mao, Meta Platforms
|
||||
Andreas Selvik, Meta Platforms
|
||||
John Schofield, Meta Platforms
|
||||
Contacts :
|
||||
Cass Everitt, Meta Platforms
|
||||
Wenlin Mao, Meta Platforms
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Extension 113
|
||||
#ifndef XR_EXT_event_channel
|
||||
|
||||
#if defined(XR_EXT_event_channel_EXPERIMENTAL_VERSION)
|
||||
#if XR_EXT_event_channel_EXPERIMENTAL_VERSION != 1
|
||||
#error "unknown experimental version number for XR_EXT_event_channel_EXPERIMENTAL_VERSION"
|
||||
#endif
|
||||
|
||||
#define XR_EXT_event_channel 1
|
||||
#define XR_EXT_event_channel_SPEC_VERSION 1
|
||||
#define XR_EXT_event_channel_EXTENSION_NAME "XR_EXT_event_channel_EXPERIMENTAL_1"
|
||||
|
||||
/*
|
||||
Overview
|
||||
|
||||
The OpenXR 1.0 event model is very simple.
|
||||
There is a single implicit event channel per instance, and the application
|
||||
polls it for events via flink:xrPollEvent.
|
||||
This design is sufficient for limited use, but introduces extra burden on
|
||||
modular application code making use of events for disparate purposes, as it
|
||||
is the application's responsibility to route any events to the module or
|
||||
modules that need to handle the event.
|
||||
|
||||
This extension expands on the OpenXR event model to add support for multiple
|
||||
separate event channels.
|
||||
These event channels are created and destroyed by the application, and they
|
||||
can: be polled independently.
|
||||
Operations that may generate events may: also optionally allow the
|
||||
application to specify the event channel where the events will be delivered.
|
||||
If left unspecified, such events will be delivered to the implicit
|
||||
per-instance event channel by default.
|
||||
*/
|
||||
|
||||
/*
|
||||
XrEventChannelEXT is an event channel with its own queue. It can be polled
|
||||
independently from the implicit per-instance event channel used by default.
|
||||
*/
|
||||
XR_DEFINE_HANDLE(XrEventChannelEXT)
|
||||
|
||||
/*
|
||||
Create info structure contains no parameters beyond the conventional ones.
|
||||
*/
|
||||
XR_STRUCT_ENUM(XR_TYPE_EVENT_CHANNEL_CREATE_INFO_EXT, 1000170001);
|
||||
typedef struct XrEventChannelCreateInfoEXT {
|
||||
XrStructureType type; // XR_TYPE_EVENT_CHANNEL_CREATE_INFO_EXT
|
||||
const void* XR_MAY_ALIAS next;
|
||||
} XrEventChannelCreateInfoEXT;
|
||||
|
||||
/*
|
||||
The event channel target structure provides a means to append the
|
||||
target event channel for an operation that can generate events.
|
||||
This extension does not define any such operations, but this structure
|
||||
is expected to be useful for other extensions.
|
||||
*/
|
||||
XR_STRUCT_ENUM(XR_TYPE_EVENT_CHANNEL_TARGET_EXT, 1000170002);
|
||||
typedef struct XrEventChannelTargetEXT {
|
||||
XrStructureType type; // XR_TYPE_EVENT_CHANNEL_TARGET_EXT
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrEventChannelEXT channel;
|
||||
} XrEventChannelTargetEXT;
|
||||
|
||||
/* flag for select event channel info struct */
|
||||
typedef enum XrSelectEventChannelFlagsEXT {
|
||||
// Reserved for future extensions.
|
||||
} XrSelectEventChannelFlagsEXT;
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_SELECT_EVENT_CHANNEL_INFO_EXT, 1000170003);
|
||||
/*
|
||||
info structure for xrSelectEventChannelEXT contains all input parameters for xrSelectEventChannelEXT
|
||||
to use
|
||||
*/
|
||||
typedef struct XrSelectEventChannelInfoEXT {
|
||||
XrStructureType type; // XR_TYPE_SELECT_EVENT_CHANNEL_INFO_EXT
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSelectEventChannelFlagsEXT flags;
|
||||
XrDuration timeout;
|
||||
uint32_t eventChannelCount;
|
||||
const XrEventChannelEXT* eventChannels;
|
||||
} XrSelectEventChannelInfoEXT;
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
/*
|
||||
functions to create event channel and return a handle
|
||||
*/
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateEventChannelEXT(
|
||||
XrInstance instance,
|
||||
const XrEventChannelCreateInfoEXT* info,
|
||||
XrEventChannelEXT* channel);
|
||||
|
||||
/*
|
||||
Pending or future events assigned to this channel are inaccessible
|
||||
after its destruction.
|
||||
*/
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrDestroyEventChannelEXT(XrEventChannelEXT channel);
|
||||
|
||||
/*
|
||||
Same semantics as xrPollEvent, but with a specific channel.
|
||||
*/
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrPollEventChannelEXT(XrEventChannelEXT channel, XrEventDataBuffer* eventData);
|
||||
|
||||
/*
|
||||
Multiple event channels can be checked for available events, and
|
||||
the application may choose to block for a specified duration waiting
|
||||
for events to be enqueued.
|
||||
On success, XR_SUCCESS is returned, and channelWithEvent is set to the
|
||||
index of the corresponding element of eventChannels.
|
||||
On timeout, XR_TIMEOUT_EXPIRED is returned, and channelWithEvent is
|
||||
unmodified.
|
||||
|
||||
ISSUE: Should there be any ordering requirements for which channel
|
||||
is selected when multiple channels have events enqueued?
|
||||
|
||||
Current Solution:
|
||||
No order is specified.
|
||||
*/
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrSelectEventChannelEXT(
|
||||
XrInstance instance,
|
||||
XrSelectEventChannelInfoEXT* info,
|
||||
uint32_t* channelWithEvent);
|
||||
|
||||
/*
|
||||
get default eventchannel handle that is created duing xrCreateInstance to be accessed and used by
|
||||
application
|
||||
*/
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrGetDefaultEventChannelEXT(XrInstance instance, XrEventChannelEXT* channel);
|
||||
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrCreateEventChannelEXT)(
|
||||
XrInstance instance,
|
||||
const XrEventChannelCreateInfoEXT* info,
|
||||
XrEventChannelEXT* channel);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrDestroyEventChannelEXT)(XrEventChannelEXT channel);
|
||||
|
||||
typedef XrResult(
|
||||
XRAPI_PTR* PFN_xrPollEventChannelEXT)(XrEventChannelEXT channel, XrEventDataBuffer* eventData);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrSelectEventChannelEXT)(
|
||||
XrInstance instance,
|
||||
XrSelectEventChannelInfoEXT* info,
|
||||
uint32_t* channelWithEvent);
|
||||
|
||||
typedef XrResult(
|
||||
XRAPI_PTR* PFN_xrGetDefaultEventChannelEXT)(XrInstance instance, XrEventChannelEXT* channel);
|
||||
|
||||
#endif // defined(XR_EXT_event_channel_EXPERIMENTAL_VERSION)
|
||||
|
||||
#endif // XR_EXT_event_channel
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
Filename : fb_body_tracking.h
|
||||
Content :
|
||||
Language : C99
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr.h>
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
#include <cstdint>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Extension 77
|
||||
|
||||
#ifndef XR_FB_body_tracking
|
||||
|
||||
#define XR_FB_body_tracking 1
|
||||
XR_DEFINE_HANDLE(XrBodyTrackerFB)
|
||||
|
||||
#define XR_FB_body_tracking_SPEC_VERSION 1
|
||||
#define XR_FB_BODY_TRACKING_EXTENSION_NAME "XR_FB_body_tracking"
|
||||
|
||||
#define XR_FBX1_body_tracking_SPEC_VERSION 1
|
||||
#define XR_FBX1_BODY_TRACKING_EXTENSION_NAME "XR_FBX1_body_tracking"
|
||||
#define XR_FBX2_body_tracking_SPEC_VERSION 2
|
||||
#define XR_FBX2_BODY_TRACKING_EXTENSION_NAME "XR_FBX2_body_tracking"
|
||||
|
||||
// While experimental, the experimental version must be set to get extension definitions
|
||||
#if defined(XR_FB_body_tracking_EXPERIMENTAL_VERSION)
|
||||
#if XR_FB_body_tracking_EXPERIMENTAL_VERSION == 2
|
||||
#undef XR_FB_body_tracking_SPEC_VERSION
|
||||
#undef XR_FB_BODY_TRACKING_EXTENSION_NAME
|
||||
#define XR_FB_body_tracking_SPEC_VERSION XR_FBX2_body_tracking_SPEC_VERSION
|
||||
#define XR_FB_BODY_TRACKING_EXTENSION_NAME XR_FBX2_BODY_TRACKING_EXTENSION_NAME
|
||||
#elif defined(XR_FB_body_tracking_EXPERIMENTAL_VERSION)
|
||||
// Error if the chosen experimental version is different than the available in this header
|
||||
#error "unknown experimental version number for XR_FB_body_tracking_EXPERIMENTAL_VERSION"
|
||||
#endif // switch by XR_FB_body_tracking_EXPERIMENTAL_VERSION
|
||||
#endif // defined(XR_FB_body_tracking_EXPERIMENTAL_VERSION)
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_BODY_TRACKER_CREATE_INFO_FB, 1000076001);
|
||||
XR_STRUCT_ENUM(XR_TYPE_BODY_JOINTS_LOCATE_INFO_FB, 1000076002);
|
||||
XR_STRUCT_ENUM(XR_TYPE_BODY_JOINT_LOCATIONS_V1_FB, 1000076003);
|
||||
XR_STRUCT_ENUM(XR_TYPE_BODY_JOINT_LOCATIONS_FB, 1000076005);
|
||||
#define XR_TYPE_BODY_JOINT_LOCATIONS_V2_FB XR_TYPE_BODY_JOINT_LOCATIONS_FB
|
||||
XR_STRUCT_ENUM(XR_TYPE_BODY_SKELETON_FB, 1000076006);
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_SYSTEM_BODY_TRACKING_PROPERTIES_FB, 1000076004);
|
||||
|
||||
typedef enum XrBodyJointFB {
|
||||
XR_BODY_JOINT_ROOT_FB = 0,
|
||||
XR_BODY_JOINT_HIPS_FB = 1,
|
||||
XR_BODY_JOINT_SPINE_LOWER_FB = 2,
|
||||
XR_BODY_JOINT_SPINE_MIDDLE_FB = 3,
|
||||
XR_BODY_JOINT_SPINE_UPPER_FB = 4,
|
||||
XR_BODY_JOINT_CHEST_FB = 5,
|
||||
XR_BODY_JOINT_NECK_FB = 6,
|
||||
XR_BODY_JOINT_HEAD_FB = 7,
|
||||
XR_BODY_JOINT_LEFT_SHOULDER_FB = 8,
|
||||
XR_BODY_JOINT_LEFT_SCAPULA_FB = 9,
|
||||
XR_BODY_JOINT_LEFT_ARM_UPPER_FB = 10,
|
||||
XR_BODY_JOINT_LEFT_ARM_LOWER_FB = 11,
|
||||
XR_BODY_JOINT_LEFT_HAND_WRIST_TWIST_FB = 12,
|
||||
XR_BODY_JOINT_RIGHT_SHOULDER_FB = 13,
|
||||
XR_BODY_JOINT_RIGHT_SCAPULA_FB = 14,
|
||||
XR_BODY_JOINT_RIGHT_ARM_UPPER_FB = 15,
|
||||
XR_BODY_JOINT_RIGHT_ARM_LOWER_FB = 16,
|
||||
XR_BODY_JOINT_RIGHT_HAND_WRIST_TWIST_FB = 17,
|
||||
XR_BODY_JOINT_LEFT_HAND_PALM_FB = 18,
|
||||
XR_BODY_JOINT_LEFT_HAND_WRIST_FB = 19,
|
||||
XR_BODY_JOINT_LEFT_HAND_THUMB_METACARPAL_FB = 20,
|
||||
XR_BODY_JOINT_LEFT_HAND_THUMB_PROXIMAL_FB = 21,
|
||||
XR_BODY_JOINT_LEFT_HAND_THUMB_DISTAL_FB = 22,
|
||||
XR_BODY_JOINT_LEFT_HAND_THUMB_TIP_FB = 23,
|
||||
XR_BODY_JOINT_LEFT_HAND_INDEX_METACARPAL_FB = 24,
|
||||
XR_BODY_JOINT_LEFT_HAND_INDEX_PROXIMAL_FB = 25,
|
||||
XR_BODY_JOINT_LEFT_HAND_INDEX_INTERMEDIATE_FB = 26,
|
||||
XR_BODY_JOINT_LEFT_HAND_INDEX_DISTAL_FB = 27,
|
||||
XR_BODY_JOINT_LEFT_HAND_INDEX_TIP_FB = 28,
|
||||
XR_BODY_JOINT_LEFT_HAND_MIDDLE_METACARPAL_FB = 29,
|
||||
XR_BODY_JOINT_LEFT_HAND_MIDDLE_PROXIMAL_FB = 30,
|
||||
XR_BODY_JOINT_LEFT_HAND_MIDDLE_INTERMEDIATE_FB = 31,
|
||||
XR_BODY_JOINT_LEFT_HAND_MIDDLE_DISTAL_FB = 32,
|
||||
XR_BODY_JOINT_LEFT_HAND_MIDDLE_TIP_FB = 33,
|
||||
XR_BODY_JOINT_LEFT_HAND_RING_METACARPAL_FB = 34,
|
||||
XR_BODY_JOINT_LEFT_HAND_RING_PROXIMAL_FB = 35,
|
||||
XR_BODY_JOINT_LEFT_HAND_RING_INTERMEDIATE_FB = 36,
|
||||
XR_BODY_JOINT_LEFT_HAND_RING_DISTAL_FB = 37,
|
||||
XR_BODY_JOINT_LEFT_HAND_RING_TIP_FB = 38,
|
||||
XR_BODY_JOINT_LEFT_HAND_LITTLE_METACARPAL_FB = 39,
|
||||
XR_BODY_JOINT_LEFT_HAND_LITTLE_PROXIMAL_FB = 40,
|
||||
XR_BODY_JOINT_LEFT_HAND_LITTLE_INTERMEDIATE_FB = 41,
|
||||
XR_BODY_JOINT_LEFT_HAND_LITTLE_DISTAL_FB = 42,
|
||||
XR_BODY_JOINT_LEFT_HAND_LITTLE_TIP_FB = 43,
|
||||
XR_BODY_JOINT_RIGHT_HAND_PALM_FB = 44,
|
||||
XR_BODY_JOINT_RIGHT_HAND_WRIST_FB = 45,
|
||||
XR_BODY_JOINT_RIGHT_HAND_THUMB_METACARPAL_FB = 46,
|
||||
XR_BODY_JOINT_RIGHT_HAND_THUMB_PROXIMAL_FB = 47,
|
||||
XR_BODY_JOINT_RIGHT_HAND_THUMB_DISTAL_FB = 48,
|
||||
XR_BODY_JOINT_RIGHT_HAND_THUMB_TIP_FB = 49,
|
||||
XR_BODY_JOINT_RIGHT_HAND_INDEX_METACARPAL_FB = 50,
|
||||
XR_BODY_JOINT_RIGHT_HAND_INDEX_PROXIMAL_FB = 51,
|
||||
XR_BODY_JOINT_RIGHT_HAND_INDEX_INTERMEDIATE_FB = 52,
|
||||
XR_BODY_JOINT_RIGHT_HAND_INDEX_DISTAL_FB = 53,
|
||||
XR_BODY_JOINT_RIGHT_HAND_INDEX_TIP_FB = 54,
|
||||
XR_BODY_JOINT_RIGHT_HAND_MIDDLE_METACARPAL_FB = 55,
|
||||
XR_BODY_JOINT_RIGHT_HAND_MIDDLE_PROXIMAL_FB = 56,
|
||||
XR_BODY_JOINT_RIGHT_HAND_MIDDLE_INTERMEDIATE_FB = 57,
|
||||
XR_BODY_JOINT_RIGHT_HAND_MIDDLE_DISTAL_FB = 58,
|
||||
XR_BODY_JOINT_RIGHT_HAND_MIDDLE_TIP_FB = 59,
|
||||
XR_BODY_JOINT_RIGHT_HAND_RING_METACARPAL_FB = 60,
|
||||
XR_BODY_JOINT_RIGHT_HAND_RING_PROXIMAL_FB = 61,
|
||||
XR_BODY_JOINT_RIGHT_HAND_RING_INTERMEDIATE_FB = 62,
|
||||
XR_BODY_JOINT_RIGHT_HAND_RING_DISTAL_FB = 63,
|
||||
XR_BODY_JOINT_RIGHT_HAND_RING_TIP_FB = 64,
|
||||
XR_BODY_JOINT_RIGHT_HAND_LITTLE_METACARPAL_FB = 65,
|
||||
XR_BODY_JOINT_RIGHT_HAND_LITTLE_PROXIMAL_FB = 66,
|
||||
XR_BODY_JOINT_RIGHT_HAND_LITTLE_INTERMEDIATE_FB = 67,
|
||||
XR_BODY_JOINT_RIGHT_HAND_LITTLE_DISTAL_FB = 68,
|
||||
XR_BODY_JOINT_RIGHT_HAND_LITTLE_TIP_FB = 69,
|
||||
XR_BODY_JOINT_COUNT_FB = 70,
|
||||
XR_BODY_JOINT_NONE_FB = -1,
|
||||
XR_BODY_JOINT_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrBodyJointFB;
|
||||
|
||||
typedef enum XrBodyJointSetFB {
|
||||
XR_BODY_JOINT_SET_DEFAULT_FB = 0,
|
||||
XR_BODY_JOINT_SET_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrBodyJointSetFB;
|
||||
|
||||
typedef struct XrSystemBodyTrackingPropertiesFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrBool32 supportsBodyTracking;
|
||||
} XrSystemBodyTrackingPropertiesFB;
|
||||
|
||||
typedef struct XrBodyTrackerCreateInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrBodyJointSetFB bodyJointSet;
|
||||
} XrBodyTrackerCreateInfoFB;
|
||||
|
||||
typedef struct XrBodyJointsLocateInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpace baseSpace;
|
||||
XrTime time;
|
||||
} XrBodyJointsLocateInfoFB;
|
||||
|
||||
typedef struct XrBodyJointLocationFB {
|
||||
XrSpaceLocationFlags locationFlags;
|
||||
XrPosef pose;
|
||||
} XrBodyJointLocationFB;
|
||||
|
||||
typedef struct XrBodyJointLocationsFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrBool32 isActive;
|
||||
float confidence;
|
||||
uint32_t jointCount;
|
||||
XrBodyJointLocationFB* jointLocations;
|
||||
uint32_t skeletonChangedCount;
|
||||
XrTime time;
|
||||
} XrBodyJointLocationsFB;
|
||||
#define XrBodyJointLocationsV2FB XrBodyJointLocationsFB
|
||||
|
||||
typedef struct XrBodyJointLocationsV1FB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrBool32 isActive;
|
||||
float confidence;
|
||||
uint32_t jointCount;
|
||||
XrBodyJointLocationFB* jointLocations;
|
||||
} XrBodyJointLocationsV1FB;
|
||||
|
||||
typedef struct XrBodySkeletonJointFB {
|
||||
int32_t joint;
|
||||
int32_t parentJoint;
|
||||
XrPosef pose;
|
||||
} XrBodySkeletonJointFB;
|
||||
|
||||
typedef struct XrBodySkeletonFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
uint32_t jointCount;
|
||||
XrBodySkeletonJointFB* joints;
|
||||
} XrBodySkeletonFB;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrCreateBodyTrackerFB)(
|
||||
XrSession session,
|
||||
const XrBodyTrackerCreateInfoFB* createInfo,
|
||||
XrBodyTrackerFB* bodyTracker);
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrDestroyBodyTrackerFB)(XrBodyTrackerFB bodyTracker);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrLocateBodyJointsFB)(
|
||||
XrBodyTrackerFB bodyTracker,
|
||||
const XrBodyJointsLocateInfoFB* locateInfo,
|
||||
XrBodyJointLocationsFB* locations);
|
||||
|
||||
typedef XrResult(
|
||||
XRAPI_PTR* PFN_xrGetBodySkeletonFB)(XrBodyTrackerFB bodyTracker, XrBodySkeletonFB* skeleton);
|
||||
|
||||
#if defined(XR_FB_body_tracking_EXPERIMENTAL_VERSION) && \
|
||||
(XR_FB_body_tracking_EXPERIMENTAL_VERSION == 2)
|
||||
typedef XrResult(
|
||||
XRAPI_PTR* PFN_xrGetSkeletonFB)(XrBodyTrackerFB bodyTracker, XrBodySkeletonFB* skeleton);
|
||||
#endif
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateBodyTrackerFB(
|
||||
XrSession session,
|
||||
const XrBodyTrackerCreateInfoFB* createInfo,
|
||||
XrBodyTrackerFB* bodyTracker);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateBodyTrackerV1FB(
|
||||
XrSession session,
|
||||
const XrBodyTrackerCreateInfoFB* createInfo,
|
||||
XrBodyTrackerFB* bodyTracker);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrDestroyBodyTrackerFB(XrBodyTrackerFB bodyTracker);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrLocateBodyJointsFB(
|
||||
XrBodyTrackerFB bodyTracker,
|
||||
const XrBodyJointsLocateInfoFB* locateInfo,
|
||||
XrBodyJointLocationsFB* locations);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrLocateBodyJointsV1FB(
|
||||
XrBodyTrackerFB bodyTracker,
|
||||
const XrBodyJointsLocateInfoFB* locateInfo,
|
||||
XrBodyJointLocationsV1FB* locations);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrGetBodySkeletonFB(XrBodyTrackerFB bodyTracker, XrBodySkeletonFB* skeleton);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrGetSkeletonFB(XrBodyTrackerFB bodyTracker, XrBodySkeletonFB* skeleton);
|
||||
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
|
||||
#endif // XR_FB_body_tracking
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
Filename : fb_composition_layer_depth_test.h
|
||||
Content : Extension to control if a layer will participate in depth testing. If
|
||||
extension is not used no layer will participate in depth testing.
|
||||
Language : C99 Copyright
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
|
||||
/*
|
||||
Extension 213 XR_FB_composition_layer_depth_test
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_composition_layer_depth_test
|
||||
|
||||
// This extension enables depth-tested layer composition. The compositor will maintain a depth
|
||||
// buffer in addition to a color buffer. The depth buffer is cleared to a depth corresponding to the
|
||||
// infinitely far distance at the beginning of composition.
|
||||
|
||||
// When composing each layer, if depth testing is requested, the incoming layer depths are
|
||||
// transformed into the compositor window space depth and compared to the depth stored in the frame
|
||||
// buffer. If the depth test fails, the fragment is discarded. If the depth test passes the depth
|
||||
// buffer is updated if depth writes are enabled, and color processing continues.
|
||||
|
||||
// Depth testing requires depth values for the layer. For projection layers, this can be supplied
|
||||
// via the XR_KHR_composition_layer_depth extension. For geometric primitive layers, the runtime
|
||||
// computes the depth of the sample directly from the layer parameters.
|
||||
// XrCompositionLayerDepthTestFB may only be chained to layers that support depth.
|
||||
|
||||
#define XR_FB_composition_layer_depth_test 1
|
||||
#define XR_FB_composition_layer_depth_test_SPEC_VERSION 1
|
||||
#define XR_FB_COMPOSITION_LAYER_DEPTH_TEST_EXTENSION_NAME "XR_FB_composition_layer_depth_test"
|
||||
|
||||
typedef enum XrCompareOpFB {
|
||||
XR_COMPARE_OP_NEVER_FB = 0,
|
||||
XR_COMPARE_OP_LESS_FB = 1,
|
||||
XR_COMPARE_OP_EQUAL_FB = 2,
|
||||
XR_COMPARE_OP_LESS_OR_EQUAL_FB = 3,
|
||||
XR_COMPARE_OP_GREATER_FB = 4,
|
||||
XR_COMPARE_OP_NOT_EQUAL_FB = 5,
|
||||
XR_COMPARE_OP_GREATER_OR_EQUAL_FB = 6,
|
||||
XR_COMPARE_OP_ALWAYS_FB = 7,
|
||||
} XrCompareOpFB;
|
||||
|
||||
// To specify that a layer should be depth tested, a XrCompositionLayerDepthTestFB structure must be
|
||||
// passed via the polymorphic XrCompositionLayerBaseHeader structure’s next parameter chain.
|
||||
|
||||
// Valid Usage (Implicit)
|
||||
// * The XR_FB_composition_layer_depth_test extension must be enabled prior to using
|
||||
// XrCompositionLayerDepthTestFB
|
||||
// * type must be XR_TYPE_COMPOSITION_LAYER_DEPTH_TEST_FB
|
||||
// * next must be NULL or a valid pointer to the next structure in a structure chain
|
||||
// * compareOp must be a valid XrCompareOpFB value
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_COMPOSITION_LAYER_DEPTH_TEST_FB, 1000212000);
|
||||
typedef struct XrCompositionLayerDepthTestFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrBool32 depthMask;
|
||||
XrCompareOpFB compareOp;
|
||||
} XrCompositionLayerDepthTestFB;
|
||||
|
||||
#endif // XR_FB_composition_layer_depth_test
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
Filename : fb_eye_tracking.h
|
||||
Content : Eye tracking APIs.
|
||||
Language : C99
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr.h>
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
|
||||
/*
|
||||
203 XR_FB_eye_tracking_social
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_eye_tracking_social
|
||||
|
||||
#if defined(XR_FB_eye_tracking_EXPERIMENTAL_VERSION) && \
|
||||
defined(XR_FB_eye_tracking_social_EXPERIMENTAL_VERSION)
|
||||
#error \
|
||||
"either XR_FB_eye_tracking_EXPERIMENTAL_VERSION or XR_FB_eye_tracking_social_EXPERIMENTAL_VERSION should be defined"
|
||||
#endif
|
||||
#if defined(XR_FB_eye_tracking_EXPERIMENTAL_VERSION) && \
|
||||
(XR_FB_eye_tracking_EXPERIMENTAL_VERSION != 1)
|
||||
#error "unknown experimental version number for XR_FB_eye_tracking_EXPERIMENTAL_VERSION"
|
||||
#endif
|
||||
#if defined(XR_FB_eye_tracking_social_EXPERIMENTAL_VERSION) && \
|
||||
(XR_FB_eye_tracking_social_EXPERIMENTAL_VERSION != 1)
|
||||
#error "unknown experimental version number for XR_FB_eye_tracking_social_EXPERIMENTAL_VERSION"
|
||||
#endif
|
||||
|
||||
#define XR_FB_eye_tracking_social 1
|
||||
|
||||
#define XR_FB_eye_tracking_social_SPEC_VERSION 1
|
||||
#define XR_FB_EYE_TRACKING_SOCIAL_EXTENSION_NAME "XR_FB_eye_tracking_social"
|
||||
|
||||
#define XR_FBX1_eye_tracking_SPEC_VERSION 1
|
||||
#define XR_FBX1_EYE_TRACKING_EXTENSION_NAME "XR_FBX1_eye_tracking"
|
||||
#define XR_FBX1_eye_tracking_social_SPEC_VERSION 1
|
||||
#define XR_FBX1_EYE_TRACKING_SOCIAL_EXTENSION_NAME "XR_FBX1_eye_tracking_social"
|
||||
|
||||
#if defined(XR_FB_eye_tracking_social_EXPERIMENTAL_VERSION) && \
|
||||
(XR_FB_eye_tracking_social_EXPERIMENTAL_VERSION == 1)
|
||||
|
||||
#undef XR_FB_eye_tracking_social_SPEC_VERSION
|
||||
#undef XR_FB_EYE_TRACKING_SOCIAL_EXTENSION_NAME
|
||||
#define XR_FB_eye_tracking_social_SPEC_VERSION XR_FBX1_eye_tracking_social_SPEC_VERSION
|
||||
#define XR_FB_EYE_TRACKING_SOCIAL_EXTENSION_NAME XR_FBX1_EYE_TRACKING_SOCIAL_EXTENSION_NAME
|
||||
|
||||
#elif defined(XR_FB_eye_tracking_EXPERIMENTAL_VERSION) && \
|
||||
(XR_FB_eye_tracking_EXPERIMENTAL_VERSION == 1)
|
||||
|
||||
#undef XR_FB_eye_tracking_social_SPEC_VERSION
|
||||
#undef XR_FB_EYE_TRACKING_SOCIAL_EXTENSION_NAME
|
||||
#define XR_FB_eye_tracking_SPEC_VERSION XR_FBX1_eye_tracking_SPEC_VERSION
|
||||
#define XR_FB_EYE_TRACKING_EXTENSION_NAME XR_FBX1_EYE_TRACKING_EXTENSION_NAME
|
||||
|
||||
#endif
|
||||
|
||||
XR_DEFINE_HANDLE(XrEyeTrackerFB)
|
||||
XR_STRUCT_ENUM(XR_TYPE_EYE_TRACKER_CREATE_INFO_FB, 1000202001);
|
||||
XR_STRUCT_ENUM(XR_TYPE_EYE_GAZES_INFO_FB, 1000202002);
|
||||
XR_STRUCT_ENUM(XR_TYPE_EYE_GAZES_FB, 1000202003);
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_SYSTEM_EYE_TRACKING_PROPERTIES_FB, 1000202004);
|
||||
|
||||
typedef XrFlags64 XrEyeInputFlagsFB;
|
||||
|
||||
typedef struct XrSystemEyeTrackingPropertiesFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrBool32 supportsEyeTracking;
|
||||
} XrSystemEyeTrackingPropertiesFB;
|
||||
|
||||
typedef struct XrEyeTrackerCreateInfoV2FB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
} XrEyeTrackerCreateInfoV2FB;
|
||||
|
||||
typedef struct XrEyeTrackerCreateInfoV1FB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrEyeInputFlagsFB flags;
|
||||
} XrEyeTrackerCreateInfoV1FB;
|
||||
|
||||
typedef struct XrEyeGazesInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpace baseSpace;
|
||||
XrTime time;
|
||||
} XrEyeGazesInfoFB;
|
||||
|
||||
typedef struct XrEyeGazeV2FB {
|
||||
XrBool32 isValid;
|
||||
XrPosef gazePose;
|
||||
float gazeConfidence;
|
||||
} XrEyeGazeV2FB;
|
||||
|
||||
typedef struct XrEyeGazeV1FB {
|
||||
XrBool32 isValid;
|
||||
XrPosef gazePose;
|
||||
float gazeConfidence;
|
||||
} XrEyeGazeV1FB;
|
||||
|
||||
typedef enum XrEyePositionFB {
|
||||
XR_EYE_POSITION_LEFT_FB = 0,
|
||||
XR_EYE_POSITION_RIGHT_FB = 1,
|
||||
XR_EYE_POSITION_COUNT_FB = 2,
|
||||
XR_EYE_POSITION_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrEyePositionFB;
|
||||
|
||||
typedef struct XrEyeGazesV2FB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrEyeGazeV2FB gaze[2];
|
||||
XrTime time;
|
||||
} XrEyeGazesV2FB;
|
||||
|
||||
typedef struct XrEyeGazesV1FB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrEyeGazeV1FB gaze[2];
|
||||
} XrEyeGazesV1FB;
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateEyeTrackerV1FB(
|
||||
XrSession session,
|
||||
const XrEyeTrackerCreateInfoV1FB* createInfo,
|
||||
XrEyeTrackerFB* eyeTracker);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateEyeTrackerV2FB(
|
||||
XrSession session,
|
||||
const XrEyeTrackerCreateInfoV2FB* createInfo,
|
||||
XrEyeTrackerFB* eyeTracker);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrDestroyEyeTrackerFB(XrEyeTrackerFB eyeTracker);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetEyeGazesV1FB(
|
||||
XrEyeTrackerFB eyeTracker,
|
||||
const XrEyeGazesInfoFB* gazeInfo,
|
||||
XrEyeGazesV1FB* eyeGazes);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetEyeGazesV2FB(
|
||||
XrEyeTrackerFB eyeTracker,
|
||||
const XrEyeGazesInfoFB* gazeInfo,
|
||||
XrEyeGazesV2FB* eyeGazes);
|
||||
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
|
||||
#if !defined(XR_FB_eye_tracking_social_EXPERIMENTAL_VERSION) && \
|
||||
!defined(XR_FB_eye_tracking_EXPERIMENTAL_VERSION) || \
|
||||
defined(XR_FB_eye_tracking_social_EXPERIMENTAL_VERSION) && \
|
||||
(XR_FB_eye_tracking_social_EXPERIMENTAL_VERSION == 1)
|
||||
|
||||
#define XrEyeGazeFB XrEyeGazeV2FB
|
||||
#define XrEyeGazesFB XrEyeGazesV2FB
|
||||
#define XrEyeTrackerCreateInfoFB XrEyeTrackerCreateInfoV2FB
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrCreateEyeTrackerFB)(
|
||||
XrSession session,
|
||||
const XrEyeTrackerCreateInfoV2FB* createInfo,
|
||||
XrEyeTrackerFB* eyeTracker);
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrDestroyEyeTrackerFB)(XrEyeTrackerFB eyeTracker);
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetEyeGazesFB)(
|
||||
XrEyeTrackerFB eyeTracker,
|
||||
const XrEyeGazesInfoFB* gazeInfo,
|
||||
XrEyeGazesV2FB* eyeGazes);
|
||||
|
||||
#elif defined(XR_FB_eye_tracking_EXPERIMENTAL_VERSION) && \
|
||||
(XR_FB_eye_tracking_EXPERIMENTAL_VERSION == 1)
|
||||
|
||||
// Flag bits for XrEyeInputFlagsFB
|
||||
static const XrEyeInputFlagsFB XR_EYE_INPUT_FLAGS_LEFT_EYE_BIT_FB = 0x00000001;
|
||||
static const XrEyeInputFlagsFB XR_EYE_INPUT_FLAGS_RIGHT_EYE_BIT_FB = 0x00000002;
|
||||
|
||||
#define XrEyeGazeFB XrEyeGazeV1FB
|
||||
#define XrEyeGazesFB XrEyeGazesV1FB
|
||||
#define XrEyeTrackerCreateInfoFB XrEyeTrackerCreateInfoV1FB
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrCreateEyeTrackerFB)(
|
||||
XrSession session,
|
||||
const XrEyeTrackerCreateInfoV1FB* createInfo,
|
||||
XrEyeTrackerFB* eyeTracker);
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrDestroyEyeTrackerFB)(XrEyeTrackerFB eyeTracker);
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetEyeGazesFB)(
|
||||
XrEyeTrackerFB eyeTracker,
|
||||
const XrEyeGazesInfoFB* gazeInfo,
|
||||
XrEyeGazesV1FB* eyeGazes);
|
||||
|
||||
#endif // versions
|
||||
|
||||
#endif // XR_FB_eye_tracking
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+384
@@ -0,0 +1,384 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
Filename : fb_face_tracking.h
|
||||
Content : Face tracking APIs.
|
||||
Language : C99
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr.h>
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
|
||||
/*
|
||||
202 XR_FB_face_tracking
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_face_tracking
|
||||
#define XR_FB_face_tracking 1
|
||||
XR_DEFINE_HANDLE(XrFaceTrackerFB)
|
||||
|
||||
#define XR_FB_face_tracking_SPEC_VERSION 1
|
||||
#define XR_FB_FACE_TRACKING_EXTENSION_NAME "XR_FB_face_tracking"
|
||||
#define XR_FBX1_face_tracking_SPEC_VERSION 1
|
||||
#define XR_FBX1_FACE_TRACKING_EXTENSION_NAME "XR_FBX1_face_tracking"
|
||||
#define XR_FBX2_face_tracking_SPEC_VERSION 2
|
||||
#define XR_FBX2_FACE_TRACKING_EXTENSION_NAME "XR_FBX2_face_tracking"
|
||||
|
||||
#if defined(XR_FB_face_tracking_EXPERIMENTAL_VERSION)
|
||||
#if XR_FB_face_tracking_EXPERIMENTAL_VERSION == 1
|
||||
#undef XR_FB_face_tracking_SPEC_VERSION
|
||||
#undef XR_FB_FACE_TRACKING_EXTENSION_NAME
|
||||
#define XR_FB_face_tracking_SPEC_VERSION XR_FBX1_face_tracking_SPEC_VERSION
|
||||
#define XR_FB_FACE_TRACKING_EXTENSION_NAME XR_FBX1_FACE_TRACKING_EXTENSION_NAME
|
||||
#elif XR_FB_face_tracking_EXPERIMENTAL_VERSION == 2
|
||||
#undef XR_FB_face_tracking_SPEC_VERSION
|
||||
#undef XR_FB_FACE_TRACKING_EXTENSION_NAME
|
||||
#define XR_FB_face_tracking_SPEC_VERSION XR_FBX2_face_tracking_SPEC_VERSION
|
||||
#define XR_FB_FACE_TRACKING_EXTENSION_NAME XR_FBX2_FACE_TRACKING_EXTENSION_NAME
|
||||
#else
|
||||
#error "unknown experimental version number for XR_FB_face_tracking_EXPERIMENTAL_VERSION"
|
||||
#endif // versions
|
||||
#endif // defined(XR_FB_face_tracking_EXPERIMENTAL_VERSION)
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_FACE_TRACKER_CREATE_INFO_V1_FB, 1000201001);
|
||||
XR_STRUCT_ENUM(XR_TYPE_FACE_TRACKER_CREATE_INFO_FB, 1000201005);
|
||||
XR_STRUCT_ENUM(XR_TYPE_FACE_EXPRESSION_INFO_FB, 1000201002);
|
||||
XR_STRUCT_ENUM(XR_TYPE_FACE_EXPRESSION_WEIGHTS_V1_FB, 1000201003);
|
||||
XR_STRUCT_ENUM(XR_TYPE_FACE_EXPRESSION_WEIGHTS_FB, 1000201006);
|
||||
#define XR_TYPE_FACE_TRACKER_CREATE_INFO_V2_FB XR_TYPE_FACE_TRACKER_CREATE_INFO_FB
|
||||
#define XR_TYPE_FACE_EXPRESSION_WEIGHTS_V2_FB XR_TYPE_FACE_EXPRESSION_WEIGHTS_FB
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_SYSTEM_FACE_TRACKING_PROPERTIES_FB, 1000201004);
|
||||
|
||||
#if !defined(XR_FB_face_tracking_EXPERIMENTAL_VERSION) || \
|
||||
(XR_FB_face_tracking_EXPERIMENTAL_VERSION == 2)
|
||||
|
||||
typedef enum XrFaceExpressionFB {
|
||||
XR_FACE_EXPRESSION_BROW_LOWERER_L_FB = 0,
|
||||
XR_FACE_EXPRESSION_BROW_LOWERER_R_FB = 1,
|
||||
|
||||
XR_FACE_EXPRESSION_CHEEK_PUFF_L_FB = 2,
|
||||
XR_FACE_EXPRESSION_CHEEK_PUFF_R_FB = 3,
|
||||
XR_FACE_EXPRESSION_CHEEK_RAISER_L_FB = 4,
|
||||
XR_FACE_EXPRESSION_CHEEK_RAISER_R_FB = 5,
|
||||
XR_FACE_EXPRESSION_CHEEK_SUCK_L_FB = 6,
|
||||
XR_FACE_EXPRESSION_CHEEK_SUCK_R_FB = 7,
|
||||
|
||||
XR_FACE_EXPRESSION_CHIN_RAISER_B_FB = 8,
|
||||
XR_FACE_EXPRESSION_CHIN_RAISER_T_FB = 9,
|
||||
|
||||
XR_FACE_EXPRESSION_DIMPLER_L_FB = 10,
|
||||
XR_FACE_EXPRESSION_DIMPLER_R_FB = 11,
|
||||
|
||||
XR_FACE_EXPRESSION_EYES_CLOSED_L_FB = 12,
|
||||
XR_FACE_EXPRESSION_EYES_CLOSED_R_FB = 13,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_DOWN_L_FB = 14,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_DOWN_R_FB = 15,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_LEFT_L_FB = 16,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_LEFT_R_FB = 17,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_RIGHT_L_FB = 18,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_RIGHT_R_FB = 19,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_UP_L_FB = 20,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_UP_R_FB = 21,
|
||||
|
||||
XR_FACE_EXPRESSION_INNER_BROW_RAISER_L_FB = 22,
|
||||
XR_FACE_EXPRESSION_INNER_BROW_RAISER_R_FB = 23,
|
||||
|
||||
XR_FACE_EXPRESSION_JAW_DROP_FB = 24,
|
||||
XR_FACE_EXPRESSION_JAW_SIDEWAYS_LEFT_FB = 25,
|
||||
XR_FACE_EXPRESSION_JAW_SIDEWAYS_RIGHT_FB = 26,
|
||||
XR_FACE_EXPRESSION_JAW_THRUST_FB = 27,
|
||||
|
||||
XR_FACE_EXPRESSION_LID_TIGHTENER_L_FB = 28,
|
||||
XR_FACE_EXPRESSION_LID_TIGHTENER_R_FB = 29,
|
||||
|
||||
XR_FACE_EXPRESSION_LIP_CORNER_DEPRESSOR_L_FB = 30,
|
||||
XR_FACE_EXPRESSION_LIP_CORNER_DEPRESSOR_R_FB = 31,
|
||||
XR_FACE_EXPRESSION_LIP_CORNER_PULLER_L_FB = 32,
|
||||
XR_FACE_EXPRESSION_LIP_CORNER_PULLER_R_FB = 33,
|
||||
XR_FACE_EXPRESSION_LIP_FUNNELER_LB_FB = 34,
|
||||
XR_FACE_EXPRESSION_LIP_FUNNELER_LT_FB = 35,
|
||||
XR_FACE_EXPRESSION_LIP_FUNNELER_RB_FB = 36,
|
||||
XR_FACE_EXPRESSION_LIP_FUNNELER_RT_FB = 37,
|
||||
XR_FACE_EXPRESSION_LIP_PRESSOR_L_FB = 38,
|
||||
XR_FACE_EXPRESSION_LIP_PRESSOR_R_FB = 39,
|
||||
XR_FACE_EXPRESSION_LIP_PUCKER_L_FB = 40,
|
||||
XR_FACE_EXPRESSION_LIP_PUCKER_R_FB = 41,
|
||||
XR_FACE_EXPRESSION_LIP_STRETCHER_L_FB = 42,
|
||||
XR_FACE_EXPRESSION_LIP_STRETCHER_R_FB = 43,
|
||||
XR_FACE_EXPRESSION_LIP_SUCK_LB_FB = 44,
|
||||
XR_FACE_EXPRESSION_LIP_SUCK_LT_FB = 45,
|
||||
XR_FACE_EXPRESSION_LIP_SUCK_RB_FB = 46,
|
||||
XR_FACE_EXPRESSION_LIP_SUCK_RT_FB = 47,
|
||||
XR_FACE_EXPRESSION_LIP_TIGHTENER_L_FB = 48,
|
||||
XR_FACE_EXPRESSION_LIP_TIGHTENER_R_FB = 49,
|
||||
XR_FACE_EXPRESSION_LIPS_TOWARD_FB = 50,
|
||||
XR_FACE_EXPRESSION_LOWER_LIP_DEPRESSOR_L_FB = 51,
|
||||
XR_FACE_EXPRESSION_LOWER_LIP_DEPRESSOR_R_FB = 52,
|
||||
|
||||
XR_FACE_EXPRESSION_MOUTH_LEFT_FB = 53,
|
||||
XR_FACE_EXPRESSION_MOUTH_RIGHT_FB = 54,
|
||||
|
||||
XR_FACE_EXPRESSION_NOSE_WRINKLER_L_FB = 55,
|
||||
XR_FACE_EXPRESSION_NOSE_WRINKLER_R_FB = 56,
|
||||
|
||||
XR_FACE_EXPRESSION_OUTER_BROW_RAISER_L_FB = 57,
|
||||
XR_FACE_EXPRESSION_OUTER_BROW_RAISER_R_FB = 58,
|
||||
|
||||
XR_FACE_EXPRESSION_UPPER_LID_RAISER_L_FB = 59,
|
||||
XR_FACE_EXPRESSION_UPPER_LID_RAISER_R_FB = 60,
|
||||
XR_FACE_EXPRESSION_UPPER_LIP_RAISER_L_FB = 61,
|
||||
XR_FACE_EXPRESSION_UPPER_LIP_RAISER_R_FB = 62,
|
||||
|
||||
XR_FACE_EXPRESSION_COUNT_FB = 63,
|
||||
XR_FACE_EXPRESSION_NONE_FB = -1,
|
||||
XR_FACE_EXPRESSION_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrFaceExpressionFB;
|
||||
|
||||
#elif XR_FB_face_tracking_EXPERIMENTAL_VERSION == 1
|
||||
|
||||
typedef enum XrFaceExpressionFB {
|
||||
XR_FACE_EXPRESSION_BROW_LOWERER_L_FB = 0,
|
||||
XR_FACE_EXPRESSION_BROW_LOWERER_R_FB = 1,
|
||||
|
||||
XR_FACE_EXPRESSION_CHEEK_PUFF_L_FB = 2,
|
||||
XR_FACE_EXPRESSION_CHEEK_PUFF_R_FB = 3,
|
||||
XR_FACE_EXPRESSION_CHEEK_RAISER_L_FB = 4,
|
||||
XR_FACE_EXPRESSION_CHEEK_RAISER_R_FB = 5,
|
||||
XR_FACE_EXPRESSION_CHEEK_SUCK_L_FB = 6,
|
||||
XR_FACE_EXPRESSION_CHEEK_SUCK_R_FB = 7,
|
||||
|
||||
XR_FACE_EXPRESSION_CHIN_RAISER_B_FB = 8,
|
||||
XR_FACE_EXPRESSION_CHIN_RAISER_T_FB = 9,
|
||||
|
||||
XR_FACE_EXPRESSION_DIMPLER_L_FB = 10,
|
||||
XR_FACE_EXPRESSION_DIMPLER_R_FB = 11,
|
||||
|
||||
XR_FACE_EXPRESSION_EYES_CLOSED_L_FB = 12,
|
||||
XR_FACE_EXPRESSION_EYES_CLOSED_R_FB = 13,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_DOWN_L_FB = 14,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_DOWN_R_FB = 15,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_LEFT_L_FB = 16,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_LEFT_R_FB = 17,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_RIGHT_L_FB = 18,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_RIGHT_R_FB = 19,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_UP_L_FB = 20,
|
||||
XR_FACE_EXPRESSION_EYES_LOOK_UP_R_FB = 21,
|
||||
|
||||
XR_FACE_EXPRESSION_INNER_BROW_RAISER_L_FB = 22,
|
||||
XR_FACE_EXPRESSION_INNER_BROW_RAISER_R_FB = 23,
|
||||
|
||||
XR_FACE_EXPRESSION_JAW_DROP_FB = 24,
|
||||
XR_FACE_EXPRESSION_JAW_SIDEWAYS_LEFT_FB = 25,
|
||||
XR_FACE_EXPRESSION_JAW_SIDEWAYS_RIGHT_FB = 26,
|
||||
XR_FACE_EXPRESSION_JAW_THRUST_FB = 27,
|
||||
|
||||
XR_FACE_EXPRESSION_LID_TIGHTENER_L_FB = 28,
|
||||
XR_FACE_EXPRESSION_LID_TIGHTENER_R_FB = 29,
|
||||
|
||||
XR_FACE_EXPRESSION_LIP_CORNER_DEPRESSOR_L_FB = 30,
|
||||
XR_FACE_EXPRESSION_LIP_CORNER_DEPRESSOR_R_FB = 31,
|
||||
XR_FACE_EXPRESSION_LIP_CORNER_PULLER_L_FB = 32,
|
||||
XR_FACE_EXPRESSION_LIP_CORNER_PULLER_R_FB = 33,
|
||||
XR_FACE_EXPRESSION_LIP_FUNNELER_LB_FB = 34,
|
||||
XR_FACE_EXPRESSION_LIP_FUNNELER_LT_FB = 35,
|
||||
XR_FACE_EXPRESSION_LIP_FUNNELER_RB_FB = 36,
|
||||
XR_FACE_EXPRESSION_LIP_FUNNELER_RT_FB = 37,
|
||||
XR_FACE_EXPRESSION_LIP_PRESSOR_L_FB = 38,
|
||||
XR_FACE_EXPRESSION_LIP_PRESSOR_R_FB = 39,
|
||||
XR_FACE_EXPRESSION_LIP_PUCKER_L_FB = 40,
|
||||
XR_FACE_EXPRESSION_LIP_PUCKER_R_FB = 41,
|
||||
XR_FACE_EXPRESSION_LIP_STRETCHER_L_FB = 42,
|
||||
XR_FACE_EXPRESSION_LIP_STRETCHER_R_FB = 43,
|
||||
XR_FACE_EXPRESSION_LIP_SUCK_LB_FB = 44,
|
||||
XR_FACE_EXPRESSION_LIP_SUCK_LT_FB = 45,
|
||||
XR_FACE_EXPRESSION_LIP_SUCK_RB_FB = 46,
|
||||
XR_FACE_EXPRESSION_LIP_SUCK_RT_FB = 47,
|
||||
XR_FACE_EXPRESSION_LIP_TIGHTENER_L_FB = 48,
|
||||
XR_FACE_EXPRESSION_LIP_TIGHTENER_R_FB = 49,
|
||||
XR_FACE_EXPRESSION_LIPS_TOWARD_LB_FB = 50,
|
||||
XR_FACE_EXPRESSION_LIPS_TOWARD_LT_FB = 51,
|
||||
XR_FACE_EXPRESSION_LIPS_TOWARD_RB_FB = 52,
|
||||
XR_FACE_EXPRESSION_LIPS_TOWARD_RT_FB = 53,
|
||||
XR_FACE_EXPRESSION_LOWER_LIP_DEPRESSOR_L_FB = 54,
|
||||
XR_FACE_EXPRESSION_LOWER_LIP_DEPRESSOR_R_FB = 55,
|
||||
|
||||
XR_FACE_EXPRESSION_MOUTH_LEFT_FB = 56,
|
||||
XR_FACE_EXPRESSION_MOUTH_RIGHT_FB = 57,
|
||||
|
||||
XR_FACE_EXPRESSION_NASOLABIAL_FURROW_L_FB = 58,
|
||||
XR_FACE_EXPRESSION_NASOLABIAL_FURROW_R_FB = 59,
|
||||
|
||||
XR_FACE_EXPRESSION_NOSE_WRINKLER_L_FB = 60,
|
||||
XR_FACE_EXPRESSION_NOSE_WRINKLER_R_FB = 61,
|
||||
XR_FACE_EXPRESSION_NOSTRIL_COMPRESSOR_L_FB = 62,
|
||||
XR_FACE_EXPRESSION_NOSTRIL_COMPRESSOR_R_FB = 63,
|
||||
XR_FACE_EXPRESSION_NOSTRIL_DILATOR_L_FB = 64,
|
||||
XR_FACE_EXPRESSION_NOSTRIL_DILATOR_R_FB = 65,
|
||||
|
||||
XR_FACE_EXPRESSION_OUTER_BROW_RAISER_L_FB = 66,
|
||||
XR_FACE_EXPRESSION_OUTER_BROW_RAISER_R_FB = 67,
|
||||
|
||||
XR_FACE_EXPRESSION_UPPER_LID_RAISER_L_FB = 68,
|
||||
XR_FACE_EXPRESSION_UPPER_LID_RAISER_R_FB = 69,
|
||||
XR_FACE_EXPRESSION_UPPER_LIP_RAISER_L_FB = 70,
|
||||
XR_FACE_EXPRESSION_UPPER_LIP_RAISER_R_FB = 71,
|
||||
|
||||
XR_FACE_EXPRESSION_COUNT_FB = 72,
|
||||
XR_FACE_EXPRESSION_NONE_FB = -1,
|
||||
XR_FACE_EXPRESSION_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrFaceExpressionFB;
|
||||
|
||||
#endif // versions
|
||||
|
||||
typedef XrFlags64 XrFaceInputFlagsFB;
|
||||
|
||||
#if defined(XR_FB_face_tracking_EXPERIMENTAL_VERSION) && \
|
||||
(XR_FB_face_tracking_EXPERIMENTAL_VERSION == 1)
|
||||
|
||||
// Flag bits for XrFaceInputFlagsFB
|
||||
static const XrFaceInputFlagsFB XR_FACE_INPUT_FLAGS_UPPER_FACE_BIT_FB = 0x00000001;
|
||||
static const XrFaceInputFlagsFB XR_FACE_INPUT_FLAGS_LOWER_FACE_BIT_FB = 0x00000002;
|
||||
static const XrFaceInputFlagsFB XR_FACE_INPUT_FLAGS_AUDIO_BIT_FB = 0x00000004;
|
||||
|
||||
#endif // XR_FB_face_tracking_EXPERIMENTAL_VERSION == 1
|
||||
|
||||
typedef enum XrFaceExpressionSetFB {
|
||||
XR_FACE_EXPRESSSION_SET_DEFAULT_FB = 0,
|
||||
XR_FACE_EXPRESSSION_SET_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrFaceExpressionSetFB;
|
||||
|
||||
typedef enum XrFaceConfidenceFB {
|
||||
XR_FACE_CONFIDENCE_LOWER_FACE_FB = 0,
|
||||
XR_FACE_CONFIDENCE_UPPER_FACE_FB = 1,
|
||||
|
||||
XR_FACE_CONFIDENCE_COUNT_FB = 2,
|
||||
XR_FACE_CONFIDENCE_NONE_FB = -1,
|
||||
XR_FACE_CONFIDENCE_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrFaceConfidenceFB;
|
||||
|
||||
typedef struct XrSystemFaceTrackingPropertiesFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrBool32 supportsFaceTracking;
|
||||
} XrSystemFaceTrackingPropertiesFB;
|
||||
|
||||
typedef struct XrFaceTrackerCreateInfoV2FB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrFaceExpressionSetFB faceExpressionSet;
|
||||
} XrFaceTrackerCreateInfoV2FB;
|
||||
|
||||
typedef struct XrFaceTrackerCreateInfoV1FB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrFaceInputFlagsFB flags;
|
||||
} XrFaceTrackerCreateInfoV1FB;
|
||||
|
||||
typedef struct XrFaceExpressionInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrTime time;
|
||||
} XrFaceExpressionInfoFB;
|
||||
|
||||
typedef struct XrFaceExpressionStatusFB {
|
||||
XrBool32 isValid;
|
||||
XrBool32 isEyeFollowingBlendshapesValid;
|
||||
} XrFaceExpressionStatusFB;
|
||||
|
||||
typedef struct XrFaceExpressionWeightsV2FB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
uint32_t weightCount;
|
||||
float* weights;
|
||||
uint32_t confidenceCount;
|
||||
float* confidences;
|
||||
XrFaceExpressionStatusFB status;
|
||||
XrTime time;
|
||||
} XrFaceExpressionWeightsV2FB;
|
||||
|
||||
typedef struct XrFaceExpressionWeightsV1FB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
uint32_t weightsCapacityInput;
|
||||
uint32_t weightsCountOutput;
|
||||
float* weights;
|
||||
float* weightConfidences;
|
||||
} XrFaceExpressionWeightsV1FB;
|
||||
|
||||
#if !defined(XR_FB_face_tracking_EXPERIMENTAL_VERSION) || \
|
||||
(XR_FB_face_tracking_EXPERIMENTAL_VERSION == 2)
|
||||
|
||||
#define XrFaceTrackerCreateInfoFB XrFaceTrackerCreateInfoV2FB
|
||||
#define XrFaceExpressionWeightsFB XrFaceExpressionWeightsV2FB
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrCreateFaceTrackerFB)(
|
||||
XrSession session,
|
||||
const XrFaceTrackerCreateInfoV2FB* createInfo,
|
||||
XrFaceTrackerFB* faceTracker);
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrDestroyFaceTrackerFB)(XrFaceTrackerFB faceTracker);
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetFaceExpressionWeightsFB)(
|
||||
XrFaceTrackerFB faceTracker,
|
||||
const XrFaceExpressionInfoFB* expressionInfo,
|
||||
XrFaceExpressionWeightsV2FB* expressionWeights);
|
||||
|
||||
#elif XR_FB_face_tracking_EXPERIMENTAL_VERSION == 1
|
||||
|
||||
#define XrFaceTrackerCreateInfoFB XrFaceTrackerCreateInfoV1FB
|
||||
#define XrFaceExpressionWeightsFB XrFaceExpressionWeightsV1FB
|
||||
#undef XR_TYPE_FACE_TRACKER_CREATE_INFO_FB
|
||||
#undef XR_TYPE_FACE_EXPRESSION_WEIGHTS_FB
|
||||
#define XR_TYPE_FACE_TRACKER_CREATE_INFO_FB XR_TYPE_FACE_TRACKER_CREATE_INFO_V1_FB
|
||||
#define XR_TYPE_FACE_EXPRESSION_WEIGHTS_FB XR_TYPE_FACE_EXPRESSION_WEIGHTS_V1_FB
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrCreateFaceTrackerFB)(
|
||||
XrSession session,
|
||||
const XrFaceTrackerCreateInfoV1FB* createInfo,
|
||||
XrFaceTrackerFB* faceTracker);
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrDestroyFaceTrackerFB)(XrFaceTrackerFB faceTracker);
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetFaceExpressionWeightsFB)(
|
||||
XrFaceTrackerFB faceTracker,
|
||||
const XrFaceExpressionInfoFB* expressionInfo,
|
||||
XrFaceExpressionWeightsV1FB* expressionWeights);
|
||||
|
||||
#endif // versions
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateFaceTrackerV2FB(
|
||||
XrSession session,
|
||||
const XrFaceTrackerCreateInfoV2FB* createInfo,
|
||||
XrFaceTrackerFB* faceTracker);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateFaceTrackerV1FB(
|
||||
XrSession session,
|
||||
const XrFaceTrackerCreateInfoV1FB* createInfo,
|
||||
XrFaceTrackerFB* faceTracker);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrDestroyFaceTrackerFB(XrFaceTrackerFB faceTracker);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetFaceExpressionWeightsV2FB(
|
||||
XrFaceTrackerFB faceTracker,
|
||||
const XrFaceExpressionInfoFB* expressionInfo,
|
||||
XrFaceExpressionWeightsV2FB* expressionWeights);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetFaceExpressionWeightsV1FB(
|
||||
XrFaceTrackerFB faceTracker,
|
||||
const XrFaceExpressionInfoFB* expressionInfo,
|
||||
XrFaceExpressionWeightsV1FB* expressionWeights);
|
||||
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
|
||||
#endif // XR_FB_face_tracking
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
Filename : fb_haptic_amplitude_envelope.h
|
||||
Content : Haptic Amplitude Envelope extension.
|
||||
Language : C99
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
|
||||
/*
|
||||
174 XR_FB_haptic_amplitude_envelope
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_haptic_amplitude_envelope
|
||||
#define XR_FB_haptic_amplitude_envelope 1
|
||||
|
||||
#define XR_FBX1_haptic_amplitude_envelope_SPEC_VERSION 1
|
||||
#define XR_FBX1_HAPTIC_AMPLITUDE_ENVELOPE_EXTENSION_NAME "XR_FBX1_haptic_amplitude_envelope"
|
||||
|
||||
#ifndef XR_FB_haptic_amplitude_envelope_EXPERIMENTAL_VERSION
|
||||
#define XR_FB_haptic_amplitude_envelope_SPEC_VERSION 1
|
||||
#define XR_FB_HAPTIC_AMPLITUDE_ENVELOPE_EXTENSION_NAME "XR_FB_haptic_amplitude_envelope"
|
||||
#elif XR_FB_haptic_amplitude_envelope_EXPERIMENTAL_VERSION == 1
|
||||
#define XR_FB_haptic_amplitude_envelope_SPEC_VERSION XR_FBX1_haptic_amplitude_envelope_SPEC_VERSION
|
||||
#define XR_FB_HAPTIC_AMPLITUDE_ENVELOPE_EXTENSION_NAME \
|
||||
XR_FBX1_HAPTIC_AMPLITUDE_ENVELOPE_EXTENSION_NAME
|
||||
#else
|
||||
#error \
|
||||
"unknown experimental version number for XR_FB_haptic_amplitude_envelope_EXPERIMENTAL_VERSION"
|
||||
#endif // XR_FB_haptic_amplitude_envelope_EXPERIMENTAL_VERSION
|
||||
|
||||
#define XR_MAX_HAPTIC_AMPLITUDE_ENVELOPE_SAMPLES_FB 4000u
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_HAPTIC_AMPLITUDE_ENVELOPE_VIBRATION_FB, 1000173001);
|
||||
/// If triggered on localized haptics (trigger/thumb), this will throw an
|
||||
/// XR_ERROR_FEATURE_UNSUPPORTED
|
||||
typedef struct XrHapticAmplitudeEnvelopeVibrationFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
/// time for which the effect will be played
|
||||
XrDuration duration;
|
||||
/// number of elements in the array
|
||||
uint32_t amplitudeCount;
|
||||
/// array representing the amplitude envelope
|
||||
const float* amplitudes;
|
||||
} XrHapticAmplitudeEnvelopeVibrationFB;
|
||||
|
||||
#endif // XR_FB_haptic_amplitude_envelope
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
Filename : fb_haptic_pcm.h
|
||||
Content : Haptic PCM extension.
|
||||
Language : C99
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr.h>
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
|
||||
/*
|
||||
210 XR_FB_haptic_pcm
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_haptic_pcm
|
||||
#define XR_FB_haptic_pcm 1
|
||||
|
||||
#define XR_FBX1_haptic_pcm_SPEC_VERSION 1
|
||||
#define XR_FBX1_HAPTIC_PCM_EXTENSION_NAME "XR_FBX1_haptic_pcm"
|
||||
|
||||
#ifndef XR_FB_haptic_pcm_EXPERIMENTAL_VERSION
|
||||
#define XR_FB_haptic_pcm_SPEC_VERSION 1
|
||||
#define XR_FB_HAPTIC_PCM_EXTENSION_NAME "XR_FB_haptic_pcm"
|
||||
#elif XR_FB_haptic_pcm_EXPERIMENTAL_VERSION == 1
|
||||
#define XR_FB_haptic_pcm_SPEC_VERSION XR_FBX1_haptic_pcm_SPEC_VERSION
|
||||
#define XR_FB_HAPTIC_PCM_EXTENSION_NAME XR_FBX1_HAPTIC_PCM_EXTENSION_NAME
|
||||
#else
|
||||
#error "unknown experimental version for XR_FB_haptic_pcm"
|
||||
#endif // XR_FB_haptic_pcm_EXPERIMENTAL_VERSION
|
||||
|
||||
/// We have fixed the internal buffer size. The developer may check the bufferCountOutout field of
|
||||
/// the XrHapticPcmVibrationFB struct to know how many samples were processed.
|
||||
#define XR_MAX_HAPTIC_PCM_BUFFER_SIZE_FB 4000
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_DEVICE_PCM_SAMPLE_RATE_GET_INFO_FB, 1000209002);
|
||||
/// Provided to xrGetDevicePCMSampleRateFB to retrieve the PCM sample rate
|
||||
/// of the last connected controller
|
||||
typedef struct XrDevicePcmSampleRateGetInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
/// value will be populated with a PCM haptic sample rate in Hz
|
||||
float sampleRate;
|
||||
} XrDevicePcmSampleRateGetInfoFB;
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_HAPTIC_PCM_VIBRATION_FB, 1000209001);
|
||||
/// This struct provides a high fidelity control over the haptics effect
|
||||
/// If triggered on localized haptics (trigger/thumb), this will throw an
|
||||
/// XR_ERROR_FEATURE_UNSUPPORTED
|
||||
typedef struct XrHapticPcmVibrationFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
/// number of samples
|
||||
uint32_t bufferSize;
|
||||
/// the samples that the developer provides, expectation is that these samples are points on a
|
||||
/// sine curve
|
||||
const float* buffer;
|
||||
/// number of samples to be playes per second, this is used to determine the duration of the
|
||||
/// effect
|
||||
float sampleRate;
|
||||
/// if set to false, any existing samples will be cleared and a new haptic effect will begin, if
|
||||
/// true, samples will be appended to the currently playing effect
|
||||
XrBool32 append;
|
||||
/// pointer to an unsigned integer, which contains the number of samples that were consumed from
|
||||
/// the input
|
||||
uint32_t* samplesConsumed;
|
||||
} XrHapticPcmVibrationFB;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetDeviceSampleRateFB)(
|
||||
XrSession session,
|
||||
const XrHapticActionInfo* hapticActionInfo,
|
||||
XrDevicePcmSampleRateGetInfoFB* deviceSampleRate);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
/// Get the PCM haptics sample rate of the last connected controller
|
||||
/// If the controller is not supported by the PCM haptics APIs,
|
||||
/// deviceSampleRate->sampleRate will be set to 0.0f.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetDeviceSampleRateFB(
|
||||
XrSession session,
|
||||
const XrHapticActionInfo* hapticActionInfo,
|
||||
XrDevicePcmSampleRateGetInfoFB* deviceSampleRate);
|
||||
|
||||
#endif // XR_EXTENSION_PROTOTYPES
|
||||
#endif // !XR_NO_PROTOTYPES
|
||||
|
||||
#ifdef XR_FB_haptic_pcm_EXPERIMENTAL_VERSION
|
||||
|
||||
#if XR_FB_haptic_pcm_EXPERIMENTAL_VERSION >= 1
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_HAPTIC_PCM_VIBRATION_FBX1, 1000209001);
|
||||
/// This struct provides a high fidelity control over the haptics effect
|
||||
/// If triggered on localized haptics (trigger/thumb), this will throw an
|
||||
/// XR_ERROR_FEATURE_UNSUPPORTED
|
||||
typedef struct XrHapticPcmVibrationFBX1 {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
/// the samples that the developer provides, expectation is that these samples are points on a
|
||||
/// sine curve
|
||||
const float* buffer;
|
||||
/// number of samples
|
||||
uint32_t bufferSize;
|
||||
/// number of samples to be playes per second, this is used to determine the duration of the
|
||||
/// effect
|
||||
float sampleRate;
|
||||
/// if set to true, any existing samples will be cleared and a new haptic effect will begin, if
|
||||
/// false, samples will be appended to the currently playing effect
|
||||
XrBool32 clear;
|
||||
/// pointer to an unsigned integer, which contains the number of samples that were consumed from
|
||||
/// the input
|
||||
uint32_t* bufferCountOutput;
|
||||
} XrHapticPcmVibrationFBX1;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetDevicePCMSampleRateFBX1)(
|
||||
XrSession session,
|
||||
XrDevicePcmSampleRateGetInfoFB* deviceSampleRate);
|
||||
|
||||
#endif // XR_FB_haptic_pcm_EXPERIMENTAL_VERSION >= 1
|
||||
|
||||
#if XR_FB_haptic_pcm_EXPERIMENTAL_VERSION == 1
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrGetDevicePCMSampleRateFB(XrSession session, XrDevicePcmSampleRateGetInfoFB* deviceSampleRate);
|
||||
|
||||
#endif // XR_EXTENSION_PROTOTYPES
|
||||
#endif // !XR_NO_PROTOTYPES
|
||||
|
||||
#define PFN_xrGetDevicePCMSampleRateFB PFN_xrGetDevicePCMSampleRateFBX1
|
||||
|
||||
#endif // XR_FB_haptic_pcm_EXPERIMENTAL_VERSION == 1
|
||||
|
||||
#endif // XR_FB_haptic_pcm_EXPERIMENTAL_VERSION
|
||||
|
||||
#endif // XR_FB_haptic_pcm
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+194
@@ -0,0 +1,194 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Filename : fb_scene.h
|
||||
Content : This header defines spatial entity components and functions used to obtain
|
||||
information from Scene Model.
|
||||
Language : C99
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/fb_spatial_entity.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Extension 176
|
||||
|
||||
#ifndef XR_FB_scene
|
||||
#define XR_FB_scene 1
|
||||
|
||||
|
||||
#ifndef XR_FB_scene_EXPERIMENTAL_VERSION
|
||||
#define XR_FB_scene_SPEC_VERSION 1
|
||||
#define XR_FB_SCENE_EXTENSION_NAME "XR_FB_scene"
|
||||
#else
|
||||
#error "unknown experimental version number for XR_FB_scene_EXPERIMENTAL_VERSION"
|
||||
#endif
|
||||
|
||||
static const XrSpaceComponentTypeFB XR_SPACE_COMPONENT_TYPE_BOUNDED_2D_FB =
|
||||
(XrSpaceComponentTypeFB)3;
|
||||
static const XrSpaceComponentTypeFB XR_SPACE_COMPONENT_TYPE_BOUNDED_3D_FB =
|
||||
(XrSpaceComponentTypeFB)4;
|
||||
static const XrSpaceComponentTypeFB XR_SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB =
|
||||
(XrSpaceComponentTypeFB)5;
|
||||
static const XrSpaceComponentTypeFB XR_SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB =
|
||||
(XrSpaceComponentTypeFB)6;
|
||||
|
||||
// Helper structs to define a 3D bounding box, similar to the 2D counterparts.
|
||||
typedef struct XrExtent3DfFB {
|
||||
float width;
|
||||
float height;
|
||||
float depth;
|
||||
} XrExtent3DfFB;
|
||||
|
||||
typedef struct XrOffset3DfFB {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
} XrOffset3DfFB;
|
||||
|
||||
typedef struct XrRect3DfFB {
|
||||
XrOffset3DfFB offset;
|
||||
XrExtent3DfFB extent;
|
||||
} XrRect3DfFB;
|
||||
|
||||
// Semantic labels component for two-call idiom with xrGetSpaceSemanticLabelsFB.
|
||||
static const XrStructureType XR_TYPE_SEMANTIC_LABELS_FB = (XrStructureType)1000175000;
|
||||
typedef struct XrSemanticLabelsFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
|
||||
// Input, capacity of the label buffer in byte.
|
||||
uint32_t bufferCapacityInput;
|
||||
|
||||
// Output, size of the label buffer in byte.
|
||||
uint32_t bufferCountOutput;
|
||||
|
||||
// Multiple labels represented by raw string, separated by comma (,).
|
||||
char* buffer;
|
||||
} XrSemanticLabelsFB;
|
||||
|
||||
// Room layout component for two-call idiom with xrGetSpaceRoomLayoutFB.
|
||||
static const XrStructureType XR_TYPE_ROOM_LAYOUT_FB = (XrStructureType)1000175001;
|
||||
typedef struct XrRoomLayoutFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
|
||||
// Floor of the room layout.
|
||||
XrUuidEXT floorUuid;
|
||||
|
||||
// Ceiling of the room layout.
|
||||
XrUuidEXT ceilingUuid;
|
||||
|
||||
// Input, capacity of wall list buffer.
|
||||
uint32_t wallUuidCapacityInput;
|
||||
|
||||
// Output, number of walls included in the list.
|
||||
uint32_t wallUuidCountOutput;
|
||||
|
||||
// Ordered list of walls of the room layout.
|
||||
XrUuidEXT* wallUuids;
|
||||
} XrRoomLayoutFB;
|
||||
|
||||
// 2D boundary for two-call idiom with xrGetSpaceBoundary2DFB.
|
||||
static const XrStructureType XR_TYPE_BOUNDARY_2D_FB = (XrStructureType)1000175002;
|
||||
typedef struct XrBoundary2DFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
|
||||
// Input, capacity of the vertex buffer.
|
||||
uint32_t vertexCapacityInput;
|
||||
|
||||
// Output, size of the vertex buffer.
|
||||
uint32_t vertexCountOutput;
|
||||
|
||||
// Vertices of the polygonal boundary in the coordinate frame of the associated space.
|
||||
// Currently only support outer bounds.
|
||||
XrVector2f* vertices;
|
||||
} XrBoundary2DFB;
|
||||
|
||||
// Get 2D bounding box associated with space that has bounded 2D component enabled.
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceBoundingBox2DFB)(
|
||||
XrSession session,
|
||||
XrSpace space,
|
||||
XrRect2Df* boundingBox2DOutput);
|
||||
|
||||
// Get 3D bounding box associated with space that has bounded 3D component enabled.
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceBoundingBox3DFB)(
|
||||
XrSession session,
|
||||
XrSpace space,
|
||||
XrRect3DfFB* boundingBox3DOutput);
|
||||
|
||||
// Get semantic labels associated with space that has semantic labels component enabled.
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceSemanticLabelsFB)(
|
||||
XrSession session,
|
||||
XrSpace space,
|
||||
XrSemanticLabelsFB* semanticLabelsOutput);
|
||||
|
||||
// Get 2D boundary associated with space that has bounded 2D component enabled.
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceBoundary2DFB)(
|
||||
XrSession session,
|
||||
XrSpace space,
|
||||
XrBoundary2DFB* boundary2DOutput);
|
||||
|
||||
// Get room layout associated with space that has room layout component enabled.
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceRoomLayoutFB)(
|
||||
XrSession session,
|
||||
XrSpace space,
|
||||
XrRoomLayoutFB* roomLayoutOutput);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
// Get 2D bounding box associated with space that has bounded 2D component enabled.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrGetSpaceBoundingBox2DFB(XrSession session, XrSpace space, XrRect2Df* boundingBox2DOutput);
|
||||
|
||||
// Get 3D bounding box associated with space that has bounded 3D component enabled.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrGetSpaceBoundingBox3DFB(XrSession session, XrSpace space, XrRect3DfFB* boundingBox3DOutput);
|
||||
|
||||
// Get semantic labels associated with space that has semantic labels component enabled.
|
||||
// Note: This functions uses two-call idiom:
|
||||
// 1) When byteCapacityInput == 0, only byteCountOutput will be updated and no semantic label string
|
||||
// will be copied;
|
||||
// 2) When byteCapacityInput >= byteCountOutput, semantic labels will be copied to labels as a
|
||||
// string;
|
||||
// 3) Otherwise returns XR_ERROR_SIZE_INSUFFICIENT.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetSpaceSemanticLabelsFB(
|
||||
XrSession session,
|
||||
XrSpace space,
|
||||
XrSemanticLabelsFB* semanticLabelsOutput);
|
||||
|
||||
// Get 2D boundary associated with space that has bounded 2D component enabled.
|
||||
// Note: This functions uses two-call idiom:
|
||||
// 1) When vertexCapacityInput == 0, only vertexCountOutput will be updated and no vertices will
|
||||
// be copied;
|
||||
// 2) When vertexCapacityInput >= vertexCountOutput, vertices will be copied to boundary2DOutput;
|
||||
// 3) Otherwise returns XR_ERROR_SIZE_INSUFFICIENT.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrGetSpaceBoundary2DFB(XrSession session, XrSpace space, XrBoundary2DFB* boundary2DOutput);
|
||||
|
||||
// Get room layout associated with space that has room layout component enabled.
|
||||
// Note: This functions uses two-call idiom:
|
||||
// 1) When wallUuidCapacityInput == 0, only wallUuidCountOutput will be updated and no UUIDs will
|
||||
// be copied;
|
||||
// 2) When wallUuidCapacityInput >= wallUuidCountOutput, UUIDs will be copied to
|
||||
// entityContainerOutput;
|
||||
// 3) Otherwise returns XR_ERROR_SIZE_INSUFFICIENT.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrGetSpaceRoomLayoutFB(XrSession session, XrSpace space, XrRoomLayoutFB* roomLayoutOutput);
|
||||
|
||||
#endif // XR_EXTENSION_PROTOTYPES
|
||||
#endif // !XR_NO_PROTOTYPES
|
||||
#endif // XR_FB_scene
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Filename : fb_scene_capture.h
|
||||
Content : Scene Capture functionality.
|
||||
Language : C99
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/fb_spatial_entity.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Extension 199
|
||||
|
||||
#ifndef XR_FB_scene_capture
|
||||
#define XR_FB_scene_capture 1
|
||||
|
||||
|
||||
#ifndef XR_FB_scene_capture_EXPERIMENTAL_VERSION
|
||||
#define XR_FB_scene_capture_SPEC_VERSION 1
|
||||
#define XR_FB_SCENE_CAPTURE_EXTENSION_NAME "XR_FB_scene_capture"
|
||||
#else
|
||||
#error "unknown experimental version number for XR_FB_scene_capture_EXPERIMENTAL_VERSION"
|
||||
#endif
|
||||
|
||||
// Events.
|
||||
static const XrStructureType XR_TYPE_EVENT_DATA_SCENE_CAPTURE_COMPLETE_FB =
|
||||
(XrStructureType)1000198001;
|
||||
|
||||
// Struct of scene capture complete event
|
||||
// The event struct contains the result of the scene capture operation
|
||||
typedef struct XrEventDataSceneCaptureCompleteFB {
|
||||
XrStructureType type; // XR_TYPE_EVENT_DATA_SCENE_CAPTURE_COMPLETE_FB
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrAsyncRequestIdFB requestId;
|
||||
XrResult result;
|
||||
} XrEventDataSceneCaptureCompleteFB;
|
||||
|
||||
// Struct for requesting scene capture.
|
||||
static const XrStructureType XR_TYPE_SCENE_CAPTURE_REQUEST_INFO_FB = (XrStructureType)1000198050;
|
||||
typedef struct XrSceneCaptureRequestInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
|
||||
// Length of request buffer.
|
||||
uint32_t requestByteCount;
|
||||
|
||||
// Request buffer.
|
||||
const char* request;
|
||||
} XrSceneCaptureRequestInfoFB;
|
||||
|
||||
// Request scene capture to the system.
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrRequestSceneCaptureFB)(
|
||||
XrSession session,
|
||||
const XrSceneCaptureRequestInfoFB* request,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
// Request scene capture to the system.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrRequestSceneCaptureFB(
|
||||
XrSession session,
|
||||
const XrSceneCaptureRequestInfoFB* request,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
#endif // XR_EXTENSION_PROTOTYPES
|
||||
#endif // !XR_NO_PROTOTYPES
|
||||
|
||||
|
||||
#endif // XR_FB_scene_capture
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+375
@@ -0,0 +1,375 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Filename : fb_spatial_entity.h
|
||||
Content : spatial entity interface.
|
||||
Language : C99
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
114 XR_FB_spatial_entity
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_spatial_entity
|
||||
#define XR_FB_spatial_entity 1
|
||||
|
||||
#define XR_FBX2_spatial_entity_SPEC_VERSION 2
|
||||
#define XR_FBX2_SPATIAL_ENTITY_EXTENSION_NAME "XR_FBX2_spatial_entity"
|
||||
|
||||
#ifndef XR_FB_spatial_entity_EXPERIMENTAL_VERSION
|
||||
#define XR_FB_spatial_entity_SPEC_VERSION 1
|
||||
#define XR_FB_SPATIAL_ENTITY_EXTENSION_NAME "XR_FB_spatial_entity"
|
||||
#elif XR_FB_spatial_entity_EXPERIMENTAL_VERSION == 2
|
||||
#define XR_FB_spatial_entity_SPEC_VERSION XR_FBX2_spatial_entity_SPEC_VERSION
|
||||
#define XR_FB_SPATIAL_ENTITY_EXTENSION_NAME XR_FBX2_SPATIAL_ENTITY_EXTENSION_NAME
|
||||
#else
|
||||
#error "unknown experimental version for XR_FB_spatial_entity"
|
||||
#endif
|
||||
|
||||
// Potentially long running requests return an async request identifier
|
||||
// which will be part of messages returned via events. The nature of
|
||||
// the response event or events depends on the request, but the async
|
||||
// request identifier, returned immediately at request time, is used
|
||||
// to associate responses with requests.
|
||||
typedef uint64_t XrAsyncRequestIdFB;
|
||||
|
||||
static const XrResult XR_ERROR_SPACE_COMPONENT_NOT_SUPPORTED_FB = (XrResult)-1000113000;
|
||||
static const XrResult XR_ERROR_SPACE_COMPONENT_NOT_ENABLED_FB = (XrResult)-1000113001;
|
||||
static const XrResult XR_ERROR_SPACE_COMPONENT_STATUS_PENDING_FB = (XrResult)-1000113002;
|
||||
static const XrResult XR_ERROR_SPACE_COMPONENT_STATUS_ALREADY_SET_FB = (XrResult)-1000113003;
|
||||
|
||||
// Every XrSpace object represents a spatial entity that may support an
|
||||
// arbitrary number of component interfaces. If the component interface
|
||||
// is advertised as supported, and the support is enabled, then functions
|
||||
// associated with that interface may be used with that XrSpace.
|
||||
//
|
||||
// Whether a component interface is enabled at creation depends on the
|
||||
// method of creation.
|
||||
//
|
||||
// The XR_SPACE_COMPONENT_TYPE_LOCATABLE_FB interface must be enabled to use
|
||||
// xrLocateSpace() on any space created through the Spatial Entity system
|
||||
// introduced with this extension.
|
||||
//
|
||||
// When functions use a space in a context where one or more necessary
|
||||
// components are not enabled for the space,
|
||||
// XR_ERROR_SPACE_COMPONENT_NOT_ENABLED_FB must be returned.
|
||||
//
|
||||
typedef enum XrSpaceComponentTypeFB {
|
||||
// Works with xrLocateSpace, etc.
|
||||
XR_SPACE_COMPONENT_TYPE_LOCATABLE_FB = 0,
|
||||
// enables save, load, erase, etc.
|
||||
XR_SPACE_COMPONENT_TYPE_STORABLE_FB = 1,
|
||||
// Bounded 2D component, used in fb_scene extension.
|
||||
// XR_SPACE_COMPONENT_TYPE_BOUNDED_2D_FB = 3,
|
||||
// Bounded 3D component, used in fb_scene extension.
|
||||
// XR_SPACE_COMPONENT_TYPE_BOUNDED_3D_FB = 4,
|
||||
// Semantic labels component, used in fb_scene extension.
|
||||
// XR_SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB = 5,
|
||||
// Room layout component, used in fb_scene extension.
|
||||
// XR_SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB = 6,
|
||||
// Space container component, used in fb_spatial_entity_container extension.
|
||||
// XR_SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB = 7,
|
||||
XR_SPACE_COMPONENT_TYPE_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrSpaceComponentTypeFB;
|
||||
|
||||
// Spatial Entity system properties
|
||||
static const XrStructureType XR_TYPE_SYSTEM_SPATIAL_ENTITY_PROPERTIES_FB =
|
||||
(XrStructureType)1000113004;
|
||||
typedef struct XrSystemSpatialEntityPropertiesFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrBool32 supportsSpatialEntity;
|
||||
} XrSystemSpatialEntityPropertiesFB;
|
||||
|
||||
// Create info struct used when creating a spatial anchor
|
||||
static const XrStructureType XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_FB = (XrStructureType)1000113003;
|
||||
typedef struct XrSpatialAnchorCreateInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpace space;
|
||||
XrPosef poseInSpace;
|
||||
XrTime time;
|
||||
} XrSpatialAnchorCreateInfoFB;
|
||||
|
||||
// Struct used to enable a component
|
||||
static const XrStructureType XR_TYPE_SPACE_COMPONENT_STATUS_SET_INFO_FB =
|
||||
(XrStructureType)1000113007;
|
||||
typedef struct XrSpaceComponentStatusSetInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpaceComponentTypeFB componentType;
|
||||
XrBool32 enabled;
|
||||
XrDuration timeout;
|
||||
} XrSpaceComponentStatusSetInfoFB;
|
||||
|
||||
// Struct to hold component status
|
||||
//
|
||||
// Next chain provided here for future component interfaces that
|
||||
// may have more detailed status to provide.
|
||||
//
|
||||
// The changePending flag is set immediately upon requesting a
|
||||
// component enabled change, but the change in the enabled state
|
||||
// is not reflected in the status until the async request
|
||||
// completes successfully.
|
||||
static const XrStructureType XR_TYPE_SPACE_COMPONENT_STATUS_FB = (XrStructureType)1000113001;
|
||||
typedef struct XrSpaceComponentStatusFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrBool32 enabled;
|
||||
XrBool32 changePending;
|
||||
} XrSpaceComponentStatusFB;
|
||||
|
||||
// Event returned once a Spatial Anchor has successfully been created
|
||||
static const XrStructureType XR_TYPE_EVENT_DATA_SPATIAL_ANCHOR_CREATE_COMPLETE_FB =
|
||||
(XrStructureType)1000113005;
|
||||
typedef struct XrEventDataSpatialAnchorCreateCompleteFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrAsyncRequestIdFB requestId;
|
||||
XrResult result;
|
||||
XrSpace space;
|
||||
XrUuidEXT uuid;
|
||||
} XrEventDataSpatialAnchorCreateCompleteFB;
|
||||
|
||||
// The xrSetSpaceComponentStatusFB request delivers the result of the
|
||||
// request via event. If the request was not successful, the
|
||||
// component status will be unaltered except that the changePending status
|
||||
// is cleared.
|
||||
static const XrStructureType XR_TYPE_EVENT_DATA_SPACE_SET_STATUS_COMPLETE_FB =
|
||||
(XrStructureType)1000113006;
|
||||
typedef struct XrEventDataSpaceSetStatusCompleteFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrAsyncRequestIdFB requestId;
|
||||
XrResult result;
|
||||
XrSpace space;
|
||||
XrUuidEXT uuid;
|
||||
XrSpaceComponentTypeFB componentType;
|
||||
XrBool32 enabled;
|
||||
} XrEventDataSpaceSetStatusCompleteFB;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrCreateSpatialAnchorFB)(
|
||||
XrSession session,
|
||||
const XrSpatialAnchorCreateInfoFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceUuidFB)(XrSpace space, XrUuidEXT* uuid);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrEnumerateSpaceSupportedComponentsFB)(
|
||||
XrSpace space,
|
||||
uint32_t componentTypeCapacityInput,
|
||||
uint32_t* componentTypeCountOutput,
|
||||
XrSpaceComponentTypeFB* componentTypes);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrSetSpaceComponentStatusFB)(
|
||||
XrSpace space,
|
||||
const XrSpaceComponentStatusSetInfoFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceComponentStatusFB)(
|
||||
XrSpace space,
|
||||
XrSpaceComponentTypeFB componentType,
|
||||
XrSpaceComponentStatusFB* status);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
// xrCreateSpatialAnchorFB is used to create a new spatial anchor space
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorFB(
|
||||
XrSession session,
|
||||
const XrSpatialAnchorCreateInfoFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
// xrGetSpaceUuidFB is used to access the uuid for an XrSpace if supported
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetSpaceUuidFB(XrSpace space, XrUuidEXT* uuid);
|
||||
|
||||
// All the component interfaces that an entity supports can be discovered
|
||||
// through the xrEnumerateSpaceSupportedComponentsFB() function. The list of
|
||||
// supported components will not change over the life of the entity.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateSpaceSupportedComponentsFB(
|
||||
XrSpace space,
|
||||
uint32_t componentTypeCapacityInput,
|
||||
uint32_t* componentTypeCountOutput,
|
||||
XrSpaceComponentTypeFB* componentTypes);
|
||||
|
||||
// xrSetSpaceComponentStatusFB() enables or disables any supported component
|
||||
// interface for a space. Some component interfaces may take time to become
|
||||
// ready. Rather than block, xrSetSpaceComponentStatusFB() returns an async
|
||||
// request identifier, and its result is returned via event.
|
||||
//
|
||||
// XR_ERROR_SPACE_SET_COMPONENT_STATUS_PENDING is returned if xrSetSpaceComponentStatusFB()
|
||||
// is called on a space that has an xrSetSpaceComponentStatusFB() call pending already.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrSetSpaceComponentStatusFB(
|
||||
XrSpace space,
|
||||
const XrSpaceComponentStatusSetInfoFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
// xrGetSpaceComponentStatusFB is used to determine whether a component interface is
|
||||
// currently enabled for a space.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetSpaceComponentStatusFB(
|
||||
XrSpace space,
|
||||
XrSpaceComponentTypeFB componentType,
|
||||
XrSpaceComponentStatusFB* status);
|
||||
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif // XR_FB_spatial_entity
|
||||
|
||||
// =============================================================================
|
||||
// Begin Backwards Compatibility (DEPRECATED)
|
||||
// =============================================================================
|
||||
|
||||
// Separate include guard for experimental backwards compatibility,
|
||||
// to make sure this still gets included even when the extension
|
||||
// is included in openxr.h
|
||||
#ifndef XR_FBX_spatial_entity
|
||||
#define XR_FBX_spatial_entity 1
|
||||
|
||||
// Conditionally define experimental versions, since they are not getting defined
|
||||
// if the extension is included from openxr.h
|
||||
|
||||
#ifndef XR_FBX2_spatial_entity_SPEC_VERSION
|
||||
#define XR_FBX2_spatial_entity_SPEC_VERSION 2
|
||||
#define XR_FBX2_SPATIAL_ENTITY_EXTENSION_NAME "XR_FBX2_spatial_entity"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef XR_FB_spatial_entity_EXPERIMENTAL_VERSION
|
||||
|
||||
|
||||
#if XR_FB_spatial_entity_EXPERIMENTAL_VERSION >= 2
|
||||
|
||||
#define XR_UUID_SIZE_FBX2 2
|
||||
typedef struct XrSpatialEntityUuidFBX2 {
|
||||
uint64_t value[XR_UUID_SIZE_FBX2];
|
||||
} XrSpatialEntityUuidFBX2;
|
||||
|
||||
static const XrStructureType XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_FBX2 = (XrStructureType)1000011303;
|
||||
|
||||
static const XrStructureType XR_TYPE_COMPONENT_ENABLE_REQUEST_FBX2 = (XrStructureType)1000113000;
|
||||
typedef struct XrComponentEnableRequestFBX2 {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpaceComponentTypeFB componentType;
|
||||
XrBool32 enable;
|
||||
XrDuration timeout;
|
||||
} XrComponentEnableRequestFBX2;
|
||||
|
||||
static const XrStructureType XR_TYPE_EVENT_DATA_SET_COMPONENT_ENABLE_RESULT_FBX2 =
|
||||
(XrStructureType)1000113002;
|
||||
typedef struct XrEventDataSetComponentEnableResultFBX2 {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrAsyncRequestIdFB requestId;
|
||||
XrResult result;
|
||||
XrSpaceComponentTypeFB componentType;
|
||||
XrSpace space;
|
||||
} XrEventDataSetComponentEnableResultFBX2;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrCreateSpatialAnchorFBX2)(
|
||||
XrSession session,
|
||||
const XrSpatialAnchorCreateInfoFB* info,
|
||||
XrSpace* space);
|
||||
|
||||
typedef XrResult(
|
||||
XRAPI_PTR* PFN_xrGetSpatialEntityUuidFBX2)(XrSpace space, XrSpatialEntityUuidFBX2* uuid);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrEnumerateSupportedComponentsFBX2)(
|
||||
XrSpace space,
|
||||
uint32_t componentTypeCapacityInput,
|
||||
uint32_t* componentTypeCountOutput,
|
||||
XrSpaceComponentTypeFB* componentTypes);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrSetComponentEnabledFBX2)(
|
||||
XrSpace space,
|
||||
const XrComponentEnableRequestFBX2* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetComponentStatusFBX2)(
|
||||
XrSpace space,
|
||||
XrSpaceComponentTypeFB componentType,
|
||||
XrSpaceComponentStatusFB* status);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrGetSpatialEntityUuidFB(XrSpace space, XrSpatialEntityUuidFBX2* uuid);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateSupportedComponentsFB(
|
||||
XrSpace space,
|
||||
uint32_t componentTypeCapacityInput,
|
||||
uint32_t* componentTypeCountOutput,
|
||||
XrSpaceComponentTypeFB* componentTypes);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrSetComponentEnabledFB(
|
||||
XrSpace space,
|
||||
const XrComponentEnableRequestFBX2* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetComponentStatusFB(
|
||||
XrSpace space,
|
||||
XrSpaceComponentTypeFB componentType,
|
||||
XrSpaceComponentStatusFB* status);
|
||||
|
||||
#endif // XR_EXTENSION_PROTOTYPES
|
||||
#endif // !XR_NO_PROTOTYPES
|
||||
|
||||
#endif // XR_FB_spatial_entity_EXPERIMENTAL_VERSION >= 2
|
||||
|
||||
#if XR_FB_spatial_entity_EXPERIMENTAL_VERSION == 2
|
||||
|
||||
#define XR_ERROR_COMPONENT_NOT_SUPPORTED_FB XR_ERROR_SPACE_COMPONENT_NOT_SUPPORTED_FB
|
||||
#define XR_ERROR_COMPONENT_NOT_ENABLED_FB XR_ERROR_SPACE_COMPONENT_NOT_ENABLED_FB
|
||||
#define XR_ERROR_SET_COMPONENT_ENABLE_PENDING_FB XR_ERROR_SPACE_COMPONENT_STATUS_PENDING_FB
|
||||
#define XR_ERROR_SET_COMPONENT_ENABLE_ALREADY_ENABLED_FB \
|
||||
XR_ERROR_SPACE_COMPONENT_STATUS_ALREADY_SET_FB
|
||||
|
||||
#define XrComponentTypeFB XrSpaceComponentTypeFB
|
||||
#define XR_COMPONENT_TYPE_LOCATABLE_FB XR_SPACE_COMPONENT_TYPE_LOCATABLE_FB
|
||||
#define XR_COMPONENT_TYPE_STORABLE_FB XR_SPACE_COMPONENT_TYPE_STORABLE_FB
|
||||
#define XR_COMPONENT_TYPE_MAX_ENUM_FB XR_SPACE_COMPONENT_TYPE_MAX_ENUM_FB
|
||||
|
||||
#define XrComponentStatusFB XrSpaceComponentStatusFB
|
||||
#define XR_TYPE_COMPONENT_STATUS_FB XR_TYPE_SPACE_COMPONENT_STATUS_FB
|
||||
|
||||
#define XR_UUID_SIZE_FB XR_UUID_SIZE_FBX2
|
||||
#define XrSpatialEntityUuidFB XrSpatialEntityUuidFBX2
|
||||
|
||||
#define XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_FB XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_FBX2
|
||||
|
||||
#define XR_TYPE_COMPONENT_ENABLE_REQUEST_FB XR_TYPE_COMPONENT_ENABLE_REQUEST_FBX2
|
||||
#define XrComponentEnableRequestFB XrComponentEnableRequestFBX2
|
||||
|
||||
#define XR_TYPE_EVENT_DATA_SET_COMPONENT_ENABLE_RESULT_FB \
|
||||
XR_TYPE_EVENT_DATA_SET_COMPONENT_ENABLE_RESULT_FBX2
|
||||
#define XrEventDataSetComponentEnableResultFB XrEventDataSetComponentEnableResultFBX2
|
||||
|
||||
#define PFN_xrCreateSpatialAnchorFB PFN_xrCreateSpatialAnchorFBX2
|
||||
#define PFN_xrGetSpatialEntityUuidFB PFN_xrGetSpatialEntityUuidFBX2
|
||||
#define PFN_xrEnumerateSupportedComponentsFB PFN_xrEnumerateSupportedComponentsFBX2
|
||||
#define PFN_xrSetComponentEnabledFB PFN_xrSetComponentEnabledFBX2
|
||||
#define PFN_xrGetComponentStatusFB PFN_xrGetComponentStatusFBX2
|
||||
|
||||
#endif // XR_FB_spatial_entity_EXPERIMENTAL_VERSION == 2
|
||||
|
||||
|
||||
#endif // XR_FB_spatial_entity_EXPERIMENTAL_VERSION
|
||||
|
||||
// =============================================================================
|
||||
// End Backwards Compatibility (DEPRECATED)
|
||||
// =============================================================================
|
||||
|
||||
#endif // XR_FBX_spatial_entity
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Filename : fb_spatial_entity_container.h
|
||||
Content : Spatial entity container functionality.
|
||||
Language : C99
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/fb_spatial_entity.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Extension 200
|
||||
|
||||
#ifndef XR_FB_spatial_entity_container
|
||||
#define XR_FB_spatial_entity_container 1
|
||||
|
||||
|
||||
#ifndef XR_FB_spatial_entity_container_EXPERIMENTAL_VERSION
|
||||
#define XR_FB_spatial_entity_container_SPEC_VERSION 1
|
||||
#define XR_FB_SPATIAL_ENTITY_CONTAINER_EXTENSION_NAME "XR_FB_spatial_entity_container"
|
||||
#else
|
||||
#error "unknown experimental version number for XR_FB_spatial_entity_container_EXPERIMENTAL_VERSION"
|
||||
#endif
|
||||
|
||||
static const XrSpaceComponentTypeFB XR_SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB =
|
||||
(XrSpaceComponentTypeFB)7;
|
||||
|
||||
// Space container component.
|
||||
static const XrStructureType XR_TYPE_SPACE_CONTAINER_FB = (XrStructureType)1000199000;
|
||||
typedef struct XrSpaceContainerFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
|
||||
// Input, capacity of UUID list.
|
||||
uint32_t uuidCapacityInput;
|
||||
|
||||
// Output, number of spatial entities included in the list.
|
||||
uint32_t uuidCountOutput;
|
||||
|
||||
// List of spatial entities contained in the entity to which this component is attached.
|
||||
XrUuidEXT* uuids;
|
||||
} XrSpaceContainerFB;
|
||||
|
||||
// Get space container component.
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceContainerFB)(
|
||||
XrSession session,
|
||||
XrSpace space,
|
||||
XrSpaceContainerFB* spaceContainerOutput);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
// Get space container component.
|
||||
// Note: This functions uses two-call idiom:
|
||||
// 1) When uuidCapacityInput == 0, only uuidCountOutput will be updated and no UUIDs will be
|
||||
// copied;
|
||||
// 2) When uuidCapacityInput >= uuidCountOutput, UUIDs will be copied to
|
||||
// spaceContainerOutput;
|
||||
// 3) Otherwise returns XR_ERROR_SIZE_INSUFFICIENT.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrGetSpaceContainerFB(XrSession session, XrSpace space, XrSpaceContainerFB* spaceContainerOutput);
|
||||
|
||||
#endif // XR_EXTENSION_PROTOTYPES
|
||||
#endif // !XR_NO_PROTOTYPES
|
||||
#endif // XR_FB_spatial_entity_container
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+319
@@ -0,0 +1,319 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Filename : fb_spatial_entity_query.h
|
||||
Content : spatial entity interface.
|
||||
Language : C99
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/fb_spatial_entity.h>
|
||||
#include <openxr/fb_spatial_entity_storage.h>
|
||||
|
||||
/*
|
||||
157 XR_FB_spatial_entity_query
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_spatial_entity_query
|
||||
#define XR_FB_spatial_entity_query 1
|
||||
|
||||
#ifndef XR_FB_spatial_entity
|
||||
#error "This extension depends XR_FB_spatial_entity which has not been defined"
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_spatial_entity_storage
|
||||
#error "This extension depends XR_FB_spatial_entity_storage which has not been defined"
|
||||
#endif
|
||||
|
||||
#define XR_FBX2_spatial_entity_query_SPEC_VERSION 2
|
||||
#define XR_FBX2_SPATIAL_ENTITY_QUERY_EXTENSION_NAME "XR_FBX2_spatial_entity_query"
|
||||
|
||||
#ifndef XR_FB_spatial_entity_query_EXPERIMENTAL_VERSION
|
||||
#define XR_FB_spatial_entity_query_SPEC_VERSION 1
|
||||
#define XR_FB_SPATIAL_ENTITY_QUERY_EXTENSION_NAME "XR_FB_spatial_entity_query"
|
||||
#elif XR_FB_spatial_entity_query_EXPERIMENTAL_VERSION == 2
|
||||
#define XR_FB_spatial_entity_query_SPEC_VERSION XR_FBX2_spatial_entity_query_SPEC_VERSION
|
||||
#define XR_FB_SPATIAL_ENTITY_QUERY_EXTENSION_NAME XR_FBX2_SPATIAL_ENTITY_QUERY_EXTENSION_NAME
|
||||
#else
|
||||
#error "unknown experimental version for XR_FB_spatial_entity_query"
|
||||
#endif
|
||||
|
||||
// This extension allows an application to query the spaces that have been previously shared
|
||||
// or persisted onto the device
|
||||
//
|
||||
// The following types of Query actions can be performed:
|
||||
//
|
||||
// - XR_SPACE_QUERY_ACTION_LOAD_FB
|
||||
// Performs a simple query that returns a XR_TYPE_EVENT_DATA_SPACE_QUERY_RESULTS_AVAILABLE_FB
|
||||
// when results found during the query become available. There will also be a final
|
||||
// XR_TYPE_EVENT_DATA_SPACE_QUERY_COMPLETE_FB event that is returned when all XrSpaces
|
||||
// have been returned. This query type can be used when looking for a list of all
|
||||
// spaces that match the filter criteria specified. Using this query does an implicit load
|
||||
// on the spaces found by this query.
|
||||
//
|
||||
|
||||
// Type of query being performed.
|
||||
typedef enum XrSpaceQueryActionFB {
|
||||
// returns XrSpaces
|
||||
XR_SPACE_QUERY_ACTION_LOAD_FB = 0,
|
||||
XR_SPACE_QUERY_ACTION_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrSpaceQueryActionFB;
|
||||
|
||||
// Query base struct
|
||||
typedef struct XR_MAY_ALIAS XrSpaceQueryInfoBaseHeaderFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
} XrSpaceQueryInfoBaseHeaderFB;
|
||||
|
||||
// Query filter base struct
|
||||
typedef struct XR_MAY_ALIAS XrSpaceFilterInfoBaseHeaderFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
} XrSpaceFilterInfoBaseHeaderFB;
|
||||
|
||||
// Query result to be returned in the results array of XrEventSpatialEntityQueryResultsFBX2 or as
|
||||
// output from xrRetrieveSpaceQueryResultsFB(). No type or next pointer included to save
|
||||
// space in the results array.
|
||||
typedef struct XrSpaceQueryResultFB {
|
||||
XrSpace space;
|
||||
XrUuidEXT uuid;
|
||||
} XrSpaceQueryResultFB;
|
||||
|
||||
// May be used to query for spaces and perform a specific action on the spaces returned.
|
||||
// The available actions can be found in XrSpaceQueryActionFB.
|
||||
// The filter info provided to the filter member of the struct will be used as an inclusive
|
||||
// filter. All spaces that match this criteria will be included in the results returned.
|
||||
// The excludeFilter member of the struct is not supported at this time.
|
||||
static const XrStructureType XR_TYPE_SPACE_QUERY_INFO_FB = (XrStructureType)1000156001;
|
||||
typedef struct XrSpaceQueryInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpaceQueryActionFB queryAction;
|
||||
uint32_t maxResultCount;
|
||||
XrDuration timeout;
|
||||
const XrSpaceFilterInfoBaseHeaderFB* filter;
|
||||
const XrSpaceFilterInfoBaseHeaderFB* excludeFilter;
|
||||
} XrSpaceQueryInfoFB;
|
||||
|
||||
// Storage location info is used by the query filters and added to the next chain in order to
|
||||
// specify which location the query filter wishes to perform it query from
|
||||
static const XrStructureType XR_TYPE_SPACE_STORAGE_LOCATION_FILTER_INFO_FB =
|
||||
(XrStructureType)1000156003;
|
||||
typedef struct XrSpaceStorageLocationFilterInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpaceStorageLocationFB location;
|
||||
} XrSpaceStorageLocationFilterInfoFB;
|
||||
|
||||
// May be used to query the system to find all spaces that match the uuids provided
|
||||
// in the filter info
|
||||
static const XrStructureType XR_TYPE_SPACE_UUID_FILTER_INFO_FB = (XrStructureType)1000156054;
|
||||
typedef struct XrSpaceUuidFilterInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
uint32_t uuidCount;
|
||||
const XrUuidEXT* uuids;
|
||||
} XrSpaceUuidFilterInfoFB;
|
||||
|
||||
// May be used to query the system to find all spaces that have a particular component enabled
|
||||
static const XrStructureType XR_TYPE_SPACE_COMPONENT_FILTER_INFO_FB = (XrStructureType)1000156052;
|
||||
typedef struct XrSpaceComponentFilterInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpaceComponentTypeFB componentType;
|
||||
} XrSpaceComponentFilterInfoFB;
|
||||
|
||||
static const XrStructureType XR_TYPE_SPACE_QUERY_RESULTS_FB = (XrStructureType)1000156002;
|
||||
typedef struct XrSpaceQueryResultsFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
uint32_t resultCapacityInput;
|
||||
uint32_t resultCountOutput;
|
||||
XrSpaceQueryResultFB* results;
|
||||
} XrSpaceQueryResultsFB;
|
||||
|
||||
static const XrStructureType XR_TYPE_EVENT_DATA_SPACE_QUERY_RESULTS_AVAILABLE_FB =
|
||||
(XrStructureType)1000156103;
|
||||
typedef struct XrEventDataSpaceQueryResultsAvailableFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrAsyncRequestIdFB requestId;
|
||||
} XrEventDataSpaceQueryResultsAvailableFB;
|
||||
|
||||
// When a query has completely finished this event will be returned
|
||||
static const XrStructureType XR_TYPE_EVENT_DATA_SPACE_QUERY_COMPLETE_FB =
|
||||
(XrStructureType)1000156104;
|
||||
typedef struct XrEventDataSpaceQueryCompleteFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrAsyncRequestIdFB requestId;
|
||||
XrResult result;
|
||||
} XrEventDataSpaceQueryCompleteFB;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrQuerySpacesFB)(
|
||||
XrSession session,
|
||||
const XrSpaceQueryInfoBaseHeaderFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrRetrieveSpaceQueryResultsFB)(
|
||||
XrSession session,
|
||||
XrAsyncRequestIdFB requestId,
|
||||
XrSpaceQueryResultsFB* results);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrQuerySpacesFB(
|
||||
XrSession session,
|
||||
const XrSpaceQueryInfoBaseHeaderFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
// Call this function to get available results for a request. Results are available following a
|
||||
// XrEventDataSpaceQueryResultsAvailableFB from xrPollEvent() and will be purged from the
|
||||
// runtime once results have been copied into the application's buffer. The application should call
|
||||
// this function once to populate resultCount before allocating enough memory for a second call to
|
||||
// actually retrieve any available results.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrRetrieveSpaceQueryResultsFB(
|
||||
XrSession session,
|
||||
XrAsyncRequestIdFB requestId,
|
||||
XrSpaceQueryResultsFB* results);
|
||||
|
||||
#endif // XR_EXTENSION_PROTOTYPES
|
||||
#endif // !XR_NO_PROTOTYPES
|
||||
#endif // XR_FB_spatial_entity_query
|
||||
|
||||
// =============================================================================
|
||||
// Begin Backwards Compatibility (DEPRECATED)
|
||||
// =============================================================================
|
||||
// Separate include guard for experimental backwards compatibility,
|
||||
// to make sure this still gets included even when the extension
|
||||
// is included in openxr.h
|
||||
#ifndef XR_FBX_spatial_entity_query
|
||||
#define XR_FBX_spatial_entity_query 1
|
||||
|
||||
// Conditionally define experimental versions, since they are not getting defined
|
||||
// if the extension is included from openxr.h
|
||||
#ifndef XR_FBX2_spatial_entity_query_SPEC_VERSION
|
||||
#define XR_FBX2_spatial_entity_query_SPEC_VERSION 2
|
||||
#define XR_FBX2_SPATIAL_ENTITY_QUERY_EXTENSION_NAME "XR_FBX2_spatial_entity_query"
|
||||
#endif
|
||||
|
||||
#ifdef XR_FB_spatial_entity_query_EXPERIMENTAL_VERSION
|
||||
|
||||
#if XR_FB_spatial_entity_query_EXPERIMENTAL_VERSION >= 2
|
||||
|
||||
static const XrStructureType XR_TYPE_SPATIAL_ENTITY_QUERY_INFO_ACTION_QUERY_FBX2 =
|
||||
(XrStructureType)1000156000;
|
||||
typedef struct XrSpatialEntityQueryInfoActionQueryFBX2 {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
int32_t maxQuerySpaces;
|
||||
XrDuration timeout;
|
||||
XrSpaceQueryActionFB queryAction;
|
||||
const XrSpaceFilterInfoBaseHeaderFB* filter;
|
||||
const XrSpaceFilterInfoBaseHeaderFB* excludeFilter;
|
||||
} XrSpatialEntityQueryInfoActionQueryFBX2;
|
||||
|
||||
static const XrStructureType XR_TYPE_SPATIAL_ENTITY_QUERY_FILTER_IDS_FBX2 =
|
||||
(XrStructureType)1000156053;
|
||||
typedef struct XrSpatialEntityQueryFilterIdsFBX2 {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpatialEntityUuidFBX2* uuids;
|
||||
uint32_t numIds;
|
||||
} XrSpatialEntityQueryFilterIdsFBX2;
|
||||
|
||||
typedef struct XrSpatialEntityQueryResultFBX2 {
|
||||
XrSpace space;
|
||||
XrSpatialEntityUuidFBX2 uuid;
|
||||
} XrSpatialEntityQueryResultFBX2;
|
||||
|
||||
#define XR_SPATIAL_ENTITY_QUERY_MAX_RESULTS_PER_EVENT_FBX2 128
|
||||
static const XrStructureType XR_TYPE_EVENT_SPATIAL_ENTITY_QUERY_RESULTS_FBX2 =
|
||||
(XrStructureType)1000156102;
|
||||
typedef struct XrEventSpatialEntityQueryResultsFBX2 {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrAsyncRequestIdFB request;
|
||||
uint32_t numResults;
|
||||
XrSpatialEntityQueryResultFBX2 results[XR_SPATIAL_ENTITY_QUERY_MAX_RESULTS_PER_EVENT_FBX2];
|
||||
} XrEventSpatialEntityQueryResultsFBX2;
|
||||
|
||||
static const XrStructureType XR_TYPE_EVENT_SPATIAL_ENTITY_QUERY_COMPLETE_FBX2 =
|
||||
(XrStructureType)1000156101;
|
||||
typedef struct XrEventSpatialEntityQueryCompleteFBX2 {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrResult result;
|
||||
int32_t numSpacesFound;
|
||||
XrAsyncRequestIdFB request;
|
||||
} XrEventSpatialEntityQueryCompleteFBX2;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrQuerySpatialEntityFBX2)(
|
||||
XrSession session,
|
||||
const XrSpaceQueryInfoBaseHeaderFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
|
||||
#endif // XR_FB_spatial_entity_query_EXPERIMENTAL_VERSION >= 2
|
||||
|
||||
#if XR_FB_spatial_entity_query_EXPERIMENTAL_VERSION == 2
|
||||
|
||||
#define XrSpatialEntityQueryPredicateFB XrSpaceQueryActionFB
|
||||
#define XR_SPATIAL_ENTITY_QUERY_PREDICATE_LOAD_FB XR_SPACE_QUERY_ACTION_LOAD_FB
|
||||
#define XR_SPATIAL_ENTITY_QUERY_PREDICATE_MAX_ENUM_FB XR_SPACE_QUERY_ACTION_MAX_ENUM_FB
|
||||
|
||||
#define XR_TYPE_SPATIAL_ENTITY_QUERY_INFO_ACTION_QUERY_FB \
|
||||
XR_TYPE_SPATIAL_ENTITY_QUERY_INFO_ACTION_QUERY_FBX2
|
||||
#define XrSpatialEntityQueryInfoActionQueryFB XrSpatialEntityQueryInfoActionQueryFBX2
|
||||
|
||||
#define XrSpatialEntityQueryInfoBaseHeaderFB XrSpaceQueryInfoBaseHeaderFB
|
||||
#define XrSpatialEntityQueryFilterBaseHeaderFB XrSpaceFilterInfoBaseHeaderFB
|
||||
|
||||
#define XR_TYPE_SPATIAL_ENTITY_STORAGE_LOCATION_INFO_FB \
|
||||
XR_TYPE_SPACE_STORAGE_LOCATION_FILTER_INFO_FB
|
||||
#define XrSpatialEntityStorageLocationInfoFB XrSpaceStorageLocationFilterInfoFB
|
||||
|
||||
#define XR_TYPE_SPATIAL_ENTITY_QUERY_FILTER_IDS_FB XR_TYPE_SPATIAL_ENTITY_QUERY_FILTER_IDS_FBX2
|
||||
#define XrSpatialEntityQueryFilterIdsFB XrSpatialEntityQueryFilterIdsFBX2
|
||||
|
||||
#define XR_TYPE_SPATIAL_ENTITY_QUERY_FILTER_COMPONENT_TYPE_FB XR_TYPE_SPACE_COMPONENT_FILTER_INFO_FB
|
||||
#define XrSpatialEntityQueryFilterComponentTypeFB XrSpaceComponentFilterInfoFB
|
||||
|
||||
#define XR_FB_SPATIAL_ENTITY_QUERY_MAX_RESULTS_PER_EVENT \
|
||||
XR_SPATIAL_ENTITY_QUERY_MAX_RESULTS_PER_EVENT_FBX2
|
||||
#define XR_FBX2_SPATIAL_ENTITY_QUERY_MAX_RESULTS_PER_EVENT \
|
||||
XR_SPATIAL_ENTITY_QUERY_MAX_RESULTS_PER_EVENT_FBX2
|
||||
|
||||
#define XR_TYPE_EVENT_SPATIAL_ENTITY_QUERY_RESULTS_FB \
|
||||
XR_TYPE_EVENT_SPATIAL_ENTITY_QUERY_RESULTS_FBX2
|
||||
#define XrEventSpatialEntityQueryResultsFB XrEventSpatialEntityQueryResultsFBX2
|
||||
|
||||
#define XR_TYPE_EVENT_SPATIAL_ENTITY_QUERY_COMPLETE_FB \
|
||||
XR_TYPE_EVENT_SPATIAL_ENTITY_QUERY_COMPLETE_FBX2
|
||||
#define XrEventSpatialEntityQueryCompleteFB XrEventSpatialEntityQueryCompleteFBX2
|
||||
|
||||
#define PFN_xrQuerySpatialEntityFB PFN_xrQuerySpatialEntityFBX1
|
||||
#define PFN_xrTerminateSpatialEntityQueryFB PFN_xrTerminateSpatialEntityQueryFBX2
|
||||
|
||||
#endif // XR_FB_spatial_entity_query_EXPERIMENTAL_VERSION == 2
|
||||
|
||||
|
||||
#endif // XR_FB_spatial_entity_query_EXPERIMENTAL_VERSION
|
||||
|
||||
// =============================================================================
|
||||
// End Backwards Compatibility (DEPRECATED)
|
||||
// =============================================================================
|
||||
|
||||
#endif // XR_FBX_spatial_entity_query
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+256
@@ -0,0 +1,256 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Filename : fb_spatial_entity_storage.h
|
||||
Content : spatial entity interface.
|
||||
Language : C99
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/fb_spatial_entity.h>
|
||||
|
||||
/*
|
||||
159 XR_FB_spatial_entity_storage
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_spatial_entity_storage
|
||||
#define XR_FB_spatial_entity_storage 1
|
||||
|
||||
#ifndef XR_FB_spatial_entity
|
||||
#error "This extension depends XR_FB_spatial_entity which has not been defined"
|
||||
#endif
|
||||
|
||||
#define XR_FBX2_spatial_entity_storage_SPEC_VERSION 2
|
||||
#define XR_FBX2_SPATIAL_ENTITY_STORAGE_EXTENSION_NAME "XR_FBX2_spatial_entity_storage"
|
||||
|
||||
#ifndef XR_FB_spatial_entity_storage_EXPERIMENTAL_VERSION
|
||||
#define XR_FB_spatial_entity_storage_SPEC_VERSION 1
|
||||
#define XR_FB_SPATIAL_ENTITY_STORAGE_EXTENSION_NAME "XR_FB_spatial_entity_storage"
|
||||
#elif XR_FB_spatial_entity_storage_EXPERIMENTAL_VERSION == 2
|
||||
#define XR_FB_spatial_entity_storage_SPEC_VERSION XR_FBX2_spatial_entity_storage_SPEC_VERSION
|
||||
#define XR_FB_SPATIAL_ENTITY_STORAGE_EXTENSION_NAME XR_FBX2_SPATIAL_ENTITY_STORAGE_EXTENSION_NAME
|
||||
#else
|
||||
#error "unknown experimental version for XR_FB_spatial_entity_storage"
|
||||
#endif
|
||||
|
||||
// In order to persist XrSpaces between application uses the XR_SPACE_COMPONENT_TYPE_STORABLE_FB
|
||||
// component can be enabled on a space that supports this functionality. If this
|
||||
// component has been enabled it allows for application developers to access the ability to
|
||||
// save and erase persisted XrSpaces.
|
||||
|
||||
// Storage location to be used to store, erase, and query spaces from
|
||||
typedef enum XrSpaceStorageLocationFB {
|
||||
XR_SPACE_STORAGE_LOCATION_INVALID_FB = 0,
|
||||
XR_SPACE_STORAGE_LOCATION_LOCAL_FB = 1,
|
||||
XR_SPACE_STORAGE_LOCATION_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrSpaceStorageLocationFB;
|
||||
|
||||
// Whether data should be persisted indefinitely or otherwise
|
||||
typedef enum XrSpacePersistenceModeFB {
|
||||
XR_SPACE_PERSISTENCE_MODE_INVALID_FB = 0,
|
||||
XR_SPACE_PERSISTENCE_MODE_INDEFINITE_FB = 1,
|
||||
XR_SPACE_PERSISTENCE_MODE_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrSpacePersistenceModeFB;
|
||||
|
||||
// Space save information used by xrSaveSpaceFB
|
||||
static const XrStructureType XR_TYPE_SPACE_SAVE_INFO_FB = (XrStructureType)1000158000;
|
||||
typedef struct XrSpaceSaveInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpace space;
|
||||
XrSpaceStorageLocationFB location;
|
||||
XrSpacePersistenceModeFB persistenceMode;
|
||||
} XrSpaceSaveInfoFB;
|
||||
|
||||
// Space erase information used by xrEraseSpaceFB
|
||||
static const XrStructureType XR_TYPE_SPACE_ERASE_INFO_FB = (XrStructureType)1000158001;
|
||||
typedef struct XrSpaceEraseInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpace space;
|
||||
XrSpaceStorageLocationFB location;
|
||||
} XrSpaceEraseInfoFB;
|
||||
|
||||
// Save Result
|
||||
// The save result event contains the success of the save/write operation to the
|
||||
// specified location as well as the XrSpace handle on which the save operation was attempted
|
||||
// on in addition to the unique Uuid and the triggered async request id from the initial
|
||||
// calling function
|
||||
static const XrStructureType XR_TYPE_EVENT_DATA_SPACE_SAVE_COMPLETE_FB =
|
||||
(XrStructureType)1000158106;
|
||||
typedef struct XrEventDataSpaceSaveCompleteFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrAsyncRequestIdFB requestId;
|
||||
XrResult result;
|
||||
XrSpace space;
|
||||
XrUuidEXT uuid;
|
||||
XrSpaceStorageLocationFB location;
|
||||
} XrEventDataSpaceSaveCompleteFB;
|
||||
|
||||
// Erase Result
|
||||
// The erase result event contains the success of the erase operation from the specified storage
|
||||
// location. It will also provide the uuid of the anchor and the async request id from the initial
|
||||
// calling function
|
||||
static const XrStructureType XR_TYPE_EVENT_DATA_SPACE_ERASE_COMPLETE_FB =
|
||||
(XrStructureType)1000158107;
|
||||
typedef struct XrEventDataSpaceEraseCompleteFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrAsyncRequestIdFB requestId;
|
||||
XrResult result;
|
||||
XrSpace space;
|
||||
XrUuidEXT uuid;
|
||||
XrSpaceStorageLocationFB location;
|
||||
} XrEventDataSpaceEraseCompleteFB;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrSaveSpaceFB)(
|
||||
XrSession session,
|
||||
const XrSpaceSaveInfoFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrEraseSpaceFB)(
|
||||
XrSession session,
|
||||
const XrSpaceEraseInfoFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrSaveSpaceFB(XrSession session, const XrSpaceSaveInfoFB* info, XrAsyncRequestIdFB* requestId);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrEraseSpaceFB(XrSession session, const XrSpaceEraseInfoFB* info, XrAsyncRequestIdFB* requestId);
|
||||
|
||||
#endif // XR_EXTENSION_PROTOTYPES
|
||||
#endif // !XR_NO_PROTOTYPES
|
||||
#endif // XR_FB_spatial_entity_storage
|
||||
|
||||
// =============================================================================
|
||||
// Begin Backwards Compatibility (DEPRECATED)
|
||||
// =============================================================================
|
||||
|
||||
// Separate include guard for experimental backwards compatibility,
|
||||
// to make sure this still gets included even when the extension
|
||||
// is included in openxr.h
|
||||
#ifndef XR_FBX_spatial_entity_storage
|
||||
#define XR_FBX_spatial_entity_storage 1
|
||||
|
||||
// Conditionally define experimental versions, since they are not getting defined
|
||||
// if the extension is included from openxr.h
|
||||
#ifndef XR_FBX2_spatial_entity_storage_SPEC_VERSION
|
||||
#define XR_FBX2_spatial_entity_storage_SPEC_VERSION 2
|
||||
#define XR_FBX2_SPATIAL_ENTITY_STORAGE_EXTENSION_NAME "XR_FBX2_spatial_entity_storage"
|
||||
#endif
|
||||
|
||||
#ifdef XR_FB_spatial_entity_storage_EXPERIMENTAL_VERSION
|
||||
|
||||
#if XR_FB_spatial_entity_storage_EXPERIMENTAL_VERSION >= 2
|
||||
|
||||
|
||||
static const XrStructureType XR_TYPE_EVENT_SPATIAL_ENTITY_STORAGE_SAVE_RESULT_FBX2 =
|
||||
(XrStructureType)1000077103;
|
||||
typedef struct XrEventSpatialEntityStorageSaveResultFBX2 {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrResult result;
|
||||
XrSpace space;
|
||||
XrSpatialEntityUuidFBX2 uuid;
|
||||
XrAsyncRequestIdFB request;
|
||||
} XrEventSpatialEntityStorageSaveResultFBX2;
|
||||
|
||||
static const XrStructureType XR_TYPE_EVENT_SPATIAL_ENTITY_STORAGE_ERASE_RESULT_FBX2 =
|
||||
(XrStructureType)1000077104;
|
||||
typedef struct XrEventSpatialEntityStorageEraseResultFBX2 {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrResult result;
|
||||
XrSpaceStorageLocationFB location;
|
||||
XrSpatialEntityUuidFBX2 uuid;
|
||||
XrAsyncRequestIdFB request;
|
||||
} XrEventSpatialEntityStorageEraseResultFBX2;
|
||||
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrSpatialEntitySaveSpaceFBX2)(
|
||||
XrSession session,
|
||||
const XrSpaceSaveInfoFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrSpatialEntityEraseSpaceFBX2)(
|
||||
XrSession session,
|
||||
const XrSpaceEraseInfoFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrSpatialEntitySaveSpaceFB(
|
||||
XrSession session,
|
||||
const XrSpaceSaveInfoFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrSpatialEntityEraseSpaceFB(
|
||||
XrSession session,
|
||||
const XrSpaceEraseInfoFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
|
||||
#endif // XR_EXTENSION_PROTOTYPES
|
||||
#endif // !XR_NO_PROTOTYPES
|
||||
|
||||
#endif // XR_FB_spatial_entity_storage_EXPERIMENTAL_VERSION >= 2
|
||||
|
||||
#if XR_FB_spatial_entity_storage_EXPERIMENTAL_VERSION == 2
|
||||
|
||||
#define XrSpatialEntityStorageLocationFB XrSpaceStorageLocationFB
|
||||
#define XR_SPATIAL_ENTITY_STORAGE_LOCATION_INVALID_FB XR_SPACE_STORAGE_LOCATION_INVALID_FB
|
||||
#define XR_SPATIAL_ENTITY_STORAGE_LOCATION_LOCAL_FB XR_SPACE_STORAGE_LOCATION_LOCAL_FB
|
||||
#define XR_SPATIAL_ENTITY_STORAGE_LOCATION_MAX_ENUM_FB XR_SPACE_STORAGE_LOCATION_MAX_ENUM_FB
|
||||
|
||||
#define XrSpatialEntityStoragePersistenceModeFB XrSpacePersistenceModeFB
|
||||
#define XR_SPATIAL_ENTITY_STORAGE_PERSISTENCE_MODE_INVALID_FB XR_SPACE_PERSISTENCE_MODE_INVALID_FB
|
||||
#define XR_SPATIAL_ENTITY_STORAGE_PERSISTENCE_MODE_INDEFINITE_HIGH_PRI_FB \
|
||||
XR_SPACE_PERSISTENCE_MODE_INDEFINITE_FB
|
||||
#define XR_SPATIAL_ENTITY_STORAGE_PERSISTENCE_MODE_MAX_ENUM_FB XR_SPACE_PERSISTENCE_MODE_MAX_ENUM_FB
|
||||
|
||||
#define XR_TYPE_SPATIAL_ENTITY_STORAGE_SAVE_INFO_FB XR_TYPE_SPACE_SAVE_INFO_FB
|
||||
#define XrSpatialEntityStorageSaveInfoFB XrSpaceSaveInfoFB
|
||||
|
||||
#define XR_TYPE_SPATIAL_ENTITY_STORAGE_ERASE_INFO_FB XR_TYPE_SPACE_ERASE_INFO_FB
|
||||
#define XrSpatialEntityStorageEraseInfoFB XrSpaceEraseInfoFB
|
||||
|
||||
|
||||
#define XR_TYPE_EVENT_SPATIAL_ENTITY_STORAGE_SAVE_RESULT_FB \
|
||||
XR_TYPE_EVENT_SPATIAL_ENTITY_STORAGE_SAVE_RESULT_FBX2
|
||||
#define XrEventSpatialEntityStorageSaveResultFB XrEventSpatialEntityStorageSaveResultFBX2
|
||||
|
||||
#define XR_TYPE_EVENT_SPATIAL_ENTITY_STORAGE_ERASE_RESULT_FB \
|
||||
XR_TYPE_EVENT_SPATIAL_ENTITY_STORAGE_ERASE_RESULT_FBX2
|
||||
#define XrEventSpatialEntityStorageEraseResultFB XrEventSpatialEntityStorageEraseResultFBX2
|
||||
|
||||
|
||||
#define PFN_xrSpatialEntitySaveSpaceFB PFN_xrSpatialEntitySaveSpaceFBX2
|
||||
#define PFN_xrSpatialEntityEraseSpaceFB PFN_xrSpatialEntityEraseSpaceFBX2
|
||||
|
||||
#endif // XR_FB_spatial_entity_storage_EXPERIMENTAL_VERSION == 2
|
||||
|
||||
|
||||
#endif // XR_FB_spatial_entity_storage_EXPERIMENTAL_VERSION
|
||||
|
||||
#endif // XR_FBX_spatial_entity_storage
|
||||
// =============================================================================
|
||||
// End Backwards Compatibility (DEPRECATED)
|
||||
// =============================================================================
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
Filename : fb_touch_controller_extras.h
|
||||
Content : Touch Controller Extras interaction profile extensions.
|
||||
Language : C99
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
|
||||
/*
|
||||
207 XR_FB_touch_controller_extras
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_touch_controller_extras
|
||||
|
||||
#if defined(XR_FB_touch_controller_extras_EXPERIMENTAL_VERSION)
|
||||
#if XR_FB_touch_controller_extras_EXPERIMENTAL_VERSION != 1
|
||||
#error "unknown experimental version number for XR_FB_touch_controller_extras_EXPERIMENTAL_VERSION"
|
||||
#endif
|
||||
|
||||
#define XR_FB_touch_controller_extras 1
|
||||
#define XR_FB_touch_controller_extras_SPEC_VERSION 1
|
||||
#define XR_FB_TOUCH_CONTROLLER_EXTRAS_EXTENSION_NAME "XR_FBX1_touch_controller_extras"
|
||||
|
||||
// Oculus Touch Controller Profile with additional paths
|
||||
// Path: /interaction_profiles/oculus/touch_controller
|
||||
// Valid for user paths:
|
||||
// /user/hand/left
|
||||
// /user/hand/right
|
||||
//
|
||||
// This interaction profile represents the input sources and haptics on the Oculus Touch
|
||||
// controller. This is a superset of the existing `Oculus Touch Controller Profile`
|
||||
// Path: /interaction_profiles/oculus/touch_controller
|
||||
//
|
||||
// Supported component paths compatible with the above:
|
||||
//
|
||||
// On /user/hand/left only:
|
||||
// …/input/x/click
|
||||
// …/input/x/touch
|
||||
// …/input/y/click
|
||||
// …/input/y/touch
|
||||
// …/input/menu/click
|
||||
//
|
||||
// On /user/hand/right only:
|
||||
// …/input/a/click
|
||||
// …/input/a/touch
|
||||
// …/input/b/click
|
||||
// …/input/b/touch
|
||||
// …/input/system/click (may not be available for application use)
|
||||
//
|
||||
// On both:
|
||||
// …/input/squeeze/value
|
||||
// …/input/trigger/value
|
||||
// …/input/trigger/touch
|
||||
// …/input/thumbstick
|
||||
// …/input/thumbstick/x
|
||||
// …/input/thumbstick/y
|
||||
// …/input/thumbstick/click
|
||||
// …/input/thumbstick/touch
|
||||
// …/input/thumbrest/touch
|
||||
// …/input/grip/pose
|
||||
// …/input/aim/pose
|
||||
// …/output/haptic
|
||||
//
|
||||
// Additional paths enabled by this extension
|
||||
//
|
||||
// On both:
|
||||
// …/input/trigger/proximity_fb
|
||||
// …/input/thumb_fb/proximity_fb
|
||||
|
||||
#endif // defined(XR_FB_touch_controller_extras_EXPERIMENTAL_VERSION)
|
||||
|
||||
#endif // XR_FB_touch_controller_extras
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+311
@@ -0,0 +1,311 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
Filename : fb_touch_controller_pro.h
|
||||
Content : Touch Controller Pro interaction profile.
|
||||
Language : C99
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
|
||||
/*
|
||||
168 XR_FB_touch_controller_pro
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_touch_controller_pro
|
||||
#define XR_FB_touch_controller_pro 1
|
||||
|
||||
#define XR_FBX1_touch_controller_pro_SPEC_VERSION 1
|
||||
#define XR_FBX1_TOUCH_CONTROLLER_PRO_EXTENSION_NAME "XR_FBX1_touch_controller_pro"
|
||||
#define XR_FBX2_touch_controller_pro_SPEC_VERSION 2
|
||||
#define XR_FBX2_TOUCH_CONTROLLER_PRO_EXTENSION_NAME "XR_FBX2_touch_controller_pro"
|
||||
#define XR_FBX3_touch_controller_pro_SPEC_VERSION 3
|
||||
#define XR_FBX3_TOUCH_CONTROLLER_PRO_EXTENSION_NAME "XR_FBX3_touch_controller_pro"
|
||||
|
||||
#ifndef XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION
|
||||
#define XR_FB_touch_controller_pro_SPEC_VERSION 1
|
||||
#define XR_FB_TOUCH_CONTROLLER_PRO_EXTENSION_NAME "XR_FB_touch_controller_pro"
|
||||
#elif XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION == 1
|
||||
#define XR_FB_touch_controller_pro_SPEC_VERSION XR_FBX1_touch_controller_pro_SPEC_VERSION
|
||||
#define XR_FB_TOUCH_CONTROLLER_PRO_EXTENSION_NAME XR_FBX1_TOUCH_CONTROLLER_PRO_EXTENSION_NAME
|
||||
#elif XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION == 2
|
||||
#define XR_FB_touch_controller_pro_SPEC_VERSION XR_FBX2_touch_controller_pro_SPEC_VERSION
|
||||
#define XR_FB_TOUCH_CONTROLLER_PRO_EXTENSION_NAME XR_FBX2_TOUCH_CONTROLLER_PRO_EXTENSION_NAME
|
||||
#elif XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION == 3
|
||||
#define XR_FB_touch_controller_pro_SPEC_VERSION XR_FBX3_touch_controller_pro_SPEC_VERSION
|
||||
#define XR_FB_TOUCH_CONTROLLER_PRO_EXTENSION_NAME XR_FBX3_TOUCH_CONTROLLER_PRO_EXTENSION_NAME
|
||||
#else
|
||||
#error "unknown experimental version number for XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION"
|
||||
#endif // XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION
|
||||
|
||||
// Facebook Touch Controller PRO Profile
|
||||
// Path: /interaction_profiles/facebook/touch_controller_pro
|
||||
// Valid for user paths:
|
||||
// /user/hand/left
|
||||
// /user/hand/right
|
||||
//
|
||||
// This interaction profile represents the input sources and haptics on the Facebook Touch
|
||||
// controller pro. This is a superset of the existing `Oculus Touch Controller Profile`
|
||||
// Path: /interaction_profiles/oculus/touch_controller
|
||||
//
|
||||
// Supported component paths compatible with the above:
|
||||
//
|
||||
// On /user/hand/left only:
|
||||
// …/input/x/click
|
||||
// …/input/x/touch
|
||||
// …/input/y/click
|
||||
// …/input/y/touch
|
||||
// …/input/menu/click
|
||||
//
|
||||
// On /user/hand/right only:
|
||||
// …/input/a/click
|
||||
// …/input/a/touch
|
||||
// …/input/b/click
|
||||
// …/input/b/touch
|
||||
// …/input/system/click (may not be available for application use)
|
||||
//
|
||||
// On both:
|
||||
// …/input/squeeze/value
|
||||
// …/input/trigger/value
|
||||
// …/input/trigger/touch
|
||||
// …/input/thumbstick
|
||||
// …/input/thumbstick/x
|
||||
// …/input/thumbstick/y
|
||||
// …/input/thumbstick/click
|
||||
// …/input/thumbstick/touch
|
||||
// …/input/thumbrest/touch
|
||||
// …/input/grip/pose
|
||||
// …/input/aim/pose
|
||||
// …/output/haptic
|
||||
//
|
||||
// Additional supported paths enabled by this profile
|
||||
//
|
||||
// On both:
|
||||
// …/input/thumbrest/force
|
||||
// …/input/stylus_fb/force
|
||||
// …/input/trigger/curl_fb
|
||||
// …/input/trigger/slide_fb
|
||||
// …/input/trigger/proximity_fb
|
||||
// …/input/thumb_fb/proximity_fb
|
||||
// …/output/trigger_haptic_fb
|
||||
// …/output/thumb_haptic_fb
|
||||
|
||||
#ifdef XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION
|
||||
#if XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION == 3
|
||||
// X3 adds Pinch API support
|
||||
|
||||
// Left for an(other) iteration to keep experimental builds working
|
||||
#define XR_FB_touch_controller_pro_DEPRECATED_EXPERIMENTAL_VERSION 1
|
||||
#define XR_FB_TOUCH_CONTROLLER_PRO_DEPRECATED_EXPERIMENTAL_EXTENSION_NAME \
|
||||
"XR_FBX1_touch_controller_pro"
|
||||
|
||||
// system properties
|
||||
XR_STRUCT_ENUM(XR_TYPE_TOUCH_CONTROLLER_PRO_DEPRECATED_PROPERTIES_FB, 1000167000);
|
||||
typedef struct XrTouchControllerPro_DEPRECATED_PropertiesFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrBool32 supportsLeftController;
|
||||
XrBool32 supportsRightController;
|
||||
} XrTouchControllerPro_DEPRECATED_PropertiesFB;
|
||||
|
||||
// Facebook Touch Controller PRO Profile
|
||||
// Path: /interaction_profiles/facebook/touch_controller_pro
|
||||
// Valid for user paths:
|
||||
// /user/hand/left
|
||||
// /user/hand/right
|
||||
//
|
||||
// This interaction profile represents the input sources and haptics on the Facebook Touch
|
||||
// controller pro. This is a superset of the existing `Oculus Touch Controller Profile`
|
||||
// Path: /interaction_profiles/oculus/touch_controller
|
||||
//
|
||||
// Supported component paths compatible with the above:
|
||||
//
|
||||
// On /user/hand/left only:
|
||||
// …/input/x/click
|
||||
// …/input/x/touch
|
||||
// …/input/y/click
|
||||
// …/input/y/touch
|
||||
// …/input/menu/click
|
||||
//
|
||||
// On /user/hand/right only:
|
||||
// …/input/a/click
|
||||
// …/input/a/touch
|
||||
// …/input/b/click
|
||||
// …/input/b/touch
|
||||
// …/input/system/click (may not be available for application use)
|
||||
//
|
||||
// On both:
|
||||
// …/input/squeeze/value
|
||||
// …/input/trigger/value
|
||||
// …/input/trigger/touch
|
||||
// …/input/thumbstick
|
||||
// …/input/thumbstick/x
|
||||
// …/input/thumbstick/y
|
||||
// …/input/thumbstick/click
|
||||
// …/input/thumbstick/touch
|
||||
// …/input/thumbrest/touch
|
||||
// …/input/grip/pose
|
||||
// …/input/aim/pose
|
||||
// …/output/haptic
|
||||
//
|
||||
// Additional supported paths enabled by this profile
|
||||
//
|
||||
// On both:
|
||||
// …/input/thumbrest/force
|
||||
// …/input/stylus_fb/force
|
||||
// …/input/trigger/curl_fb
|
||||
// …/input/trigger/slide_fb
|
||||
// …/input/trigger/proximity_fb
|
||||
// …/input/thumb_fb/proximity_fb
|
||||
// …/input/pinch_fb/value // NEW in X3
|
||||
// …/input/pinch_fb/force // NEW in X3
|
||||
// …/output/trigger_haptic_fb
|
||||
// …/output/thumb_haptic_fb
|
||||
|
||||
#elif XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION == 2
|
||||
|
||||
// Left for an iteration to keep experimental builds working
|
||||
#define XR_FB_touch_controller_pro_DEPRECATED_EXPERIMENTAL_VERSION 1
|
||||
#define XR_FB_TOUCH_CONTROLLER_PRO_DEPRECATED_EXPERIMENTAL_EXTENSION_NAME \
|
||||
"XR_FBX1_touch_controller_pro"
|
||||
|
||||
// system properties
|
||||
XR_STRUCT_ENUM(XR_TYPE_TOUCH_CONTROLLER_PRO_DEPRECATED_PROPERTIES_FB, 1000167000);
|
||||
typedef struct XrTouchControllerPro_DEPRECATED_PropertiesFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrBool32 supportsLeftController;
|
||||
XrBool32 supportsRightController;
|
||||
} XrTouchControllerPro_DEPRECATED_PropertiesFB;
|
||||
|
||||
// Facebook Touch Controller PRO Profile
|
||||
// Path: /interaction_profiles/facebook/touch_controller_pro
|
||||
// Valid for user paths:
|
||||
// /user/hand/left
|
||||
// /user/hand/right
|
||||
//
|
||||
// This interaction profile represents the input sources and haptics on the Facebook Touch
|
||||
// controller pro. This is a superset of the existing `Oculus Touch Controller Profile`
|
||||
// Path: /interaction_profiles/oculus/touch_controller
|
||||
//
|
||||
// Supported component paths compatible with the above:
|
||||
//
|
||||
// On /user/hand/left only:
|
||||
// …/input/x/click
|
||||
// …/input/x/touch
|
||||
// …/input/y/click
|
||||
// …/input/y/touch
|
||||
// …/input/menu/click
|
||||
//
|
||||
// On /user/hand/right only:
|
||||
// …/input/a/click
|
||||
// …/input/a/touch
|
||||
// …/input/b/click
|
||||
// …/input/b/touch
|
||||
// …/input/system/click (may not be available for application use)
|
||||
//
|
||||
// On both:
|
||||
// …/input/squeeze/value
|
||||
// …/input/trigger/value
|
||||
// …/input/trigger/touch
|
||||
// …/input/thumbstick
|
||||
// …/input/thumbstick/x
|
||||
// …/input/thumbstick/y
|
||||
// …/input/thumbstick/click
|
||||
// …/input/thumbstick/touch
|
||||
// …/input/thumbrest/touch
|
||||
// …/input/grip/pose
|
||||
// …/input/aim/pose
|
||||
// …/output/haptic
|
||||
//
|
||||
// Additional supported paths enabled by this profile
|
||||
//
|
||||
// On both:
|
||||
// …/input/thumbrest/force
|
||||
// …/input/stylus_fb/force
|
||||
// …/input/trigger/curl_fb
|
||||
// …/input/trigger/slide_fb
|
||||
// …/input/trigger/proximity_fb
|
||||
// …/input/thumb_fb/proximity_fb
|
||||
// …/output/trigger_haptic_fb
|
||||
// …/output/thumb_haptic_fb
|
||||
|
||||
#elif XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION == 1
|
||||
|
||||
// Facebook Touch Controller PRO Profile
|
||||
// Path: /interaction_profiles/facebook/touch_controller_pro
|
||||
// Valid for user paths:
|
||||
// /user/hand/left
|
||||
// /user/hand/right
|
||||
//
|
||||
// This interaction profile represents the input sources and haptics on the Facebook Touch
|
||||
// controller pro. This is a superset of the existing `Oculus Touch Controller Profile`
|
||||
// Path: /interaction_profiles/oculus/touch_controller
|
||||
//
|
||||
// Supported component paths compatible with the above:
|
||||
//
|
||||
// On /user/hand/left only:
|
||||
// …/input/x/click
|
||||
// …/input/x/touch
|
||||
// …/input/y/click
|
||||
// …/input/y/touch
|
||||
// …/input/menu/click
|
||||
//
|
||||
// On /user/hand/right only:
|
||||
// …/input/a/click
|
||||
// …/input/a/touch
|
||||
// …/input/b/click
|
||||
// …/input/b/touch
|
||||
// …/input/system/click (may not be available for application use)
|
||||
//
|
||||
// On both:
|
||||
// …/input/squeeze/value
|
||||
// …/input/trigger/value
|
||||
// …/input/trigger/touch
|
||||
// …/input/thumbstick/x
|
||||
// …/input/thumbstick/y
|
||||
// …/input/thumbstick/click
|
||||
// …/input/thumbstick/touch
|
||||
// …/input/thumbrest/touch
|
||||
// …/input/grip/pose
|
||||
// …/input/aim/pose
|
||||
// …/output/haptic
|
||||
//
|
||||
// Additional supported paths enabled by this profile
|
||||
//
|
||||
// On both:
|
||||
// …/input/trackpad/x
|
||||
// …/input/trackpad/y
|
||||
// …/input/trackpad/force
|
||||
// …/input/stylus/force
|
||||
// …/input/trigger/curl
|
||||
// …/input/trigger/slide
|
||||
// …/input/trigger/proximity_fb
|
||||
// …/input/thumb_fb/proximity_fb
|
||||
// …/output/trigger_haptic
|
||||
// …/output/thumb_haptic
|
||||
|
||||
// system properties
|
||||
XR_STRUCT_ENUM(XR_TYPE_TOUCH_CONTROLLER_PRO_PROPERTIES_FB, 1000167000);
|
||||
typedef struct XrTouchControllerProPropertiesFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrBool32 supportsLeftController;
|
||||
XrBool32 supportsRightController;
|
||||
} XrTouchControllerProPropertiesFB;
|
||||
|
||||
#endif // XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION == 1
|
||||
|
||||
#endif // defined(XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION)
|
||||
|
||||
#endif // XR_FB_touch_controller_pro
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
Filename : meta_foveation_eye_tracked.h
|
||||
Content : Eye tracked foveated rendering extension.
|
||||
already merged: https://gitlab.khronos.org/openxr/openxr/-/merge_requests/2239
|
||||
Language : C99
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
|
||||
/*
|
||||
Extension 201 XR_META_foveation_eye_tracked
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_META_foveation_eye_tracked
|
||||
|
||||
|
||||
#define XR_META_foveation_eye_tracked 1
|
||||
#define XR_FOVEATION_CENTER_SIZE_META 2
|
||||
#define XR_META_foveation_eye_tracked_SPEC_VERSION 1
|
||||
#define XR_META_FOVEATION_EYE_TRACKED_EXTENSION_NAME "XR_META_foveation_eye_tracked"
|
||||
|
||||
typedef XrFlags64 XrFoveationEyeTrackedProfileCreateFlagsMETA;
|
||||
|
||||
// Flag bits for XrFoveationEyeTrackedProfileCreateFlagsMETA
|
||||
|
||||
typedef XrFlags64 XrFoveationEyeTrackedStateFlagsMETA;
|
||||
|
||||
// Flag bits for XrFoveationEyeTrackedStateFlagsMETA
|
||||
static const XrFoveationEyeTrackedStateFlagsMETA XR_FOVEATION_EYE_TRACKED_STATE_VALID_BIT_META =
|
||||
0x00000001;
|
||||
|
||||
// XrFoveationEyeTrackedProfileCreateInfoMETA extends XrFoveationLevelProfileCreateInfoFB
|
||||
XR_STRUCT_ENUM(XR_TYPE_FOVEATION_EYE_TRACKED_PROFILE_CREATE_INFO_META, 1000200000);
|
||||
typedef struct XrFoveationEyeTrackedProfileCreateInfoMETA {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrFoveationEyeTrackedProfileCreateFlagsMETA flags;
|
||||
} XrFoveationEyeTrackedProfileCreateInfoMETA;
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_FOVEATION_EYE_TRACKED_STATE_META, 1000200001);
|
||||
typedef struct XrFoveationEyeTrackedStateMETA {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrVector2f foveationCenter[XR_FOVEATION_CENTER_SIZE_META];
|
||||
XrFoveationEyeTrackedStateFlagsMETA flags;
|
||||
} XrFoveationEyeTrackedStateMETA;
|
||||
|
||||
// XrSystemFoveationEyeTrackedPropertiesMETA extends XrSystemProperties
|
||||
XR_STRUCT_ENUM(XR_TYPE_SYSTEM_FOVEATION_EYE_TRACKED_PROPERTIES_META, 1000200002);
|
||||
typedef struct XrSystemFoveationEyeTrackedPropertiesMETA {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrBool32 supportsFoveationEyeTracked;
|
||||
} XrSystemFoveationEyeTrackedPropertiesMETA;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrGetFoveationEyeTrackedStateMETA)(
|
||||
XrSession session,
|
||||
XrFoveationEyeTrackedStateMETA* foveationState);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetFoveationEyeTrackedStateMETA(
|
||||
XrSession session,
|
||||
XrFoveationEyeTrackedStateMETA* foveationState);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
|
||||
#endif // XR_META_foveation_eye_tracked
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
Filename : meta_local_dimming.h
|
||||
Content : Local dimming extension.
|
||||
Merge Request : https://gitlab.khronos.org/openxr/openxr/-/merge_requests/2267
|
||||
Language : C99
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
|
||||
/*
|
||||
Extension 217 XR_META_local_dimming
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef XR_META_local_dimming
|
||||
#define XR_META_local_dimming 1
|
||||
#define XR_META_local_dimming_SPEC_VERSION 1
|
||||
#define XR_META_LOCAL_DIMMING_EXTENSION_NAME "XR_META_local_dimming"
|
||||
|
||||
typedef enum XrLocalDimmingModeMETA {
|
||||
XR_LOCAL_DIMMING_MODE_OFF_META = 0,
|
||||
XR_LOCAL_DIMMING_MODE_ON_META = 1,
|
||||
XR_LOCAL_DIMMING_MODE_MAX_ENUM_META = 0x7FFFFFFF
|
||||
} XrLocalDimmingModeMETA;
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_FRAME_END_INFO_LOCAL_DIMMING_META, 1000216000);
|
||||
struct XrLocalDimmingFrameEndInfoMETA {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrLocalDimmingModeMETA localDimmingMode;
|
||||
};
|
||||
|
||||
#endif // XR_META_local_dimming
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Filename : openxr_extension_helpers.h
|
||||
Content : Helpers for private and experimental extension definition headers.
|
||||
Language : C99
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr.h>
|
||||
|
||||
#define XR_ENUM(type, enm, constant) static const type enm = (type)constant
|
||||
#define XR_STRUCT_ENUM(enm, constant) XR_ENUM(XrStructureType, enm, constant)
|
||||
#define XR_REFSPACE_ENUM(enm, constant) XR_ENUM(XrReferenceSpaceType, enm, constant)
|
||||
#define XR_RESULT_ENUM(enm, constant) XR_ENUM(XrResult, enm, constant)
|
||||
#define XR_COMPONENT_ENUM(enm, constant) XR_ENUM(XrComponentTypeFB, enm, constant)
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Filename : openxr_oculus.h
|
||||
Content : Oculus OpenXR Extensions.
|
||||
Language : C99
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#ifndef OPENXR_OCULUS_H_
|
||||
#define OPENXR_OCULUS_H_ 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// XR_KHR_loader_init and XR_KHR_loader_init_android now available in 1.0.11 public spec.
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // OPENXR_OCULUS_H_
|
||||
+523
@@ -0,0 +1,523 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Filename : openxr_oculus_helpers.h
|
||||
Content : OpenXR Helper routines
|
||||
Language : C99
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#ifndef OPENXR_OCULUS_HELPERS_H
|
||||
#define OPENXR_OCULUS_HELPERS_H 1
|
||||
|
||||
#include <openxr/openxr.h>
|
||||
|
||||
#include "math.h" // for cosf(), sinf(), tanf()
|
||||
|
||||
typedef enum {
|
||||
GRAPHICS_VULKAN,
|
||||
GRAPHICS_OPENGL,
|
||||
GRAPHICS_OPENGL_ES,
|
||||
GRAPHICS_D3D,
|
||||
} GraphicsAPI;
|
||||
|
||||
// OpenXR time values are expressed in nanseconds.
|
||||
static inline double FromXrTime(const XrTime time) {
|
||||
return (time * 1e-9);
|
||||
}
|
||||
|
||||
static inline XrTime ToXrTime(const double timeInSeconds) {
|
||||
return (timeInSeconds * 1e9);
|
||||
}
|
||||
|
||||
typedef struct XrMatrix4x4f {
|
||||
float m[16];
|
||||
} XrMatrix4x4f;
|
||||
|
||||
static inline XrVector3f XrVector3f_Zero() {
|
||||
XrVector3f r;
|
||||
r.x = r.y = r.z = 0.0f;
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline XrVector3f XrVector3f_ScalarMultiply(const XrVector3f v, float scale) {
|
||||
XrVector3f u;
|
||||
u.x = v.x * scale;
|
||||
u.y = v.y * scale;
|
||||
u.z = v.z * scale;
|
||||
return u;
|
||||
}
|
||||
|
||||
static inline float XrVector3f_Dot(const XrVector3f u, const XrVector3f v) {
|
||||
return u.x * v.x + u.y * v.y + u.z * v.z;
|
||||
}
|
||||
|
||||
static inline XrVector3f XrVector3f_Add(const XrVector3f u, const XrVector3f v) {
|
||||
XrVector3f w;
|
||||
w.x = u.x + v.x;
|
||||
w.y = u.y + v.y;
|
||||
w.z = u.z + v.z;
|
||||
return w;
|
||||
}
|
||||
|
||||
static inline float XrVector3f_LengthSquared(const XrVector3f v) {
|
||||
return XrVector3f_Dot(v, v);
|
||||
}
|
||||
|
||||
static inline float XrVector3f_Length(const XrVector3f v) {
|
||||
return sqrtf(XrVector3f_LengthSquared(v));
|
||||
}
|
||||
|
||||
static inline XrVector3f XrVector3f_Normalized(const XrVector3f v) {
|
||||
float rcpLen = 1.0f / XrVector3f_Length(v);
|
||||
return XrVector3f_ScalarMultiply(v, rcpLen);
|
||||
}
|
||||
|
||||
static inline XrQuaternionf XrQuaternionf_Identity() {
|
||||
XrQuaternionf r;
|
||||
r.x = r.y = r.z = 0.0;
|
||||
r.w = 1.0f;
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline XrQuaternionf XrQuaternionf_CreateFromVectorAngle(
|
||||
const XrVector3f axis,
|
||||
const float angle) {
|
||||
XrQuaternionf r;
|
||||
if (XrVector3f_LengthSquared(axis) == 0.0f) {
|
||||
return XrQuaternionf_Identity();
|
||||
}
|
||||
|
||||
XrVector3f unitAxis = XrVector3f_Normalized(axis);
|
||||
float sinHalfAngle = sinf(angle * 0.5f);
|
||||
|
||||
r.w = cosf(angle * 0.5f);
|
||||
r.x = unitAxis.x * sinHalfAngle;
|
||||
r.y = unitAxis.y * sinHalfAngle;
|
||||
r.z = unitAxis.z * sinHalfAngle;
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline XrQuaternionf XrQuaternionf_Inverse(const XrQuaternionf q) {
|
||||
XrQuaternionf r;
|
||||
r.x = -q.x;
|
||||
r.y = -q.y;
|
||||
r.z = -q.z;
|
||||
r.w = q.w;
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline XrQuaternionf XrQuaternionf_Multiply(const XrQuaternionf a, const XrQuaternionf b) {
|
||||
XrQuaternionf c;
|
||||
c.x = a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y;
|
||||
c.y = a.w * b.y - a.x * b.z + a.y * b.w + a.z * b.x;
|
||||
c.z = a.w * b.z + a.x * b.y - a.y * b.x + a.z * b.w;
|
||||
c.w = a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z;
|
||||
return c;
|
||||
}
|
||||
|
||||
static inline XrVector3f XrQuaternionf_Rotate(const XrQuaternionf a, const XrVector3f v) {
|
||||
XrVector3f r;
|
||||
XrQuaternionf q = {v.x, v.y, v.z, 0.0f};
|
||||
XrQuaternionf aq = XrQuaternionf_Multiply(a, q);
|
||||
XrQuaternionf aInv = XrQuaternionf_Inverse(a);
|
||||
XrQuaternionf aqaInv = XrQuaternionf_Multiply(aq, aInv);
|
||||
r.x = aqaInv.x;
|
||||
r.y = aqaInv.y;
|
||||
r.z = aqaInv.z;
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline XrQuaternionf XrQuaternionf_Normalize(const XrQuaternionf q) {
|
||||
double n = sqrtf(q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w);
|
||||
if (n != 0.0f) {
|
||||
n = 1.0f / n;
|
||||
}
|
||||
XrQuaternionf c;
|
||||
c.x = q.x * n;
|
||||
c.y = q.y * n;
|
||||
c.z = q.z * n;
|
||||
c.w = q.w * n;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
static inline XrPosef XrPosef_Identity() {
|
||||
XrPosef r;
|
||||
r.orientation = XrQuaternionf_Identity();
|
||||
r.position = XrVector3f_Zero();
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline XrPosef XrPosef_Create(const XrQuaternionf orientation, const XrVector3f position) {
|
||||
XrPosef r;
|
||||
r.orientation = orientation;
|
||||
r.position = position;
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline XrVector3f XrPosef_Transform(const XrPosef a, const XrVector3f v) {
|
||||
XrVector3f r0 = XrQuaternionf_Rotate(a.orientation, v);
|
||||
return XrVector3f_Add(r0, a.position);
|
||||
}
|
||||
|
||||
static inline XrPosef XrPosef_Multiply(const XrPosef a, const XrPosef b) {
|
||||
XrPosef c;
|
||||
c.orientation = XrQuaternionf_Multiply(a.orientation, b.orientation);
|
||||
c.position = XrPosef_Transform(a, b.position);
|
||||
return c;
|
||||
}
|
||||
|
||||
static inline XrPosef XrPosef_Inverse(const XrPosef a) {
|
||||
XrPosef b;
|
||||
b.orientation = XrQuaternionf_Inverse(a.orientation);
|
||||
b.position = XrQuaternionf_Rotate(b.orientation, XrVector3f_ScalarMultiply(a.position, -1.0f));
|
||||
return b;
|
||||
}
|
||||
|
||||
// Creates a scale matrix.
|
||||
static inline void
|
||||
XrMatrix4x4f_CreateScale(XrMatrix4x4f* result, const float x, const float y, const float z) {
|
||||
result->m[0] = x;
|
||||
result->m[1] = 0.0f;
|
||||
result->m[2] = 0.0f;
|
||||
result->m[3] = 0.0f;
|
||||
result->m[4] = 0.0f;
|
||||
result->m[5] = y;
|
||||
result->m[6] = 0.0f;
|
||||
result->m[7] = 0.0f;
|
||||
result->m[8] = 0.0f;
|
||||
result->m[9] = 0.0f;
|
||||
result->m[10] = z;
|
||||
result->m[11] = 0.0f;
|
||||
result->m[12] = 0.0f;
|
||||
result->m[13] = 0.0f;
|
||||
result->m[14] = 0.0f;
|
||||
result->m[15] = 1.0f;
|
||||
}
|
||||
|
||||
// Creates a matrix from a quaternion.
|
||||
static inline void XrMatrix4x4f_CreateFromQuaternion(
|
||||
XrMatrix4x4f* result,
|
||||
const XrQuaternionf* quat) {
|
||||
const float x2 = quat->x + quat->x;
|
||||
const float y2 = quat->y + quat->y;
|
||||
const float z2 = quat->z + quat->z;
|
||||
|
||||
const float xx2 = quat->x * x2;
|
||||
const float yy2 = quat->y * y2;
|
||||
const float zz2 = quat->z * z2;
|
||||
|
||||
const float yz2 = quat->y * z2;
|
||||
const float wx2 = quat->w * x2;
|
||||
const float xy2 = quat->x * y2;
|
||||
const float wz2 = quat->w * z2;
|
||||
const float xz2 = quat->x * z2;
|
||||
const float wy2 = quat->w * y2;
|
||||
|
||||
result->m[0] = 1.0f - yy2 - zz2;
|
||||
result->m[1] = xy2 + wz2;
|
||||
result->m[2] = xz2 - wy2;
|
||||
result->m[3] = 0.0f;
|
||||
|
||||
result->m[4] = xy2 - wz2;
|
||||
result->m[5] = 1.0f - xx2 - zz2;
|
||||
result->m[6] = yz2 + wx2;
|
||||
result->m[7] = 0.0f;
|
||||
|
||||
result->m[8] = xz2 + wy2;
|
||||
result->m[9] = yz2 - wx2;
|
||||
result->m[10] = 1.0f - xx2 - yy2;
|
||||
result->m[11] = 0.0f;
|
||||
|
||||
result->m[12] = 0.0f;
|
||||
result->m[13] = 0.0f;
|
||||
result->m[14] = 0.0f;
|
||||
result->m[15] = 1.0f;
|
||||
}
|
||||
|
||||
// Creates an identity matrix.
|
||||
static inline void XrMatrix4x4f_CreateIdentity(XrMatrix4x4f* result) {
|
||||
result->m[0] = 1.0f;
|
||||
result->m[1] = 0.0f;
|
||||
result->m[2] = 0.0f;
|
||||
result->m[3] = 0.0f;
|
||||
result->m[4] = 0.0f;
|
||||
result->m[5] = 1.0f;
|
||||
result->m[6] = 0.0f;
|
||||
result->m[7] = 0.0f;
|
||||
result->m[8] = 0.0f;
|
||||
result->m[9] = 0.0f;
|
||||
result->m[10] = 1.0f;
|
||||
result->m[11] = 0.0f;
|
||||
result->m[12] = 0.0f;
|
||||
result->m[13] = 0.0f;
|
||||
result->m[14] = 0.0f;
|
||||
result->m[15] = 1.0f;
|
||||
}
|
||||
|
||||
// Creates a translation matrix.
|
||||
static inline void
|
||||
XrMatrix4x4f_CreateTranslation(XrMatrix4x4f* result, const float x, const float y, const float z) {
|
||||
result->m[0] = 1.0f;
|
||||
result->m[1] = 0.0f;
|
||||
result->m[2] = 0.0f;
|
||||
result->m[3] = 0.0f;
|
||||
result->m[4] = 0.0f;
|
||||
result->m[5] = 1.0f;
|
||||
result->m[6] = 0.0f;
|
||||
result->m[7] = 0.0f;
|
||||
result->m[8] = 0.0f;
|
||||
result->m[9] = 0.0f;
|
||||
result->m[10] = 1.0f;
|
||||
result->m[11] = 0.0f;
|
||||
result->m[12] = x;
|
||||
result->m[13] = y;
|
||||
result->m[14] = z;
|
||||
result->m[15] = 1.0f;
|
||||
}
|
||||
|
||||
// Use left-multiplication to accumulate transformations.
|
||||
static inline void
|
||||
XrMatrix4x4f_Multiply(XrMatrix4x4f* result, const XrMatrix4x4f* a, const XrMatrix4x4f* b) {
|
||||
result->m[0] = a->m[0] * b->m[0] + a->m[4] * b->m[1] + a->m[8] * b->m[2] + a->m[12] * b->m[3];
|
||||
result->m[1] = a->m[1] * b->m[0] + a->m[5] * b->m[1] + a->m[9] * b->m[2] + a->m[13] * b->m[3];
|
||||
result->m[2] = a->m[2] * b->m[0] + a->m[6] * b->m[1] + a->m[10] * b->m[2] + a->m[14] * b->m[3];
|
||||
result->m[3] = a->m[3] * b->m[0] + a->m[7] * b->m[1] + a->m[11] * b->m[2] + a->m[15] * b->m[3];
|
||||
|
||||
result->m[4] = a->m[0] * b->m[4] + a->m[4] * b->m[5] + a->m[8] * b->m[6] + a->m[12] * b->m[7];
|
||||
result->m[5] = a->m[1] * b->m[4] + a->m[5] * b->m[5] + a->m[9] * b->m[6] + a->m[13] * b->m[7];
|
||||
result->m[6] = a->m[2] * b->m[4] + a->m[6] * b->m[5] + a->m[10] * b->m[6] + a->m[14] * b->m[7];
|
||||
result->m[7] = a->m[3] * b->m[4] + a->m[7] * b->m[5] + a->m[11] * b->m[6] + a->m[15] * b->m[7];
|
||||
|
||||
result->m[8] = a->m[0] * b->m[8] + a->m[4] * b->m[9] + a->m[8] * b->m[10] + a->m[12] * b->m[11];
|
||||
result->m[9] = a->m[1] * b->m[8] + a->m[5] * b->m[9] + a->m[9] * b->m[10] + a->m[13] * b->m[11];
|
||||
result->m[10] =
|
||||
a->m[2] * b->m[8] + a->m[6] * b->m[9] + a->m[10] * b->m[10] + a->m[14] * b->m[11];
|
||||
result->m[11] =
|
||||
a->m[3] * b->m[8] + a->m[7] * b->m[9] + a->m[11] * b->m[10] + a->m[15] * b->m[11];
|
||||
|
||||
result->m[12] =
|
||||
a->m[0] * b->m[12] + a->m[4] * b->m[13] + a->m[8] * b->m[14] + a->m[12] * b->m[15];
|
||||
result->m[13] =
|
||||
a->m[1] * b->m[12] + a->m[5] * b->m[13] + a->m[9] * b->m[14] + a->m[13] * b->m[15];
|
||||
result->m[14] =
|
||||
a->m[2] * b->m[12] + a->m[6] * b->m[13] + a->m[10] * b->m[14] + a->m[14] * b->m[15];
|
||||
result->m[15] =
|
||||
a->m[3] * b->m[12] + a->m[7] * b->m[13] + a->m[11] * b->m[14] + a->m[15] * b->m[15];
|
||||
}
|
||||
|
||||
static inline void XrMatrix4x4f_Transpose(XrMatrix4x4f* result, const XrMatrix4x4f* src) {
|
||||
result->m[0] = src->m[0];
|
||||
result->m[1] = src->m[4];
|
||||
result->m[2] = src->m[8];
|
||||
result->m[3] = src->m[12];
|
||||
result->m[4] = src->m[1];
|
||||
result->m[5] = src->m[5];
|
||||
result->m[6] = src->m[9];
|
||||
result->m[7] = src->m[13];
|
||||
result->m[8] = src->m[2];
|
||||
result->m[9] = src->m[6];
|
||||
result->m[10] = src->m[10];
|
||||
result->m[11] = src->m[14];
|
||||
result->m[12] = src->m[3];
|
||||
result->m[13] = src->m[7];
|
||||
result->m[14] = src->m[11];
|
||||
result->m[15] = src->m[15];
|
||||
}
|
||||
|
||||
static inline void XrMatrix4x4f_InvertRigidBody(XrMatrix4x4f* result, const XrMatrix4x4f* src) {
|
||||
result->m[0] = src->m[0];
|
||||
result->m[1] = src->m[4];
|
||||
result->m[2] = src->m[8];
|
||||
result->m[3] = 0.0f;
|
||||
result->m[4] = src->m[1];
|
||||
result->m[5] = src->m[5];
|
||||
result->m[6] = src->m[9];
|
||||
result->m[7] = 0.0f;
|
||||
result->m[8] = src->m[2];
|
||||
result->m[9] = src->m[6];
|
||||
result->m[10] = src->m[10];
|
||||
result->m[11] = 0.0f;
|
||||
result->m[12] = -(src->m[0] * src->m[12] + src->m[1] * src->m[13] + src->m[2] * src->m[14]);
|
||||
result->m[13] = -(src->m[4] * src->m[12] + src->m[5] * src->m[13] + src->m[6] * src->m[14]);
|
||||
result->m[14] = -(src->m[8] * src->m[12] + src->m[9] * src->m[13] + src->m[10] * src->m[14]);
|
||||
result->m[15] = 1.0f;
|
||||
}
|
||||
|
||||
static inline XrMatrix4x4f XrMatrix4x4f_CreateFromRigidTransform(const XrPosef* s) {
|
||||
XrMatrix4x4f rotationMatrix;
|
||||
XrMatrix4x4f_CreateFromQuaternion(&rotationMatrix, &s->orientation);
|
||||
|
||||
XrMatrix4x4f translationMatrix;
|
||||
XrMatrix4x4f_CreateTranslation(&translationMatrix, s->position.x, s->position.y, s->position.z);
|
||||
|
||||
XrMatrix4x4f r;
|
||||
XrMatrix4x4f_Multiply(&r, &translationMatrix, &rotationMatrix);
|
||||
return r;
|
||||
}
|
||||
|
||||
// Creates a projection matrix based on the specified dimensions.
|
||||
// The projection matrix transforms -Z=forward, +Y=up, +X=right to the appropriate clip space for
|
||||
// the graphics API. The far plane is placed at infinity if farZ <= nearZ. An infinite projection
|
||||
// matrix is preferred for rasterization because, except for things *right* up against the near
|
||||
// plane, it always provides better precision:
|
||||
// "Tightening the Precision of Perspective Rendering"
|
||||
// Paul Upchurch, Mathieu Desbrun
|
||||
// Journal of Graphics Tools, Volume 16, Issue 1, 2012
|
||||
static inline void XrMatrix4x4f_CreateProjection(
|
||||
XrMatrix4x4f* result,
|
||||
GraphicsAPI graphicsApi,
|
||||
const float tanAngleLeft,
|
||||
const float tanAngleRight,
|
||||
const float tanAngleUp,
|
||||
float const tanAngleDown,
|
||||
const float nearZ,
|
||||
const float farZ) {
|
||||
const float tanAngleWidth = tanAngleRight - tanAngleLeft;
|
||||
|
||||
// Set to tanAngleDown - tanAngleUp for a clip space with positive Y down (Vulkan).
|
||||
// Set to tanAngleUp - tanAngleDown for a clip space with positive Y up (OpenGL / D3D / Metal).
|
||||
const float tanAngleHeight = (graphicsApi == GRAPHICS_VULKAN) ? (tanAngleDown - tanAngleUp)
|
||||
: (tanAngleUp - tanAngleDown);
|
||||
|
||||
// Set to nearZ for a [-1,1] Z clip space (OpenGL / OpenGL ES).
|
||||
// Set to zero for a [0,1] Z clip space (Vulkan / D3D / Metal).
|
||||
const float offsetZ =
|
||||
(graphicsApi == GRAPHICS_OPENGL || graphicsApi == GRAPHICS_OPENGL_ES) ? nearZ : 0.0f;
|
||||
if (farZ <= nearZ) {
|
||||
// place the far plane at infinity
|
||||
result->m[0] = 2 / tanAngleWidth;
|
||||
result->m[4] = 0;
|
||||
result->m[8] = (tanAngleRight + tanAngleLeft) / tanAngleWidth;
|
||||
result->m[12] = 0;
|
||||
|
||||
result->m[1] = 0;
|
||||
result->m[5] = 2 / tanAngleHeight;
|
||||
result->m[9] = (tanAngleUp + tanAngleDown) / tanAngleHeight;
|
||||
result->m[13] = 0;
|
||||
|
||||
result->m[2] = 0;
|
||||
result->m[6] = 0;
|
||||
result->m[10] = -1;
|
||||
result->m[14] = -(nearZ + offsetZ);
|
||||
|
||||
result->m[3] = 0;
|
||||
result->m[7] = 0;
|
||||
result->m[11] = -1;
|
||||
result->m[15] = 0;
|
||||
} else {
|
||||
// normal projection
|
||||
result->m[0] = 2 / tanAngleWidth;
|
||||
result->m[4] = 0;
|
||||
result->m[8] = (tanAngleRight + tanAngleLeft) / tanAngleWidth;
|
||||
result->m[12] = 0;
|
||||
|
||||
result->m[1] = 0;
|
||||
result->m[5] = 2 / tanAngleHeight;
|
||||
result->m[9] = (tanAngleUp + tanAngleDown) / tanAngleHeight;
|
||||
result->m[13] = 0;
|
||||
|
||||
result->m[2] = 0;
|
||||
result->m[6] = 0;
|
||||
result->m[10] = -(farZ + offsetZ) / (farZ - nearZ);
|
||||
result->m[14] = -(farZ * (nearZ + offsetZ)) / (farZ - nearZ);
|
||||
|
||||
result->m[3] = 0;
|
||||
result->m[7] = 0;
|
||||
result->m[11] = -1;
|
||||
result->m[15] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Creates a projection matrix based on the specified FOV (specified in radians).
|
||||
static inline void XrMatrix4x4f_CreateProjectionFov(
|
||||
XrMatrix4x4f* result,
|
||||
GraphicsAPI graphicsApi,
|
||||
const XrFovf fov,
|
||||
const float nearZ,
|
||||
const float farZ) {
|
||||
const float tanLeft = tanf(fov.angleLeft);
|
||||
const float tanRight = tanf(fov.angleRight);
|
||||
|
||||
const float tanDown = tanf(fov.angleDown);
|
||||
const float tanUp = tanf(fov.angleUp);
|
||||
|
||||
XrMatrix4x4f_CreateProjection(
|
||||
result, graphicsApi, tanLeft, tanRight, tanUp, tanDown, nearZ, farZ);
|
||||
}
|
||||
|
||||
// Creates a rotation matrix.
|
||||
// If -Z=forward, +Y=up, +X=right, then degreesX=pitch, degreesY=yaw, degreesZ=roll.
|
||||
static inline void XrMatrix4x4f_CreateRotation(
|
||||
XrMatrix4x4f* result,
|
||||
const float radiansX,
|
||||
const float radiansY,
|
||||
const float radiansZ) {
|
||||
const float sinX = sinf(radiansX);
|
||||
const float cosX = cosf(radiansX);
|
||||
const XrMatrix4x4f rotationX = {
|
||||
{1.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
cosX,
|
||||
sinX,
|
||||
0.0f,
|
||||
0.0f,
|
||||
-sinX,
|
||||
cosX,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
1.0f}};
|
||||
|
||||
const float sinY = sinf(radiansY);
|
||||
const float cosY = cosf(radiansY);
|
||||
const XrMatrix4x4f rotationY = {
|
||||
{cosY,
|
||||
0,
|
||||
-sinY,
|
||||
0.0f,
|
||||
0.0f,
|
||||
1.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
sinY,
|
||||
0.0f,
|
||||
cosY,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
1.0f}};
|
||||
|
||||
const float sinZ = sinf(radiansZ);
|
||||
const float cosZ = cosf(radiansZ);
|
||||
const XrMatrix4x4f rotationZ = {
|
||||
{cosZ,
|
||||
sinZ,
|
||||
0.0f,
|
||||
0.0f,
|
||||
-sinZ,
|
||||
cosZ,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
1.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
1.0f}};
|
||||
|
||||
XrMatrix4x4f rotationXY;
|
||||
XrMatrix4x4f_Multiply(&rotationXY, &rotationY, &rotationX);
|
||||
XrMatrix4x4f_Multiply(result, &rotationZ, &rotationXY);
|
||||
}
|
||||
|
||||
#endif // OPENXR_OCULUS_HELPERS_H
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user