summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/AcceptDialog.xml2
-rw-r--r--doc/classes/AudioStreamPlayer3D.xml2
-rw-r--r--doc/classes/ColorPickerButton.xml2
-rw-r--r--doc/classes/ConfirmationDialog.xml1
-rw-r--r--doc/classes/Control.xml6
-rw-r--r--doc/classes/DirectionalLight3D.xml4
-rw-r--r--doc/classes/DisplayServer.xml15
-rw-r--r--doc/classes/EditorDebuggerPlugin.xml7
-rw-r--r--doc/classes/EditorExportPlugin.xml3
-rw-r--r--doc/classes/EditorFileDialog.xml1
-rw-r--r--doc/classes/EditorImportPlugin.xml3
-rw-r--r--doc/classes/EditorInspectorPlugin.xml4
-rw-r--r--doc/classes/EditorInterface.xml6
-rw-r--r--doc/classes/EditorNode3DGizmoPlugin.xml3
-rw-r--r--doc/classes/EditorPlugin.xml1
-rw-r--r--doc/classes/EditorProperty.xml4
-rw-r--r--doc/classes/EditorSceneFormatImporter.xml2
-rw-r--r--doc/classes/EditorTranslationParserPlugin.xml3
-rw-r--r--doc/classes/FileDialog.xml2
-rw-r--r--doc/classes/GraphEdit.xml4
-rw-r--r--doc/classes/Input.xml32
-rw-r--r--doc/classes/ItemList.xml1
-rw-r--r--doc/classes/Light3D.xml2
-rw-r--r--doc/classes/LineEdit.xml5
-rw-r--r--doc/classes/MenuButton.xml1
-rw-r--r--doc/classes/NavigationMesh.xml2
-rw-r--r--doc/classes/OptionButton.xml1
-rw-r--r--doc/classes/RichTextLabel.xml1
-rw-r--r--doc/classes/SceneTreeTimer.xml2
-rw-r--r--doc/classes/ScrollContainer.xml2
-rw-r--r--doc/classes/SpinBox.xml1
-rw-r--r--doc/classes/TabBar.xml (renamed from doc/classes/Tabs.xml)12
-rw-r--r--doc/classes/TabContainer.xml1
-rw-r--r--doc/classes/TextEdit.xml12
-rw-r--r--doc/classes/TextParagraph.xml2
-rw-r--r--doc/classes/TileMap.xml26
-rw-r--r--doc/classes/TileMapPattern.xml85
-rw-r--r--doc/classes/TileSet.xml28
-rw-r--r--doc/classes/XRAnchor3D.xml33
-rw-r--r--doc/classes/XRController3D.xml68
-rw-r--r--doc/classes/XRInterface.xml79
-rw-r--r--doc/classes/XRInterfaceExtension.xml44
-rw-r--r--doc/classes/XRNode3D.xml53
-rw-r--r--doc/classes/XRPose.xml41
-rw-r--r--doc/classes/XRPositionalTracker.xml121
-rw-r--r--doc/classes/XRServer.xml31
46 files changed, 590 insertions, 171 deletions
diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml
index c753b341d2..df0cc6f268 100644
--- a/doc/classes/AcceptDialog.xml
+++ b/doc/classes/AcceptDialog.xml
@@ -32,12 +32,14 @@
<return type="Label" />
<description>
Returns the label used for built-in text.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
</description>
</method>
<method name="get_ok_button">
<return type="Button" />
<description>
Returns the OK [Button] instance.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
</description>
</method>
<method name="register_text_enter">
diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml
index bd344fad29..e8a78d5a4c 100644
--- a/doc/classes/AudioStreamPlayer3D.xml
+++ b/doc/classes/AudioStreamPlayer3D.xml
@@ -123,7 +123,7 @@
Logarithmic dampening of loudness according to distance.
</constant>
<constant name="ATTENUATION_DISABLED" value="3" enum="AttenuationModel">
- No dampening of loudness according to distance. The sound will still be heard positionally, unlike an [AudioStreamPlayer].
+ No dampening of loudness according to distance. The sound will still be heard positionally, unlike an [AudioStreamPlayer]. [constant ATTENUATION_DISABLED] can be combined with a [member max_distance] value greater than [code]0.0[/code] to achieve linear attenuation clamped to a sphere of a defined size.
</constant>
<constant name="DOPPLER_TRACKING_DISABLED" value="0" enum="DopplerTracking">
Disables doppler tracking.
diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml
index 1cdfbd760e..58b6e89507 100644
--- a/doc/classes/ColorPickerButton.xml
+++ b/doc/classes/ColorPickerButton.xml
@@ -17,12 +17,14 @@
<return type="ColorPicker" />
<description>
Returns the [ColorPicker] that this node toggles.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
</description>
</method>
<method name="get_popup">
<return type="PopupPanel" />
<description>
Returns the control's [PopupPanel] which allows you to connect to popup signals. This allows you to handle events when the ColorPicker is shown or hidden.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
</description>
</method>
</methods>
diff --git a/doc/classes/ConfirmationDialog.xml b/doc/classes/ConfirmationDialog.xml
index 352631da1d..c4bdaf436d 100644
--- a/doc/classes/ConfirmationDialog.xml
+++ b/doc/classes/ConfirmationDialog.xml
@@ -22,6 +22,7 @@
<return type="Button" />
<description>
Returns the cancel button.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
</description>
</method>
</methods>
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index 7c8239977f..332d171457 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -763,10 +763,10 @@
</method>
<method name="set_drag_forwarding">
<return type="void" />
- <argument index="0" name="target" type="Node" />
+ <argument index="0" name="target" type="Object" />
<description>
- Forwards the handling of this control's drag and drop to [code]target[/code] node.
- Forwarding can be implemented in the target node similar to the methods [method _get_drag_data], [method _can_drop_data], and [method _drop_data] but with two differences:
+ Forwards the handling of this control's drag and drop to [code]target[/code] object.
+ Forwarding can be implemented in the target object similar to the methods [method _get_drag_data], [method _can_drop_data], and [method _drop_data] but with two differences:
1. The function name must be suffixed with [b]_fw[/b]
2. The function must take an extra argument that is the control doing the forwarding
[codeblocks]
diff --git a/doc/classes/DirectionalLight3D.xml b/doc/classes/DirectionalLight3D.xml
index 7c006ad3a6..f2a6e5b6f8 100644
--- a/doc/classes/DirectionalLight3D.xml
+++ b/doc/classes/DirectionalLight3D.xml
@@ -11,7 +11,7 @@
</tutorials>
<members>
<member name="directional_shadow_blend_splits" type="bool" setter="set_blend_splits" getter="is_blend_splits_enabled" default="false">
- If [code]true[/code], shadow detail is sacrificed in exchange for smoother transitions between splits.
+ If [code]true[/code], shadow detail is sacrificed in exchange for smoother transitions between splits. This is ignored when [member directional_shadow_mode] is [code]SHADOW_ORTHOGONAL[/code].
</member>
<member name="directional_shadow_fade_start" type="float" setter="set_param" getter="get_param" default="0.8">
Proportion of [member directional_shadow_max_distance] at which point the shadow starts to fade. At [member directional_shadow_max_distance] the shadow will disappear.
@@ -29,7 +29,7 @@
The distance from camera to shadow split 1. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or [code]SHADOW_PARALLEL_4_SPLITS[/code].
</member>
<member name="directional_shadow_split_2" type="float" setter="set_param" getter="get_param" default="0.2">
- The distance from shadow split 1 to split 2. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or [code]SHADOW_PARALLEL_4_SPLITS[/code].
+ The distance from shadow split 1 to split 2. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code].
</member>
<member name="directional_shadow_split_3" type="float" setter="set_param" getter="get_param" default="0.5">
The distance from shadow split 2 to split 3. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code].
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index 7a467c03c1..4b43286594 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -13,6 +13,13 @@
Returns the user's clipboard as a string if possible.
</description>
</method>
+ <method name="clipboard_get_primary" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns the user's primary clipboard as a string if possible.
+ [b]Note:[/b] This method is only implemented on Linux.
+ </description>
+ </method>
<method name="clipboard_set">
<return type="void" />
<argument index="0" name="clipboard" type="String" />
@@ -20,6 +27,14 @@
Sets the user's clipboard content to the given string.
</description>
</method>
+ <method name="clipboard_set_primary">
+ <return type="void" />
+ <argument index="0" name="clipboard_primary" type="String" />
+ <description>
+ Sets the user's primary clipboard content to the given string.
+ [b]Note:[/b] This method is only implemented on Linux.
+ </description>
+ </method>
<method name="console_set_visible">
<return type="void" />
<argument index="0" name="console_visible" type="bool" />
diff --git a/doc/classes/EditorDebuggerPlugin.xml b/doc/classes/EditorDebuggerPlugin.xml
index 0773e176b3..6687d3c3ac 100644
--- a/doc/classes/EditorDebuggerPlugin.xml
+++ b/doc/classes/EditorDebuggerPlugin.xml
@@ -4,9 +4,10 @@
A base class to implement debugger plugins.
</brief_description>
<description>
- All debugger plugin scripts must extend [EditorDebuggerPlugin]. It provides functions related to editor side of debugger.
- You don't need to instantiate this class. That is handled by the debugger itself. [Control] nodes can be added as child nodes to provide a GUI front-end for the plugin.
- Do not queue_free/reparent it's instance otherwise the instance becomes unusable.
+ [EditorDebuggerPlugin] provides functions related to the editor side of the debugger.
+ You don't need to instantiate this class; that is automatically handled by the debugger. [Control] nodes can be added as child nodes to provide a GUI for the plugin.
+ Do not free or reparent this node, otherwise it becomes unusable.
+ To use [EditorDebuggerPlugin], register it using the [method EditorPlugin.add_debugger_plugin] method first.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml
index fca7bb350d..3830bfc60e 100644
--- a/doc/classes/EditorExportPlugin.xml
+++ b/doc/classes/EditorExportPlugin.xml
@@ -4,7 +4,8 @@
A script that is executed when exporting the project.
</brief_description>
<description>
- Editor export plugins are automatically activated whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, [method _export_begin] is called at the beginning of the export process and then [method _export_file] is called for each exported file.
+ [EditorExportPlugin]s are automatically invoked whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, [method _export_begin] is called at the beginning of the export process and then [method _export_file] is called for each exported file.
+ To use [EditorExportPlugin], register it using the [method EditorPlugin.add_export_plugin] method first.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/EditorFileDialog.xml b/doc/classes/EditorFileDialog.xml
index 53fba9f3b8..79758281ac 100644
--- a/doc/classes/EditorFileDialog.xml
+++ b/doc/classes/EditorFileDialog.xml
@@ -26,6 +26,7 @@
<return type="VBoxContainer" />
<description>
Returns the [code]VBoxContainer[/code] used to display the file system.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
</description>
</method>
<method name="invalidate">
diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml
index c5a44009d2..6011a5411d 100644
--- a/doc/classes/EditorImportPlugin.xml
+++ b/doc/classes/EditorImportPlugin.xml
@@ -4,7 +4,7 @@
Registers a custom resource importer in the editor. Use the class to parse any file and import it as a new resource type.
</brief_description>
<description>
- EditorImportPlugins provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. Register your [EditorPlugin] with [method EditorPlugin.add_import_plugin].
+ [EditorImportPlugin]s provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers.
EditorImportPlugins work by associating with specific file extensions and a resource type. See [method _get_recognized_extensions] and [method _get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].godot/imported[/code] directory (see [member ProjectSettings.application/config/project_data_dir_name]).
Below is an example EditorImportPlugin that imports a [Mesh] from a file with the extension ".special" or ".spec":
[codeblocks]
@@ -108,6 +108,7 @@
}
[/csharp]
[/codeblocks]
+ To use [EditorImportPlugin], register it using the [method EditorPlugin.add_import_plugin] method first.
</description>
<tutorials>
<link title="Import plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html</link>
diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml
index 17397b80bf..f65e974d47 100644
--- a/doc/classes/EditorInspectorPlugin.xml
+++ b/doc/classes/EditorInspectorPlugin.xml
@@ -4,13 +4,13 @@
Plugin for adding custom property editors on inspector.
</brief_description>
<description>
- These plugins allow adding custom property editors to [EditorInspector].
- Plugins are registered via [method EditorPlugin.add_inspector_plugin].
+ [EditorInspectorPlugin] allows adding custom property editors to [EditorInspector].
When an object is edited, the [method _can_handle] function is called and must return [code]true[/code] if the object type is supported.
If supported, the function [method _parse_begin] will be called, allowing to place custom controls at the beginning of the class.
Subsequently, the [method _parse_category] and [method _parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too.
Finally, [method _parse_end] will be called.
On each of these calls, the "add" functions can be called.
+ To use [EditorInspectorPlugin], register it using the [method EditorPlugin.add_inspector_plugin] method first.
</description>
<tutorials>
<link title="Inspector plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/inspector_plugins.html</link>
diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml
index ad878aad80..5790d8c5af 100644
--- a/doc/classes/EditorInterface.xml
+++ b/doc/classes/EditorInterface.xml
@@ -28,12 +28,14 @@
<return type="Control" />
<description>
Returns the main container of Godot editor's window. For example, you can use it to retrieve the size of the container and place your controls accordingly.
+ [b]Warning:[/b] Removing and freeing this node will render the editor useless and may cause a crash.
</description>
</method>
<method name="get_command_palette" qualifiers="const">
<return type="EditorCommandPalette" />
<description>
Returns the editor's [EditorCommandPalette] instance.
+ [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash.
</description>
</method>
<method name="get_current_path" qualifiers="const">
@@ -53,6 +55,7 @@
<description>
Returns the main editor control. Use this as a parent for main screens.
[b]Note:[/b] This returns the main editor control containing the whole editor, not the 2D or 3D viewports specifically.
+ [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash.
</description>
</method>
<method name="get_editor_paths">
@@ -77,12 +80,14 @@
<return type="FileSystemDock" />
<description>
Returns the editor's [FileSystemDock] instance.
+ [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash.
</description>
</method>
<method name="get_inspector" qualifiers="const">
<return type="EditorInspector" />
<description>
Returns the editor's [EditorInspector] instance.
+ [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash.
</description>
</method>
<method name="get_open_scenes" qualifiers="const">
@@ -113,6 +118,7 @@
<return type="ScriptEditor" />
<description>
Returns the editor's [ScriptEditor] instance.
+ [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash.
</description>
</method>
<method name="get_selected_path" qualifiers="const">
diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml
index 424d5dd310..08423c4577 100644
--- a/doc/classes/EditorNode3DGizmoPlugin.xml
+++ b/doc/classes/EditorNode3DGizmoPlugin.xml
@@ -4,7 +4,8 @@
Used by the editor to define Node3D gizmo types.
</brief_description>
<description>
- EditorNode3DGizmoPlugin allows you to define a new type of Gizmo. There are two main ways to do so: extending [EditorNode3DGizmoPlugin] for the simpler gizmos, or creating a new [EditorNode3DGizmo] type. See the tutorial in the documentation for more info.
+ [EditorNode3DGizmoPlugin] allows you to define a new type of Gizmo. There are two main ways to do so: extending [EditorNode3DGizmoPlugin] for the simpler gizmos, or creating a new [EditorNode3DGizmo] type. See the tutorial in the documentation for more info.
+ To use [EditorNode3DGizmoPlugin], register it using the [method EditorPlugin.add_spatial_gizmo_plugin] method first.
</description>
<tutorials>
<link title="Spatial gizmo plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html</link>
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index f2764865df..8df6d721d4 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -469,6 +469,7 @@
<description>
Gets the Editor's dialogue used for making scripts.
[b]Note:[/b] Users can configure it before use.
+ [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash.
</description>
</method>
<method name="get_undo_redo">
diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml
index 6af6507606..5f342e6dc2 100644
--- a/doc/classes/EditorProperty.xml
+++ b/doc/classes/EditorProperty.xml
@@ -73,8 +73,8 @@
<member name="deletable" type="bool" setter="set_deletable" getter="is_deletable" default="false">
Used by the inspector, set to [code]true[/code] when the property can be deleted by the user.
</member>
- <member name="draw_red" type="bool" setter="set_draw_red" getter="is_draw_red" default="false">
- Used by the inspector, set to [code]true[/code] when the property must draw with error color. This is used for editable children's properties.
+ <member name="draw_warning" type="bool" setter="set_draw_warning" getter="is_draw_warning" default="false">
+ Used by the inspector, set to [code]true[/code] when the property is drawn with the editor theme's warning color. This is used for editable children's properties.
</member>
<member name="keying" type="bool" setter="set_keying" getter="is_keying" default="false">
Used by the inspector, set to [code]true[/code] when the property can add keys for animation.
diff --git a/doc/classes/EditorSceneFormatImporter.xml b/doc/classes/EditorSceneFormatImporter.xml
index d890188092..6dbd80604e 100644
--- a/doc/classes/EditorSceneFormatImporter.xml
+++ b/doc/classes/EditorSceneFormatImporter.xml
@@ -4,6 +4,8 @@
Imports scenes from third-parties' 3D files.
</brief_description>
<description>
+ [EditorSceneFormatImporter] allows to define an importer script for a third-party 3D format.
+ To use [EditorSceneFormatImporter], register it using the [method EditorPlugin.add_scene_format_importer_plugin] method first.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml
index de8204def3..900d877f12 100644
--- a/doc/classes/EditorTranslationParserPlugin.xml
+++ b/doc/classes/EditorTranslationParserPlugin.xml
@@ -4,7 +4,7 @@
Plugin for adding custom parsers to extract strings that are to be translated from custom files (.csv, .json etc.).
</brief_description>
<description>
- Plugins are registered via [method EditorPlugin.add_translation_parser_plugin] method. To define the parsing and string extraction logic, override the [method _parse_file] method in script.
+ [EditorTranslationParserPlugin] is invoked when a file is being parsed to extract strings that require translation. To define the parsing and string extraction logic, override the [method _parse_file] method in script.
Add the extracted strings to argument [code]msgids[/code] or [code]msgids_context_plural[/code] if context or plural is used.
When adding to [code]msgids_context_plural[/code], you must add the data using the format [code]["A", "B", "C"][/code], where [code]A[/code] represents the extracted string, [code]B[/code] represents the context, and [code]C[/code] represents the plural version of the extracted string. If you want to add only context but not plural, put [code]""[/code] for the plural slot. The idea is the same if you only want to add plural but not context. See the code below for concrete examples.
The extracted strings will be written into a POT file selected by user under "POT Generation" in "Localization" tab in "Project Settings" menu.
@@ -98,6 +98,7 @@
}
[/csharp]
[/codeblocks]
+ To use [EditorTranslationParserPlugin], register it using the [method EditorPlugin.add_translation_parser_plugin] method first.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml
index 22b5c72fa9..fa43f97104 100644
--- a/doc/classes/FileDialog.xml
+++ b/doc/classes/FileDialog.xml
@@ -32,12 +32,14 @@
<return type="LineEdit" />
<description>
Returns the LineEdit for the selected file.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
</description>
</method>
<method name="get_vbox">
<return type="VBoxContainer" />
<description>
Returns the vertical box container of the dialog, custom controls can be added to it.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
</description>
</method>
<method name="invalidate">
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml
index 2213b9b8b2..673bf19122 100644
--- a/doc/classes/GraphEdit.xml
+++ b/doc/classes/GraphEdit.xml
@@ -89,8 +89,8 @@
<method name="get_zoom_hbox">
<return type="HBoxContainer" />
<description>
- Gets the [HBoxContainer] that contains the zooming and grid snap controls in the top left of the graph.
- Warning: The intended usage of this function is to allow you to reposition or add your own custom controls to the container. This is an internal control and as such should not be freed. If you wish to hide this or any of its children, use their [member CanvasItem.visible] property instead.
+ Gets the [HBoxContainer] that contains the zooming and grid snap controls in the top left of the graph. You can use this method to reposition the toolbar or to add your own custom controls to it.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
</description>
</method>
<method name="is_node_connected">
diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml
index 00ead31115..88e4a67615 100644
--- a/doc/classes/Input.xml
+++ b/doc/classes/Input.xml
@@ -269,6 +269,14 @@
Removes all mappings from the internal database that match the given GUID.
</description>
</method>
+ <method name="set_accelerometer">
+ <return type="void" />
+ <argument index="0" name="value" type="Vector3" />
+ <description>
+ Sets the acceleration value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
+ [b]Note:[/b] This value can be immediately overwritten by the hardware sensor value on Android and iOS.
+ </description>
+ </method>
<method name="set_custom_mouse_cursor">
<return type="void" />
<argument index="0" name="image" type="Resource" />
@@ -291,6 +299,30 @@
[b]Note:[/b] This method generates an [InputEventMouseMotion] to update cursor immediately.
</description>
</method>
+ <method name="set_gravity">
+ <return type="void" />
+ <argument index="0" name="value" type="Vector3" />
+ <description>
+ Sets the gravity value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
+ [b]Note:[/b] This value can be immediately overwritten by the hardware sensor value on Android and iOS.
+ </description>
+ </method>
+ <method name="set_gyroscope">
+ <return type="void" />
+ <argument index="0" name="value" type="Vector3" />
+ <description>
+ Sets the value of the rotation rate of the gyroscope sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
+ [b]Note:[/b] This value can be immediately overwritten by the hardware sensor value on Android and iOS.
+ </description>
+ </method>
+ <method name="set_magnetometer">
+ <return type="void" />
+ <argument index="0" name="value" type="Vector3" />
+ <description>
+ Sets the value of the magnetic field of the magnetometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
+ [b]Note:[/b] This value can be immediately overwritten by the hardware sensor value on Android and iOS.
+ </description>
+ </method>
<method name="set_mouse_mode">
<return type="void" />
<argument index="0" name="mode" type="int" enum="Input.MouseMode" />
diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml
index e3e4a9fa7d..0a995c770b 100644
--- a/doc/classes/ItemList.xml
+++ b/doc/classes/ItemList.xml
@@ -165,6 +165,7 @@
<return type="VScrollBar" />
<description>
Returns the [Object] ID associated with the list.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
</description>
</method>
<method name="is_anything_selected">
diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml
index 52359b0ede..dbda22d618 100644
--- a/doc/classes/Light3D.xml
+++ b/doc/classes/Light3D.xml
@@ -32,7 +32,7 @@
If [code]true[/code], the light only appears in the editor and will not be visible at runtime.
</member>
<member name="light_angular_distance" type="float" setter="set_param" getter="get_param" default="0.0">
- The light's angular size in degrees. Only available for [DirectionalLight3D]s. For reference, the Sun from the Earth is approximately [code]0.5[/code].
+ The light's angular size in degrees. Increasing this will make shadows softer at greater distances. Only available for [DirectionalLight3D]s. For reference, the Sun from the Earth is approximately [code]0.5[/code].
</member>
<member name="light_bake_mode" type="int" setter="set_bake_mode" getter="get_bake_mode" enum="Light3D.BakeMode" default="1">
The light's bake mode. See [enum BakeMode].
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index 4ad71d1e80..a37bab9b11 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -67,6 +67,7 @@
<return type="PopupMenu" />
<description>
Returns the [PopupMenu] of this [LineEdit]. By default, this menu is displayed when right-clicking on the [LineEdit].
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
</description>
</method>
<method name="get_opentype_feature" qualifiers="const">
@@ -221,6 +222,10 @@
[/csharp]
[/codeblocks]
</member>
+ <member name="middle_mouse_paste_enabled" type="bool" setter="set_middle_mouse_paste_enabled" getter="is_middle_mouse_paste_enabled" default="true">
+ If [code]false[/code], using middle mouse button to paste clipboard will be disabled.
+ [b]Note:[/b] This method is only implemented on Linux.
+ </member>
<member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" override="true" enum="Control.CursorShape" default="1" />
<member name="placeholder_alpha" type="float" setter="set_placeholder_alpha" getter="get_placeholder_alpha" default="0.6">
Opacity of the [member placeholder_text]. From [code]0[/code] to [code]1[/code].
diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml
index 5bdc9cccd9..dda9b98db4 100644
--- a/doc/classes/MenuButton.xml
+++ b/doc/classes/MenuButton.xml
@@ -15,6 +15,7 @@
<return type="PopupMenu" />
<description>
Returns the [PopupMenu] contained in this button.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
</description>
</method>
<method name="set_disable_shortcuts">
diff --git a/doc/classes/NavigationMesh.xml b/doc/classes/NavigationMesh.xml
index e476949360..b100a20963 100644
--- a/doc/classes/NavigationMesh.xml
+++ b/doc/classes/NavigationMesh.xml
@@ -84,7 +84,7 @@
<member name="agent/max_slope" type="float" setter="set_agent_max_slope" getter="get_agent_max_slope" default="45.0">
The maximum slope that is considered walkable, in degrees.
</member>
- <member name="agent/radius" type="float" setter="set_agent_radius" getter="get_agent_radius" default="0.6">
+ <member name="agent/radius" type="float" setter="set_agent_radius" getter="get_agent_radius" default="1.0">
The distance to erode/shrink the walkable area of the heightfield away from obstructions.
[b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell/size].
</member>
diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml
index 264ef9975a..5c64dc4162 100644
--- a/doc/classes/OptionButton.xml
+++ b/doc/classes/OptionButton.xml
@@ -84,6 +84,7 @@
<return type="PopupMenu" />
<description>
Returns the [PopupMenu] contained in this button.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
</description>
</method>
<method name="get_selected_id" qualifiers="const">
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index a2e1c3d2c2..668f9af4a2 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -101,6 +101,7 @@
<return type="VScrollBar" />
<description>
Returns the vertical scrollbar.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
</description>
</method>
<method name="get_visible_line_count" qualifiers="const">
diff --git a/doc/classes/SceneTreeTimer.xml b/doc/classes/SceneTreeTimer.xml
index f97c5e42b5..b0509a322e 100644
--- a/doc/classes/SceneTreeTimer.xml
+++ b/doc/classes/SceneTreeTimer.xml
@@ -10,7 +10,7 @@
[gdscript]
func some_function():
print("Timer started.")
- yield(get_tree().create_timer(1.0), "timeout")
+ await get_tree().create_timer(1.0).timeout
print("Timer ended.")
[/gdscript]
[csharp]
diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml
index 1cf8c6cb54..976c32c243 100644
--- a/doc/classes/ScrollContainer.xml
+++ b/doc/classes/ScrollContainer.xml
@@ -22,12 +22,14 @@
<return type="HScrollBar" />
<description>
Returns the horizontal scrollbar [HScrollBar] of this [ScrollContainer].
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to disable the horizontal scrollbar, use [member scroll_horizontal_enabled]. If you want to only hide it instead, use [member scroll_horizontal_visible].
</description>
</method>
<method name="get_v_scrollbar">
<return type="VScrollBar" />
<description>
Returns the vertical scrollbar [VScrollBar] of this [ScrollContainer].
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to disable the vertical scrollbar, use [member scroll_vertical_enabled]. If you want to only hide it instead, use [member scroll_vertical_visible].
</description>
</method>
</methods>
diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml
index 33d2b472b5..615f5e3586 100644
--- a/doc/classes/SpinBox.xml
+++ b/doc/classes/SpinBox.xml
@@ -39,6 +39,7 @@
<return type="LineEdit" />
<description>
Returns the [LineEdit] instance from this [SpinBox]. You can use it to access properties and methods of [LineEdit].
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
</description>
</method>
</methods>
diff --git a/doc/classes/Tabs.xml b/doc/classes/TabBar.xml
index ded4f0b32f..3ca124bb58 100644
--- a/doc/classes/Tabs.xml
+++ b/doc/classes/TabBar.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="Tabs" inherits="Control" version="4.0">
+<class name="TabBar" inherits="Control" version="4.0">
<brief_description>
- Tabs control.
+ Tab bar control.
</brief_description>
<description>
Simple tabs control, similar to [TabContainer] but is only in charge of drawing tabs, not interacting with children.
@@ -114,7 +114,7 @@
<method name="get_tabs_rearrange_group" qualifiers="const">
<return type="int" />
<description>
- Returns the [Tabs]' rearrange group ID.
+ Returns the [TabBar]'s rearrange group ID.
</description>
</method>
<method name="move_tab">
@@ -192,7 +192,7 @@
<return type="void" />
<argument index="0" name="group_id" type="int" />
<description>
- Defines the rearrange group ID. Choose for each [Tabs] the same value to dragging tabs between [Tabs]. Enable drag with [member drag_to_rearrange_enabled].
+ Defines the rearrange group ID. Choose for each [TabBar] the same value to dragging tabs between [TabBar]. Enable drag with [member drag_to_rearrange_enabled].
</description>
</method>
</methods>
@@ -209,10 +209,10 @@
<member name="scrolling_enabled" type="bool" setter="set_scrolling_enabled" getter="get_scrolling_enabled" default="true">
if [code]true[/code], the mouse's scroll wheel can be used to navigate the scroll view.
</member>
- <member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" enum="Tabs.TabAlign" default="1">
+ <member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" enum="TabBar.TabAlign" default="1">
The alignment of all tabs. See [enum TabAlign] for details.
</member>
- <member name="tab_close_display_policy" type="int" setter="set_tab_close_display_policy" getter="get_tab_close_display_policy" enum="Tabs.CloseButtonDisplayPolicy" default="0">
+ <member name="tab_close_display_policy" type="int" setter="set_tab_close_display_policy" getter="get_tab_close_display_policy" enum="TabBar.CloseButtonDisplayPolicy" default="0">
Sets when the close button will appear on the tabs. See [enum CloseButtonDisplayPolicy] for details.
</member>
</members>
diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml
index 4c50aa4e1f..1f32bba5a1 100644
--- a/doc/classes/TabContainer.xml
+++ b/doc/classes/TabContainer.xml
@@ -20,6 +20,7 @@
<return type="Popup" />
<description>
Returns the [Popup] node instance if one has been set already with [method set_popup].
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
</description>
</method>
<method name="get_previous_tab" qualifiers="const">
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index 3667dbf578..ba3394b54a 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -41,6 +41,13 @@
Override this method to define what happens when the user performs a paste operation.
</description>
</method>
+ <method name="_paste_primary_clipboard" qualifiers="virtual">
+ <return type="void" />
+ <description>
+ Override this method to define what happens when the user performs a paste operation with middle mouse button.
+ [b]Note:[/b] This method is only implemented on Linux.
+ </description>
+ </method>
<method name="add_gutter">
<return type="void" />
<argument index="0" name="at" type="int" default="-1" />
@@ -314,6 +321,7 @@
<return type="PopupMenu" />
<description>
Returns the [PopupMenu] of this [TextEdit]. By default, this menu is displayed when right-clicking on the [TextEdit].
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
</description>
</method>
<method name="get_minimap_line_at_pos" qualifiers="const">
@@ -936,6 +944,10 @@
<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
</member>
+ <member name="middle_mouse_paste_enabled" type="bool" setter="set_middle_mouse_paste_enabled" getter="is_middle_mouse_paste_enabled" default="true">
+ If [code]false[/code], using middle mouse button to paste clipboard will be disabled.
+ [b]Note:[/b] This method is only implemented on Linux.
+ </member>
<member name="minimap_draw" type="bool" setter="set_draw_minimap" getter="is_drawing_minimap" default="false">
If [code]true[/code], a minimap is shown, providing an outline of your source code.
</member>
diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml
index e06dfee698..5bd6b0572c 100644
--- a/doc/classes/TextParagraph.xml
+++ b/doc/classes/TextParagraph.xml
@@ -199,7 +199,7 @@
Returns width (for horizontal layout) or height (for vertical) of the line of text.
</description>
</method>
- <method name="get_non_wraped_size" qualifiers="const">
+ <method name="get_non_wrapped_size" qualifiers="const">
<return type="Vector2" />
<description>
Returns the size of the bounding box of the paragraph, without line breaks.
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index d7108c3a2a..e65d5b4533 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -117,6 +117,14 @@
Returns the neighboring cell to the one at coordinates [code]coords[/code], indentified by the [code]neighbor[/code] direction. This method takes into account the different layouts a TileMap can take.
</description>
</method>
+ <method name="get_pattern">
+ <return type="TileMapPattern" />
+ <argument index="0" name="layer" type="int" />
+ <argument index="1" name="coords_array" type="Vector2i[]" />
+ <description>
+ Creates a new [TileMapPattern] from the given layer and set of cells.
+ </description>
+ </method>
<method name="get_surrounding_tiles">
<return type="Vector2i[]" />
<argument index="0" name="coords" type="Vector2i" />
@@ -151,6 +159,15 @@
Returns if a layer Y-sorts its tiles.
</description>
</method>
+ <method name="map_pattern">
+ <return type="Vector2i" />
+ <argument index="0" name="position_in_tilemap" type="Vector2i" />
+ <argument index="1" name="coords_in_pattern" type="Vector2i" />
+ <argument index="2" name="pattern" type="TileMapPattern" />
+ <description>
+ Returns for the given coodinate [code]coords_in_pattern[/code] in a [TileMapPattern] the corresponding cell coordinates if the pattern was pasted at the [code]position_in_tilemap[/code] coordinates (see [method set_pattern]). This mapping is required as in half-offset tile shapes, the mapping might not work by calculating [code]position_in_tile_map + coords_in_pattern[/code]
+ </description>
+ </method>
<method name="map_to_world" qualifiers="const">
<return type="Vector2" />
<argument index="0" name="map_position" type="Vector2i" />
@@ -237,6 +254,15 @@
Sets a layers Z-index value. This Z-index is added to each tile's Z-index value.
</description>
</method>
+ <method name="set_pattern">
+ <return type="void" />
+ <argument index="0" name="layer" type="int" />
+ <argument index="1" name="position" type="Vector2i" />
+ <argument index="2" name="pattern" type="TileMapPattern" />
+ <description>
+ Paste the given [TileMapPattern] at the given [code]position[/code] and [code]layer[/code] in the tile map.
+ </description>
+ </method>
<method name="world_to_map" qualifiers="const">
<return type="Vector2i" />
<argument index="0" name="world_position" type="Vector2" />
diff --git a/doc/classes/TileMapPattern.xml b/doc/classes/TileMapPattern.xml
new file mode 100644
index 0000000000..4c46625423
--- /dev/null
+++ b/doc/classes/TileMapPattern.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="TileMapPattern" inherits="Resource" version="4.0">
+ <brief_description>
+ Holds a pattern to be copied from or pasted into [TileMap]s.
+ </brief_description>
+ <description>
+ This resource holds a set of cells to help bulk manipulations of [TileMap].
+ A pattern always start at the [code](0,0)[/code] coordinates and cannot have cells with negative coordinates.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="get_cell_alternative_tile" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="coords" type="Vector2i" />
+ <description>
+ Returns the tile alternative ID of the cell at [code]coords[/code].
+ </description>
+ </method>
+ <method name="get_cell_atlas_coords" qualifiers="const">
+ <return type="Vector2i" />
+ <argument index="0" name="coords" type="Vector2i" />
+ <description>
+ Returns the tile atlas coordinates ID of the cell at [code]coords[/code].
+ </description>
+ </method>
+ <method name="get_cell_source_id" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="coords" type="Vector2i" />
+ <description>
+ Returns the tile source ID of the cell at [code]coords[/code].
+ </description>
+ </method>
+ <method name="get_size" qualifiers="const">
+ <return type="Vector2i" />
+ <description>
+ Returns the size, in cells, of the pattern.
+ </description>
+ </method>
+ <method name="get_used_cells" qualifiers="const">
+ <return type="Vector2i[]" />
+ <description>
+ Returns the list of used cell coordinates in the pattern.
+ </description>
+ </method>
+ <method name="has_cell" qualifiers="const">
+ <return type="bool" />
+ <argument index="0" name="coords" type="Vector2i" />
+ <description>
+ Returns whether the pattern has a tile at the given coordinates.
+ </description>
+ </method>
+ <method name="is_empty" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns whether the pattern is empty or not.
+ </description>
+ </method>
+ <method name="remove_cell">
+ <return type="void" />
+ <argument index="0" name="coords" type="Vector2i" />
+ <argument index="1" name="arg1" type="bool" />
+ <description>
+ Remove the cell at the given coordinates.
+ </description>
+ </method>
+ <method name="set_cell">
+ <return type="void" />
+ <argument index="0" name="coords" type="Vector2i" />
+ <argument index="1" name="source_id" type="int" default="-1" />
+ <argument index="2" name="atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" />
+ <argument index="3" name="alternative_tile" type="int" default="-1" />
+ <description>
+ Sets the tile indentifiers for the cell at coordinates [code]coords[/code]. See [method TileMap.set_cell].
+ </description>
+ </method>
+ <method name="set_size">
+ <return type="void" />
+ <argument index="0" name="size" type="Vector2i" />
+ <description>
+ Sets the size of the pattern.
+ </description>
+ </method>
+ </methods>
+</class>
diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml
index 02baded019..45d6f9ca6c 100644
--- a/doc/classes/TileSet.xml
+++ b/doc/classes/TileSet.xml
@@ -46,6 +46,14 @@
Occlusion layers allow assigning occlusion polygons to atlas tiles.
</description>
</method>
+ <method name="add_pattern">
+ <return type="int" />
+ <argument index="0" name="pattern" type="TileMapPattern" />
+ <argument index="1" name="index" type="int" default="-1" />
+ <description>
+ Adds a [TileMapPattern] to be stored in the TileSet resouce. If provided, insert it at the given [code]index[/code].
+ </description>
+ </method>
<method name="add_physics_layer">
<return type="void" />
<argument index="0" name="to_position" type="int" default="-1" />
@@ -154,6 +162,19 @@
Returns the occlusion layers count.
</description>
</method>
+ <method name="get_pattern">
+ <return type="TileMapPattern" />
+ <argument index="0" name="index" type="int" default="-1" />
+ <description>
+ Returns the [TileMapPattern] at the given [code]index[/code].
+ </description>
+ </method>
+ <method name="get_patterns_count">
+ <return type="int" />
+ <description>
+ Returns the number of [TileMapPattern] this tile set handles.
+ </description>
+ </method>
<method name="get_physics_layer_collision_layer" qualifiers="const">
<return type="int" />
<argument index="0" name="layer_index" type="int" />
@@ -374,6 +395,13 @@
Removes the occlusion layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly.
</description>
</method>
+ <method name="remove_pattern">
+ <return type="void" />
+ <argument index="0" name="index" type="int" />
+ <description>
+ Remove the [TileMapPattern] at the given index.
+ </description>
+ </method>
<method name="remove_physics_layer">
<return type="void" />
<argument index="0" name="layer_index" type="int" />
diff --git a/doc/classes/XRAnchor3D.xml b/doc/classes/XRAnchor3D.xml
index 94fc8fc13d..2c54c728ed 100644
--- a/doc/classes/XRAnchor3D.xml
+++ b/doc/classes/XRAnchor3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="XRAnchor3D" inherits="Node3D" version="4.0">
+<class name="XRAnchor3D" inherits="XRNode3D" version="4.0">
<brief_description>
An anchor point in AR space.
</brief_description>
@@ -11,24 +11,6 @@
<tutorials>
</tutorials>
<methods>
- <method name="get_anchor_name" qualifiers="const">
- <return type="String" />
- <description>
- Returns the name given to this anchor.
- </description>
- </method>
- <method name="get_is_active" qualifiers="const">
- <return type="bool" />
- <description>
- Returns [code]true[/code] if the anchor is being tracked and [code]false[/code] if no anchor with this ID is currently known.
- </description>
- </method>
- <method name="get_mesh" qualifiers="const">
- <return type="Mesh" />
- <description>
- If provided by the [XRInterface], this returns a mesh object for the anchor. For an anchor, this can be a shape related to the object being tracked or it can be a mesh that provides topology related to the anchor and can be used to create shadows/reflections on surfaces or for generating collision shapes.
- </description>
- </method>
<method name="get_plane" qualifiers="const">
<return type="Plane" />
<description>
@@ -42,17 +24,4 @@
</description>
</method>
</methods>
- <members>
- <member name="anchor_id" type="int" setter="set_anchor_id" getter="get_anchor_id" default="1">
- The anchor's ID. You can set this before the anchor itself exists. The first anchor gets an ID of [code]1[/code], the second an ID of [code]2[/code], etc. When anchors get removed, the engine can then assign the corresponding ID to new anchors. The most common situation where anchors "disappear" is when the AR server identifies that two anchors represent different parts of the same plane and merges them.
- </member>
- </members>
- <signals>
- <signal name="mesh_updated">
- <argument index="0" name="mesh" type="Mesh" />
- <description>
- Emitted when the mesh associated with the anchor changes or when one becomes available. This is especially important for topology that is constantly being [code]mesh_updated[/code].
- </description>
- </signal>
- </signals>
</class>
diff --git a/doc/classes/XRController3D.xml b/doc/classes/XRController3D.xml
index 35edf5c2b2..eb91196e00 100644
--- a/doc/classes/XRController3D.xml
+++ b/doc/classes/XRController3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="XRController3D" inherits="Node3D" version="4.0">
+<class name="XRController3D" inherits="XRNode3D" version="4.0">
<brief_description>
A spatial node representing a spatially-tracked controller.
</brief_description>
@@ -7,63 +7,41 @@
This is a helper spatial node that is linked to the tracking of controllers. It also offers several handy passthroughs to the state of buttons and such on the controllers.
Controllers are linked by their ID. You can create controller nodes before the controllers are available. If your game always uses two controllers (one for each hand), you can predefine the controllers with ID 1 and 2; they will become active as soon as the controllers are identified. If you expect additional controllers to be used, you should react to the signals and add XRController3D nodes to your scene.
The position of the controller node is automatically updated by the [XRServer]. This makes this node ideal to add child nodes to visualize the controller.
+ As many XR runtimes now use a configurable action map all inputs are named.
</description>
<tutorials>
<link title="VR documentation index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
</tutorials>
<methods>
- <method name="get_controller_name" qualifiers="const">
- <return type="String" />
+ <method name="get_axis" qualifiers="const">
+ <return type="Vector2" />
+ <argument index="0" name="name" type="StringName" />
<description>
- If active, returns the name of the associated controller if provided by the AR/VR SDK used.
+ Returns a [Vector2] for the input with the given [code]name[/code]. This is used for thumbsticks and thumbpads found on many controllers.
</description>
</method>
- <method name="get_is_active" qualifiers="const">
- <return type="bool" />
+ <method name="get_tracker_hand" qualifiers="const">
+ <return type="int" enum="XRPositionalTracker.TrackerHand" />
<description>
- Returns [code]true[/code] if the bound controller is active. XR systems attempt to track active controllers.
+ Returns the hand holding this controller, if known. See [enum XRPositionalTracker.TrackerHand].
</description>
</method>
- <method name="get_joystick_axis" qualifiers="const">
+ <method name="get_value" qualifiers="const">
<return type="float" />
- <argument index="0" name="axis" type="int" />
- <description>
- Returns the value of the given axis for things like triggers, touchpads, etc. that are embedded into the controller.
- </description>
- </method>
- <method name="get_joystick_id" qualifiers="const">
- <return type="int" />
- <description>
- Returns the ID of the joystick object bound to this. Every controller tracked by the [XRServer] that has buttons and axis will also be registered as a joystick within Godot. This means that all the normal joystick tracking and input mapping will work for buttons and axis found on the AR/VR controllers. This ID is purely offered as information so you can link up the controller with its joystick entry.
- </description>
- </method>
- <method name="get_mesh" qualifiers="const">
- <return type="Mesh" />
+ <argument index="0" name="name" type="StringName" />
<description>
- If provided by the [XRInterface], this returns a mesh associated with the controller. This can be used to visualize the controller.
- </description>
- </method>
- <method name="get_tracker_hand" qualifiers="const">
- <return type="int" enum="XRPositionalTracker.TrackerHand" />
- <description>
- Returns the hand holding this controller, if known. See [enum XRPositionalTracker.TrackerHand].
+ Returns a numeric value for the input with the given [code]name[/code]. This is used for triggers and grip sensors.
</description>
</method>
<method name="is_button_pressed" qualifiers="const">
<return type="bool" />
- <argument index="0" name="button" type="int" />
+ <argument index="0" name="name" type="StringName" />
<description>
- Returns [code]true[/code] if the button at index [code]button[/code] is pressed. See [enum JoyButton].
+ Returns [code]true[/code] if the button with the given [code]name[/code] is pressed.
</description>
</method>
</methods>
<members>
- <member name="controller_id" type="int" setter="set_controller_id" getter="get_controller_id" default="1">
- The controller's ID.
- A controller ID of 0 is unbound and will always result in an inactive node. Controller ID 1 is reserved for the first controller that identifies itself as the left-hand controller and ID 2 is reserved for the first controller that identifies itself as the right-hand controller.
- For any other controller that the [XRServer] detects, we continue with controller ID 3.
- When a controller is turned off, its slot is freed. This ensures controllers will keep the same ID even when controllers with lower IDs are turned off.
- </member>
<member name="rumble" type="float" setter="set_rumble" getter="get_rumble" default="0.0">
The degree to which the controller vibrates. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code]. If changed, updates [member XRPositionalTracker.rumble] accordingly.
This is a useful property to animate if you want the controller to vibrate for a limited duration.
@@ -71,21 +49,29 @@
</members>
<signals>
<signal name="button_pressed">
- <argument index="0" name="button" type="int" />
+ <argument index="0" name="name" type="String" />
<description>
Emitted when a button on this controller is pressed.
</description>
</signal>
<signal name="button_released">
- <argument index="0" name="button" type="int" />
+ <argument index="0" name="name" type="String" />
<description>
Emitted when a button on this controller is released.
</description>
</signal>
- <signal name="mesh_updated">
- <argument index="0" name="mesh" type="Mesh" />
+ <signal name="input_axis_changed">
+ <argument index="0" name="name" type="String" />
+ <argument index="1" name="value" type="Vector2" />
+ <description>
+ Emitted when a thumbstick or thumbpad on this controller is moved.
+ </description>
+ </signal>
+ <signal name="input_value_changed">
+ <argument index="0" name="name" type="String" />
+ <argument index="1" name="value" type="float" />
<description>
- Emitted when the mesh associated with the controller changes or when one becomes available. Generally speaking this will be a static mesh after becoming available.
+ Emitted when a trigger or similar input on this controller changes value.
</description>
</signal>
</signals>
diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml
index ffc2bc138d..7ae70f97a2 100644
--- a/doc/classes/XRInterface.xml
+++ b/doc/classes/XRInterface.xml
@@ -29,6 +29,12 @@
Returns the name of this interface (OpenXR, OpenVR, OpenHMD, ARKit, etc).
</description>
</method>
+ <method name="get_play_area" qualifiers="const">
+ <return type="PackedVector3Array" />
+ <description>
+ Returns an array of vectors that denotes the physical play area mapped to the virtual space around the [XROrigin3D] point. The points form a convex polygon that can be used to react to or visualise the play area. This returns an empty array if this feature is not supported or if the information is not yet available.
+ </description>
+ </method>
<method name="get_render_target_size">
<return type="Vector2" />
<description>
@@ -63,6 +69,34 @@
Is [code]true[/code] if this interface has been initialised.
</description>
</method>
+ <method name="set_play_area_mode">
+ <return type="bool" />
+ <argument index="0" name="mode" type="int" enum="XRInterface.PlayAreaMode" />
+ <description>
+ Sets the active play area mode, will return [code]false[/code] if the mode can't be used with this interface.
+ </description>
+ </method>
+ <method name="supports_play_area_mode">
+ <return type="bool" />
+ <argument index="0" name="mode" type="int" enum="XRInterface.PlayAreaMode" />
+ <description>
+ Call this to find out if a given play area mode is supported by this interface.
+ </description>
+ </method>
+ <method name="trigger_haptic_pulse">
+ <return type="void" />
+ <argument index="0" name="action_name" type="String" />
+ <argument index="1" name="tracker_name" type="StringName" />
+ <argument index="2" name="frequency" type="float" />
+ <argument index="3" name="amplitude" type="float" />
+ <argument index="4" name="duration_sec" type="float" />
+ <argument index="5" name="delay_sec" type="float" />
+ <description>
+ Triggers a haptic pulse on a device associated with this interface.
+ [code]action_name[/code] is the name of the action for this pulse.
+ [code]tracker_name[/code] is optional and can be used to direct the pulse to a specific device provided that device is bound to this haptic.
+ </description>
+ </method>
<method name="uninitialize">
<return type="void" />
<description>
@@ -77,7 +111,18 @@
<member name="interface_is_primary" type="bool" setter="set_primary" getter="is_primary" default="false">
[code]true[/code] if this is the primary interface.
</member>
+ <member name="xr_play_area_mode" type="int" setter="set_play_area_mode" getter="get_play_area_mode" enum="XRInterface.PlayAreaMode" default="0">
+ The play area mode for this interface.
+ </member>
</members>
+ <signals>
+ <signal name="play_area_changed">
+ <argument index="0" name="mode" type="int" />
+ <description>
+ Emitted when the play area is changed. This can be a result of the player resetting the boundary or entering a new play area, the player changing the play area mode, the world scale changing or the player resetting their headset orientation.
+ </description>
+ </signal>
+ </signals>
<constants>
<constant name="XR_NONE" value="0" enum="Capabilities">
No XR capabilities.
@@ -88,20 +133,17 @@
<constant name="XR_STEREO" value="2" enum="Capabilities">
This interface supports stereoscopic rendering.
</constant>
- <constant name="XR_AR" value="4" enum="Capabilities">
- This interface supports AR (video background and real world tracking).
- </constant>
- <constant name="XR_EXTERNAL" value="8" enum="Capabilities">
- 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.
+ <constant name="XR_QUAD" value="4" enum="Capabilities">
+ This interface supports quad rendering (not yet supported by Godot).
</constant>
- <constant name="EYE_MONO" value="0" enum="Eyes">
- Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported.
+ <constant name="XR_VR" value="8" enum="Capabilities">
+ this interface supports VR.
</constant>
- <constant name="EYE_LEFT" value="1" enum="Eyes">
- Left eye output, this is mostly used internally when rendering the image for the left eye and obtaining positioning and projection information.
+ <constant name="XR_AR" value="16" enum="Capabilities">
+ This interface supports AR (video background and real world tracking).
</constant>
- <constant name="EYE_RIGHT" value="2" enum="Eyes">
- Right eye output, this is mostly used internally when rendering the image for the right eye and obtaining positioning and projection information.
+ <constant name="XR_EXTERNAL" value="32" enum="Capabilities">
+ 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.
</constant>
<constant name="XR_NORMAL_TRACKING" value="0" enum="TrackingStatus">
Tracking is behaving as expected.
@@ -118,5 +160,20 @@
<constant name="XR_NOT_TRACKING" value="4" enum="TrackingStatus">
Tracking is not functional (camera not plugged in or obscured, lighthouses turned off, etc.).
</constant>
+ <constant name="XR_PLAY_AREA_UNKNOWN" value="0" enum="PlayAreaMode">
+ Play area mode not set or not available.
+ </constant>
+ <constant name="XR_PLAY_AREA_3DOF" value="1" enum="PlayAreaMode">
+ Play area only supports orientation tracking, no positional tracking, area will center around player.
+ </constant>
+ <constant name="XR_PLAY_AREA_SITTING" value="2" enum="PlayAreaMode">
+ Player is in seated position, limited positional tracking, fixed guardian around player.
+ </constant>
+ <constant name="XR_PLAY_AREA_ROOMSCALE" value="3" enum="PlayAreaMode">
+ Player is free to move around, full positional tracking.
+ </constant>
+ <constant name="XR_PLAY_AREA_STAGE" value="4" enum="PlayAreaMode">
+ Same as roomscale but origin point is fixed to the center of the physical space, XRServer.center_on_hmd disabled.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/XRInterfaceExtension.xml b/doc/classes/XRInterfaceExtension.xml
index 84b46e0ddd..d2bb6aa59a 100644
--- a/doc/classes/XRInterfaceExtension.xml
+++ b/doc/classes/XRInterfaceExtension.xml
@@ -41,6 +41,16 @@
<description>
</description>
</method>
+ <method name="_get_play_area" qualifiers="virtual const">
+ <return type="PackedVector3Array" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_play_area_mode" qualifiers="virtual const">
+ <return type="int" />
+ <description>
+ </description>
+ </method>
<method name="_get_projection_for_view" qualifiers="virtual">
<return type="PackedFloat64Array" />
<argument index="0" name="view" type="int" />
@@ -55,6 +65,17 @@
<description>
</description>
</method>
+ <method name="_get_suggested_pose_names" qualifiers="virtual const">
+ <return type="PackedStringArray" />
+ <argument index="0" name="tracker_name" type="StringName" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_suggested_tracker_names" qualifiers="virtual const">
+ <return type="PackedStringArray" />
+ <description>
+ </description>
+ </method>
<method name="_get_tracking_status" qualifiers="virtual const">
<return type="int" />
<description>
@@ -99,6 +120,29 @@
<description>
</description>
</method>
+ <method name="_set_play_area_mode" qualifiers="virtual const">
+ <return type="bool" />
+ <argument index="0" name="mode" type="int" />
+ <description>
+ </description>
+ </method>
+ <method name="_supports_play_area_mode" qualifiers="virtual const">
+ <return type="bool" />
+ <argument index="0" name="mode" type="int" enum="XRInterface.PlayAreaMode" />
+ <description>
+ </description>
+ </method>
+ <method name="_trigger_haptic_pulse" qualifiers="virtual">
+ <return type="void" />
+ <argument index="0" name="action_name" type="String" />
+ <argument index="1" name="tracker_name" type="StringName" />
+ <argument index="2" name="frequency" type="float" />
+ <argument index="3" name="amplitude" type="float" />
+ <argument index="4" name="duration_sec" type="float" />
+ <argument index="5" name="delay_sec" type="float" />
+ <description>
+ </description>
+ </method>
<method name="_uninitialize" qualifiers="virtual">
<return type="void" />
<description>
diff --git a/doc/classes/XRNode3D.xml b/doc/classes/XRNode3D.xml
new file mode 100644
index 0000000000..2e6d11d729
--- /dev/null
+++ b/doc/classes/XRNode3D.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="XRNode3D" inherits="Node3D" version="4.0">
+ <brief_description>
+ A spatial node that has its position automatically updated by the [XRServer].
+ </brief_description>
+ <description>
+ This node can be bound to a specific pose of a [XRPositionalTracker] and will automatically have its [member Node3D.transform] updated by the [XRServer]. Nodes of this type must be added as children of the [XROrigin3D] node.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="get_has_tracking_data" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if the [member tracker] has current tracking data for the [member pose] being tracked.
+ </description>
+ </method>
+ <method name="get_is_active" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if the [member tracker] has been registered and the [member pose] is being tracked.
+ </description>
+ </method>
+ <method name="get_pose">
+ <return type="XRPose" />
+ <description>
+ Returns the [XRPose] containing the current state of the pose being tracked. This gives access to additional properties of this pose.
+ </description>
+ </method>
+ <method name="trigger_haptic_pulse">
+ <return type="void" />
+ <argument index="0" name="action_name" type="String" />
+ <argument index="1" name="frequency" type="float" />
+ <argument index="2" name="amplitude" type="float" />
+ <argument index="3" name="duration_sec" type="float" />
+ <argument index="4" name="delay_sec" type="float" />
+ <description>
+ Triggers a haptic pulse on a device associated with this interface.
+ [code]action_name[/code] is the name of the action for this pulse.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="pose" type="StringName" setter="set_pose_name" getter="get_pose_name" default="&amp;&quot;default&quot;">
+ The name of the pose we're bound to. Which poses a tracker supports is not known during design time.
+ Godot defines number of standard pose names such as [code]aim[/code] and [code]grip[/code] but other may be configured within a given [XRInterface].
+ </member>
+ <member name="tracker" type="StringName" setter="set_tracker" getter="get_tracker" default="&amp;&quot;&quot;">
+ The name of the tracker we're bound to. Which trackers are available is not known during design time.
+ Godot defines a number of standard trackers such as [code]left_hand[/code] and [code]right_hand[/code] but others may be configured within a given [XRInterface].
+ </member>
+ </members>
+</class>
diff --git a/doc/classes/XRPose.xml b/doc/classes/XRPose.xml
new file mode 100644
index 0000000000..0de2bc9e48
--- /dev/null
+++ b/doc/classes/XRPose.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="XRPose" inherits="RefCounted" version="4.0">
+ <brief_description>
+ This object contains all data related to a pose on a tracked object.
+ </brief_description>
+ <description>
+ XR runtimes often identify multiple locations on devices such as controllers that are spatially tracked.
+ Orientation, location, linear velocity and angular velocity are all provided for each pose by the XR runtime. This object contains this state of a pose.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="get_adjusted_transform" qualifiers="const">
+ <return type="Transform3D" />
+ <description>
+ Returns the [member transform] with world scale and our reference frame applied. This is the transform used to position [XRNode3D] objects.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" default="Vector3(0, 0, 0)">
+ The angular velocity for this pose.
+ </member>
+ <member name="has_tracking_data" type="bool" setter="set_has_tracking_data" getter="get_has_tracking_data" default="false">
+ If [code]true[/code] our tracking data is up to date. If [code]false[/code] we're no longer receiving new tracking data and our state is whatever that last valid state was.
+ </member>
+ <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3(0, 0, 0)">
+ The linear velocity of this pose.
+ </member>
+ <member name="name" type="StringName" setter="set_name" getter="get_name" default="&amp;&quot;&quot;">
+ The name of this pose. Pose names are often driven by an action map setup by the user. Godot does suggest a number of pose names that it expects [XRInterface]s to implement:
+ - [code]root[/code] defines a root location, often used for tracked objects that do not have further nodes.
+ - [code]aim[/code] defines the tip of a controller with the orientation pointing outwards, for instance: add your raycasts to this.
+ - [code]grip[/code] defines the location where the user grips the controller
+ - [code]skeleton[/code] defines the root location a hand mesh should be placed when using hand tracking and the animated skeleton supplied by the XR runtime.
+ </member>
+ <member name="transform" type="Transform3D" setter="set_transform" getter="get_transform" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)">
+ The transform containing the original and transform as reported by the XR runtime.
+ </member>
+ </members>
+</class>
diff --git a/doc/classes/XRPositionalTracker.xml b/doc/classes/XRPositionalTracker.xml
index d231bfde74..bd6a518835 100644
--- a/doc/classes/XRPositionalTracker.xml
+++ b/doc/classes/XRPositionalTracker.xml
@@ -5,86 +5,113 @@
</brief_description>
<description>
An instance of this object represents a device that is tracked, such as a controller or anchor point. HMDs aren't represented here as they are handled internally.
- As controllers are turned on and the AR/VR interface detects them, instances of this object are automatically added to this list of active tracking objects accessible through the [XRServer].
- The [XRController3D] and [XRAnchor3D] both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDNative-based interfaces can interact with them.
+ As controllers are turned on and the [XRInterface] detects them, instances of this object are automatically added to this list of active tracking objects accessible through the [XRServer].
+ The [XRController3D] and [XRAnchor3D] both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDExtension-based interfaces can interact with them.
</description>
<tutorials>
<link title="VR documentation index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
</tutorials>
<methods>
- <method name="get_joy_id" qualifiers="const">
- <return type="int" />
+ <method name="get_input" qualifiers="const">
+ <return type="Variant" />
+ <argument index="0" name="name" type="StringName" />
<description>
- If this is a controller that is being tracked, the controller will also be represented by a joystick entry with this ID.
+ Returns an input for this tracker. It can return a boolean, float or [Vector2] value depending on whether the input is a button, trigger or thumbstick/thumbpad.
</description>
</method>
- <method name="get_mesh" qualifiers="const">
- <return type="Mesh" />
+ <method name="get_pose" qualifiers="const">
+ <return type="XRPose" />
+ <argument index="0" name="name" type="StringName" />
<description>
- Returns the mesh related to a controller or anchor point if one is available.
+ Returns the current [XRPose] state object for the bound [code]pose[/code].
</description>
</method>
- <method name="get_orientation" qualifiers="const">
- <return type="Basis" />
+ <method name="has_pose" qualifiers="const">
+ <return type="bool" />
+ <argument index="0" name="name" type="StringName" />
<description>
- Returns the controller's orientation matrix.
+ Returns [code]true[/code] if the bound [code]tracker[/code] is available and is currently tracking the bound [code]pose[/code].
</description>
</method>
- <method name="get_position" qualifiers="const">
- <return type="Vector3" />
+ <method name="invalidate_pose">
+ <return type="void" />
+ <argument index="0" name="name" type="StringName" />
<description>
- Returns the world-space controller position.
+ Marks this pose as invalid, we don't clear the last reported state but it allows users to decide if trackers need to be hidden if we loose tracking or just remain at their last known position.
</description>
</method>
- <method name="get_tracker_hand" qualifiers="const">
- <return type="int" enum="XRPositionalTracker.TrackerHand" />
+ <method name="set_input">
+ <return type="void" />
+ <argument index="0" name="name" type="StringName" />
+ <argument index="1" name="value" type="Variant" />
<description>
- Returns the hand holding this tracker, if known. See [enum TrackerHand] constants.
+ Changes the value for the given input. This method is called by a [XRInterface] implementation and should not be used directly.
</description>
</method>
- <method name="get_tracker_id" qualifiers="const">
- <return type="int" />
+ <method name="set_pose">
+ <return type="void" />
+ <argument index="0" name="name" type="StringName" />
+ <argument index="1" name="transform" type="Transform3D" />
+ <argument index="2" name="linear_velocity" type="Vector3" />
+ <argument index="3" name="angular_velocity" type="Vector3" />
<description>
- Returns the internal tracker ID. This uniquely identifies the tracker per tracker type and matches the ID you need to specify for nodes such as the [XRController3D] and [XRAnchor3D] nodes.
+ Sets the transform, linear velocity and angular velocity for the given pose. This method is called by a [XRInterface] implementation and should not be used directly.
</description>
</method>
- <method name="get_tracker_name" qualifiers="const">
- <return type="StringName" />
+ </methods>
+ <members>
+ <member name="description" type="String" setter="set_tracker_desc" getter="get_tracker_desc" default="&quot;&quot;">
+ The description of this tracker.
+ </member>
+ <member name="hand" type="int" setter="set_tracker_hand" getter="get_tracker_hand" enum="XRPositionalTracker.TrackerHand" default="0">
+ Defines which hand this tracker relates to.
+ </member>
+ <member name="name" type="StringName" setter="set_tracker_name" getter="get_tracker_name" default="&amp;&quot;Unknown&quot;">
+ The unique name of this tracker. The trackers that are available differ between various XR runtimes and can often be configured by the user. Godot maintains a number of reserved names that it expects the [XRInterface] to implement if applicable:
+ - [code]left_hand[/code] identifies the controller held in the players left hand
+ - [code]right_hand[/code] identifies the controller held in the players right hand
+ </member>
+ <member name="rumble" type="float" setter="set_rumble" getter="get_rumble" default="0.0">
+ The degree to which the tracker rumbles. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code].
+ </member>
+ <member name="type" type="int" setter="set_tracker_type" getter="get_tracker_type" enum="XRServer.TrackerType" default="128">
+ The type of tracker.
+ </member>
+ </members>
+ <signals>
+ <signal name="button_pressed">
+ <argument index="0" name="name" type="String" />
<description>
- Returns the controller or anchor point's name, if applicable.
+ Emitted when a button on this tracker is pressed. Note that many XR runtimes allow other inputs to be mapped to buttons.
</description>
- </method>
- <method name="get_tracker_type" qualifiers="const">
- <return type="int" enum="XRServer.TrackerType" />
+ </signal>
+ <signal name="button_released">
+ <argument index="0" name="name" type="String" />
<description>
- Returns the tracker's type, which will be one of the values from the [enum XRServer.TrackerType] enum.
+ Emitted when a button on this tracker is released.
</description>
- </method>
- <method name="get_transform" qualifiers="const">
- <return type="Transform3D" />
- <argument index="0" name="adjust_by_reference_frame" type="bool" />
+ </signal>
+ <signal name="input_axis_changed">
+ <argument index="0" name="name" type="String" />
+ <argument index="1" name="vector" type="Vector2" />
<description>
- Returns the transform combining this device's orientation and position.
+ Emitted when a thumbstick or thumbpad on this tracker moves.
</description>
- </method>
- <method name="is_tracking_orientation" qualifiers="const">
- <return type="bool" />
+ </signal>
+ <signal name="input_value_changed">
+ <argument index="0" name="name" type="String" />
+ <argument index="1" name="value" type="float" />
<description>
- Returns [code]true[/code] if this device is tracking orientation.
+ Emitted when a trigger or similar input on this tracker changes value.
</description>
- </method>
- <method name="is_tracking_position" qualifiers="const">
- <return type="bool" />
+ </signal>
+ <signal name="pose_changed">
+ <argument index="0" name="pose" type="XRPose" />
<description>
- Returns [code]true[/code] if this device is tracking position.
+ Emitted when the state of a pose tracked by this tracker changes.
</description>
- </method>
- </methods>
- <members>
- <member name="rumble" type="float" setter="set_rumble" getter="get_rumble" default="0.0">
- The degree to which the tracker rumbles. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code].
- </member>
- </members>
+ </signal>
+ </signals>
<constants>
<constant name="TRACKER_HAND_UNKNOWN" value="0" enum="TrackerHand">
The hand this tracker is held in is unknown or not applicable.
diff --git a/doc/classes/XRServer.xml b/doc/classes/XRServer.xml
index 0929094fd1..87164ebb52 100644
--- a/doc/classes/XRServer.xml
+++ b/doc/classes/XRServer.xml
@@ -90,20 +90,21 @@
<method name="get_reference_frame" qualifiers="const">
<return type="Transform3D" />
<description>
- Returns the reference frame transform. Mostly used internally and exposed for GDNative build interfaces.
+ Returns the reference frame transform. Mostly used internally and exposed for GDExtension build interfaces.
</description>
</method>
<method name="get_tracker" qualifiers="const">
<return type="XRPositionalTracker" />
- <argument index="0" name="idx" type="int" />
+ <argument index="0" name="tracker_name" type="StringName" />
<description>
- Returns the positional tracker at the given ID.
+ Returns the positional tracker with this name.
</description>
</method>
- <method name="get_tracker_count" qualifiers="const">
- <return type="int" />
+ <method name="get_trackers">
+ <return type="Dictionary" />
+ <argument index="0" name="tracker_types" type="int" />
<description>
- Returns the number of trackers currently registered.
+ Returns a dictionary of trackers for this type.
</description>
</method>
<method name="remove_interface">
@@ -145,7 +146,6 @@
<signal name="tracker_added">
<argument index="0" name="tracker_name" type="StringName" />
<argument index="1" name="type" type="int" />
- <argument index="2" name="id" type="int" />
<description>
Emitted when a new tracker has been added. If you don't use a fixed number of controllers or if you're using [XRAnchor3D]s for an AR solution, it is important to react to this signal to add the appropriate [XRController3D] or [XRAnchor3D] nodes related to this new tracker.
</description>
@@ -153,20 +153,29 @@
<signal name="tracker_removed">
<argument index="0" name="tracker_name" type="StringName" />
<argument index="1" name="type" type="int" />
- <argument index="2" name="id" type="int" />
<description>
Emitted when a tracker is removed. You should remove any [XRController3D] or [XRAnchor3D] points if applicable. This is not mandatory, the nodes simply become inactive and will be made active again when a new tracker becomes available (i.e. a new controller is switched on that takes the place of the previous one).
</description>
</signal>
+ <signal name="tracker_updated">
+ <argument index="0" name="tracker_name" type="StringName" />
+ <argument index="1" name="type" type="int" />
+ <description>
+ Emitted when an existing tracker has been updated. This can happen if the user switches controllers.
+ </description>
+ </signal>
</signals>
<constants>
- <constant name="TRACKER_CONTROLLER" value="1" enum="TrackerType">
+ <constant name="TRACKER_HEAD" value="1" enum="TrackerType">
+ The tracker tracks the location of the players head. This is usually a location centered between the players eyes. Note that for handheld AR devices this can be the current location of the device.
+ </constant>
+ <constant name="TRACKER_CONTROLLER" value="2" enum="TrackerType">
The tracker tracks the location of a controller.
</constant>
- <constant name="TRACKER_BASESTATION" value="2" enum="TrackerType">
+ <constant name="TRACKER_BASESTATION" value="4" enum="TrackerType">
The tracker tracks the location of a base station.
</constant>
- <constant name="TRACKER_ANCHOR" value="4" enum="TrackerType">
+ <constant name="TRACKER_ANCHOR" value="8" enum="TrackerType">
The tracker tracks the location and size of an AR anchor.
</constant>
<constant name="TRACKER_ANY_KNOWN" value="127" enum="TrackerType">