Inheritance #

RefCounted

- AESContext
- AStar2D
- AStar3D
- AStarGrid2D
- AudioEffectInstance (1)
- AudioSample
- AudioSamplePlayback
- AudioStreamPlayback (5)
- CameraFeed
- CharFXTransform
- ConfigFile
- Crypto
- DTLSServer
- DirAccess
- ENetConnection
- EditorContextMenuPlugin
- EditorDebuggerPlugin
- EditorDebuggerSession
- EditorExportPlatform (6)
- EditorExportPlugin
- EditorExportPreset
- EditorFeatureProfile
- EditorFileSystemImportFormatSupportQuery
- EditorInspectorPlugin
- EditorResourceConversionPlugin
- EditorResourcePreviewGenerator
- EditorResourceTooltipPlugin
- EditorSceneFormatImporter (4)
- EditorScenePostImport
- EditorScenePostImportPlugin
- EditorScript
- EditorTranslationParserPlugin
- EncodedObjectAsID
- EngineProfiler
- Expression
- FileAccess
- GLTFObjectModelProperty
- HMACContext
- HTTPClient
- HashingContext
- ImageFormatLoader (1)
- JavaClass
- JavaObject
- JavaScriptObject
- KinematicCollision2D
- KinematicCollision3D
- Lightmapper (1)
- MeshConvexDecompositionSettings
- MeshDataTool
- MultiplayerAPI (2)
- Mutex
- NavigationPathQueryParameters2D
- NavigationPathQueryParameters3D
- NavigationPathQueryResult2D
- NavigationPathQueryResult3D
- Node3DGizmo (1)
- OggPacketSequencePlayback
- OpenXRAPIExtension
- PCKPacker
- PackedDataContainerRef
- PacketPeer (8)
- PhysicsPointQueryParameters2D
- PhysicsPointQueryParameters3D
- PhysicsRayQueryParameters2D
- PhysicsRayQueryParameters3D
- PhysicsShapeQueryParameters2D
- PhysicsShapeQueryParameters3D
- PhysicsTestMotionParameters2D
- PhysicsTestMotionParameters3D
- PhysicsTestMotionResult2D
- PhysicsTestMotionResult3D
- RDAttachmentFormat
- RDFramebufferPass
- RDPipelineColorBlendState
- RDPipelineColorBlendStateAttachment
- RDPipelineDepthStencilState
- RDPipelineMultisampleState
- RDPipelineRasterizationState
- RDPipelineSpecializationConstant
- RDSamplerState
- RDShaderSource
- RDTextureFormat
- RDTextureView
- RDUniform
- RDVertexAttribute
- RandomNumberGenerator
- RegEx
- RegExMatch
- RenderSceneBuffers (2)
- RenderSceneBuffersConfiguration
- Resource (103)
- ResourceFormatLoader
- ResourceFormatSaver
- ResourceImporter (16)
- SceneState
- SceneTreeTimer
- Semaphore
- SkinReference
- StreamPeer (5)
- SurfaceTool
- TCPServer
- TLSOptions
- TextLine
- TextParagraph
- TextServer (1)
- Thread
- TranslationDomain
- TriangleMesh
- Tween
- Tweener (5)
- UDPServer
- UPNP
- UPNPDevice
- WeakRef
- WebRTCPeerConnection (1)
- XMLParser
- XRInterface (4)
- XRPose
- XRTracker (2)
- ZIPPacker
- ZIPReader
OpenXRInterface
Table of contents

OpenXRInterface #

is_refcounted, is_instantiable, core, not_builtin_classes

Our OpenXR interface.

The OpenXR interface allows Godot to interact with OpenXR runtimes and make it possible to create XR experiences and games.

Due to the needs of OpenXR this interface works slightly different than other plugin based XR interfaces. It needs to be initialized when Godot starts. You need to enable OpenXR, settings for this can be found in your games project settings under the XR heading. You do need to mark a viewport for use with XR in order for Godot to know which render result should be output to the headset.

Members #

var display_refresh_rate: float = 0.0#

The display refresh rate for the current HMD. Only functional if this feature is supported by the OpenXR runtime and after the interface has been initialized.

var foveation_dynamic: bool = false#

Enable dynamic foveation adjustment, the interface must be initialized before this is accessible. If enabled foveation will automatically adjusted between low and foveation_level.

Note: Only works on compatibility renderer.

var foveation_level: int = 0#

Set foveation level from 0 (off) to 3 (high), the interface must be initialized before this is accessible.

