SparseSpatialMapController Class¶
Description¶
MonoBehaviour which controls the map generated from SparseSpatialMap in the scene.
Enums¶
public enum SparseSpatialMapController.ActiveControlStrategy |
Strategy to control the GameObject .active. |
public enum SparseSpatialMapController.DataSource |
Map data source type. |
Classes¶
public class SparseSpatialMapController.SparseSpatialMapInfo |
Sparse map information. |
public class SparseSpatialMapController.MapManagerSourceData |
MapManager source for map creation. |
public class SparseSpatialMapController.ParticleParameter |
Parameters for point cloud particles rendering. |
MonoBehaviour Messages¶
protected virtual void Awake() |
protected virtual void Start() |
protected virtual void OnDestroy() |
Fields¶
PointCloudParticleSystem¶
- C#
public ParticleSystem PointCloudParticleSystem
The ParticleSystem used for point cloud rendering.
ActiveControl¶
- C#
public SparseSpatialMapController.ActiveControlStrategy ActiveControl
Strategy to control the GameObject .active. If you are willing to control GameObject .active or there are other components controlling GameObject .active, make sure to set it to SparseSpatialMapController.ActiveControlStrategy.None .
SourceType¶
- C#
public SparseSpatialMapController.DataSource SourceType
Map data source.
MapManagerSource¶
- C#
public SparseSpatialMapController.MapManagerSourceData MapManagerSource
MapManager source for map creation. Valid when SparseSpatialMapController.SourceType == SparseSpatialMapController.DataSource.MapManager .
MapInfoSource¶
- C#
public SparseSpatialMapController.SparseSpatialMapInfo MapInfoSource
MapInfo source for map creation. Valid when SparseSpatialMapController.SourceType == SparseSpatialMapController.DataSource.MapInfo .
Properties¶
MapInfo¶
- C#
public SparseSpatialMapController.SparseSpatialMapInfo MapInfo { get; }
Map information. Accessible after MapInfoAvailable event.
MapWorker¶
- C#
public SparseSpatialMapWorkerFrameFilter MapWorker { get; set; }
The SparseSpatialMapWorkerFrameFilter which loads the map after SparseSpatialMapController.MapInfoAvailable . When set to null, the map will be unloaded from MapWorker previously set. Modify at any time and takes effect immediately.
PointCloudParticleParameter¶
- C#
public SparseSpatialMapController.ParticleParameter PointCloudParticleParameter { get; set; }
Parameters for point cloud particles rendering.
PointCloud¶
- C#
public List< Vector3 > PointCloud { get; }
Point cloud data.
ShowPointCloud¶
- C#
public bool ShowPointCloud { get; set; }
Show or hide point cloud.
IsLocalizing¶
- C#
public bool IsLocalizing { get; }
Is the map being localized at the moment.
Events¶
MapInfoAvailable¶
- C#
public event Action MapInfoAvailable
Event when SparseSpatialMapController.MapInfo can be used.
MapLocalized¶
- C#
public event Action MapLocalized
Map localized event.
MapStopLocalize¶
- C#
public event Action MapStopLocalize
Stop map localization event.
MapLoad¶
- C#
public event Action< SparseSpatialMapController.SparseSpatialMapInfo , bool, string> MapLoad
Map load finish event. The bool value indicates the load success or not. The string value is the error message when fail.
MapUnload¶
- C#
public event Action< SparseSpatialMapController.SparseSpatialMapInfo , bool, string> MapUnload
Map unload finish event. The bool value indicates the unload success or not. The string value is the error message when fail.
MapHost¶
- C#
public event Action< SparseSpatialMapController.SparseSpatialMapInfo , bool, string> MapHost
Map finish create and upload event. The bool value indicates success or not. The string value is the error message when fail.
Methods¶
HitTest¶
Perform hit test against the point cloud. The results are returned sorted by their distance to the camera in ascending order. pointInView should be normalized to [0, 1]^2.
Host¶
- C#
public void Host(string name, Optional< Image > preview)
Create and upload map. name is the map name and preview is the optional map preview image.