OpenXRPlaneTracker
Inherits: OpenXRSpatialEntityTracker < XRPositionalTracker < XRTracker < RefCounted < Object
Description
Section titled “Description”Spatial entity tracker for our spatial entity plane tracking extension.
Spatial entity tracker for our OpenXR spatial entity plane tracking extension. These trackers identify entities in our real space such as walls, floors, tables, etc. and map their location to our virtual space.
Properties
Section titled “Properties”| Type | Name | Default |
|---|---|---|
| Vector2 | bounds_size |
Vector2(0, 0) |
| OpenXRSpatialComponentPlaneAlignmentList.PlaneAlignment | plane_alignment |
0 |
| String | plane_label |
"" |
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| void | clear_mesh_data() |
| PackedInt32Array | get_indices() const |
| Mesh | get_mesh() |
| Transform3D | get_mesh_offset() const |
| Shape3D | get_shape(thickness: float = 0.01) |
| PackedVector2Array | get_vertices() const |
| void | set_mesh_data(origin: Transform3D, vertices: PackedVector2Array, indices: PackedInt32Array = PackedInt32Array()) |
Signals
Section titled “Signals”mesh_changed
mesh_changed()
Emitted when our mesh data has changed the mesh instance and collision needs to be updated.
Property descriptions
Section titled “Property descriptions”bounds_size
Vector2 bounds_size = Vector2(0, 0)
The bounding size of the plane. This is a 2D size.
plane_alignment
OpenXRSpatialComponentPlaneAlignmentList.PlaneAlignment plane_alignment = 0
The main alignment in space of this plane.
plane_label
String plane_label = ""
The semantic label for this plane.
Method descriptions
Section titled “Method descriptions”clear_mesh_data
void clear_mesh_data()
Clears the mesh data for this tracker. You should only call this if you are handling your own discovery logic.
get_indices
PackedInt32Array get_indices() const
Gets the index data for the mesh.
get_mesh
Mesh get_mesh()
Gets a mesh created from either the mesh data or from our bounding size for this plane. This mesh is cached and will return the same resource when called while vertex and index data remains unchanged.
get_mesh_offset
Transform3D get_mesh_offset() const
Gets the transform by which to offset the mesh and collision shape from our pose to display these correctly.
get_shape
Shape3D get_shape(thickness: float = 0.01)
Gets a collision shape built either from the mesh data or from our bounding size for this plane.
get_vertices
PackedVector2Array get_vertices() const
Gets the vertex data for the mesh.
set_mesh_data
void set_mesh_data(origin: Transform3D, vertices: PackedVector2Array, indices: PackedInt32Array = PackedInt32Array())
Sets the mesh data for this plane. You should only call this if you are handling your own discovery logic.
