ArPointCloud

Contains a set of observed 3D points and confidence values.

Summary

Typedefs

ArPointCloud typedef
struct ArPointCloud_
A cloud of tracked 3D visual feature points (reference type, large data).

Functions

ArPointCloud_getData(const ArSession *session, const ArPointCloud *point_cloud, const float **out_point_cloud_data)
void
Retrieves a pointer to the Point Cloud data.
ArPointCloud_getNumberOfPoints(const ArSession *session, const ArPointCloud *point_cloud, int32_t *out_number_of_points)
void
Retrieves the number of points in the Point Cloud.
ArPointCloud_getPointIds(const ArSession *session, const ArPointCloud *point_cloud, const int32_t **out_point_ids)
void
Retrieves a pointer to the Point Cloud point IDs.
ArPointCloud_getTimestamp(const ArSession *session, const ArPointCloud *point_cloud, int64_t *out_timestamp_ns)
void
Returns the timestamp in nanoseconds when this Point Cloud was observed.
ArPointCloud_release(ArPointCloud *point_cloud)
void
Releases a reference to the Point Cloud.

Typedefs

ArPointCloud

struct ArPointCloud_ ArPointCloud

A cloud of tracked 3D visual feature points (reference type, large data).

Functions

ArPointCloud_getData

void ArPointCloud_getData(
  const ArSession *session,
  const ArPointCloud *point_cloud,
  const float **out_point_cloud_data
)

Retrieves a pointer to the Point Cloud data.

Each point is represented by four consecutive values in the array; first the X, Y, Z position coordinates, followed by a confidence value. This is the same format as described in DEPTH_POINT_CLOUD.

The pointer returned by this function is valid until ArPointCloud_release is called. If the number of points is zero, then the value of *out_point_cloud_data is undefined.

If your app needs to keep some Point Cloud data, for example to compare Point Cloud data frame to frame, consider copying just the data points your app needs, and then calling ArPointCloud_release to reduce the amount of memory required.

ArPointCloud_getNumberOfPoints

void ArPointCloud_getNumberOfPoints(
  const ArSession *session,
  const ArPointCloud *point_cloud,
  int32_t *out_number_of_points
)

Retrieves the number of points in the Point Cloud.

ArPointCloud_getPointIds

void ArPointCloud_getPointIds(
  const ArSession *session,
  const ArPointCloud *point_cloud,
  const int32_t **out_point_ids
)

Retrieves a pointer to the Point Cloud point IDs.

The number of IDs is the same as number of points, and is given by ArPointCloud_getNumberOfPoints.

Each point has a unique identifier (within a session) that is persistent across frames. That is, if a point from Point Cloud 1 has the same id as the point from Point Cloud 2, then it represents the same point in space.

The pointer returned by this function is valid until ArPointCloud_release is called. If the number of points is zero, then the value of *out_point_ids is undefined.

If your app needs to keep some Point Cloud data, for example to compare Point Cloud data frame to frame, consider copying just the data points your app needs, and then calling ArPointCloud_release to reduce the amount of memory required.

ArPointCloud_getTimestamp

void ArPointCloud_getTimestamp(
  const ArSession *session,
  const ArPointCloud *point_cloud,
  int64_t *out_timestamp_ns
)

Returns the timestamp in nanoseconds when this Point Cloud was observed.

This timestamp uses the same time base as ArFrame_getTimestamp.

ArPointCloud_release

void ArPointCloud_release(
  ArPointCloud *point_cloud
)

Releases a reference to the Point Cloud.

This must match a call to ArFrame_acquirePointCloud.

This function may safely be called with NULL - it will do nothing.