XRController3D

package
v0.0.0-...-ae8aae0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package XRController3D provides methods for working with XRController3D object instances.

Index

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 Any

type Any interface {
	gd.IsClass
	AsXRController3D() Instance
}

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 New

func New() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode3D

func (self Instance) AsNode3D() Node3D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsXRController3D

func (self Instance) AsXRController3D() Instance

func (Instance) AsXRNode3D

func (self Instance) AsXRNode3D() XRNode3D.Instance

func (Instance) GetFloat

func (self Instance) GetFloat(name string) Float.X

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

func (Instance) GetInput

func (self Instance) GetInput(name string) any

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

func (self Instance) GetVector2(name string) Vector2.XY

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

func (self Instance) IsButtonPressed(name string) bool

Returns [code]true[/code] if the button with the given [param name] is pressed.

func (Instance) OnButtonPressed

func (self Instance) OnButtonPressed(cb func(name string))

func (Instance) OnButtonReleased

func (self Instance) OnButtonReleased(cb func(name string))

func (Instance) OnInputFloatChanged

func (self Instance) OnInputFloatChanged(cb func(name string, value Float.X))

func (Instance) OnInputVector2Changed

func (self Instance) OnInputVector2Changed(cb func(name string, value Vector2.XY))

func (Instance) OnProfileChanged

func (self Instance) OnProfileChanged(cb func(role string))

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL