API reference

Controller Class

Implements IController
The Interaction SDK's default concrete implementation of IController.
Instances of this type represent and expose the capabilities of tracked XR controllers in the physical world. Controllers are leveraged in many different ways throughout the Interaction SDK (as IControllers directly, as ISelectors, as sources for RayInteractor.Ray data, etc.) and, along with Hands, is one of the main interaction modalities supported by the SDK.

Properties

ControllerInput : ControllerInput
[Get]
Implementation of IController.ControllerInput; for details, please refer to the related documentation provided for that interface.
Signature
virtual ControllerInput ControllerInput
Handedness : Handedness
[Get]
Implementation of IController.Handedness; for details, please refer to the related documentation provided for that interface.
Signature
virtual Handedness Handedness
IsConnected : bool
[Get]
Implementation of IController.IsConnected; for details, please refer to the related documentation provided for that interface.
Signature
virtual bool IsConnected
IsPointerPoseValid : bool
[Get]
Checks whether a valid "pointer pose" is currently available.
See IController.TryGetPointerPose(out Pose) for details on what a pointer pose is.
Signature
virtual bool IsPointerPoseValid
IsPoseValid : bool
[Get]
Implementation of IController.IsPoseValid; for details, please refer to the related documentation provided for that interface.
Signature
virtual bool IsPoseValid
Scale : float
[Get]
Implementation of IController.Scale; for details, please refer to the related documentation provided for that interface.
Signature
virtual float Scale

Events

WhenUpdated : Action
Implementation of IController.WhenUpdated; for details, please refer to the related documentation provided for that interface.
Signature
virtual Action WhenUpdated

Protected Methods

Apply ( data )
Signature
override void Apply(ControllerDataAsset data)
Parameters
Returns
override void

Methods

InjectAllController ( updateMode , updateAfter , modifyDataFromSource , applyModifier )
Wrapper for DataModifier<TData>.InjectAllDataModifier(DataSource<TData>.UpdateModeFlags, IDataSource, IDataSource<TData>, bool), for injecting the required dependencies to a dynamically-allocated Controller instance.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void InjectAllController(UpdateModeFlags updateMode, IDataSource updateAfter, IDataSource< ControllerDataAsset > modifyDataFromSource, bool applyModifier)
Parameters
updateMode: UpdateModeFlags
updateAfter: IDataSource
modifyDataFromSource: IDataSource< ControllerDataAsset >
applyModifier: bool
Returns
void
IsButtonUsageAllActive ( buttonUsage )
Implementation of IController.IsButtonUsageAllActive(ControllerButtonUsage); for details, please refer to the related documentation provided for that interface.
Signature
virtual bool IsButtonUsageAllActive(ControllerButtonUsage buttonUsage)
Parameters
buttonUsage: ControllerButtonUsage
Returns
bool
IsButtonUsageAnyActive ( buttonUsage )
Implementation of IController.IsButtonUsageAnyActive(ControllerButtonUsage); for details, please refer to the related documentation provided for that interface.
Signature
virtual bool IsButtonUsageAnyActive(ControllerButtonUsage buttonUsage)
Parameters
buttonUsage: ControllerButtonUsage
Returns
bool
MarkInputDataRequiresUpdate ()
Overrides and encapsulates DataSource<TData>.MarkInputDataRequiresUpdate, augmenting the behavior of the base type's method by invoking WhenUpdated to notify observers of the occurrence.
Signature
override void MarkInputDataRequiresUpdate()
Returns
override void
TryGetPointerPose ( pose )
Implementation of IController.TryGetPointerPose(out Pose); for details, please refer to the related documentation provided for that interface.
Signature
virtual bool TryGetPointerPose(out Pose pose)
Parameters
pose: out Pose
Returns
bool
TryGetPose ( pose )
Implementation of IController.TryGetPose(out Pose); for details, please refer to the related documentation provided for that interface.
Signature
virtual bool TryGetPose(out Pose pose)
Parameters
pose: out Pose
Returns
bool