Documentation ¶
Overview ¶
Package XRPositionalTracker provides methods for working with XRPositionalTracker object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsXRPositionalTracker() Instance
- func (self Instance) AsXRTracker() XRTracker.Instance
- func (self Instance) GetInput(name string) any
- func (self Instance) GetPose(name string) [1]gdclass.XRPose
- func (self Instance) Hand() gdclass.XRPositionalTrackerTrackerHand
- func (self Instance) HasPose(name string) bool
- func (self Instance) InvalidatePose(name string)
- 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, vector Vector2.XY))
- func (self Instance) OnPoseChanged(cb func(pose [1]gdclass.XRPose))
- func (self Instance) OnPoseLostTracking(cb func(pose [1]gdclass.XRPose))
- func (self Instance) OnProfileChanged(cb func(role string))
- func (self Instance) Profile() string
- func (self Instance) SetHand(value gdclass.XRPositionalTrackerTrackerHand)
- func (self Instance) SetInput(name string, value any)
- func (self Instance) SetPose(name string, transform Transform3D.BasisOrigin, linear_velocity Vector3.XYZ, ...)
- func (self Instance) SetProfile(value string)
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
- type TrackerHand
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.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 (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsXRPositionalTracker ¶
func (Instance) AsXRTracker ¶
func (Instance) GetInput ¶
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 ¶
Returns the current [XRPose] state object for the bound [param name] pose.
func (Instance) Hand ¶
func (self Instance) Hand() gdclass.XRPositionalTrackerTrackerHand
func (Instance) HasPose ¶
Returns [code]true[/code] if the tracker is available and is currently tracking the bound [param name] pose.
func (Instance) InvalidatePose ¶
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 (Instance) OnButtonReleased ¶
func (Instance) OnInputFloatChanged ¶
func (Instance) OnInputVector2Changed ¶
func (Instance) OnPoseChanged ¶
func (Instance) OnPoseLostTracking ¶
func (Instance) OnProfileChanged ¶
func (Instance) SetHand ¶
func (self Instance) SetHand(value gdclass.XRPositionalTrackerTrackerHand)
func (Instance) SetInput ¶
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 (*Instance) UnsafePointer ¶
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 )