@@ -39,6 +39,7 @@ private float MaxFrameTimeInSeconds
3939 public bool CreateMeshColliders = true ;
4040
4141 private bool drawProcessedMesh = true ;
42+
4243 // Properties
4344 /// <summary>
4445 /// Controls rendering of the mesh. This can be set by the user to hide or show the mesh.
@@ -59,6 +60,11 @@ public bool DrawProcessedMesh
5960 }
6061 }
6162
63+ /// <summary>
64+ /// Have any mesh sectors been scanned
65+ /// </summary>
66+ public bool HasMeshSectors { get { return meshSectors != null && meshSectors . Count > 0 ; } }
67+
6268 /// <summary>
6369 /// Indicates if the previous import is still being processed.
6470 /// </summary>
@@ -80,13 +86,13 @@ public bool DrawProcessedMesh
8086 private SpatialUnderstanding spatialUnderstanding ;
8187
8288 /// <summary>
83- /// The spatial understanding mesh will be split into pieces so that we don't have to
89+ /// The spatial understanding mesh will be split into pieces so that we don't have to
8490 /// render the whole mesh, rather just the parts that are visible to the user.
8591 /// </summary>
8692 private Dictionary < Vector3 , MeshData > meshSectors = new Dictionary < Vector3 , MeshData > ( ) ;
8793
8894 /// <summary>
89- /// A data structure to manage collecting triangles as we
95+ /// A data structure to manage collecting triangles as we
9096 /// subdivide the spatial understanding mesh into smaller sub meshes.
9197 /// </summary>
9298 private class MeshData
@@ -157,11 +163,11 @@ public void Commit()
157163 /// <param name="point3">Third point on the triangle.</param>
158164 public void AddTriangle ( Vector3 point1 , Vector3 point2 , Vector3 point3 )
159165 {
160- // Currently spatial understanding in the native layer voxellizes the space
161- // into ~2000 voxels per cubic meter. Even in a degerate case we
166+ // Currently spatial understanding in the native layer voxellizes the space
167+ // into ~2000 voxels per cubic meter. Even in a degerate case we
162168 // will use far fewer than 65000 vertices, this check should not fail
163169 // unless the spatial understanding native layer is updated to have more
164- // voxels per cubic meter.
170+ // voxels per cubic meter.
165171 if ( verts . Count < 65000 )
166172 {
167173 tris . Add ( verts . Count ) ;
@@ -195,7 +201,7 @@ private void Update()
195201 }
196202
197203 /// <summary>
198- /// Adds a triangle with the specified points to the specified sector.
204+ /// Adds a triangle with the specified points to the specified sector.
199205 /// </summary>
200206 /// <param name="sector">The sector to add the triangle to.</param>
201207 /// <param name="point1">First point of the triangle.</param>
@@ -289,8 +295,8 @@ public IEnumerator Import_UnderstandingMesh()
289295 }
290296
291297 float startTime = Time . realtimeSinceStartup ;
292- // first we need to split the playspace up into segments so we don't always
293- // draw everything. We can break things up in to cubic meters.
298+ // first we need to split the playspace up into segments so we don't always
299+ // draw everything. We can break things up in to cubic meters.
294300 for ( int index = 0 ; index < meshIndices . Length ; index += 3 )
295301 {
296302 Vector3 firstVertex = meshVertices [ meshIndices [ index ] ] ;
@@ -389,7 +395,7 @@ private Vector3 VectorToSector(Vector3 vector)
389395 }
390396
391397 /// <summary>
392- /// Updates the mesh import process. This function will kick off the import
398+ /// Updates the mesh import process. This function will kick off the import
393399 /// coroutine at the requested internal.
394400 /// </summary>
395401 private void Update_MeshImport ( )
@@ -411,4 +417,4 @@ private void OnDestroy()
411417 }
412418 }
413419
414- }
420+ }
0 commit comments