Note: Only works on compatibility renderer.

var render_target_size_multiplier: float = 1.0#

The render size multiplier for the current HMD. Must be set before the interface has been initialized.

var vrs_min_radius: float = 20.0#

The minimum radius around the focal point where full quality is guaranteed if VRS is used as a percentage of screen size.

Note: Mobile and Forward+ renderers only. Requires Viewport.vrs_mode to be set to Viewport.VRS_XR.

var vrs_strength: float = 1.0#

The strength used to calculate the VRS density map. The greater this value, the more noticeable VRS is. This improves performance at the cost of quality.

Note: Mobile and Forward+ renderers only. Requires Viewport.vrs_mode to be set to Viewport.VRS_XR.

Methods #

const func get_action_sets() -> Array#

Returns a list of action sets registered with Godot (loaded from the action map at runtime).

const func get_available_display_refresh_rates() -> Array#

Returns display refresh rates supported by the current HMD. Only returned if this feature is supported by the OpenXR runtime and after the interface has been initialized.

const func get_hand_joint_angular_velocity(joint: int enumOpenXRInterface.HandJoints) -> Vector3#

If handtracking is enabled, returns the angular velocity of a joint (joint) of a hand (hand) as provided by OpenXR. This is relative to XROrigin3D!

const func get_hand_joint_flags(joint: int enumOpenXRInterface.HandJoints) -> intOpenXRInterface.HandJointFlags#

If handtracking is enabled, returns flags that inform us of the validity of the tracking data.

const func get_hand_joint_linear_velocity(joint: int enumOpenXRInterface.HandJoints) -> Vector3#

If handtracking is enabled, returns the linear velocity of a joint (joint) of a hand (hand) as provided by OpenXR. This is relative to XROrigin3D without worldscale applied!

const func get_hand_joint_position(joint: int enumOpenXRInterface.HandJoints) -> Vector3#

If handtracking is enabled, returns the position of a joint (joint) of a hand (hand) as provided by OpenXR. This is relative to XROrigin3D without worldscale applied!

const func get_hand_joint_radius(joint: int enumOpenXRInterface.HandJoints) -> float#

If handtracking is enabled, returns the radius of a joint (joint) of a hand (hand) as provided by OpenXR. This is without worldscale applied!

const func get_hand_joint_rotation(joint: int enumOpenXRInterface.HandJoints) -> Quaternion#

If handtracking is enabled, returns the rotation of a joint (joint) of a hand (hand) as provided by OpenXR.

const func get_hand_tracking_source(hand: int enumOpenXRInterface.Hand) -> intOpenXRInterface.HandTrackedSource#

If handtracking is enabled and hand tracking source is supported, gets the source of the hand tracking data for hand.

const func get_motion_range(hand: int enumOpenXRInterface.Hand) -> intOpenXRInterface.HandMotionRange#

If handtracking is enabled and motion range is supported, gets the currently configured motion range for hand.

const func is_action_set_active(name: String) -> bool#

Returns true if the given action set is active.

func is_eye_gaze_interaction_supported() -> bool#

Returns the capabilities of the eye gaze interaction extension.

Note: This only returns a valid value after OpenXR has been initialized.

const func is_foveation_supported() -> bool#

Returns true if OpenXR's foveation extension is supported, the interface must be initialized before this returns a valid value.

Note: This feature is only available on the compatibility renderer and currently only available on some stand alone headsets. For Vulkan set Viewport.vrs_mode to VRS_XR on desktop.

const func is_hand_interaction_supported() -> bool#

Returns true if OpenXR's hand interaction profile is supported and enabled.

Note: This only returns a valid value after OpenXR has been initialized.

func is_hand_tracking_supported() -> bool#

Returns true if OpenXR's hand tracking is supported and enabled.

Note: This only returns a valid value after OpenXR has been initialized.

func set_action_set_active(active: bool) -> void#

Sets the given action set as active or inactive.

func set_motion_range(motion_range: int enumOpenXRInterface.HandMotionRange) -> void#

If handtracking is enabled and motion range is supported, sets the currently configured motion range for hand to motion_range.

Annotations #

Constants #

const HAND_LEFT = 0 enum Hand#

Left hand.

const HAND_RIGHT = 1 enum Hand#

Right hand.

const HAND_MAX = 2 enum Hand#

Maximum value for the hand enum.

const HAND_MOTION_RANGE_UNOBSTRUCTED = 0 enum HandMotionRange#

