summaryrefslogtreecommitdiffstats
path: root/modules/openxr/openxr_util.h
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2023-07-12 17:15:25 +0200
committerYuri Sizov <yuris@humnom.net>2023-07-12 17:15:25 +0200
commit661c3954a6f76aa58ecce5dc2e0e476a7c8ec6b1 (patch)
tree7164b32813df5c6455ffd267f4b3f8a8b0bca862 /modules/openxr/openxr_util.h
parentf25233cbc9386d35baa4c5a9aa8bbe998c999440 (diff)
parent34a07b81ae640dc877a47091ca9a63d1a2cba07b (diff)
downloadredot-engine-661c3954a6f76aa58ecce5dc2e0e476a7c8ec6b1.tar.gz
Merge pull request #73443 from akien-mga/unbundle-openxr
Allow unbundling OpenXR (for Linux distros)
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