Class BaseController
Base Controller class to inherit from for all controllers.
Inheritance
BaseController
Assembly: cs.temp.dll.dll
public abstract class BaseController : IMixedRealityController
Constructors
Declaration
protected BaseController(TrackingState trackingState, Handedness controllerHandedness, IMixedRealityInputSource inputSource = null, MixedRealityInteractionMapping[] interactions = null, IMixedRealityInputSourceDefinition definition = null)
Parameters
Properties
Declaration
public Vector3 AngularVelocity { get; protected set; }
Property Value
The designated hand that the Input Source is managing, as defined by the SDK / Unity.
Declaration
public Handedness ControllerHandedness { get; }
Property Value
Type |
Description |
Handedness |
|
The default interactions for this controller.
Declaration
public virtual MixedRealityInteractionMapping[] DefaultInteractions { get; }
Property Value
The default left-handed interactions for this controller.
Declaration
public virtual MixedRealityInteractionMapping[] DefaultLeftHandedInteractions { get; }
Property Value
The default right-handed interactions for this controller.
Declaration
public virtual MixedRealityInteractionMapping[] DefaultRightHandedInteractions { get; }
Property Value
Represents the archetypal definition of what this controller supports and can perform.
Declaration
protected virtual IMixedRealityInputSourceDefinition Definition { get; }
Property Value
Is the controller enabled?
Declaration
public bool Enabled { get; set; }
Property Value
The registered Input Source for this controller
Declaration
public IMixedRealityInputSource InputSource { get; }
Property Value
Mapping definition for this controller, linking the Physical inputs to logical Input System Actions
Declaration
public MixedRealityInteractionMapping[] Interactions { get; }
Property Value
Some controllers such as articulated should only be able
to invoke pointing/distant interactions in certain poses.
Declaration
public virtual bool IsInPointingPose { get; }
Property Value
Indicates the accuracy of the position data being reported.
Declaration
public bool IsPositionApproximate { get; protected set; }
Property Value
Indicates that this controller is currently providing position data.
Declaration
public bool IsPositionAvailable { get; protected set; }
Property Value
Indicates that this controller is currently providing rotation data.
Declaration
public bool IsRotationAvailable { get; protected set; }
Property Value
Outputs the current state of the Input Source, whether it is tracked or not. As defined by the SDK / Unity.
Declaration
public TrackingState TrackingState { get; protected set; }
Property Value
Declaration
public Vector3 Velocity { get; protected set; }
Property Value
Declaration
public IMixedRealityControllerVisualizer Visualizer { get; protected set; }
Property Value
Methods
Load the Interaction mappings for this controller from the configured Controller Mapping profile
Declaration
public void AssignControllerMappings(MixedRealityInteractionMapping[] mappings)
Parameters
Declaration
protected static MixedRealityControllerMapping[] GetControllerMappings()
Returns
Declaration
protected static MixedRealityControllerVisualizationProfile GetControllerVisualizationProfile()
Returns
Declaration
protected static bool IsControllerMappingEnabled()
Returns
Sets up the configuration based on the Mixed Reality Controller Mapping Profile.
Declaration
[Obsolete("This method is no longer used. Configuration now happens in the constructor. You can check this controller's Enabled property for configuration state.")]
public bool SetupConfiguration(Type controllerType)
Parameters
Type |
Name |
Description |
Type |
controllerType |
The type this controller represents.
|
Returns
Sets up the configuration based on the Mixed Reality Controller Mapping Profile.
Declaration
[Obsolete("This method is no longer used. Configuration now happens in the constructor. You can check this controller's Enabled property for configuration state.")]
public bool SetupConfiguration(Type controllerType, InputSourceType inputSourceType = InputSourceType.Controller)
Parameters
Returns
Assign the default interactions based on this controller's handedness, if necessary.
Declaration
public virtual void SetupDefaultInteractions()
Assign the default interactions based on controller handedness, if necessary.
Declaration
[Obsolete("The handedness parameter is no longer used. This method now reads from the controller's handedness.")]
public virtual void SetupDefaultInteractions(Handedness controllerHandedness)
Parameters
Type |
Name |
Description |
Handedness |
controllerHandedness |
|
Declaration
protected bool TryAddControllerModelToSceneHierarchy(GameObject controllerObject)
Parameters
Type |
Name |
Description |
GameObject |
controllerObject |
|
Returns
Try to render a controller model for this controller from the visualization profile.
Declaration
protected virtual bool TryRenderControllerModel(Type controllerType, InputSourceType inputSourceType)
Parameters
Type |
Name |
Description |
Type |
controllerType |
The type of controller to load the model for.
|
InputSourceType |
inputSourceType |
Whether the model represents a hand or a controller.
|
Returns
Type |
Description |
Boolean |
True if a model was successfully loaded or model rendering is disabled. False if a model tried to load but failed.
|
Implements