Full hand range, if user closes their hands, we make a full fist.

const HAND_MOTION_RANGE_CONFORM_TO_CONTROLLER = 1 enum HandMotionRange#

Conform to controller, if user closes their hands, the tracked data conforms to the shape of the controller.

const HAND_MOTION_RANGE_MAX = 2 enum HandMotionRange#

Maximum value for the motion range enum.

const HAND_TRACKED_SOURCE_UNKNOWN = 0 enum HandTrackedSource#

The source of hand tracking data is unknown (the extension is likely unsupported).

const HAND_TRACKED_SOURCE_UNOBSTRUCTED = 1 enum HandTrackedSource#

The source of hand tracking is unobstructed, this means that an accurate method of hand tracking is used, e.g. optical hand tracking, data gloves, etc.

const HAND_TRACKED_SOURCE_CONTROLLER = 2 enum HandTrackedSource#

The source of hand tracking is a controller, bone positions are inferred from controller inputs.

const HAND_TRACKED_SOURCE_MAX = 3 enum HandTrackedSource#

Maximum value for the hand tracked source enum.

const HAND_JOINT_PALM = 0 enum HandJoints#

Palm joint.

const HAND_JOINT_WRIST = 1 enum HandJoints#

Wrist joint.

const HAND_JOINT_THUMB_METACARPAL = 2 enum HandJoints#

Thumb metacarpal joint.

const HAND_JOINT_THUMB_PROXIMAL = 3 enum HandJoints#

Thumb proximal joint.

const HAND_JOINT_THUMB_DISTAL = 4 enum HandJoints#

Thumb distal joint.

const HAND_JOINT_THUMB_TIP = 5 enum HandJoints#

Thumb tip joint.

const HAND_JOINT_INDEX_METACARPAL = 6 enum HandJoints#

Index metacarpal joint.

const HAND_JOINT_INDEX_PROXIMAL = 7 enum HandJoints#

Index proximal joint.

const HAND_JOINT_INDEX_INTERMEDIATE = 8 enum HandJoints#

Index intermediate joint.

const HAND_JOINT_INDEX_DISTAL = 9 enum HandJoints#

Index distal joint.

const HAND_JOINT_INDEX_TIP = 10 enum HandJoints#

Index tip joint.

const HAND_JOINT_MIDDLE_METACARPAL = 11 enum HandJoints#

Middle metacarpal joint.

const HAND_JOINT_MIDDLE_PROXIMAL = 12 enum HandJoints#

Middle proximal joint.

const HAND_JOINT_MIDDLE_INTERMEDIATE = 13 enum HandJoints#

Middle intermediate joint.

const HAND_JOINT_MIDDLE_DISTAL = 14 enum HandJoints#

Middle distal joint.

const HAND_JOINT_MIDDLE_TIP = 15 enum HandJoints#

Middle tip joint.

const HAND_JOINT_RING_METACARPAL = 16 enum HandJoints#

Ring metacarpal joint.

const HAND_JOINT_RING_PROXIMAL = 17 enum HandJoints#

Ring proximal joint.

const HAND_JOINT_RING_INTERMEDIATE = 18 enum HandJoints#

Ring intermediate joint.

const HAND_JOINT_RING_DISTAL = 19 enum HandJoints#

Ring distal joint.

const HAND_JOINT_RING_TIP = 20 enum HandJoints#

Ring tip joint.

const HAND_JOINT_LITTLE_METACARPAL = 21 enum HandJoints#

Little metacarpal joint.

const HAND_JOINT_LITTLE_PROXIMAL = 22 enum HandJoints#

Little proximal joint.

const HAND_JOINT_LITTLE_INTERMEDIATE = 23 enum HandJoints#

Little intermediate joint.

const HAND_JOINT_LITTLE_DISTAL = 24 enum HandJoints#

Little distal joint.

const HAND_JOINT_LITTLE_TIP = 25 enum HandJoints#

Little tip joint.

const HAND_JOINT_MAX = 26 enum HandJoints#

Maximum value for the hand joint enum.

const HAND_JOINT_NONE = 0 enum HandJointFlags
Bitfield
#

No flags are set.

const HAND_JOINT_ORIENTATION_VALID = 1 enum HandJointFlags
Bitfield
#

If set, the orientation data is valid, otherwise, the orientation data is unreliable and should not be used.

const HAND_JOINT_ORIENTATION_TRACKED = 2 enum HandJointFlags
Bitfield
#

