Skip to main content
Version: 31 Aug 2023


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


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



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


Callback sent to all MagicLeap APIs on application pause.

protected virtual override void OnApplicationPause(
bool pauseStatus


boolpauseStatusTrue if the application is paused, else False.

Reimplements: OnApplicationPause


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


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