summaryrefslogtreecommitdiffstats
path: root/modules/openxr/openxr_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/openxr/openxr_util.h')
-rw-r--r--modules/openxr/openxr_util.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/openxr/openxr_util.h b/modules/openxr/openxr_util.h
index 8ad68c0b02..3f36ab9fca 100644
--- a/modules/openxr/openxr_util.h
+++ b/modules/openxr/openxr_util.h
@@ -44,6 +44,27 @@ public:
static String get_action_type_name(XrActionType p_action_type);
static String get_environment_blend_mode_name(XrEnvironmentBlendMode p_blend_mode);
static String make_xr_version_string(XrVersion p_version);
+
+ // Copied from OpenXR xr_linear.h private header, so we can still link against
+ // system-provided packages without relying on our `thirdparty` code.
+
+ // Column-major, pre-multiplied. This type does not exist in the OpenXR API and is provided for convenience.
+ typedef struct XrMatrix4x4f {
+ float m[16];
+ } XrMatrix4x4f;
+
+ typedef enum GraphicsAPI {
+ GRAPHICS_VULKAN,
+ GRAPHICS_OPENGL,
+ GRAPHICS_OPENGL_ES,
+ GRAPHICS_D3D
+ } GraphicsAPI;
+
+ static 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);
+ static void XrMatrix4x4f_CreateProjectionFov(XrMatrix4x4f *result, GraphicsAPI graphicsApi, const XrFovf fov,
+ const float nearZ, const float farZ);
};
#endif // OPENXR_UTIL_H