@@ -13,6 +13,15 @@ public static class ARFoundationExtensions
1313
1414 public static Vector2 CenterOfScreen => new Vector2 ( Screen . width , Screen . height ) / 2 ;
1515
16+ /// <summary>
17+ /// Raycast from `Vector2` screen point. Returns true if raycast collides with a plane.
18+ /// </summary>
19+ /// <param name="position">Position on screen to fire raycast from.</param>
20+ /// <param name="raycastManager">AR Foundation raycast manager component.</param>
21+ /// <param name="planeManager">AR Foundation plane manager component.</param>
22+ /// <param name="pose">Unity pose object.</param>
23+ /// <param name="plane">AR Foundation plane object.</param>
24+ /// <returns>void</returns>
1625 public static bool RaycastToPlane ( Vector2 position , ARRaycastManager raycastManager ,
1726 ARPlaneManager planeManager , out Pose pose , out ARPlane plane )
1827 {
@@ -48,6 +57,13 @@ public static bool RaycastToPlane(Vector2 position, ARRaycastManager raycastMana
4857
4958 }
5059
60+ /// <summary>
61+ /// Raycast from center of screen. Returns true if raycast collides with a plane.
62+ /// </summary>
63+ /// <param name="raycastManager">AR Foundation raycast manager component.</param>
64+ /// <param name="planeManager">AR Foundation plane manager component.</param>
65+ /// <param name="pose">Unity pose object.</param>
66+ /// <param name="plane">AR Foundation plane object.</param>
5167 public static bool IsLookingAtPlane ( ARRaycastManager raycastManager , ARPlaneManager planeManager , out Pose pose ,
5268 out ARPlane plane )
5369 {
@@ -56,20 +72,38 @@ public static bool IsLookingAtPlane(ARRaycastManager raycastManager, ARPlaneMana
5672
5773 }
5874
75+ /// <summary>
76+ /// Raycast from center of screen. Returns true if raycast collides with a plane.
77+ /// </summary>
78+ /// <param name="raycastManager">AR Foundation raycast manager component.</param>
79+ /// <param name="planeManager">AR Foundation plane manager component.</param>
80+ /// <param name="pose">Unity pose object.</param>
5981 public static bool IsLookingAtPlane ( ARRaycastManager raycastManager , ARPlaneManager planeManager , out Pose pose )
6082 {
6183
6284 return RaycastToPlane ( CenterOfScreen , raycastManager , planeManager , out pose , out var _ ) ;
6385
6486 }
6587
88+ /// <summary>
89+ /// Raycast from center of screen. Returns true if raycast collides with a plane.
90+ /// </summary>
91+ /// <param name="raycastManager">AR Foundation raycast manager component.</param>
92+ /// <param name="planeManager">AR Foundation plane manager component.</param>
6693 public static bool IsLookingAtPlane ( ARRaycastManager raycastManager , ARPlaneManager planeManager )
6794 {
6895
6996 return RaycastToPlane ( CenterOfScreen , raycastManager , planeManager , out var _ , out var _ ) ;
7097
7198 }
7299
100+ /// <summary>
101+ /// Raycast from input position of screen. Returns true if raycast collides with a plane.
102+ /// </summary>
103+ /// <param name="raycastManager">AR Foundation raycast manager component.</param>
104+ /// <param name="planeManager">AR Foundation plane manager component.</param>
105+ /// <param name="pose">Unity pose object.</param>
106+ /// <param name="plane">AR Foundation plane object.</param>
73107 public static bool HasTouchedPlane ( ARRaycastManager raycastManager , ARPlaneManager planeManager , out Pose pose ,
74108 out ARPlane plane )
75109 {
@@ -90,20 +124,36 @@ public static bool HasTouchedPlane(ARRaycastManager raycastManager, ARPlaneManag
90124
91125 }
92126
127+ /// <summary>
128+ /// Raycast from input position of screen. Returns true if raycast collides with a plane.
129+ /// </summary>
130+ /// <param name="raycastManager">AR Foundation raycast manager component.</param>
131+ /// <param name="planeManager">AR Foundation plane manager component.</param>
132+ /// <param name="pose">Unity pose object.</param>
93133 public static bool HasTouchedPlane ( ARRaycastManager raycastManager , ARPlaneManager planeManager , out Pose pose )
94134 {
95135
96136 return HasTouchedPlane ( raycastManager , planeManager , out pose , out var _ ) ;
97137
98138 }
99139
140+ /// <summary>
141+ /// Raycast from input position of screen. Returns true if raycast collides with a plane.
142+ /// </summary>
143+ /// <param name="raycastManager">AR Foundation raycast manager component.</param>
144+ /// <param name="planeManager">AR Foundation plane manager component.</param>
100145 public static bool HasTouchedPlane ( ARRaycastManager raycastManager , ARPlaneManager planeManager )
101146 {
102147
103148 return HasTouchedPlane ( raycastManager , planeManager , out var _ , out var _ ) ;
104149
105150 }
106151
152+ /// <summary>
153+ /// Disables/enables all `ARPlane` gameObjects.
154+ /// </summary>
155+ /// <param name="planeManager">AR Foundation plane manager component.</param>
156+ /// <param name="activeState">False deactivates any tracked planes. True reactivates any deactivated planes.</param>
107157 public static void SetActiveStateOfPlaneVisuals ( this ARPlaneManager planeManager , bool activeState )
108158 {
109159
0 commit comments