SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.0 KiB

4 years ago
  1. namespace UnityEngine.XR.ARSubsystems
  2. {
  3. /// <summary>
  4. /// Represents the alignment of a plane, e.g., whether it is horizontal or vertical.
  5. /// </summary>
  6. /// <seealso cref="BoundedPlane.alignment"/>
  7. public enum PlaneAlignment
  8. {
  9. /// <summary>
  10. /// No alignment
  11. /// </summary>
  12. None = 0,
  13. /// <summary>
  14. /// The plane is horizontal with an upward facing normal, e.g., a floor.
  15. /// </summary>
  16. HorizontalUp = 100,
  17. /// <summary>
  18. /// The plane is horizontal with a downward facing normal, e.g., a ceiling.
  19. /// </summary>
  20. HorizontalDown = 101,
  21. /// <summary>
  22. /// The plane is vertical, e.g., a wall.
  23. /// </summary>
  24. Vertical = 200,
  25. /// <summary>
  26. /// The plane is not axis aligned.
  27. /// </summary>
  28. NotAxisAligned = 300
  29. }
  30. /// <summary>
  31. /// Extension methods for the <see cref="PlaneAlignment"/> enum.
  32. /// </summary>
  33. public static class PlaneAlignmentExtensions
  34. {
  35. /// <summary>
  36. /// Determines whether the plane is horizontal (whether facing up or down).
  37. /// </summary>
  38. /// <param name="alignment">The <see cref="PlaneAlignment"/> being extended.</param>
  39. /// <returns><c>true</c> if the plane is horizontal.</returns>
  40. public static bool IsHorizontal(this PlaneAlignment alignment)
  41. {
  42. return
  43. (alignment == PlaneAlignment.HorizontalUp) ||
  44. (alignment == PlaneAlignment.HorizontalDown);
  45. }
  46. /// <summary>
  47. /// Determines whether the plane is vertical.
  48. /// </summary>
  49. /// <param name="alignment">The <see cref="PlaneAlignment"/> being extended.</param>
  50. /// <returns><c>true</c> if the plane is vertical.</returns>
  51. public static bool IsVertical(this PlaneAlignment alignment)
  52. {
  53. return (alignment == PlaneAlignment.Vertical);
  54. }
  55. }
  56. }