Documentation ¶
Overview ¶
Package XRController3D provides methods for working with XRController3D object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsXRController3D() Instance
- func (self Instance) AsXRNode3D() XRNode3D.Instance
- func (self Instance) GetFloat(name string) Float.X
- func (self Instance) GetInput(name string) any
- func (self Instance) GetTrackerHand() gdclass.XRPositionalTrackerTrackerHand
- func (self Instance) GetVector2(name string) Vector2.XY
- func (self Instance) IsButtonPressed(name string) bool
- func (self Instance) OnButtonPressed(cb func(name string))
- func (self Instance) OnButtonReleased(cb func(name string))
- func (self Instance) OnInputFloatChanged(cb func(name string, value Float.X))
- func (self Instance) OnInputVector2Changed(cb func(name string, value Vector2.XY))
- func (self Instance) OnProfileChanged(cb func(role string))
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Instance ¶
type Instance [1]gdclass.XRController3D
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.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsXRController3D ¶
func (Instance) AsXRNode3D ¶
func (Instance) GetFloat ¶
Returns a numeric value for the input with the given [param name]. This is used for triggers and grip sensors.
func (Instance) GetInput ¶
Returns a [Variant] for the input with the given [param name]. This works for any input type, the variant will be typed according to the actions configuration.
func (Instance) GetTrackerHand ¶
func (self Instance) GetTrackerHand() gdclass.XRPositionalTrackerTrackerHand
Returns the hand holding this controller, if known. See [enum XRPositionalTracker.TrackerHand].
func (Instance) GetVector2 ¶
Returns a [Vector2] for the input with the given [param name]. This is used for thumbsticks and thumbpads found on many controllers.
func (Instance) IsButtonPressed ¶
Returns [code]true[/code] if the button with the given [param name] is pressed.