Skip to main content
Version: 12 Dec 2024

MLCVCamera

NameSpace: MagicLeap

MLCamera class exposes static functions to query camera related functions. Most functions are currently a direct pass through functions to the native C-API functions and incur no overhead.

Inherits from:
MLAutoAPISingleton< MLCVCamera >,
MLLazySingleton< T >

Public Methods

MLResult GetFramePose

Get transform between world origin and the camera. This method relies on a camera timestamp that is normally acquired from the MLCameraResultExtras structure, therefore this method is best used within a capture callback to maintain as much accuracy as possible. Requires ComputerVision permission.

public static MLResult GetFramePose(
MLTime vcamTimestamp,
out Matrix4x4 outTransform
)

Parameters

TypeNameDescription
MLTimevcamTimestampTime in nanoseconds to request the transform.
out Matrix4x4outTransformOutput transformation matrix on success.

Details*

tran

Returns: MLResult.Result will be MLResult.Code.Ok if successful. MLResult.Result will be MLResult.Code.PermissionDenied if necessary permission is missing. MLResult.Result will be MLResult.Code.InvalidParam if outTransform parameter was not valid (null). MLResult.Result will be MLResult.Code.UnspecifiedFailure if failed to obtain transform due to internal error.


Protected Methods

OnApplicationPause

Callback sent to all MagicLeap APIs on application pause.

protected virtual override void OnApplicationPause(
bool pauseStatus
)

Parameters

TypeNameDescription
boolpauseStatusTrue if the application is paused, else False.

Reimplements: OnApplicationPause


StartAPI

Do API-specific creation/initialization of ML resources for this API, such as creating trackers, etc. Called automatically the first time Instance is accessed. Error checking on the return value is performed in the base class.

protected virtual override MLResult.Code StartAPI()

Reimplements: StartAPI


StopAPI

API-specific cleanup. Will be called whenever MLDevice is destroyed (at the latest, when the application is shutting down). Error checking on the return value is performed in the base class.

protected virtual override MLResult.Code StopAPI()

Reimplements: StopAPI