Updated Oculus OpenXR Mobile SDK to 53.0
This commit is contained in:
@@ -1,187 +0,0 @@
|
||||
// (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
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
#ifndef EXTX1_EVENT_CHANNEL_H_
|
||||
#define EXTX1_EVENT_CHANNEL_H_ 1
|
||||
|
||||
/**********************
|
||||
This file is @generated from the OpenXR XML API registry.
|
||||
Language : C99
|
||||
Copyright : (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
***********************/
|
||||
|
||||
#include <openxr/openxr.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef XR_EXTX1_event_channel
|
||||
|
||||
#define XR_EXTX1_event_channel 1
|
||||
XR_DEFINE_HANDLE(XrEventChannelEXTX1)
|
||||
#define XR_EXTX1_event_channel_SPEC_VERSION 3
|
||||
#define XR_EXTX1_EVENT_CHANNEL_EXTENSION_NAME "XR_EXTX1_event_channel"
|
||||
#define XR_TYPE_EVENT_CHANNEL_CREATE_INFO_EXTX1 ((XrStructureType) 1000170001U)
|
||||
#define XR_TYPE_EVENT_CHANNEL_TARGET_EXTX1 ((XrStructureType) 1000170002U)
|
||||
#define XR_TYPE_SELECT_EVENT_CHANNEL_INFO_EXTX1 ((XrStructureType) 1000170003U)
|
||||
// XrEventChannelEXTX1
|
||||
#define XR_OBJECT_TYPE_EVENT_CHANNEL_EXTX1 ((XrObjectType) 1000170000U)
|
||||
|
||||
typedef enum XrSelectEventChannelFlagsEXTX1 {
|
||||
XR_SELECT_EVENT_CHANNEL_FLAGS_EXTX1_MAX_ENUM = 0x7FFFFFFF
|
||||
} XrSelectEventChannelFlagsEXTX1;
|
||||
typedef struct XrEventChannelCreateInfoEXTX1 {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
} XrEventChannelCreateInfoEXTX1;
|
||||
|
||||
typedef struct XrEventChannelTargetEXTX1 {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrEventChannelEXTX1 channel;
|
||||
} XrEventChannelTargetEXTX1;
|
||||
|
||||
typedef struct XrSelectEventChannelInfoEXTX1 {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSelectEventChannelFlagsEXTX1 flags;
|
||||
XrDuration timeout;
|
||||
uint32_t eventChannelCount;
|
||||
const XrEventChannelEXTX1* eventChannels;
|
||||
} XrSelectEventChannelInfoEXTX1;
|
||||
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrCreateEventChannelEXTX1)(XrInstance instance, const XrEventChannelCreateInfoEXTX1* createInfo, XrEventChannelEXTX1* channel);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrDestroyEventChannelEXTX1)(XrEventChannelEXTX1 channel);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrPollEventChannelEXTX1)(XrEventChannelEXTX1 channel, XrEventDataBuffer* eventData);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrSelectEventChannelEXTX1)(XrInstance instance, XrSelectEventChannelInfoEXTX1* info, uint32_t* channelWithEvent);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrSetDefaultEventChannelEXTX1)(XrInstance instance, XrEventChannelEXTX1 channel);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateEventChannelEXTX1(
|
||||
XrInstance instance,
|
||||
const XrEventChannelCreateInfoEXTX1* createInfo,
|
||||
XrEventChannelEXTX1* channel);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrDestroyEventChannelEXTX1(
|
||||
XrEventChannelEXTX1 channel);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrPollEventChannelEXTX1(
|
||||
XrEventChannelEXTX1 channel,
|
||||
XrEventDataBuffer* eventData);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrSelectEventChannelEXTX1(
|
||||
XrInstance instance,
|
||||
XrSelectEventChannelInfoEXTX1* info,
|
||||
uint32_t* channelWithEvent);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrSetDefaultEventChannelEXTX1(
|
||||
XrInstance instance,
|
||||
XrEventChannelEXTX1 channel);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_EXTX1_event_channel */
|
||||
|
||||
#ifdef XR_EXTX1_EVENT_CHANNEL_TAG_ALIAS
|
||||
typedef XrEventChannelCreateInfoEXTX1 XrEventChannelCreateInfoEXT;
|
||||
typedef XrEventChannelEXTX1 XrEventChannelEXT;
|
||||
typedef XrEventChannelTargetEXTX1 XrEventChannelTargetEXT;
|
||||
typedef XrSelectEventChannelFlagsEXTX1 XrSelectEventChannelFlagsEXT;
|
||||
typedef XrSelectEventChannelInfoEXTX1 XrSelectEventChannelInfoEXT;
|
||||
#define XR_EXT_event_channel_SPEC_VERSION XR_EXTX1_event_channel_SPEC_VERSION
|
||||
#define XR_EXT_EVENT_CHANNEL_EXTENSION_NAME XR_EXTX1_EVENT_CHANNEL_EXTENSION_NAME
|
||||
#define XR_TYPE_EVENT_CHANNEL_CREATE_INFO_EXT XR_TYPE_EVENT_CHANNEL_CREATE_INFO_EXTX1
|
||||
#define XR_TYPE_EVENT_CHANNEL_TARGET_EXT XR_TYPE_EVENT_CHANNEL_TARGET_EXTX1
|
||||
#define XR_TYPE_SELECT_EVENT_CHANNEL_INFO_EXT XR_TYPE_SELECT_EVENT_CHANNEL_INFO_EXTX1
|
||||
#define XR_OBJECT_TYPE_EVENT_CHANNEL_EXT XR_OBJECT_TYPE_EVENT_CHANNEL_EXTX1
|
||||
#endif /* XR_EXTX1_EVENT_CHANNEL_TAG_ALIAS */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+69
-129
@@ -1,57 +1,32 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
#ifndef FB_BODY_TRACKING_H_
|
||||
#define FB_BODY_TRACKING_H_ 1
|
||||
|
||||
/************************************************************************************
|
||||
Filename : fb_body_tracking.h
|
||||
Content :
|
||||
/**********************
|
||||
This file is @generated from the OpenXR XML API registry.
|
||||
Language : C99
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
Copyright : (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
***********************/
|
||||
|
||||
#include <openxr/openxr.h>
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
#include <cstdint>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#ifdef __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_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);
|
||||
// XrBodyTrackerFB
|
||||
#define XR_OBJECT_TYPE_BODY_TRACKER_FB ((XrObjectType) 1000076000U)
|
||||
#define XR_TYPE_BODY_TRACKER_CREATE_INFO_FB ((XrStructureType) 1000076001U)
|
||||
#define XR_TYPE_BODY_JOINTS_LOCATE_INFO_FB ((XrStructureType) 1000076002U)
|
||||
#define XR_TYPE_SYSTEM_BODY_TRACKING_PROPERTIES_FB ((XrStructureType) 1000076004U)
|
||||
#define XR_TYPE_BODY_JOINT_LOCATIONS_FB ((XrStructureType) 1000076005U)
|
||||
#define XR_TYPE_BODY_SKELETON_FB ((XrStructureType) 1000076006U)
|
||||
|
||||
typedef enum XrBodyJointFB {
|
||||
XR_BODY_JOINT_ROOT_FB = 0,
|
||||
@@ -129,124 +104,89 @@ typedef enum XrBodyJointFB {
|
||||
XR_BODY_JOINT_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrBodyJointFB;
|
||||
|
||||
// Describes the set of body joints to track when creating an slink:XrBodyTrackerFB.
|
||||
typedef enum XrBodyJointSetFB {
|
||||
// Indicates that the created slink:XrBodyTrackerFB tracks the set of body joints described by elink:XrBodyJointFB enum, i.e. the flink:xrLocateBodyJointsFB function returns an array of joint locations with the count of ename:XR_BODY_JOINT_COUNT_FB and can be indexed using elink:XrBodyJointFB.
|
||||
XR_BODY_JOINT_SET_DEFAULT_FB = 0,
|
||||
XR_BODY_JOINT_SET_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrBodyJointSetFB;
|
||||
typedef struct XrBodyJointLocationFB {
|
||||
XrSpaceLocationFlags locationFlags;
|
||||
XrPosef pose;
|
||||
} XrBodyJointLocationFB;
|
||||
|
||||
typedef struct XrSystemBodyTrackingPropertiesFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrBool32 supportsBodyTracking;
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrBool32 supportsBodyTracking;
|
||||
} XrSystemBodyTrackingPropertiesFB;
|
||||
|
||||
typedef struct XrBodyTrackerCreateInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrBodyJointSetFB bodyJointSet;
|
||||
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;
|
||||
int32_t joint;
|
||||
int32_t parentJoint;
|
||||
XrPosef pose;
|
||||
} XrBodySkeletonJointFB;
|
||||
|
||||
typedef struct XrBodySkeletonFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
uint32_t jointCount;
|
||||
XrBodySkeletonJointFB* joints;
|
||||
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 struct XrBodyJointsLocateInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpace baseSpace;
|
||||
XrTime time;
|
||||
} XrBodyJointsLocateInfoFB;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrLocateBodyJointsFB)(
|
||||
XrBodyTrackerFB bodyTracker,
|
||||
const XrBodyJointsLocateInfoFB* locateInfo,
|
||||
XrBodyJointLocationsFB* locations);
|
||||
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;
|
||||
|
||||
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
|
||||
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);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateBodyTrackerFB(
|
||||
XrSession session,
|
||||
const XrBodyTrackerCreateInfoFB* createInfo,
|
||||
XrBodyTrackerFB* bodyTracker);
|
||||
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 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);
|
||||
XrBodyTrackerFB bodyTracker,
|
||||
const XrBodyJointsLocateInfoFB* locateInfo,
|
||||
XrBodyJointLocationsFB* locations);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetBodySkeletonFB(
|
||||
XrBodyTrackerFB bodyTracker,
|
||||
XrBodySkeletonFB* skeleton);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_FB_body_tracking */
|
||||
|
||||
#endif // XR_FB_body_tracking
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+11
-126
@@ -20,49 +20,11 @@ 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);
|
||||
@@ -70,24 +32,16 @@ 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 {
|
||||
typedef struct XrEyeTrackerCreateInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
} XrEyeTrackerCreateInfoV2FB;
|
||||
|
||||
typedef struct XrEyeTrackerCreateInfoV1FB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrEyeInputFlagsFB flags;
|
||||
} XrEyeTrackerCreateInfoV1FB;
|
||||
} XrEyeTrackerCreateInfoFB;
|
||||
|
||||
typedef struct XrEyeGazesInfoFB {
|
||||
XrStructureType type;
|
||||
@@ -96,17 +50,12 @@ typedef struct XrEyeGazesInfoFB {
|
||||
XrTime time;
|
||||
} XrEyeGazesInfoFB;
|
||||
|
||||
typedef struct XrEyeGazeV2FB {
|
||||
typedef struct XrEyeGazeFB {
|
||||
XrBool32 isValid;
|
||||
XrPosef gazePose;
|
||||
float gazeConfidence;
|
||||
} XrEyeGazeV2FB;
|
||||
|
||||
typedef struct XrEyeGazeV1FB {
|
||||
XrBool32 isValid;
|
||||
XrPosef gazePose;
|
||||
float gazeConfidence;
|
||||
} XrEyeGazeV1FB;
|
||||
} XrEyeGazeFB;
|
||||
#define XrEyeGazeV2FB XrEyeGazeFB
|
||||
|
||||
typedef enum XrEyePositionFB {
|
||||
XR_EYE_POSITION_LEFT_FB = 0,
|
||||
@@ -115,90 +64,26 @@ typedef enum XrEyePositionFB {
|
||||
XR_EYE_POSITION_MAX_ENUM_FB = 0x7FFFFFFF
|
||||
} XrEyePositionFB;
|
||||
|
||||
typedef struct XrEyeGazesV2FB {
|
||||
typedef struct XrEyeGazesFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrEyeGazeV2FB gaze[2];
|
||||
XrEyeGazeFB 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
|
||||
} XrEyeGazesFB;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrCreateEyeTrackerFB)(
|
||||
XrSession session,
|
||||
const XrEyeTrackerCreateInfoV2FB* createInfo,
|
||||
const XrEyeTrackerCreateInfoFB* 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
|
||||
XrEyeGazesFB* eyeGazes);
|
||||
|
||||
#endif // XR_FB_eye_tracking
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+61
-272
@@ -1,81 +1,48 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
#ifndef FB_FACE_TRACKING_H_
|
||||
#define FB_FACE_TRACKING_H_ 1
|
||||
|
||||
/************************************************************************************
|
||||
Filename : fb_face_tracking.h
|
||||
Content : Face tracking APIs.
|
||||
/**********************
|
||||
This file is @generated from the OpenXR XML API registry.
|
||||
Language : C99
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
Copyright : (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
***********************/
|
||||
|
||||
#include <openxr/openxr.h>
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
|
||||
/*
|
||||
202 XR_FB_face_tracking
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef XR_FB_face_tracking
|
||||
|
||||
#define XR_FB_face_tracking 1
|
||||
|
||||
#define XR_FACE_EXPRESSSION_SET_DEFAULT_FB XR_FACE_EXPRESSION_SET_DEFAULT_FB
|
||||
|
||||
XR_DEFINE_HANDLE(XrFaceTrackerFB)
|
||||
|
||||
#define XR_FB_face_tracking_SPEC_VERSION 1
|
||||
#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)
|
||||
// XrFaceTrackerFB
|
||||
#define XR_OBJECT_TYPE_FACE_TRACKER_FB ((XrObjectType) 1000201000U)
|
||||
#define XR_TYPE_SYSTEM_FACE_TRACKING_PROPERTIES_FB ((XrStructureType) 1000201004U)
|
||||
#define XR_TYPE_FACE_TRACKER_CREATE_INFO_FB ((XrStructureType) 1000201005U)
|
||||
#define XR_TYPE_FACE_EXPRESSION_INFO_FB ((XrStructureType) 1000201002U)
|
||||
#define XR_TYPE_FACE_EXPRESSION_WEIGHTS_FB ((XrStructureType) 1000201006U)
|
||||
|
||||
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,
|
||||
@@ -86,18 +53,14 @@ typedef enum XrFaceExpressionFB {
|
||||
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,
|
||||
@@ -121,264 +84,90 @@ typedef enum XrFaceExpressionFB {
|
||||
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
|
||||
// indicates that the created slink:XrFaceTrackerFB tracks the set of blend shapes described by elink:XrFaceExpressionFB enum, i.e. the flink:xrGetFaceExpressionWeightsFB function returns an array of blend shapes with the count of ename:XR_FACE_EXPRESSION_COUNT_FB and can: be indexed using elink:XrFaceExpressionFB.
|
||||
XR_FACE_EXPRESSION_SET_DEFAULT_FB = 0,
|
||||
XR_FACE_EXPRESSION_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;
|
||||
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 XrFaceTrackerCreateInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrFaceExpressionSetFB faceExpressionSet;
|
||||
} XrFaceTrackerCreateInfoFB;
|
||||
|
||||
typedef struct XrFaceExpressionInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrTime time;
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrTime time;
|
||||
} XrFaceExpressionInfoFB;
|
||||
|
||||
typedef struct XrFaceExpressionStatusFB {
|
||||
XrBool32 isValid;
|
||||
XrBool32 isEyeFollowingBlendshapesValid;
|
||||
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 XrFaceExpressionWeightsFB {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
uint32_t weightCount;
|
||||
float* weights;
|
||||
uint32_t confidenceCount;
|
||||
float* confidences;
|
||||
XrFaceExpressionStatusFB status;
|
||||
XrTime time;
|
||||
} XrFaceExpressionWeightsFB;
|
||||
|
||||
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
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrCreateFaceTrackerFB)(XrSession session, const XrFaceTrackerCreateInfoFB* createInfo, XrFaceTrackerFB* faceTracker);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrDestroyFaceTrackerFB)(XrFaceTrackerFB faceTracker);
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetFaceExpressionWeightsFB)(XrFaceTrackerFB faceTracker, const XrFaceExpressionInfoFB* expressionInfo, XrFaceExpressionWeightsFB* expressionWeights);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateFaceTrackerFB(
|
||||
XrSession session,
|
||||
const XrFaceTrackerCreateInfoFB* createInfo,
|
||||
XrFaceTrackerFB* faceTracker);
|
||||
|
||||
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);
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrDestroyFaceTrackerFB(
|
||||
XrFaceTrackerFB faceTracker);
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetFaceExpressionWeightsFB(
|
||||
XrFaceTrackerFB faceTracker,
|
||||
const XrFaceExpressionInfoFB* expressionInfo,
|
||||
XrFaceExpressionWeightsFB* expressionWeights);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
|
||||
#endif // XR_FB_face_tracking
|
||||
#endif /* XR_FB_face_tracking */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,20 +21,8 @@ extern "C" {
|
||||
#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
|
||||
|
||||
@@ -54,6 +42,7 @@ typedef struct XrHapticAmplitudeEnvelopeVibrationFB {
|
||||
|
||||
#endif // XR_FB_haptic_amplitude_envelope
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+9
-65
@@ -21,33 +21,26 @@ extern "C" {
|
||||
|
||||
#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);
|
||||
XR_STRUCT_ENUM(XR_TYPE_DEVICE_PCM_SAMPLE_RATE_STATE_FB, 1000209002);
|
||||
static const XrStructureType XR_TYPE_DEVICE_PCM_SAMPLE_RATE_GET_INFO_FB =
|
||||
(XrStructureType)XR_TYPE_DEVICE_PCM_SAMPLE_RATE_STATE_FB;
|
||||
/// Provided to xrGetDevicePCMSampleRateFB to retrieve the PCM sample rate
|
||||
/// of the last connected controller
|
||||
typedef struct XrDevicePcmSampleRateGetInfoFB {
|
||||
typedef struct XrDevicePcmSampleRateStateFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
void* XR_MAY_ALIAS next;
|
||||
/// value will be populated with a PCM haptic sample rate in Hz
|
||||
float sampleRate;
|
||||
} XrDevicePcmSampleRateGetInfoFB;
|
||||
} XrDevicePcmSampleRateStateFB;
|
||||
|
||||
typedef XrDevicePcmSampleRateStateFB XrDevicePcmSampleRateGetInfoFB;
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_HAPTIC_PCM_VIBRATION_FB, 1000209001);
|
||||
/// This struct provides a high fidelity control over the haptics effect
|
||||
@@ -91,58 +84,9 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetDeviceSampleRateFB(
|
||||
#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
|
||||
|
||||
+32
-5
@@ -22,13 +22,8 @@ extern "C" {
|
||||
#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;
|
||||
@@ -188,6 +183,38 @@ xrGetSpaceRoomLayoutFB(XrSession session, XrSpace space, XrRoomLayoutFB* roomLay
|
||||
#endif // !XR_NO_PROTOTYPES
|
||||
#endif // XR_FB_scene
|
||||
|
||||
// Planned additions for spec version 2
|
||||
#if XR_FB_scene_SPEC_VERSION == 1
|
||||
#undef XR_FB_scene_SPEC_VERSION
|
||||
#define XR_FB_scene_SPEC_VERSION 2
|
||||
|
||||
typedef XrFlags64 XrSemanticLabelsSupportFlagsFB;
|
||||
|
||||
// When this flag is set, the system may return multiple semantic labels separated by comma (,) in
|
||||
// XrSemanticLabelsFB. Otherwise, the system returns a single semantic label.
|
||||
static const XrSemanticLabelsSupportFlagsFB XR_SCENE_SUPPORT_MULTIPLE_SEMANTIC_LABELS_FB =
|
||||
0x00000001;
|
||||
|
||||
// Struct used to tell the system what semantic labels and format in the return are supported by the
|
||||
// caller. This struct may be provided as the next of XrSemanticLabelsFB. When the next of
|
||||
// XrSemanticLabelsFB is nullptr, the system assumes the behavior used in spec version 1, i.e.:
|
||||
// (1) None of the flags are set. Specifically, the system returns a single semantic label.
|
||||
// (2) recognizedLabels include a set of labels supported in spec version 1. Specifically, they are
|
||||
// "DESK,COUCH,FLOOR,CEILING,WALL_FACE,WINDOW_FRAME,DOOR_FRAME,OTHER".
|
||||
static const XrStructureType XR_TYPE_SEMANTIC_LABELS_SUPPORT_INFO_FB = (XrStructureType)1000175010;
|
||||
typedef struct XrSemanticLabelsSupportInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
|
||||
XrSemanticLabelsSupportFlagsFB flags;
|
||||
|
||||
// Set of semantic labels recognized by the caller. Each semantic label is separated by comma
|
||||
// (,). It must be a zero-terminated string.
|
||||
const char* recognizedLabels;
|
||||
} XrSemanticLabelsSupportInfoFB;
|
||||
|
||||
#endif // XR_FB_scene_SPEC_VERSION == 1
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -21,17 +21,9 @@ extern "C" {
|
||||
#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
|
||||
@@ -244,6 +236,15 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetSpaceComponentStatusFB(
|
||||
|
||||
#ifdef XR_FB_spatial_entity_EXPERIMENTAL_VERSION
|
||||
|
||||
#if XR_FB_spatial_entity_EXPERIMENTAL_VERSION == 2
|
||||
#undef XR_FB_spatial_entity_SPEC_VERSION
|
||||
#define XR_FB_spatial_entity_SPEC_VERSION XR_FBX2_spatial_entity_SPEC_VERSION
|
||||
#undef XR_FB_SPATIAL_ENTITY_EXTENSION_NAME
|
||||
#define XR_FB_SPATIAL_ENTITY_EXTENSION_NAME XR_FBX2_SPATIAL_ENTITY_EXTENSION_NAME
|
||||
#else
|
||||
#error "unknown experimental version for XR_FB_spatial_entity"
|
||||
#endif
|
||||
|
||||
|
||||
#if XR_FB_spatial_entity_EXPERIMENTAL_VERSION >= 2
|
||||
|
||||
|
||||
@@ -32,17 +32,9 @@ extern "C" {
|
||||
#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
|
||||
@@ -207,6 +199,15 @@ XRAPI_ATTR XrResult XRAPI_CALL xrRetrieveSpaceQueryResultsFB(
|
||||
|
||||
#ifdef XR_FB_spatial_entity_query_EXPERIMENTAL_VERSION
|
||||
|
||||
#if XR_FB_spatial_entity_query_EXPERIMENTAL_VERSION == 2
|
||||
#undef XR_FB_spatial_entity_query_SPEC_VERSION
|
||||
#define XR_FB_spatial_entity_query_SPEC_VERSION XR_FBX2_spatial_entity_query_SPEC_VERSION
|
||||
#undef XR_FB_SPATIAL_ENTITY_QUERY_EXTENSION_NAME
|
||||
#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
|
||||
|
||||
#if XR_FB_spatial_entity_query_EXPERIMENTAL_VERSION >= 2
|
||||
|
||||
static const XrStructureType XR_TYPE_SPATIAL_ENTITY_QUERY_INFO_ACTION_QUERY_FBX2 =
|
||||
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Filename : fb_spatial_entity_sharing.h
|
||||
Content : spatial entity interface.
|
||||
Language : C99
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
#include <openxr/fb_spatial_entity.h>
|
||||
#include <openxr/fb_spatial_entity_storage_batch.h>
|
||||
#include <openxr/fb_spatial_entity_user.h>
|
||||
|
||||
/*
|
||||
170 XR_FB_spatial_entity_sharing
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_spatial_entity_sharing
|
||||
#define XR_FB_spatial_entity_sharing 1
|
||||
|
||||
#ifndef XR_FB_spatial_entity
|
||||
#error "This extension depends on XR_FB_spatial_entity which has not been defined"
|
||||
#endif // XR_FB_spatial_entity
|
||||
|
||||
#ifndef XR_FB_spatial_entity_storage
|
||||
#error "This extension depends on XR_FB_spatial_entity_storage which has not been defined"
|
||||
#endif // XR_FB_spatial_entity_storage
|
||||
|
||||
// XR_FB_spatial_entity_storage_batch is only a dependency in Experimental Version 5.
|
||||
// In production Share has been properly decoupled from batch_storage, although the dependency on
|
||||
// storage remains due to this extending XrSpaceStorageLocationFB.
|
||||
#if defined(XR_FB_spatial_entity_sharing_EXPERIMENTAL_VERSION) && \
|
||||
XR_FB_spatial_entity_sharing_EXPERIMENTAL_VERSION == 5
|
||||
#ifndef XR_FB_spatial_entity_storage_batch
|
||||
#error "This extension depends on XR_FB_spatial_entity_storage_batch which has not been defined"
|
||||
#endif // XR_FB_spatial_entity_storage_batch
|
||||
#endif // XR_FB_spatial_entity_sharing_EXPERIMENTAL_VERSION == 5
|
||||
|
||||
#ifndef XR_FB_spatial_entity_sharing_EXPERIMENTAL_VERSION
|
||||
#ifndef XR_FB_spatial_entity_user
|
||||
#error "This extension depends on XR_FB_spatial_entity_user which has not been defined"
|
||||
#endif // XR_FB_spatial_entity
|
||||
#endif // XR_FB_spatial_entity_sharing_EXPERIMENTAL_VERSION
|
||||
|
||||
#ifndef XR_FB_spatial_entity_sharing_EXPERIMENTAL_VERSION
|
||||
#define XR_FB_spatial_entity_sharing_SPEC_VERSION 1
|
||||
#define XR_FB_SPATIAL_ENTITY_SHARING_EXTENSION_NAME "XR_FB_spatial_entity_sharing"
|
||||
#endif // !defined(XR_FB_spatial_entity_sharing_EXPERIMENTAL_VERSION)
|
||||
|
||||
static const XrSpaceComponentTypeFB XR_SPACE_COMPONENT_TYPE_SHARABLE_FB = (XrSpaceComponentTypeFB)2;
|
||||
static const XrSpaceStorageLocationFB XR_SPACE_STORAGE_LOCATION_CLOUD_FB =
|
||||
(XrSpaceStorageLocationFB)2;
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_SPACE_SHARE_INFO_FB, 1000169001);
|
||||
XR_STRUCT_ENUM(XR_TYPE_EVENT_DATA_SPACE_SHARE_COMPLETE_FB, 1000169002);
|
||||
|
||||
XR_RESULT_ENUM(XR_ERROR_SPACE_MAPPING_INSUFFICIENT_FB, -1000169000);
|
||||
XR_RESULT_ENUM(XR_ERROR_SPACE_LOCALIZATION_FAILED_FB, -1000169001);
|
||||
XR_RESULT_ENUM(XR_ERROR_SPACE_NETWORK_TIMEOUT_FB, -1000169002);
|
||||
XR_RESULT_ENUM(XR_ERROR_SPACE_NETWORK_REQUEST_FAILED_FB, -1000169003);
|
||||
|
||||
// This is defined here unless using experimental version 1 of
|
||||
// XR_FB_spatial_entity_storage_batch.
|
||||
#if !defined(XR_FB_spatial_entity_storage_batch_EXPERIMENTAL_VERSION) || \
|
||||
XR_FB_spatial_entity_storage_batch_EXPERIMENTAL_VERSION > 1
|
||||
XR_RESULT_ENUM(XR_ERROR_SPACE_CLOUD_STORAGE_DISABLED_FB, -1000169004);
|
||||
#endif
|
||||
|
||||
typedef struct XrSpaceShareInfoFB {
|
||||
XrStructureType type; // XR_TYPE_SPACE_SHARE_INFO_FB
|
||||
const void* XR_MAY_ALIAS next;
|
||||
uint32_t spaceCount;
|
||||
XrSpace* spaces;
|
||||
uint32_t userCount;
|
||||
XrSpaceUserFB* users;
|
||||
} XrSpaceShareInfoFB;
|
||||
|
||||
typedef struct XrEventDataSpaceShareCompleteFB {
|
||||
XrStructureType type; // XR_TYPE_EVENT_DATA_SPACE_SHARE_COMPLETE_FB
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrAsyncRequestIdFB requestId;
|
||||
XrResult result;
|
||||
} XrEventDataSpaceShareCompleteFB;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrShareSpacesFB)(
|
||||
XrSession session,
|
||||
const XrSpaceShareInfoFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
// xrShareSpacesFB triggers the share flow for an Anchor. This flow can
|
||||
// potentially take a long time to complete since explicit user action is required to
|
||||
// authorize the sharing action, and once authorized a request is sent to the cloud.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrShareSpacesFB(XrSession session, const XrSpaceShareInfoFB* info, XrAsyncRequestIdFB* requestId);
|
||||
|
||||
#endif // XR_EXTENSION_PROTOTYPES
|
||||
#endif // XR_NO_PROTOTYPES
|
||||
|
||||
#endif // XR_FB_spatial_entity_sharing
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -27,17 +27,9 @@ extern "C" {
|
||||
#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
|
||||
@@ -153,6 +145,15 @@ xrEraseSpaceFB(XrSession session, const XrSpaceEraseInfoFB* info, XrAsyncRequest
|
||||
|
||||
#ifdef XR_FB_spatial_entity_storage_EXPERIMENTAL_VERSION
|
||||
|
||||
#if XR_FB_spatial_entity_storage_EXPERIMENTAL_VERSION == 2
|
||||
#undef XR_FB_spatial_entity_storage_SPEC_VERSION
|
||||
#define XR_FB_spatial_entity_storage_SPEC_VERSION XR_FBX2_spatial_entity_storage_SPEC_VERSION
|
||||
#undef XR_FB_SPATIAL_ENTITY_STORAGE_EXTENSION_NAME
|
||||
#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
|
||||
|
||||
#if XR_FB_spatial_entity_storage_EXPERIMENTAL_VERSION >= 2
|
||||
|
||||
|
||||
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Filename : fb_spatial_entity_storage_batch.h
|
||||
Content : Spatial Entity batch storage interface.
|
||||
Language : C99
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
#include <openxr/fb_spatial_entity.h>
|
||||
#include <openxr/fb_spatial_entity_storage.h>
|
||||
|
||||
/*
|
||||
239 XR_FB_spatial_entity_storage_batch
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_spatial_entity_storage_batch
|
||||
#define XR_FB_spatial_entity_storage_batch 1
|
||||
|
||||
#ifndef XR_FB_spatial_entity
|
||||
#error "This extension depends on XR_FB_spatial_entity which has not been defined"
|
||||
#endif // XR_FB_spatial_entity
|
||||
|
||||
#ifndef XR_FB_spatial_entity_storage
|
||||
#error "This extension depends on XR_FB_spatial_entity_storage which has not been defined"
|
||||
#endif // XR_FB_spatial_entity_storage
|
||||
|
||||
#ifndef XR_FB_spatial_entity_storage_batch_EXPERIMENTAL_VERSION
|
||||
#define XR_FB_spatial_entity_storage_batch_SPEC_VERSION 1
|
||||
#define XR_FB_SPATIAL_ENTITY_STORAGE_BATCH_EXTENSION_NAME "XR_FB_spatial_entity_storage_batch"
|
||||
#endif // !XR_FB_spatial_entity_storage_batch_EXPERIMENTAL_VERSION
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_SPACE_LIST_SAVE_INFO_FB, 1000238000);
|
||||
XR_STRUCT_ENUM(XR_TYPE_EVENT_DATA_SPACE_LIST_SAVE_COMPLETE_FB, 1000238001);
|
||||
|
||||
typedef struct XrSpaceListSaveInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
uint32_t spaceCount;
|
||||
XrSpace* spaces;
|
||||
XrSpaceStorageLocationFB location;
|
||||
} XrSpaceListSaveInfoFB;
|
||||
|
||||
typedef struct XrEventDataSpaceListSaveCompleteFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrAsyncRequestIdFB requestId;
|
||||
XrResult result;
|
||||
} XrEventDataSpaceListSaveCompleteFB;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrSaveSpaceListFB)(
|
||||
XrSession session,
|
||||
const XrSpaceListSaveInfoFB* info,
|
||||
XrAsyncRequestIdFB* requestId);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrSaveSpaceListFB(
|
||||
XrSession session,
|
||||
const XrSpaceListSaveInfoFB* info,
|
||||
XrAsyncRequestIdFB* request);
|
||||
|
||||
#endif // XR_EXTENSION_PROTOTYPES
|
||||
#endif // XR_NO_PROTOTYPES
|
||||
#endif // XR_FB_spatial_entity_storage_batch
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Filename : fb_spatial_entity_user.h
|
||||
Content : spatial entity interface.
|
||||
Language : C99
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
#include <openxr/fb_spatial_entity.h>
|
||||
|
||||
/*
|
||||
242 XR_FB_spatial_entity_user
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_spatial_entity_user
|
||||
#define XR_FB_spatial_entity_user 1
|
||||
|
||||
#define XR_FB_spatial_entity_user_SPEC_VERSION 1
|
||||
#define XR_FB_SPATIAL_ENTITY_USER_EXTENSION_NAME "XR_FB_spatial_entity_user"
|
||||
|
||||
XR_DEFINE_HANDLE(XrSpaceUserFB);
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_SPACE_USER_CREATE_INFO_FB, 1000241001);
|
||||
|
||||
typedef uint64_t XrSpaceUserIdFB;
|
||||
typedef struct XrSpaceUserCreateInfoFB {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrSpaceUserIdFB userId;
|
||||
} XrSpaceUserCreateInfoFB;
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrCreateSpaceUserFB)(
|
||||
XrSession session,
|
||||
const XrSpaceUserCreateInfoFB* info,
|
||||
XrSpaceUserFB* user);
|
||||
|
||||
typedef XrResult(
|
||||
XRAPI_PTR* PFN_xrGetSpaceUserIdFB)(const XrSpaceUserFB user, XrSpaceUserIdFB* userId);
|
||||
|
||||
typedef XrResult(XRAPI_PTR* PFN_xrDestroySpaceUserFB)(const XrSpaceUserFB user);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
|
||||
// xrCreateSpaceUserFB creates a XrSpaceUserFB handle with the specified information.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrCreateSpaceUserFB(XrSession session, const XrSpaceUserCreateInfoFB* info, XrSpaceUserFB* user);
|
||||
|
||||
// xrGetSpaceUserIdFB retrieves the userId corresponding to the given XrSpaceUserFB handle.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL
|
||||
xrGetSpaceUserIdFB(const XrSpaceUserFB user, XrSpaceUserIdFB* userId);
|
||||
|
||||
// XrSpaceUserFB handles are destroyed using xrDestroySpaceUserFB.
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrDestroySpaceUserFB(const XrSpaceUserFB user);
|
||||
|
||||
#endif // XR_EXTENSION_PROTOTYPES
|
||||
#endif // XR_NO_PROTOTYPES
|
||||
|
||||
#endif // XR_FB_spatial_entity_user
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+29
-21
@@ -21,28 +21,8 @@ extern "C" {
|
||||
#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
|
||||
@@ -96,6 +76,34 @@ extern "C" {
|
||||
// …/output/trigger_haptic_fb
|
||||
// …/output/thumb_haptic_fb
|
||||
|
||||
#endif // XR_FB_touch_controller_pro
|
||||
|
||||
#ifndef XR_FBX_touch_controller_pro
|
||||
#define XR_FBX_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"
|
||||
|
||||
#ifdef XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION
|
||||
#undef XR_FB_touch_controller_pro_SPEC_VERSION
|
||||
#undef XR_FB_TOUCH_CONTROLLER_PRO_EXTENSION_NAME
|
||||
#if 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
|
||||
#endif
|
||||
|
||||
#ifdef XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION
|
||||
#if XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION == 3
|
||||
// X3 adds Pinch API support
|
||||
@@ -304,7 +312,7 @@ typedef struct XrTouchControllerProPropertiesFB {
|
||||
|
||||
#endif // defined(XR_FB_touch_controller_pro_EXPERIMENTAL_VERSION)
|
||||
|
||||
#endif // XR_FB_touch_controller_pro
|
||||
#endif // XR_FBX_touch_controller_pro
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+8
-14
@@ -1,8 +1,8 @@
|
||||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
|
||||
/************************************************************************************
|
||||
Filename : fb_touch_controller_extras.h
|
||||
Content : Touch Controller Extras interaction profile extensions.
|
||||
Filename : fb_touch_controller_proximity.h
|
||||
Content : Touch Controller Proximity interaction profile extension.
|
||||
Language : C99
|
||||
*************************************************************************************/
|
||||
|
||||
@@ -11,23 +11,18 @@ Language : C99
|
||||
#include <openxr/openxr_extension_helpers.h>
|
||||
|
||||
/*
|
||||
207 XR_FB_touch_controller_extras
|
||||
207 XR_FB_touch_controller_proximity
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XR_FB_touch_controller_extras
|
||||
#ifndef XR_FB_touch_controller_proximity
|
||||
|
||||
#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"
|
||||
#define XR_FB_touch_controller_proximity 1
|
||||
#define XR_FB_touch_controller_proximity_SPEC_VERSION 1
|
||||
#define XR_FB_TOUCH_CONTROLLER_PROXIMITY_EXTENSION_NAME "XR_FB_touch_controller_proximity"
|
||||
|
||||
// Oculus Touch Controller Profile with additional paths
|
||||
// Path: /interaction_profiles/oculus/touch_controller
|
||||
@@ -75,9 +70,8 @@ extern "C" {
|
||||
// …/input/trigger/proximity_fb
|
||||
// …/input/thumb_fb/proximity_fb
|
||||
|
||||
#endif // defined(XR_FB_touch_controller_extras_EXPERIMENTAL_VERSION)
|
||||
#endif // ifndef XR_FB_touch_controller_proximity
|
||||
|
||||
#endif // XR_FB_touch_controller_extras
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -21,7 +21,6 @@ extern "C" {
|
||||
|
||||
#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
|
||||
|
||||
@@ -19,7 +19,6 @@ Language : C99
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef XR_META_local_dimming
|
||||
#define XR_META_local_dimming 1
|
||||
#define XR_META_local_dimming_SPEC_VERSION 1
|
||||
@@ -31,7 +30,8 @@ typedef enum XrLocalDimmingModeMETA {
|
||||
XR_LOCAL_DIMMING_MODE_MAX_ENUM_META = 0x7FFFFFFF
|
||||
} XrLocalDimmingModeMETA;
|
||||
|
||||
XR_STRUCT_ENUM(XR_TYPE_FRAME_END_INFO_LOCAL_DIMMING_META, 1000216000);
|
||||
XR_STRUCT_ENUM(XR_TYPE_FRAME_END_INFO_LOCAL_DIMMING_META, 1000216000); // legacy enum name
|
||||
XR_STRUCT_ENUM(XR_TYPE_LOCAL_DIMMING_FRAME_END_INFO_META, 1000216000);
|
||||
struct XrLocalDimmingFrameEndInfoMETA {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
@@ -40,6 +40,7 @@ struct XrLocalDimmingFrameEndInfoMETA {
|
||||
|
||||
#endif // XR_META_local_dimming
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
#ifndef META_RECOMMENDED_LAYER_RESOLUTION_H_
|
||||
#define META_RECOMMENDED_LAYER_RESOLUTION_H_ 1
|
||||
|
||||
/**********************
|
||||
This file is @generated from the OpenXR XML API registry.
|
||||
Language : C99
|
||||
Copyright : (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
|
||||
***********************/
|
||||
|
||||
#include <openxr/openxr.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef XR_META_recommended_layer_resolution
|
||||
|
||||
#define XR_META_recommended_layer_resolution 1
|
||||
#define XR_META_recommended_layer_resolution_SPEC_VERSION 1
|
||||
#define XR_META_RECOMMENDED_LAYER_RESOLUTION_EXTENSION_NAME "XR_META_recommended_layer_resolution"
|
||||
#define XR_TYPE_RECOMMENDED_LAYER_RESOLUTION_META ((XrStructureType) 1000254000U)
|
||||
#define XR_TYPE_RECOMMENDED_LAYER_RESOLUTION_GET_INFO_META ((XrStructureType) 1000254001U)
|
||||
typedef struct XrRecommendedLayerResolutionMETA {
|
||||
XrStructureType type;
|
||||
void* XR_MAY_ALIAS next;
|
||||
XrExtent2Di recommendedImageDimensions;
|
||||
XrBool32 isValid;
|
||||
} XrRecommendedLayerResolutionMETA;
|
||||
|
||||
typedef struct XrRecommendedLayerResolutionGetInfoMETA {
|
||||
XrStructureType type;
|
||||
const void* XR_MAY_ALIAS next;
|
||||
XrCompositionLayerBaseHeader* layer;
|
||||
XrTime predictedDisplayTime;
|
||||
} XrRecommendedLayerResolutionGetInfoMETA;
|
||||
|
||||
typedef XrResult (XRAPI_PTR *PFN_xrGetRecommendedLayerResolutionMETA)(XrSession session, const XrRecommendedLayerResolutionGetInfoMETA* layerResolutionRecommendationGetInfo, XrRecommendedLayerResolutionMETA* layerResolutionRecommendation);
|
||||
|
||||
#ifndef XR_NO_PROTOTYPES
|
||||
#ifdef XR_EXTENSION_PROTOTYPES
|
||||
XRAPI_ATTR XrResult XRAPI_CALL xrGetRecommendedLayerResolutionMETA(
|
||||
XrSession session,
|
||||
const XrRecommendedLayerResolutionGetInfoMETA* layerResolutionRecommendationGetInfo,
|
||||
XrRecommendedLayerResolutionMETA* layerResolutionRecommendation);
|
||||
#endif /* XR_EXTENSION_PROTOTYPES */
|
||||
#endif /* !XR_NO_PROTOTYPES */
|
||||
#endif /* XR_META_recommended_layer_resolution */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+14
-305
@@ -12,16 +12,10 @@ Language : C99
|
||||
#define OPENXR_OCULUS_HELPERS_H 1
|
||||
|
||||
#include <openxr/openxr.h>
|
||||
#include <xr_linear.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);
|
||||
@@ -31,10 +25,6 @@ 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;
|
||||
@@ -49,28 +39,12 @@ static inline XrVector3f XrVector3f_ScalarMultiply(const XrVector3f v, float sca
|
||||
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));
|
||||
return XrVector3f_Dot(&v, &v);
|
||||
}
|
||||
|
||||
static inline XrVector3f XrVector3f_Normalized(const XrVector3f v) {
|
||||
float rcpLen = 1.0f / XrVector3f_Length(v);
|
||||
float rcpLen = 1.0f / XrVector3f_Length(&v);
|
||||
return XrVector3f_ScalarMultiply(v, rcpLen);
|
||||
}
|
||||
|
||||
@@ -108,21 +82,14 @@ static inline XrQuaternionf XrQuaternionf_Inverse(const XrQuaternionf q) {
|
||||
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 aq;
|
||||
XrQuaternionf_Multiply(&aq, &q, &a);
|
||||
XrQuaternionf aInv = XrQuaternionf_Inverse(a);
|
||||
XrQuaternionf aqaInv = XrQuaternionf_Multiply(aq, aInv);
|
||||
XrQuaternionf aqaInv;
|
||||
XrQuaternionf_Multiply(&aqaInv, &aInv, &aq);
|
||||
r.x = aqaInv.x;
|
||||
r.y = aqaInv.y;
|
||||
r.z = aqaInv.z;
|
||||
@@ -130,7 +97,7 @@ static inline XrVector3f XrQuaternionf_Rotate(const XrQuaternionf a, const XrVec
|
||||
}
|
||||
|
||||
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);
|
||||
float 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;
|
||||
}
|
||||
@@ -159,12 +126,14 @@ static inline XrPosef XrPosef_Create(const XrQuaternionf orientation, const XrVe
|
||||
|
||||
static inline XrVector3f XrPosef_Transform(const XrPosef a, const XrVector3f v) {
|
||||
XrVector3f r0 = XrQuaternionf_Rotate(a.orientation, v);
|
||||
return XrVector3f_Add(r0, a.position);
|
||||
XrVector3f result;
|
||||
XrVector3f_Add(&result, &r0, &a.position);
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline XrPosef XrPosef_Multiply(const XrPosef a, const XrPosef b) {
|
||||
XrPosef c;
|
||||
c.orientation = XrQuaternionf_Multiply(a.orientation, b.orientation);
|
||||
XrQuaternionf_Multiply(&c.orientation, &b.orientation, &a.orientation);
|
||||
c.position = XrPosef_Transform(a, b.position);
|
||||
return c;
|
||||
}
|
||||
@@ -176,176 +145,6 @@ static inline XrPosef XrPosef_Inverse(const XrPosef a) {
|
||||
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);
|
||||
@@ -358,99 +157,9 @@ static inline XrMatrix4x4f XrMatrix4x4f_CreateFromRigidTransform(const XrPosef*
|
||||
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(
|
||||
// If -Z=forward, +Y=up, +X=right, then radiansX=pitch, radiansY=yaw, radiansZ=roll.
|
||||
static inline void XrMatrix4x4f_CreateRotationRadians(
|
||||
XrMatrix4x4f* result,
|
||||
const float radiansX,
|
||||
const float radiansY,
|
||||
|
||||
Reference in New Issue
Block a user