From 86ff7f8550703d8636828d7d204e1c8aeeb94432 Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Mon, 23 Aug 2021 15:23:16 +1000 Subject: Adding GDExtension support to XRInterface --- doc/classes/XRInterface.xml | 33 ++++----- doc/classes/XRInterfaceExtension.xml | 126 +++++++++++++++++++++++++++++++++++ doc/classes/XRServer.xml | 7 -- 3 files changed, 144 insertions(+), 22 deletions(-) create mode 100644 doc/classes/XRInterfaceExtension.xml (limited to 'doc') diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml index 1fb73e59b4..2a740ab1e8 100644 --- a/doc/classes/XRInterface.xml +++ b/doc/classes/XRInterface.xml @@ -1,7 +1,7 @@ - Base class for an AR/VR interface implementation. + Base class for an XR interface implementation. This class needs to be implemented to make an AR or VR platform available to Godot and these should be implemented as C++ modules or GDNative modules (note that for GDNative the subclass XRScriptInterface should be used). Part of the interface is exposed to GDScript so you can detect, enable and configure an AR or VR platform. @@ -26,17 +26,17 @@ - Returns the name of this interface (OpenVR, OpenHMD, ARKit, etc). + Returns the name of this interface (OpenXR, OpenVR, OpenHMD, ARKit, etc). - + Returns the resolution at which we should render our intermediate results before things like lens distortion are applied by the VR platform. - + If supported, returns the status of our tracking. This will allow you to provide feedback to the user whether there are issues with positional tracking. @@ -52,11 +52,17 @@ Call this to initialize this interface. The first interface that is initialized is identified as the primary interface and it will be used for rendering output. After initializing the interface you want to use you then need to enable the AR/VR mode of a viewport and rendering should commence. - [b]Note:[/b] You must enable the AR/VR mode on the main viewport for any device that uses the main output of Godot, such as for mobile VR. + [b]Note:[/b] You must enable the XR mode on the main viewport for any device that uses the main output of Godot, such as for mobile VR. If you do this for a platform that handles its own output (such as OpenVR) Godot will show just one eye without distortion on screen. Alternatively, you can add a separate viewport node to your scene and enable AR/VR on that viewport. It will be used to output to the HMD, leaving you free to do anything you like in the main window, such as using a separate camera as a spectator camera or rendering something completely different. While currently not used, you can activate additional interfaces. You may wish to do this if you want to track controllers from other platforms. However, at this point in time only one interface can render to an HMD. + + + + Is [code]true[/code] if this interface has been initialised. + + @@ -68,10 +74,7 @@ On an AR interface, [code]true[/code] if anchor detection is enabled. - - [code]true[/code] if this interface been initialized. - - + [code]true[/code] if this is the primary interface. @@ -89,7 +92,7 @@ This interface supports AR (video background and real world tracking). - This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of [method get_render_targetsize]). Using a separate viewport node frees up the main viewport for other purposes. + This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of [method get_render_target_size]). Using a separate viewport node frees up the main viewport for other purposes. Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported. @@ -100,19 +103,19 @@ Right eye output, this is mostly used internally when rendering the image for the right eye and obtaining positioning and projection information. - + Tracking is behaving as expected. - + Tracking is hindered by excessive motion (the player is moving faster than tracking can keep up). - + Tracking is hindered by insufficient features, it's too dark (for camera-based tracking), player is blocked, etc. - + We don't know the status of the tracking or this interface does not provide feedback. - + Tracking is not functional (camera not plugged in or obscured, lighthouses turned off, etc.). diff --git a/doc/classes/XRInterfaceExtension.xml b/doc/classes/XRInterfaceExtension.xml new file mode 100644 index 0000000000..46d8d7e4e8 --- /dev/null +++ b/doc/classes/XRInterfaceExtension.xml @@ -0,0 +1,126 @@ + + + + Base class for XR interface extensions (plugins). + + + External XR interface plugins should inherit from this class. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Blits our render results to screen optionally applying lens distortion. This can only be called while processing [code]_commit_views[/code]. + + + + + + diff --git a/doc/classes/XRServer.xml b/doc/classes/XRServer.xml index 5dd9b75ad2..85170804cc 100644 --- a/doc/classes/XRServer.xml +++ b/doc/classes/XRServer.xml @@ -37,13 +37,6 @@ You should call this method after a few seconds have passed. For instance, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism. - - - - - Clears our current primary interface if it is set to the provided interface. - - -- cgit v1.2.3