namespace Rokid.UXR.Interaction {
using UnityEngine;
public interface ISurface
{
///
/// A transform for the surface
///
Transform Transform { get; }
///
/// Raycast to the surface with an optional maximum distance value
///
/// The ray to cast
/// The returned hit data
/// If greater than zero, maximum distance of raycast
/// true if surface was hit
bool Raycast(in Ray ray, out SurfaceHit hit, float maxDistance = 0);
///
/// Find nearest point to surface
///
/// Point to check
/// The returned hit data
/// If greater than zero, maximum distance of check
/// true if nearest point was found
bool ClosestSurfacePoint(in Vector3 point, out SurfaceHit hit, float maxDistance = 0);
}
public struct SurfaceHit
{
///
/// The position of the surface hit
///
public Vector3 Point { get; set; }
///
/// The normal of the surface hit
///
public Vector3 Normal { get; set; }
///
/// The distance of the surface hit from the ray origin
///
public float Distance { get; set; }
}
}