Flutter Engine
The Flutter Engine
|
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) |
Provides information about the camera that is used to capture images.
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.
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()
[in] | session | The ARCore session |
[in] | camera | The session's camera (retrieved from any frame). |
[in,out] | out_pose | An already-allocated ArPose object into which the pose will be stored. |
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.
[in] | session | The ARCore session |
[in] | camera | The session's camera (retrieved from any frame). |
[in,out] | out_pose | An already-allocated ArPose object into which the pose will be stored. |
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.
[in] | session | The ARCore session |
[in] | camera | The session's camera. |
[in] | near | Specifies the near clip plane, in meters |
[in] | far | Specifies the far clip plane, in meters |
[in,out] | dest_col_major_4x4 | Pointer to an array of 16 floats, to be filled with a column-major homogenous transformation matrix, as used by OpenGL. |
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.
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().
[in] | session | The ARCore session |
[in] | camera | The session's camera. |
[in,out] | out_col_major_4x4 | Pointer to an array of 16 floats, to be filled with a column-major homogenous transformation matrix, as used by OpenGL. |
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.