// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Input { public interface IMixedRealityNearPointer : IMixedRealityPointer { /// /// Returns true if the hand is near anything that's grabbable /// Currently performs a sphere cast in the direction of the hand ray. /// Currently anything that has a collider is considered "Grabbable" /// Eventually we need to filter based on things that can respond /// to grab events. /// bool IsNearObject { get; } /// /// For near pointer we may want to draw a tether between the pointer /// and the object. /// /// The visual grasp point (average of index and thumb) may actually be different from the pointer /// position (the palm). /// /// This method provides a mechanism to get the visual grasp point. /// /// NOTE: Not all near pointers have a grasp point (for example a poke pointer). /// /// Out parameter filled with the grasp position if available, otherwise Vector3.zero. /// True if a grasp point was retrieved, false if not. bool TryGetNearGraspPoint(out Vector3 position); /// /// 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. /// /// /// Out parameter filled with the distance along the surface normal from the surface to the pointer if available, otherwise 0.0f. /// True if a distance was retrieved, false if not. bool TryGetDistanceToNearestSurface(out float distance); /// /// 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. /// /// /// Out parameter filled with the surface normal if available, otherwise Vector3.zero. /// True if a normal was retrieved, false if not. bool TryGetNormalToNearestSurface(out Vector3 normal); } }