Property | Type | Description | |
---|---|---|---|
Extents | Vector3 | ||
FreezeMeshUpdates | bool | ||
NumUpdatesBeforeRemoval | int | ||
RemovedMeshObjects | RemovedSurfaceHolder>.Dictionary | ||
SpatialMeshObjects | GameObject>.Dictionary | ||
SphereRadius | float | ||
TimeBetweenUpdates | float | ||
UseSphereBounds | bool |
Property | Type | Description | |
---|---|---|---|
LevelOfDetailToTPCM | int[] | ||
bakeMeshes | bool | ||
bounds | Bounds | ||
surfaceObserver |
Method | Description | |
---|---|---|
BoundsContains ( Vector3 position ) : bool |
Helper method to determine if the bounds of this component contains the provided coordinate
|
|
FinalDestroy ( GameObject surfaceObject ) : void |
Destroys the provided GameObject and The MeshFilter.mesh if present
|
|
GetDefaultLevelOfDetail ( ) : MeshLevelOfDetail |
Gets the default Level of Detail. Subclasses can override to change the default Level of Detail.
|
|
HandleAdd ( |
Handles when a surface is added or updated by either creating the needed components or finding them in either the RemovedMeshObjects collection or the SpatialMeshObjects collection If a surface is contained in the RemovedMeshObjects collection, the enabled state for its MeshCollider or MeshRenderer is restored if appropriate. The GameObject will be moved into SpatialMeshObjects, and the RemovedMeshHolder will be removed from RemovedMeshObject If a surface is not found in either collection, a new GameObject will be created for it and it will be added to SpatialMeshObjects indexed by its id. After the GameObject is handled as appropriately, SurfaceObserver.RequestMeshAsync will be called for the appropriate settings.
|
|
HandleDelete ( |
Handles cleaning up a known mesh or moving it to the RemovedMeshObjects list If NumUpdatesBeforeRemoval < 1, the mesh will immediately be destroyed upon removal Else we will create a new RemoveSurfaceHolder and add that to the RemovedMeshObjects list to cache the mesh until we believe it should actually be removed
|
|
OnDestroy ( ) : void |
Standard method called when the component is destroyed. When this component is destroyed, we clean up all of our tracked GameObjects
|
|
OnDisable ( ) : void |
Standard method called when the component is disabled When this component is disabled, we disable all of the tracked GameObjects
|
|
OnEnable ( ) : void |
Standard method called when the component is enabled When this component is enabled, we enable all of the tracked GameObjects
|
|
ProcessRemoveList ( ) : void |
Iterates through the RemovedMeshObjects list and decrements the updates remaining and removes objects if appropriate The criteria for decrementing the update count and removing the entry if appropriate is either - The mesh is not within the observed bounds (so in theory this observer does not actually care to observe it - Or the main camera (user) is within 10m of the surface (if the user is that close to the mesh, the HoloLens is likely actively reporting on that space)
|
|
ShouldBeActiveWhileRemoved ( GameObject go ) : bool |
Helper to determine if the GameObject should continue to render and/or have physics even if marked for removal by the system An object should render and/or have physics if it is within the bounds of the observer and not parented to the camera
|
|
Start ( ) : void |
Standard initialization method creating our properties
|
|
SurfaceObserver_OnDataReady ( |
Handler for when the SurfaceObserver completes RequestMeshAsync The base class defines this function to make it easier for subclasses to modify meshes upon completion without needing to handle the actual processing
|
|
SurfaceObserver_OnSurfaceChanged ( |
Handler for calling SurfaceObserver.Update which will then handle the changes The actual changes will be handled via HandleAdd (for SurfaceChange.Added and SurfaceChange.Updated) and HandleDelete (for SurfaceChange.Removed)
|
|
Update ( ) : void |
Standard Update loop During our Update, we update the observed volume for the SurfaceObserver and ensure we do one step of processing
|
|
UpdateLoop ( ) : IEnumerator |
The Coroutine which actually updates the meshes and processes our removed mesh's list This Coroutine runs forever and checks that the component is enabled and FreezeMeshUpdates has not been specified. If either are not true, we do nothing here and continue waiting.
|
Method | Description | |
---|---|---|
UpdateSurfaceObserverPosition ( ) : void |
A helper to correctly update the bounding volume for the SurfaceObserver
|
protected BoundsContains ( Vector3 position ) : bool | ||
position | Vector3 | The position to test if it is within the current bounds of the component |
return | bool |
protected FinalDestroy ( GameObject surfaceObject ) : void | ||
surfaceObject | GameObject | The GameObject to destroy |
return | void |
protected GetDefaultLevelOfDetail ( ) : MeshLevelOfDetail | ||
return | MeshLevelOfDetail |
protected HandleAdd ( |
||
surfaceId | The id of the surface that was added or updated | |
updateTime | System | The time at which the surface was modified |
bake | bool | Whether or not this component should request to back a collider for the surface |
return | void |
protected HandleDelete ( |
||
surfaceId | ||
return | void |
protected ShouldBeActiveWhileRemoved ( GameObject go ) : bool | ||
go | GameObject | The GameObject in question |
return | bool |
protected SurfaceObserver_OnDataReady ( |
||
bakedData | The processed SurfaceData | |
outputWritten | bool | Whether or not output was written |
elapsedBakeTimeSeconds | float | The time in seconds it took to request and populate the mesh |
return | void |
protected SurfaceObserver_OnSurfaceChanged ( |
||
surfaceId | The identifier of the surface in question | |
changeType | SurfaceChange | What type of change this is (add, update, or remove) |
bounds | Bounds | The bounds of the mesh |
updateTime | System | The time the update occurred |
return | void |
public Dictionary |
||
return | RemovedSurfaceHolder>.Dictionary |
public Dictionary |
||
return | GameObject>.Dictionary |