XRPositionalTracker

package
v0.0.0-...-5eaf078 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package XRPositionalTracker provides methods for working with XRPositionalTracker 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
	AsXRPositionalTracker() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsXRPositionalTracker

func (self *Extension[T]) AsXRPositionalTracker() Instance

func (*Extension[T]) AsXRTracker

func (self *Extension[T]) AsXRTracker() XRTracker.Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.XRPositionalTracker

An instance of this object represents a device that is tracked, such as a controller or anchor point. HMDs aren't represented here as they are handled internally. As controllers are turned on and the [XRInterface] detects them, instances of this object are automatically added to this list of active tracking objects accessible through the [XRServer]. The [XRNode3D] and [XRAnchor3D] both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDExtension-based interfaces can interact with them.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsObject

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

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsXRPositionalTracker

func (self Instance) AsXRPositionalTracker() Instance

func (Instance) AsXRTracker

func (self Instance) AsXRTracker() XRTracker.Instance

func (Instance) GetInput

func (self Instance) GetInput(name string) any

Returns an input for this tracker. It can return a boolean, float or [Vector2] value depending on whether the input is a button, trigger or thumbstick/thumbpad.

func (Instance) GetPose

func (self Instance) GetPose(name string) XRPose.Instance

Returns the current [XRPose] state object for the bound [param name] pose.

func (Instance) Hand

func (self Instance) Hand() TrackerHand

func (Instance) HasPose

func (self Instance) HasPose(name string) bool

Returns [code]true[/code] if the tracker is available and is currently tracking the bound [param name] pose.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) InvalidatePose

func (self Instance) InvalidatePose(name string)

Marks this pose as invalid, we don't clear the last reported state but it allows users to decide if trackers need to be hidden if we lose tracking or just remain at their last known position.

func (Instance) OnButtonPressed

func (self Instance) OnButtonPressed(cb func(name string), flags ...Signal.Flags)

func (Instance) OnButtonReleased

func (self Instance) OnButtonReleased(cb func(name string), flags ...Signal.Flags)

func (Instance) OnInputFloatChanged

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

func (Instance) OnInputVector2Changed

func (self Instance) OnInputVector2Changed(cb func(name string, vector Vector2.XY), flags ...Signal.Flags)

func (Instance) OnPoseChanged

func (self Instance) OnPoseChanged(cb func(pose XRPose.Instance), flags ...Signal.Flags)

func (Instance) OnPoseLostTracking

func (self Instance) OnPoseLostTracking(cb func(pose XRPose.Instance), flags ...Signal.Flags)

func (Instance) OnProfileChanged

func (self Instance) OnProfileChanged(cb func(role string), flags ...Signal.Flags)

func (Instance) Profile

func (self Instance) Profile() string

func (Instance) SetHand

func (self Instance) SetHand(value TrackerHand)

func (Instance) SetInput

func (self Instance) SetInput(name string, value any)

Changes the value for the given input. This method is called by a [XRInterface] implementation and should not be used directly.

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetPose

func (self Instance) SetPose(name string, transform Transform3D.BasisOrigin, linear_velocity Vector3.XYZ, angular_velocity Vector3.XYZ, tracking_confidence XRPose.TrackingConfidence)

Sets the transform, linear velocity, angular velocity and tracking confidence for the given pose. This method is called by a [XRInterface] implementation and should not be used directly.

func (Instance) SetProfile

func (self Instance) SetProfile(value string)

func (*Instance) UnsafePointer

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

func (Instance) Virtual

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

type TrackerHand

type TrackerHand int //gd:XRPositionalTracker.TrackerHand
const (
	/*The hand this tracker is held in is unknown or not applicable.*/
	TrackerHandUnknown TrackerHand = 0
	/*This tracker is the left hand controller.*/
	TrackerHandLeft TrackerHand = 1
	/*This tracker is the right hand controller.*/
	TrackerHandRight TrackerHand = 2
	/*Represents the size of the [enum TrackerHand] enum.*/
	TrackerHandMax TrackerHand = 3
)

Jump to

Keyboard shortcuts

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