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

enum PlaneAlign

The general orientation of a detected plane.

Enum Values

   
Arbitrary A surface at some other arbitrary angle, like a ramp.
HorizontalDown A horizontal surface facing down, like a ceiling.
HorizontalUp A horizontal surface facing up, like a floor or table top.
None Alignment is not known.
Vertical A vertical surface, like 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!