Monado OpenXR Runtime
xrt_plane_detections_ext Struct Reference

Each plane has n polygons; ultimately plane metadata from locations and vetices is reconstructed. More...

#include <xrt/xrt_plane_detector.h>

Collaboration diagram for xrt_plane_detections_ext:

Data Fields

uint32_t location_count
 How many locations were found. More...
 
uint32_t location_size
 size of locations and polygon_info_start_index arrays. More...
 
struct xrt_plane_detector_location_extlocations
 ! array of detected locations. More...
 
uint32_t * polygon_info_start_index
 Parallel array to locations. More...
 
uint32_t polygon_info_size
 size of polygon_infos array. More...
 
struct xrt_plane_polygon_info_extpolygon_infos
 Continuous array of polygon_infos of all polygons for all planes of a query. More...
 
uint32_t vertex_size
 size of vertices array. More...
 
struct xrt_vec2vertices
 Continuous array of polygon vertices of all polygons for all planes of a query. More...
 

Detailed Description

Each plane has n polygons; ultimately plane metadata from locations and vetices is reconstructed.

Therefore lay out the data in flattened arrays:

locations stores continuous metadata for each plane: location 1 | location 2 | location 3 | location 4 | ...

polygon_info_start_index is a helper array to go from a location entry to a polygon_info entry.

polygon_info stores info (metadata) for each polygon, flattened: plane 1 polygon 1 info | plane 1 polygon 2 info | ... | plane 2 polygon 1 info | ...

polygon_info.vertices_start_index is a helper array to go from a polygon_info entry to vertices entry.

vertices stores vertex data for each polygon, for each plane, flattened: plane 1 polygon 1 vertex 1 | plane 1 polygon 1 vertex 2 | ... | plane 1 polygon 2 vertex 1 | ...

To reconstruct the vertices of a certain plane polygon:

  • Find the index i of the plane with the requested plane_id in the locations array.
  • Use this index i to generate a new index j = polygon_info_start_index[i].
  • polygon_info[j] is the info of the first polygon of the locations[i] plane.
  • polygon_info[j + polygonBufferIndex] is the info of the requested polygon.
  • polygon_info[j + polygonBufferIndex].vertex_count is the vertex count of this polygon.
  • polygon_info[j + polygonBufferIndex].vertices_start_index is another new index k.
  • vertices[k] is the first vertex of the requested polygon.

Convention: Whoever writes to this struct checks the size values first and reallocates arrays if necessary.

Field Documentation

◆ location_count

uint32_t xrt_plane_detections_ext::location_count

How many locations were found.

◆ location_size

uint32_t xrt_plane_detections_ext::location_size

size of locations and polygon_info_start_index arrays.

◆ locations

struct xrt_plane_detector_location_ext* xrt_plane_detections_ext::locations

! array of detected locations.

Referenced by xrt_plane_detections_ext_clear().

◆ polygon_info_size

uint32_t xrt_plane_detections_ext::polygon_info_size

size of polygon_infos array.

◆ polygon_info_start_index

uint32_t* xrt_plane_detections_ext::polygon_info_start_index

Parallel array to locations.

Index into polygon_info of polygon_infos for all planes of a query.

Referenced by xrt_plane_detections_ext_clear().

◆ polygon_infos

struct xrt_plane_polygon_info_ext* xrt_plane_detections_ext::polygon_infos

Continuous array of polygon_infos of all polygons for all planes of a query.

Referenced by xrt_plane_detections_ext_clear().

◆ vertex_size

uint32_t xrt_plane_detections_ext::vertex_size

size of vertices array.

◆ vertices

struct xrt_vec2* xrt_plane_detections_ext::vertices

Continuous array of polygon vertices of all polygons for all planes of a query.

Referenced by xrt_plane_detections_ext_clear().


The documentation for this struct was generated from the following file: