ISelectSurface.cs 1.1 KB

123456789101112131415161718192021222324252627282930
  1. namespace Rokid.UXR.Interaction {
  2. using UnityEngine;
  3. public interface ISelectSurface
  4. {
  5. /// <summary>
  6. /// A transform for the surface
  7. /// </summary>
  8. Transform Transform { get; }
  9. /// <summary>
  10. /// Raycast to the surface with an optional maximum distance value
  11. /// </summary>
  12. /// <param name="ray">The ray to cast</param>
  13. /// <param name="hit">The returned hit data</param>
  14. /// <param name="maxDistance">If greater than zero, maximum distance of raycast</param>
  15. /// <returns>true if surface was hit</returns>
  16. bool Raycast(in Ray ray, out SurfaceHit hit, float maxDistance = 0);
  17. /// <summary>
  18. /// Find nearest point to surface
  19. /// </summary>
  20. /// <param name="ray">Point to check</param>
  21. /// <param name="hit">The returned hit data</param>
  22. /// <param name="maxDistance">If greater than zero, maximum distance of check</param>
  23. /// <returns>true if nearest point was found</returns>
  24. bool ClosestSurfacePoint(in Vector3 point, out SurfaceHit hit, float maxDistance = 0);
  25. }
  26. }