If set, the orientation data comes from tracking data, otherwise, the orientation data contains predicted data.

const HAND_JOINT_POSITION_VALID = 4 enum HandJointFlags
Bitfield
#

If set, the positional data is valid, otherwise, the positional data is unreliable and should not be used.

const HAND_JOINT_POSITION_TRACKED = 8 enum HandJointFlags
Bitfield
#

If set, the positional data comes from tracking data, otherwise, the positional data contains predicted data.

const HAND_JOINT_LINEAR_VELOCITY_VALID = 16 enum HandJointFlags
Bitfield
#

If set, our linear velocity data is valid, otherwise, the linear velocity data is unreliable and should not be used.

const HAND_JOINT_ANGULAR_VELOCITY_VALID = 32 enum HandJointFlags
Bitfield
#

If set, our angular velocity data is valid, otherwise, the angular velocity data is unreliable and should not be used.

Constructors #

Enums #

Hand#

enum Hand { HAND_LEFT = 0, HAND_RIGHT = 1, HAND_MAX = 2, }

HandMotionRange#

enum HandMotionRange { HAND_MOTION_RANGE_UNOBSTRUCTED = 0, HAND_MOTION_RANGE_CONFORM_TO_CONTROLLER = 1, HAND_MOTION_RANGE_MAX = 2, }

HandTrackedSource#

enum HandTrackedSource { HAND_TRACKED_SOURCE_UNKNOWN = 0, HAND_TRACKED_SOURCE_UNOBSTRUCTED = 1, HAND_TRACKED_SOURCE_CONTROLLER = 2, HAND_TRACKED_SOURCE_MAX = 3, }

HandJoints#

enum HandJoints { HAND_JOINT_PALM = 0, HAND_JOINT_WRIST = 1, HAND_JOINT_THUMB_METACARPAL = 2, HAND_JOINT_THUMB_PROXIMAL = 3, HAND_JOINT_THUMB_DISTAL = 4, HAND_JOINT_THUMB_TIP = 5, HAND_JOINT_INDEX_METACARPAL = 6, HAND_JOINT_INDEX_PROXIMAL = 7, HAND_JOINT_INDEX_INTERMEDIATE = 8, HAND_JOINT_INDEX_DISTAL = 9, HAND_JOINT_INDEX_TIP = 10, HAND_JOINT_MIDDLE_METACARPAL = 11, HAND_JOINT_MIDDLE_PROXIMAL = 12, HAND_JOINT_MIDDLE_INTERMEDIATE = 13, HAND_JOINT_MIDDLE_DISTAL = 14, HAND_JOINT_MIDDLE_TIP = 15, HAND_JOINT_RING_METACARPAL = 16, HAND_JOINT_RING_PROXIMAL = 17, HAND_JOINT_RING_INTERMEDIATE = 18, HAND_JOINT_RING_DISTAL = 19, HAND_JOINT_RING_TIP = 20, HAND_JOINT_LITTLE_METACARPAL = 21, HAND_JOINT_LITTLE_PROXIMAL = 22, HAND_JOINT_LITTLE_INTERMEDIATE = 23, HAND_JOINT_LITTLE_DISTAL = 24, HAND_JOINT_LITTLE_TIP = 25, HAND_JOINT_MAX = 26, }

HandJointFlags#

enum HandJointFlags { HAND_JOINT_NONE = 0, HAND_JOINT_ORIENTATION_VALID = 1, HAND_JOINT_ORIENTATION_TRACKED = 2, HAND_JOINT_POSITION_VALID = 4, HAND_JOINT_POSITION_TRACKED = 8, HAND_JOINT_LINEAR_VELOCITY_VALID = 16, HAND_JOINT_ANGULAR_VELOCITY_VALID = 32, }

Operators #

Signals #

signal instance_exiting()#

Informs our OpenXR instance is exiting.

signal pose_recentered()#

Informs the user queued a recenter of the player position.

signal refresh_rate_changed(refresh_rate: float)#

Informs the user the HMD refresh rate has changed.

Note: Only emitted if XR runtime supports the refresh rate extension.

signal session_begun()#

Informs our OpenXR session has been started.

signal session_focussed()#

Informs our OpenXR session now has focus.

signal session_loss_pending()#

Informs our OpenXR session is in the process of being lost.

signal session_stopping()#

Informs our OpenXR session is stopping.

signal session_visible()#

Informs our OpenXR session is now visible (output is being sent to the HMD).

Theme Items #

Tutorials #