Class SpherePointer
Inheritance
Implements
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Input
Assembly: cs.temp.dll.dll
Syntax
public class SpherePointer : BaseControllerPointer, IMixedRealityControllerPoseSynchronizer, IMixedRealitySourcePoseHandler, IMixedRealitySourceStateHandler, IMixedRealityInputHandler, IMixedRealityBaseInputHandler, IMixedRealityInputHandler<float>, IMixedRealityInputHandler<Vector2>, IMixedRealityInputHandler<Vector3>, IMixedRealityInputHandler<Quaternion>, IMixedRealityInputHandler<MixedRealityPose>, IEventSystemHandler, IMixedRealityNearPointer, IMixedRealityPointer, IEqualityComparer
Properties
IsInteractionEnabled
Declaration
public override bool IsInteractionEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
IsNearObject
Currently performs a sphere check. Currently anything that has a collider is considered "Grabbable". Eventually we need to filter based on things that can respond to grab events.
Declaration
public bool IsNearObject { get; }
Property Value
Type | Description |
---|---|
Boolean | True if the hand is near anything that's grabbable. |
NearObjectMargin
Additional distance between SphereCastRadius and NearObjectRadius.
Declaration
public float NearObjectMargin { get; }
Property Value
Type | Description |
---|---|
Single |
Remarks
This creates a dead zone in which far interaction is disabled before objects become grabbable.
NearObjectRadius
Distance at which the pointer is considered "near" an object.
Declaration
public float NearObjectRadius { get; }
Property Value
Type | Description |
---|---|
Single |
Remarks
Sum of SphereCastRadius and NearObjectMargin. Entering the NearObjectRadius disables far interaction.
SceneQueryType
Declaration
public override SceneQueryType SceneQueryType { get; set; }
Property Value
Type | Description |
---|---|
SceneQueryType |
Overrides
Methods
OnPreSceneQuery()
Called before performing the scene query.
Declaration
public override void OnPreSceneQuery()
Overrides
TryGetDistanceToNearestSurface(out Single)
Near pointers often interact with surfaces.
This method provides a mechanism to get the distance to the closest surface the near pointer is interacting with.
Declaration
public bool TryGetDistanceToNearestSurface(out float distance)
Parameters
Type | Name | Description |
---|---|---|
Single | distance | Out parameter filled with the distance along the surface normal from the surface to the pointer if available, otherwise 0.0f. |
Returns
Type | Description |
---|---|
Boolean | True if a distance was retrieved, false if not. |
TryGetNearGraspPoint(out Vector3)
Gets the position of where grasp happens For IMixedRealityHand it's the average of index and thumb. For any other IMixedRealityController, return just the pointer origin
Declaration
public bool TryGetNearGraspPoint(out Vector3 result)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | result |
Returns
Type | Description |
---|---|
Boolean |
TryGetNormalToNearestSurface(out Vector3)
Near pointers often interact with surfaces.
This method provides a mechanism to get the normal of the closest surface the near pointer is interacting with.
Declaration
public bool TryGetNormalToNearestSurface(out Vector3 normal)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | normal | Out parameter filled with the surface normal if available, otherwise Vector3.zero. |
Returns
Type | Description |
---|---|
Boolean | True if a normal was retrieved, false if not. |