1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-26 15:46:23 +00:00

OpenXR: Support composition layers based on Android surfaces

This commit is contained in:
David Snopek
2024-08-26 17:02:28 -05:00
parent 97ef3c8372
commit 3afa26834a
11 changed files with 462 additions and 154 deletions

View File

@@ -38,21 +38,8 @@
#include "scene/main/viewport.h"
#include "scene/resources/mesh.h"
OpenXRCompositionLayerEquirect::OpenXRCompositionLayerEquirect() {
composition_layer = {
XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR, // type
nullptr, // next
0, // layerFlags
XR_NULL_HANDLE, // space
XR_EYE_VISIBILITY_BOTH, // eyeVisibility
{}, // subImage
{ { 0, 0, 0, 0 }, { 0, 0, 0 } }, // pose
radius, // radius
central_horizontal_angle, // centralHorizontalAngle
upper_vertical_angle, // upperVerticalAngle
-lower_vertical_angle, // lowerVerticalAngle
};
openxr_layer_provider = memnew(OpenXRViewportCompositionLayerProvider((XrCompositionLayerBaseHeader *)&composition_layer));
OpenXRCompositionLayerEquirect::OpenXRCompositionLayerEquirect() :
OpenXRCompositionLayer((XrCompositionLayerBaseHeader *)&composition_layer) {
XRServer::get_singleton()->connect("reference_frame_changed", callable_mp(this, &OpenXRCompositionLayerEquirect::update_transform));
}