docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MLSpatialMapper

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    MLSpatialMapper
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.MagicLeap
    Assembly: UnityEngine.XR.MagicLeap.dll
    Syntax
    [AddComponentMenu("AR/Magic Leap/ML Spatial Mapper")]
    [UsesLuminPrivilege("WorldReconstruction")]
    [DisallowMultipleComponent]
    public sealed class MLSpatialMapper : MonoBehaviour

    Properties

    batchSize

    How many meshes to update per batch. Larger values are more efficient, but have higher latency.

    Declaration
    public int batchSize { get; set; }
    Property Value
    Type Description
    int

    computeNormals

    When enabled, the system will compute the normals for the triangle vertices.

    Declaration
    public bool computeNormals { get; set; }
    Property Value
    Type Description
    bool

    currentMeshType

    The current mesh type being surfaced by the subsystem provider.

    Declaration
    public MLSpatialMapper.MeshType currentMeshType { get; }
    Property Value
    Type Description
    MLSpatialMapper.MeshType

    density

    Declaration
    public float density { get; set; }
    Property Value
    Type Description
    float

    disconnectedComponentArea

    Any component that is disconnected from the main mesh and which has an area less than this size will be removed.

    Declaration
    public float disconnectedComponentArea { get; set; }
    Property Value
    Type Description
    float

    fillHoleLength

    Boundary distance (in meters) of holes you wish to have filled.

    Declaration
    public float fillHoleLength { get; set; }
    Property Value
    Type Description
    float

    levelOfDetail

    Declaration
    [Obsolete("Replaced by density")]
    public MLSpatialMapper.LevelOfDetail levelOfDetail { get; set; }
    Property Value
    Type Description
    MLSpatialMapper.LevelOfDetail

    meshIdToGameObjectMap

    A Dictionary which maps mesh ids to their GameObjects.

    Declaration
    public Dictionary<MeshId, GameObject> meshIdToGameObjectMap { get; }
    Property Value
    Type Description
    Dictionary<MeshId, GameObject>

    meshParent

    The parent transform for generated meshes.

    Declaration
    public Transform meshParent { get; set; }
    Property Value
    Type Description
    Transform

    meshPrefab

    Get or set the prefab which should be instantiated to create individual mesh instances. May have a mesh renderer and an optional mesh collider for physics.

    Declaration
    public GameObject meshPrefab { get; set; }
    Property Value
    Type Description
    GameObject

    meshQueueSize

    Controls the number of meshes to queue for generation at once. Larger numbers will lead to higher CPU usage.

    Declaration
    public uint meshQueueSize { get; set; }
    Property Value
    Type Description
    uint

    meshType

    Whether to generate a triangle mesh or point cloud points.

    Declaration
    [Obsolete("Replaced by requestedMeshType and currentMeshType")]
    public MLSpatialMapper.MeshType meshType { get; set; }
    Property Value
    Type Description
    MLSpatialMapper.MeshType

    planarize

    When enabled, the system will planarize the returned mesh (planar regions will be smoothed out).

    Declaration
    public bool planarize { get; set; }
    Property Value
    Type Description
    bool

    pollingRate

    How often to check for updates, in seconds. More frequent updates will increase CPU usage.

    Declaration
    public float pollingRate { get; set; }
    Property Value
    Type Description
    float

    removeMeshSkirt

    When enabled, the mesh skirt (overlapping area between two mesh blocks) will be removed. This field is only valid when the Mesh Type is Blocks.

    Declaration
    public bool removeMeshSkirt { get; set; }
    Property Value
    Type Description
    bool

    requestVertexConfidence

    When enabled, the system will generate confidence values for each vertex, ranging from 0-1.

    Declaration
    public bool requestVertexConfidence { get; set; }
    Property Value
    Type Description
    bool
    See Also
    TryGetConfidence(MeshId, List<float>)

    requestedMeshType

    Request Magic Leap to generate a triangle mesh or point cloud points.

    Declaration
    public MLSpatialMapper.MeshType requestedMeshType { get; set; }
    Property Value
    Type Description
    MLSpatialMapper.MeshType

    Methods

    DensityToLevelOfDetail(float)

    Declaration
    public static MLSpatialMapper.LevelOfDetail DensityToLevelOfDetail(float density)
    Parameters
    Type Name Description
    float density
    Returns
    Type Description
    MLSpatialMapper.LevelOfDetail

    DestroyAllMeshes()

    Destroy all mesh GameObjects created by this MLSpatialMapper. The meshIdToGameObjectMap will also be cleared.

    Declaration
    public void DestroyAllMeshes()

    LevelOfDetailToDensity(LevelOfDetail)

    Declaration
    public static float LevelOfDetailToDensity(MLSpatialMapper.LevelOfDetail lod)
    Parameters
    Type Name Description
    MLSpatialMapper.LevelOfDetail lod
    Returns
    Type Description
    float

    RefreshAllMeshes()

    'Refresh' all known meshes (meshes that are in meshIdToGameObjectMap). This will force all meshes to be regenerated with the current settings.

    Declaration
    public void RefreshAllMeshes()

    RefreshMesh(MeshId)

    'Refresh' a single mesh. This forces the mesh to be regenerated with the current settings.

    Declaration
    public void RefreshMesh(MeshId meshId)
    Parameters
    Type Name Description
    MeshId meshId

    The MeshId of the mesh to regenerate.

    TryGetConfidence(MeshId, List<float>)

    Retrieve the confidence values associated with a mesh. Confidence values range from 0..1. requestVertexConfidence must be enabled.

    Declaration
    public bool TryGetConfidence(MeshId meshId, List<float> confidenceOut)
    Parameters
    Type Name Description
    MeshId meshId

    The unique MeshId of the mesh.

    List<float> confidenceOut

    A List of floats, one for each vertex in the mesh.

    Returns
    Type Description
    bool

    True if confidence values were successfully retrieved for the mesh with id meshId.

    See Also
    requestVertexConfidence

    Events

    meshAdded

    An event which is invoked whenever a new mesh is added

    Declaration
    public event Action<MeshId> meshAdded
    Event Type
    Type Description
    Action<MeshId>

    meshRemoved

    An event which is invoked whenever an existing mesh is removed.

    Declaration
    public event Action<MeshId> meshRemoved
    Event Type
    Type Description
    Action<MeshId>

    meshUpdated

    An event which is invoked whenever an existing mesh is updated (regenerated).

    Declaration
    public event Action<MeshId> meshUpdated
    Event Type
    Type Description
    Action<MeshId>
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)