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