OpenXRAndroidTrackablePlaneTracker
Inherits: OpenXRAndroidTrackableTracker < XRPositionalTracker
A tracker for a plane (from XR_ANDROID_trackables).
Description
A tracker for a plane (from XR_ANDROID_trackables).
See also OpenXRAndroidTrackablesExtension.
Methods
Vector2 |
get_extents ( ) |
ArrayMesh |
get_mesh ( ) |
get_plane_label ( ) |
|
get_plane_type ( ) |
|
ConcavePolygonShape3D |
get_shape ( float thickness ) |
PackedVector3Array |
get_vertices ( ) |
Enumerations
enum PlaneType:
PlaneType PLANE_TYPE_HORIZONTAL_DOWNWARD_FACING = 0
The plane is horizontal, facing downward, like a ceiling.
PlaneType PLANE_TYPE_HORIZONTAL_UPWARD_FACING = 1
The plane is horizontal, facing upward, like a floor or tabletop.
PlaneType PLANE_TYPE_VERTICAL = 2
The plane is vertical, like a wall.
PlaneType PLANE_TYPE_ARBITRARY = 3
The plane is none of the other types.
enum PlaneLabel:
PlaneLabel PLANE_LABEL_UNKNOWN = 0
The plane is none of the other labels.
PlaneLabel PLANE_LABEL_WALL = 1
The plane is a wall.
PlaneLabel PLANE_LABEL_FLOOR = 2
The plane is a floor.
PlaneLabel PLANE_LABEL_CEILING = 3
The plane is a ceiling.
PlaneLabel PLANE_LABEL_TABLE = 4
The plane is a table.
Method Descriptions
Vector2 get_extents ( )
Returns the width and height, or Vector2.x and Vector2.y respectively.
The width and height are centered on the pose from OpenXRAndroidTrackableTracker.get_center_pose.
For example, a width of 2 means the extents extend 1 to the left and right of the center pose.
ArrayMesh get_mesh ( )
Returns an ArrayMesh, which can be assigned to MeshInstance3D.mesh.
This mesh is constructed from the same vertices returned by get_vertices.
PlaneLabel get_plane_label ( )
Return the PlaneLabel for this tracker.
PlaneType get_plane_type ( )
Return the PlaneType for this tracker.
ConcavePolygonShape3D get_shape ( float thickness )
Returns a ConcavePolygonShape3D representing the plane, which can be assigned to CollisionShape3D.shape.
thickness is how thick to make the shape, in meters. Positive values extend the thickness behind the plane, while negative values extend the thickness in front of the plane. A thickness of 0.0 will return null.
OpenXRAndroidTrackablePlaneTracker get_subsumed_by_plane ( )
Return the OpenXRAndroidTrackablePlaneTracker that subsumes (i.e replaces) this plane. Can be null.
This plane continues to receive updates even when it has a subsuming plane.
PackedVector3Array get_vertices ( )
Return a PackedVector3Array of vertices that outlines the plane, counterclockwise.
These vertices are in local space (i.e centered about the origin) and do not form a valid mesh.
These vertices form a convex polygon.
Use get_mesh if you need a mesh.