XRPositionalTracker

package
v0.0.0-...-2b43b64 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 22 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 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) [1]gdclass.XRPose

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

func (Instance) Hand

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) 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))

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, vector Vector2.XY))

func (Instance) OnPoseChanged

func (self Instance) OnPoseChanged(cb func(pose [1]gdclass.XRPose))

func (Instance) OnPoseLostTracking

func (self Instance) OnPoseLostTracking(cb func(pose [1]gdclass.XRPose))

func (Instance) OnProfileChanged

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

func (Instance) Profile

func (self Instance) Profile() string

func (Instance) SetHand

func (self Instance) SetHand(value gdclass.XRPositionalTrackerTrackerHand)

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) SetPose

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

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 = gdclass.XRPositionalTrackerTrackerHand //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