class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectNodeNode3DXRNode3D XRController3D
A spatial node representing a spatially-tracked controller.

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.

button_pressed button_pressed<>( String name=, name:String=, ):button_pressed

Emitted when a button on this controller is pressed.

button_released button_released<>( String name=, name:String=, ):button_released

Emitted when a button on this controller is released.

input_float_changed input_float_changed<>( String name=, name:String=, float value=, value:float=, ):input_float_changed

Emitted when a trigger or similar input on this controller changes value.

input_vector2_changed input_vector2_changed<>( String name=, name:String=, Vector2 value=, value:Vector2=, ):input_vector2_changed

Emitted when a thumbstick or thumbpad on this controller is moved.

float get_float<>( StringName name=, name:StringName=, ):float

Returns a numeric value for the input with the given name. This is used for triggers and grip sensors.

Variant get_input<>( StringName name=, name:StringName=, ):Variant

Returns a Variant for the input with the given name. This works for any input type, the variant will be typed according to the actions configuration.

TrackerHand get_tracker_hand<>():TrackerHand

Returns the hand holding this controller, if known. See TrackerHand.

Vector2 get_vector2<>( StringName name=, name:StringName=, ):Vector2

Returns a Vector2 for the input with the given name. This is used for thumbsticks and thumbpads found on many controllers.

bool is_button_pressed<>( StringName name=, name:StringName=, ):bool

Returns true if the button with the given name is pressed.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...