ARVRController¶
Inherits: Spatial < Node < 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 ARVRServer. This makes this node ideal to add child nodes to visualize the controller.
Tutoriales¶
Propiedades¶
|
||
|
Métodos¶
get_controller_name ( ) const |
|
get_hand ( ) const |
|
get_is_active ( ) const |
|
get_joystick_axis ( int axis ) const |
|
get_joystick_id ( ) const |
|
get_mesh ( ) const |
|
is_button_pressed ( int button ) const |
Señales¶
button_pressed ( int button )
Se emite cuando se presiona un botón de este controlador.
button_release ( int button )
Se emite cuando se libera un botón de este controlador.
mesh_updated ( 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¶
int controller_id
Default |
|
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 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.
float rumble
Default |
|
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 ARVRPositionalTracker.rumble accordingly.
This is a useful property to animate if you want the controller to vibrate for a limited duration.
Descripciones de Métodos¶
String get_controller_name ( ) const
Si está activo, devuelve el nombre del controlador asociado si lo proporciona el SDK AR/VR utilizado.
TrackerHand get_hand ( ) const
Returns the hand holding this controller, if known. See TrackerHand.
bool get_is_active ( ) const
Returns true
if the bound controller is active. ARVR systems attempt to track active controllers.
Devuelve el valor del eje dado para cosas como disparadores, touchpads, etc. que están incrustados en el controlador.
int get_joystick_id ( ) const
Returns the ID of the joystick object bound to this. Every controller tracked by the 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.
Mesh get_mesh ( ) const
If provided by the ARVRInterface, this returns a mesh associated with the controller. This can be used to visualize the controller.
Returns true
if the button at index button
is pressed. See JoystickList, in particular the JOY_VR_*
constants.