PointCloud

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).

Acquire with ArFrame_acquirePointCloud()
Release with ArPointCloud_release()

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 method may safely be called with nullptr - it will do nothing.

Send feedback about...