XRPose

package
v0.0.0-...-357ca8a Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

XR runtimes often identify multiple locations on devices such as controllers that are spatially tracked.

Orientation, location, linear velocity and angular velocity are all provided for each pose by the XR runtime. This object contains this state of a pose.

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
	AsXRPose() 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]) AsXRPose

func (self *Extension[T]) AsXRPose() 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.XRPose

Instance of the class with convieniently typed arguments and results.

var Nil Instance

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

func New

func New() Instance

func (Instance) AngularVelocity

func (self Instance) AngularVelocity() Vector3.XYZ

The angular velocity for this pose.

func (Instance) AsObject

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

func (Instance) AsRefCounted

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

func (Instance) AsXRPose

func (self Instance) AsXRPose() Instance

func (Instance) GetAdjustedTransform

func (self Instance) GetAdjustedTransform() Transform3D.BasisOrigin

Returns the Transform with world scale and our reference frame applied. This is the transform used to position XRNode3D objects.

func (Instance) HasTrackingData

func (self Instance) HasTrackingData() bool

If true our tracking data is up to date. If false we're no longer receiving new tracking data and our state is whatever that last valid state was.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) LinearVelocity

func (self Instance) LinearVelocity() Vector3.XYZ

The linear velocity of this pose.

func (Instance) Name

func (self Instance) Name() string

The name of this pose. Usually, this name is derived from an action map set up by the user. Godot also suggests some pose names that XRInterface objects are expected to implement:

- root is the root location, often used for tracked objects that do not have further nodes.

- aim is the tip of a controller with its orientation pointing outwards, often used for raycasts.

- grip is the location where the user grips the controller.

- skeleton is the root location for a hand mesh, when using hand tracking and an animated skeleton is supplied by the XR runtime.

func (Instance) SetAngularVelocity

func (self Instance) SetAngularVelocity(value Vector3.XYZ)

SetAngularVelocity sets the property returned by [GetAngularVelocity].

func (Instance) SetHasTrackingData

func (self Instance) SetHasTrackingData(value bool)

SetHasTrackingData sets the property returned by [GetHasTrackingData].

func (Instance) SetLinearVelocity

func (self Instance) SetLinearVelocity(value Vector3.XYZ)

SetLinearVelocity sets the property returned by [GetLinearVelocity].

func (Instance) SetName

func (self Instance) SetName(value string)

SetName sets the property returned by [GetName].

func (*Instance) SetObject

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

func (Instance) SetTrackingConfidence

func (self Instance) SetTrackingConfidence(value TrackingConfidence)

SetTrackingConfidence sets the property returned by [GetTrackingConfidence].

func (Instance) SetTransform

func (self Instance) SetTransform(value Transform3D.BasisOrigin)

SetTransform sets the property returned by [GetTransform].

func (Instance) TrackingConfidence

func (self Instance) TrackingConfidence() TrackingConfidence

The tracking confidence for this pose, provides insight on how accurate the spatial positioning of this record is.

func (Instance) Transform

func (self Instance) Transform() Transform3D.BasisOrigin

The transform containing the original and transform as reported by the XR runtime.

func (Instance) Virtual

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

type TrackingConfidence

type TrackingConfidence int //gd:XRPose.TrackingConfidence
const (
	// No tracking information is available for this pose.
	XrTrackingConfidenceNone TrackingConfidence = 0
	// Tracking information may be inaccurate or estimated. For example, with inside out tracking this would indicate a controller may be (partially) obscured.
	XrTrackingConfidenceLow TrackingConfidence = 1
	// Tracking information is considered accurate and up to date.
	XrTrackingConfidenceHigh TrackingConfidence = 2
)

Jump to

Keyboard shortcuts

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