Skip to main content
Version: 20 Mar 2024

MagicLeapMeshingFeature

NameSpace: MagicLeapSupport

Enables the Magic Leap OpenXR Loader for Android, and modifies the AndroidManifest to be compatible with ML2.

Inherits from:
MagicLeapOpenXRFeatureBase,
OpenXRFeature

Public Fields

MeshBoundsOrigin

The origin of the meshing volume bounds


public Vector3 MeshBoundsOrigin { get; set; }


MeshBoundsRotation

The rotation of the meshing bounds volume


public Quaternion MeshBoundsRotation { get; set; }


MeshBoundsScale

The scale of the meshing bounds volume


public Vector3 MeshBoundsScale { get; set; }


MeshDensity

The density of the meshes generated


public float MeshDensity { get; set; }


MeshRenderMode

The render mode of the generated mesh.


public MeshingMode MeshRenderMode { get; set; }


Public Methods

bool GetMeshData

public bool GetMeshData(
in TrackableId meshId,
out Vector3 [] positions,
out Vector3 [] normals,
out float [] confidence
)

Parameters

TypeNameDescription
in TrackableIdmeshId
out Vector3 []positions
out Vector3 []normals
out float []confidence

void GetMeshIds

public void GetMeshIds(
out TrackableId [] trackableIds
)

Parameters

TypeNameDescription
out TrackableId []trackableIds

void InvalidateMeshes

public void InvalidateMeshes()

void SetMeshQueryBounds

public void SetMeshQueryBounds(
Vector3 position,
Vector3 scale,
Quaternion rotation
)

Parameters

TypeNameDescription
Vector3position
Vector3scale
Quaternionrotation

void UpdateMeshQuerySettings

Update the query settings for the mesh generation

public void UpdateMeshQuerySettings(
in MeshingQuerySettings settings
)

Parameters

TypeNameDescription
in MeshingQuerySettingssettings

Protected Methods

GetFeatureId

protected virtual override string GetFeatureId()

Reimplements: GetFeatureId


OnInstanceCreate

protected override bool OnInstanceCreate(
ulong xrInstance
)

Parameters

TypeNameDescription
ulongxrInstance

OnSubsystemCreate

protected override void OnSubsystemCreate()

OnSubsystemDestroy

protected override void OnSubsystemDestroy()

OnSubsystemStart

protected override void OnSubsystemStart()

OnSubsystemStop

protected override void OnSubsystemStop()

Public Attributes

FeatureId


public const string FeatureId = "com.magicleap.openxr.feature.ml2_mesh_detection";


Public Enums

MeshDetectorFlags

The flags to represent the generated mesh's properties

EnumeratorValueDescription
ComputeNormals1 << 1Whether to compute the normals of the mesh
ComputeConfidence1 << 2Whether to compute the confidence data for the mesh
Planarize1 << 3Whether to planarize the generated mesh
MeshSkirt1 << 4When enabled, the mesh skirt (overlapping area between two mesh blocks) will be removed. This field is only valid when the mesh is not a point cloud.

MeshingMode

EnumeratorValueDescription
Triangles
PointCloud