// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Physics;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
///
/// Interface to handle raycasts into the scene. Used by FocusProvider to perform ray and sphere cast queries for pointers.
///
///
/// Implementations of IMixedRealityRaycastProvider would likely use Unity's physics system to get hit results from Colliders. However,
/// in a custom implementation, the raycast does not have to rely only on Unity-based Colliders to provide hit results, e.g. a
/// GameObject may use a different mechanism for raycasting, and with a custom implementation, it could be included in the hit result.
///
public interface IMixedRealityRaycastProvider : IMixedRealityService
{
///
/// Performs a raycast using the specified .
///
/// Whether or not the raycast hit something.
bool Raycast(RayStep step, LayerMask[] prioritizedLayerMasks, bool focusIndividualCompoundCollider, out MixedRealityRaycastHit hitInfo);
///
/// Performs a sphere cast with the specified and radius.
///
/// Whether or not the SphereCast hit something.
bool SphereCast(RayStep step, float radius, LayerMask[] prioritizedLayerMasks, bool focusIndividualCompoundCollider, out MixedRealityRaycastHit hitInfo);
///
/// Performs a graphics raycast against the specified layerMasks.
///
/// The RaycastResult of the raycast.
RaycastResult GraphicsRaycast(EventSystem eventSystem, PointerEventData pointerEventData, LayerMask[] layerMasks);
}
}