Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Typedefs | Functions
Camera

Typedefs

typedef struct ArCamera_ ArCamera
 

Functions

void ArCamera_getPose (const ArSession *session, const ArCamera *camera, ArPose *out_pose)
 
void ArCamera_getDisplayOrientedPose (const ArSession *session, const ArCamera *camera, ArPose *out_pose)
 
void ArCamera_getViewMatrix (const ArSession *session, const ArCamera *camera, float *out_col_major_4x4)
 
void ArCamera_getTrackingState (const ArSession *session, const ArCamera *camera, ArTrackingState *out_tracking_state)
 
void ArCamera_getProjectionMatrix (const ArSession *session, const ArCamera *camera, float near, float far, float *dest_col_major_4x4)
 
void ArCamera_release (ArCamera *camera)
 

Detailed Description

Provides information about the camera that is used to capture images.

Typedef Documentation

◆ ArCamera

typedef struct ArCamera_ ArCamera

The virtual and physical camera (reference type, long-lived).

Acquire with ArFrame_acquireCamera()
Release with ArCamera_release()

Definition at line 189 of file arcore_c_api.h.

Function Documentation

◆ ArCamera_getDisplayOrientedPose()

void ArCamera_getDisplayOrientedPose ( const ArSession session,
const ArCamera camera,
ArPose out_pose 
)

Sets out_pose to the pose of the user's device in the world coordinate space at the time of capture of the current camera texture. The position of the pose is located at the device's camera, while the orientation approximately matches the orientation of the display (considering display rotation), using OpenGL camera conventions (+X right, +Y up, -Z in the direction the camera is looking).

Note: This pose is only useful when ArCamera_getTrackingState() returns #AR_TRACKING_STATE_TRACKING and otherwise should not be used.

See also: ArCamera_getViewMatrix()

Parameters
[in]sessionThe ARCore session
[in]cameraThe session's camera (retrieved from any frame).
[in,out]out_poseAn already-allocated ArPose object into which the pose will be stored.

◆ ArCamera_getPose()

void ArCamera_getPose ( const ArSession session,
const ArCamera camera,
ArPose out_pose 
)

Sets out_pose to the pose of the user's device in the world coordinate space at the time of capture of the current camera texture. The position and orientation of the pose follow the device's physical camera (they are not affected by display orientation) and uses OpenGL camera conventions (+X right, +Y up, -Z in the direction the camera is looking).

Note: This pose is only useful when ArCamera_getTrackingState() returns #AR_TRACKING_STATE_TRACKING and otherwise should not be used.

Parameters
[in]sessionThe ARCore session
[in]cameraThe session's camera (retrieved from any frame).
[in,out]out_poseAn already-allocated ArPose object into which the pose will be stored.

◆ ArCamera_getProjectionMatrix()

void ArCamera_getProjectionMatrix ( const ArSession session,
const ArCamera camera,
float  near,
float  far,
float *  dest_col_major_4x4 
)

Computes a projection matrix for rendering virtual content on top of the camera image. Note that the projection matrix reflects the current display geometry and display rotation.

Parameters
[in]sessionThe ARCore session
[in]cameraThe session's camera.
[in]nearSpecifies the near clip plane, in meters
[in]farSpecifies the far clip plane, in meters
[in,out]dest_col_major_4x4Pointer to an array of 16 floats, to be filled with a column-major homogenous transformation matrix, as used by OpenGL.

◆ ArCamera_getTrackingState()

void ArCamera_getTrackingState ( const ArSession session,
const ArCamera camera,
ArTrackingState *  out_tracking_state 
)

Gets the current state of the pose of this camera. If this state is anything other than #AR_TRACKING_STATE_TRACKING the Camera's pose should not be considered useful.

◆ ArCamera_getViewMatrix()

void ArCamera_getViewMatrix ( const ArSession session,
const ArCamera camera,
float *  out_col_major_4x4 
)

Returns the view matrix for the camera for this frame. This matrix performs the inverse transfrom as the pose provided by ArCamera_getDisplayOrientedPose().

Parameters
[in]sessionThe ARCore session
[in]cameraThe session's camera.
[in,out]out_col_major_4x4Pointer to an array of 16 floats, to be filled with a column-major homogenous transformation matrix, as used by OpenGL.

◆ ArCamera_release()

void ArCamera_release ( ArCamera camera)

Releases a reference to the camera. This must match a call to ArFrame_acquireCamera().

This method may safely be called with nullptr - it will do nothing.