⚠ Preview docs — built from the develop branch and may be unstable. Go to the stable docs.

enum SpatialLabel

A semantic category the system has assigned to a spatial entity, such as a floor plane or a tracked keyboard. All label sources share this one list, so a category can come from plane tracking on one device and object tracking on another. Any given entity only uses a subset of these, and if the system reports a category StereoKit doesn’t know yet, it arrives as Uncategorized. New values are only ever appended.

Enum Values

   
Ceiling A ceiling.
Floor A floor.
None No label information available.
Table A table, or table-like surface.
Uncategorized The system recognizes this entity, but it doesn’t fit any of the categories it knows.
Wall A wall.

Examples

Finding a table to put things on

Not every device labels its planes, so this falls back to any surface that faces upward.

static bool FindTable(out Pose surface)
{
	foreach (SpatialEntity plane in SpatialEntity.With(SpatialComponent.Bounds2D))
	{
		bool isTable = plane.TryGetLabel(out SpatialLabel label)
			? label == SpatialLabel.Table
			: plane.TryGetPlaneAlign(out PlaneAlign align) && align == PlaneAlign.HorizontalUp;
		if (isTable && plane.TryGetBounds2D(out surface, out _))
			return true;
	}
	surface = Pose.Identity;
	return false;
}




Found an issue with these docs, or have some additional questions? Create an Issue on Github!