mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
Currently including `zh_CN` and `es` which both have very high completion ratios. Others will be added once they reach a significant percentage too. These RST files will be used by godot-docs in place of its `classes` folder after we sync with https://github.com/godotengine/godot-docs/pull/5458. The update workflow is manual for now (example for `zh_CN`): - Build `godotengine/godot` in the branch we currently track (now `3.x`) - Run `godot --doctool -l zh_CN` - Run `cd doc && make rst LANGARG=zh_CN` - Copy `doc/_build/rst/*` to `classes/zh_CN/` here - Make sure to have `classes/zh_CN/index.rst` copied from `docs/classes`
184 lines
9.4 KiB
ReStructuredText
184 lines
9.4 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the ARVRController.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_ARVRController:
|
|
|
|
ARVRController
|
|
==============
|
|
|
|
**Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
Un nodo espacial que representa un controlador de seguimiento espacial.
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
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 ARVRController nodes to your scene.
|
|
|
|
The position of the controller node is automatically updated by the :ref:`ARVRServer<class_ARVRServer>`. This makes this node ideal to add child nodes to visualize the controller.
|
|
|
|
Tutoriales
|
|
--------------------
|
|
|
|
- :doc:`../tutorials/vr/index`
|
|
|
|
Propiedades
|
|
----------------------
|
|
|
|
+---------------------------+-------------------------------------------------------------------+---------+
|
|
| :ref:`int<class_int>` | :ref:`controller_id<class_ARVRController_property_controller_id>` | ``1`` |
|
|
+---------------------------+-------------------------------------------------------------------+---------+
|
|
| :ref:`float<class_float>` | :ref:`rumble<class_ARVRController_property_rumble>` | ``0.0`` |
|
|
+---------------------------+-------------------------------------------------------------------+---------+
|
|
|
|
Métodos
|
|
--------------
|
|
|
|
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_controller_name<class_ARVRController_method_get_controller_name>` **(** **)** |const| |
|
|
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` | :ref:`get_hand<class_ARVRController_method_get_hand>` **(** **)** |const| |
|
|
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`get_is_active<class_ARVRController_method_get_is_active>` **(** **)** |const| |
|
|
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_joystick_axis<class_ARVRController_method_get_joystick_axis>` **(** :ref:`int<class_int>` axis **)** |const| |
|
|
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_joystick_id<class_ARVRController_method_get_joystick_id>` **(** **)** |const| |
|
|
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Mesh<class_Mesh>` | :ref:`get_mesh<class_ARVRController_method_get_mesh>` **(** **)** |const| |
|
|
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`is_button_pressed<class_ARVRController_method_is_button_pressed>` **(** :ref:`int<class_int>` button **)** |const| |
|
|
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Señales
|
|
--------------
|
|
|
|
.. _class_ARVRController_signal_button_pressed:
|
|
|
|
- **button_pressed** **(** :ref:`int<class_int>` button **)**
|
|
|
|
Se emite cuando se presiona un botón de este controlador.
|
|
|
|
----
|
|
|
|
.. _class_ARVRController_signal_button_release:
|
|
|
|
- **button_release** **(** :ref:`int<class_int>` button **)**
|
|
|
|
Se emite cuando se libera un botón de este controlador.
|
|
|
|
----
|
|
|
|
.. _class_ARVRController_signal_mesh_updated:
|
|
|
|
- **mesh_updated** **(** :ref:`Mesh<class_Mesh>` mesh **)**
|
|
|
|
Emitido cuando la malla asociada al controlador cambia o cuando uno se hace disponible. En términos generales, esta será una malla estática después de estar disponible.
|
|
|
|
Descripciones de Propiedades
|
|
--------------------------------------------------------
|
|
|
|
.. _class_ARVRController_property_controller_id:
|
|
|
|
- :ref:`int<class_int>` **controller_id**
|
|
|
|
+-----------+--------------------------+
|
|
| *Default* | ``1`` |
|
|
+-----------+--------------------------+
|
|
| *Setter* | set_controller_id(value) |
|
|
+-----------+--------------------------+
|
|
| *Getter* | get_controller_id() |
|
|
+-----------+--------------------------+
|
|
|
|
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 :ref:`ARVRServer<class_ARVRServer>` 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.
|
|
|
|
----
|
|
|
|
.. _class_ARVRController_property_rumble:
|
|
|
|
- :ref:`float<class_float>` **rumble**
|
|
|
|
+-----------+-------------------+
|
|
| *Default* | ``0.0`` |
|
|
+-----------+-------------------+
|
|
| *Setter* | set_rumble(value) |
|
|
+-----------+-------------------+
|
|
| *Getter* | get_rumble() |
|
|
+-----------+-------------------+
|
|
|
|
The degree to which the controller vibrates. Ranges from ``0.0`` to ``1.0`` with precision ``.01``. If changed, updates :ref:`ARVRPositionalTracker.rumble<class_ARVRPositionalTracker_property_rumble>` accordingly.
|
|
|
|
This is a useful property to animate if you want the controller to vibrate for a limited duration.
|
|
|
|
Descripciones de Métodos
|
|
------------------------------------------------
|
|
|
|
.. _class_ARVRController_method_get_controller_name:
|
|
|
|
- :ref:`String<class_String>` **get_controller_name** **(** **)** |const|
|
|
|
|
Si está activo, devuelve el nombre del controlador asociado si lo proporciona el SDK AR/VR utilizado.
|
|
|
|
----
|
|
|
|
.. _class_ARVRController_method_get_hand:
|
|
|
|
- :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` **get_hand** **(** **)** |const|
|
|
|
|
Returns the hand holding this controller, if known. See :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>`.
|
|
|
|
----
|
|
|
|
.. _class_ARVRController_method_get_is_active:
|
|
|
|
- :ref:`bool<class_bool>` **get_is_active** **(** **)** |const|
|
|
|
|
Returns ``true`` if the bound controller is active. ARVR systems attempt to track active controllers.
|
|
|
|
----
|
|
|
|
.. _class_ARVRController_method_get_joystick_axis:
|
|
|
|
- :ref:`float<class_float>` **get_joystick_axis** **(** :ref:`int<class_int>` axis **)** |const|
|
|
|
|
Devuelve el valor del eje dado para cosas como disparadores, touchpads, etc. que están incrustados en el controlador.
|
|
|
|
----
|
|
|
|
.. _class_ARVRController_method_get_joystick_id:
|
|
|
|
- :ref:`int<class_int>` **get_joystick_id** **(** **)** |const|
|
|
|
|
Returns the ID of the joystick object bound to this. Every controller tracked by the :ref:`ARVRServer<class_ARVRServer>` 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.
|
|
|
|
----
|
|
|
|
.. _class_ARVRController_method_get_mesh:
|
|
|
|
- :ref:`Mesh<class_Mesh>` **get_mesh** **(** **)** |const|
|
|
|
|
If provided by the :ref:`ARVRInterface<class_ARVRInterface>`, this returns a mesh associated with the controller. This can be used to visualize the controller.
|
|
|
|
----
|
|
|
|
.. _class_ARVRController_method_is_button_pressed:
|
|
|
|
- :ref:`int<class_int>` **is_button_pressed** **(** :ref:`int<class_int>` button **)** |const|
|
|
|
|
Returns ``true`` if the button at index ``button`` is pressed. See :ref:`JoystickList<enum_@GlobalScope_JoystickList>`, in particular the ``JOY_VR_*`` constants.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|