Meshing2
APIs for the Meshing system. More...
Classes
Name | |
---|---|
struct | MLMeshingSettings |
struct | MLMeshingExtents |
struct | MLMeshingBlockInfo |
struct | MLMeshingMeshInfo |
struct | MLMeshingBlockRequest |
struct | MLMeshingMeshRequest |
struct | MLMeshingBlockMesh |
struct | MLMeshingMesh |
Types
Name | |
---|---|
typedef struct MLMeshingSettings | MLMeshingSettings |
typedef struct MLMeshingExtents | MLMeshingExtents |
typedef struct MLMeshingBlockInfo | MLMeshingBlockInfo |
typedef struct MLMeshingMeshInfo | MLMeshingMeshInfo |
typedef struct MLMeshingBlockRequest | MLMeshingBlockRequest |
typedef struct MLMeshingMeshRequest | MLMeshingMeshRequest |
typedef struct MLMeshingBlockMesh | MLMeshingBlockMesh |
typedef struct MLMeshingMesh | MLMeshingMesh |
Enums
Name | |
---|---|
enum | MLMeshingFlags { MLMeshingFlags_PointCloud = 1 << 0, MLMeshingFlags_ComputeNormals = 1 << 1, MLMeshingFlags_ComputeConfidence = 1 << 2, MLMeshingFlags_Planarize = 1 << 3, MLMeshingFlags_RemoveMeshSkirt = 1 << 4, MLMeshingFlags_IndexOrderCW = 1 << 5, MLMeshingFlags_Ensure32Bits = 0x7FFFFFFF } |
enum | MLMeshingLOD { MLMeshingLOD_Minimum, MLMeshingLOD_Medium, MLMeshingLOD_Maximum, MLMeshingLOD_Ensure32Bits = 0x7FFFFFFF } |
enum | MLMeshingResult { MLMeshingResult_Success, MLMeshingResult_Failed, MLMeshingResult_Pending, MLMeshingResult_PartialUpdate, MLMeshingResult_Ensure32Bits = 0x7FFFFFFF } |
enum | MLMeshingMeshState { MLMeshingMeshState_New, MLMeshingMeshState_Updated, MLMeshingMeshState_Deleted, MLMeshingMeshState_Unchanged, MLMeshingMeshState_Ensure32Bits = 0x7FFFFFFF } |
Functions
Name | |
---|---|
MLResult | MLMeshingCreateClient(MLHandle out_client_handle, const MLMeshingSettings settings) Create the meshing client. |
MLResult | MLMeshingDestroyClient(MLHandle client_handle) Free the client resources. |
MLResult | MLMeshingInitSettings(MLMeshingSettings * out_settings) Initialize the meshing settings with system defaults. |
MLResult | MLMeshingUpdateSettings(MLHandle client_handle, const MLMeshingSettings * settings) Update the meshing settings at runtime. |
MLResult | MLMeshingRequestMeshInfo(MLHandle client_handle, const MLMeshingExtents extents, MLHandle out_request_handle) Request the Mesh Info which includes CFUIDs and bounding extents of the blocks. |
MLResult | MLMeshingGetMeshInfoResult(MLHandle client_handle, MLHandle request_handle, MLMeshingMeshInfo * out_info) Get the Result of a previous MeshInfo request. |
MLResult | MLMeshingRequestMesh(MLHandle client_handle, const MLMeshingMeshRequest request, MLHandle out_request_handle) Request the Mesh for all CFUIDs populated in request. |
MLResult | MLMeshingGetMeshResult(MLHandle client_handle, MLHandle request_handle, MLMeshingMesh * out_mesh) Get the Result of a previous Mesh request. |
MLResult | MLMeshingFreeResource(MLHandle client_handle, MLHandle * request_handle) Free resources created by the meshing APIS. Needs to be called whenever MLMeshingGetMeshInfoResult, MLMeshingGetMeshResult return a success. |
Detailed Description
APIs for the Meshing system.
Shared Object:
perception.magicleap*
The Meshing system is for generating a mesh representation of the real world.
Enums Documentation
MLMeshingFlags
Enumerator | Value | Description |
---|---|---|
MLMeshingFlags_PointCloud | 1 << 0 | If set, will return a point cloud instead of a triangle mesh. |
MLMeshingFlags_ComputeNormals | 1 << 1 | If set, the system will compute the normals for the triangle vertices. |
MLMeshingFlags_ComputeConfidence | 1 << 2 | If set, the system will compute the confidence values. |
MLMeshingFlags_Planarize | 1 << 3 | If set, the system will planarize the returned mesh (planar regions will be smoothed out). |
MLMeshingFlags_RemoveMeshSkirt | 1 << 4 | If set, the mesh skirt (overlapping area between two mesh blocks) will be removed. |
MLMeshingFlags_IndexOrderCW | 1 << 5 | If set, winding order of indices will be be changed from counter clockwise to clockwise. This could be useful for face culling process in different engines. |
MLMeshingFlags_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Request flags for the meshing system.
MLMeshingLOD
Enumerator | Value | Description |
---|---|---|
MLMeshingLOD_Minimum | Minimum Level of Detail (LOD) for the mesh. | |
MLMeshingLOD_Medium | Medium Level of Detail (LOD) for the mesh. | |
MLMeshingLOD_Maximum | Maximum Level of Detail (LOD) for the mesh. | |
MLMeshingLOD_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Level of detail of the block mesh.
MLMeshingResult
Enumerator | Value | Description |
---|---|---|
MLMeshingResult_Success | Mesh request has succeeded. | |
MLMeshingResult_Failed | Mesh request has failed. | |
MLMeshingResult_Pending | Mesh request is pending. | |
MLMeshingResult_PartialUpdate | There are partial updates on the mesh request. | |
MLMeshingResult_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Result of a mesh request.
MLMeshingMeshState
Enumerator | Value | Description |
---|---|---|
MLMeshingMeshState_New | Mesh has been created. | |
MLMeshingMeshState_Updated | Mesh has been updated. | |
MLMeshingMeshState_Deleted | Mesh has been deleted. | |
MLMeshingMeshState_Unchanged | Mesh is unchanged. | |
MLMeshingMeshState_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
State of a block mesh.
Types Documentation
MLMeshingSettings
typedef struct MLMeshingSettings MLMeshingSettings;
Mesh Settings for the underlying system.
MLMeshingExtents
typedef struct MLMeshingExtents MLMeshingExtents;
Axis aligned bounding box for querying updated mesh info.
MLMeshingBlockInfo
typedef struct MLMeshingBlockInfo MLMeshingBlockInfo;
Representation of a mesh block.
MLMeshingMeshInfo
typedef struct MLMeshingMeshInfo MLMeshingMeshInfo;
Response structure for the mesh block info.
MLMeshingBlockRequest
typedef struct MLMeshingBlockRequest MLMeshingBlockRequest;
Request structure to get the actual mesh for a block.
MLMeshingMeshRequest
typedef struct MLMeshingMeshRequest MLMeshingMeshRequest;
Request structure to get the actual mesh for a set of blocks.
MLMeshingBlockMesh
typedef struct MLMeshingBlockMesh MLMeshingBlockMesh;
Final structure for a block mesh.
MLMeshingMesh
typedef struct MLMeshingMesh MLMeshingMesh;
Result of a Mesh request. See MLMeshingGetMeshResult() for details.
Functions Documentation
MLMeshingCreateClient
MLResult MLMeshingCreateClient(
MLHandle * out_client_handle,
const MLMeshingSettings * settings
)
Create the meshing client.
Parameters
MLHandle * | out_client_handle | The handle to the created client. |
const MLMeshingSettings * | settings | The initial settings to be used for meshing. |
Returns
MLResult | MLResult_InvalidParam | Meshing Client was not created due to an invalid parameter. |
MLResult | MLResult_Ok | Meshing Client was created successfully. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
MLResult | MLResult_PermissionDenied | Missing required permission(s). |
MLResult | MLResult_UnspecifiedFailure | Meshing Client was not created due to an unknown error. |
Required Permissions:
- com.magicleap.permission.SPATIAL_MAPPING (protection level: dangerous)
Note that this will be the only function in the meshing API that will return MLResult_PermissionDenied. Trying to call the other functions with an invalid MLHandle will result in MLResult_InvalidParam.
MLMeshingDestroyClient
MLResult MLMeshingDestroyClient(
MLHandle client_handle
)
Free the client resources.
Parameters
MLHandle | client_handle | The client to destroy. |
Returns
MLResult | MLResult_InvalidParam | Meshing Client was not destroyed due to an invalid parameter. |
MLResult | MLResult_Ok | Meshing Client was destroyed successfully. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
Required Permissions:
- None
MLMeshingInitSettings
MLResult MLMeshingInitSettings(
MLMeshingSettings * out_settings
)
Initialize the meshing settings with system defaults.
Parameters
MLMeshingSettings * | out_settings | The initial settings to be used for meshing. |
Returns
MLResult | MLResult_InvalidParam | Mesh Settings were not initialized due to an invalid parameter. |
MLResult | MLResult_Ok | Mesh Settings were initialized successfully. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
Required Permissions:
- None
MLMeshingUpdateSettings
MLResult MLMeshingUpdateSettings(
MLHandle client_handle,
const MLMeshingSettings * settings
)
Update the meshing settings at runtime.
Parameters
MLHandle | client_handle | The handle to the created client. |
const MLMeshingSettings * | settings | The updated settings to be used for meshing. |
Returns
MLResult | MLResult_InvalidParam | Mesh Settings were not updated due to an invalid parameter. |
MLResult | MLResult_Ok | Mesh Settings were updated successfully. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
Required Permissions:
- None
MLMeshingRequestMeshInfo
MLResult MLMeshingRequestMeshInfo(
MLHandle client_handle,
const MLMeshingExtents * extents,
MLHandle * out_request_handle
)
Request the Mesh Info which includes CFUIDs and bounding extents of the blocks.
Parameters
MLHandle | client_handle | The handle to the created client. |
const MLMeshingExtents * | extents | The region of interest for meshing. |
MLHandle * | out_request_handle | The handle for the current request. Needs to be passed to query the result of the request. |
Returns
MLResult | MLResult_InvalidParam | Mesh info was not requested due to an invalid parameter. |
MLResult | MLResult_Ok | Mesh Info was requested successfully. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
Required Permissions:
- None
MLMeshingGetMeshInfoResult
MLResult MLMeshingGetMeshInfoResult(
MLHandle client_handle,
MLHandle request_handle,
MLMeshingMeshInfo * out_info
)
Get the Result of a previous MeshInfo request.
Parameters
MLHandle | client_handle | The handle to the created client. |
MLHandle | request_handle | The handle populated in a prev MLMeshingGetMeshInfo. |
MLMeshingMeshInfo * | out_info | The final result which will be populated only if the result is successful. |
Returns
MLResult | MLResult_InvalidParam | Mesh Settings were not updated due to an invalid parameter. |
MLResult | MLResult_Ok | Mesh Info was populated successfully. |
MLResult | MLResult_Peding | Mesh Info is pending update. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
Required Permissions:
- None
MLMeshingRequestMesh
MLResult MLMeshingRequestMesh(
MLHandle client_handle,
const MLMeshingMeshRequest * request,
MLHandle * out_request_handle
)
Request the Mesh for all CFUIDs populated in request.
Parameters
MLHandle | client_handle | The handle to the created client. |
const MLMeshingMeshRequest * | request | The request for meshes of interest. |
MLHandle * | out_request_handle | The handle for the current request. Needs to be passed to query the result of the request. |
Returns
MLResult | MLResult_InvalidParam | Meshes were not requested due to an invalid parameter. |
MLResult | MLResult_Ok | Meshes were requested successfully. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
Required Permissions:
- None
MLMeshingGetMeshResult
MLResult MLMeshingGetMeshResult(
MLHandle client_handle,
MLHandle request_handle,
MLMeshingMesh * out_mesh
)
Get the Result of a previous Mesh request.
Parameters
MLHandle | client_handle | The handle to the created client. |
MLHandle | request_handle | The handle populated in a prev MLMeshingGetMesh. |
MLMeshingMesh * | out_mesh | The final result which will be populated only if the result is successful. |
Returns
MLResult | MLResult_InvalidParam | Meshes were not updated due to an invalid parameter. |
MLResult | MLResult_Ok | Meshes was populated successfully. |
MLResult | MLResult_Peding | Meshes pending update. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
Required Permissions:
- None
MLMeshingFreeResource
MLResult MLMeshingFreeResource(
MLHandle client_handle,
MLHandle * request_handle
)
Free resources created by the meshing APIS. Needs to be called whenever MLMeshingGetMeshInfoResult, MLMeshingGetMeshResult return a success.
Parameters
MLHandle | client_handle | The handle to the created client. |
MLHandle * | request_handle | The handle populated in a prev request. |
Returns
MLResult | MLResult_InvalidParam | Resources were not freed due to an invalid parameter. |
MLResult | MLResult_Ok | Resources were freed successfully. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
Required Permissions:
- None