class_arvrcontroller.rst 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the ARVRController.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_ARVRController:
  5. ARVRController
  6. ==============
  7. **Inherits:** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. A spatial node representing a spatially tracked controller.
  12. Member Functions
  13. ----------------
  14. +------------------------------+--------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`int<class_int>` | :ref:`get_controller_id<class_ARVRController_get_controller_id>` **(** **)** const |
  16. +------------------------------+--------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`String<class_string>` | :ref:`get_controller_name<class_ARVRController_get_controller_name>` **(** **)** const |
  18. +------------------------------+--------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`get_hand<class_ARVRController_get_hand>` **(** **)** const |
  20. +------------------------------+--------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`get_is_active<class_ARVRController_get_is_active>` **(** **)** const |
  22. +------------------------------+--------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`float<class_float>` | :ref:`get_joystick_axis<class_ARVRController_get_joystick_axis>` **(** :ref:`int<class_int>` axis **)** const |
  24. +------------------------------+--------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`int<class_int>` | :ref:`get_joystick_id<class_ARVRController_get_joystick_id>` **(** **)** const |
  26. +------------------------------+--------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`is_button_pressed<class_ARVRController_is_button_pressed>` **(** :ref:`int<class_int>` button **)** const |
  28. +------------------------------+--------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`set_controller_id<class_ARVRController_set_controller_id>` **(** :ref:`int<class_int>` controller_id **)** |
  30. +------------------------------+--------------------------------------------------------------------------------------------------------------------+
  31. Signals
  32. -------
  33. - **button_pressed** **(** :ref:`int<class_int>` button **)**
  34. When a button on this controller is pressed, this signal is given.
  35. - **button_release** **(** :ref:`int<class_int>` button **)**
  36. When a button on this controller is released, this signal is given.
  37. Member Variables
  38. ----------------
  39. - :ref:`int<class_int>` **controller_id**
  40. Description
  41. -----------
  42. This is a helper spatial node that is linked to the tracking of controllers. It also offers several handy pass throughs to the state of buttons and such on the controllers.
  43. Controllers are linked by their id. You can create controller nodes before the controllers are available. Say your game always uses two controllers (one for each hand) you can predefine the controllers with id 1 and 2 and 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.
  44. The position of the controller node is automatically updated by the ARVR Server. This makes this node ideal to add child nodes to visualise the controller.
  45. Member Function Description
  46. ---------------------------
  47. .. _class_ARVRController_get_controller_id:
  48. - :ref:`int<class_int>` **get_controller_id** **(** **)** const
  49. Returns the controller id currently assigned to this node.
  50. .. _class_ARVRController_get_controller_name:
  51. - :ref:`String<class_string>` **get_controller_name** **(** **)** const
  52. If active, returns the name of the associated controller if provided by the AR/VR SDK used.
  53. .. _class_ARVRController_get_hand:
  54. - :ref:`int<class_int>` **get_hand** **(** **)** const
  55. .. _class_ARVRController_get_is_active:
  56. - :ref:`bool<class_bool>` **get_is_active** **(** **)** const
  57. Returns true if the controller bound to this node is currently active and being tracked.
  58. .. _class_ARVRController_get_joystick_axis:
  59. - :ref:`float<class_float>` **get_joystick_axis** **(** :ref:`int<class_int>` axis **)** const
  60. Returns the value of the given axis for things like triggers, touchpads, etc. that are embedded into the controller.
  61. .. _class_ARVRController_get_joystick_id:
  62. - :ref:`int<class_int>` **get_joystick_id** **(** **)** const
  63. Returns the ID of the joystick object bound to this. Every controller tracked by the ARVR Server 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.
  64. .. _class_ARVRController_is_button_pressed:
  65. - :ref:`int<class_int>` **is_button_pressed** **(** :ref:`int<class_int>` button **)** const
  66. Is the given button currently pressed?
  67. .. _class_ARVRController_set_controller_id:
  68. - void **set_controller_id** **(** :ref:`int<class_int>` controller_id **)**
  69. Changes the id that identifies the controller bound to this node. The first controller that the ARVR Server detects will have id 1, the second id 2, the third id 3, etc. When a controller is turned off that slot is freed ensuring that controllers will keep the same id while it is turned on even when controllers with lower ids are turned off.