SpatialCapability.PlaneTracking
static SpatialCapability PlaneTracking
Description
Detection and tracking of flat surfaces in the environment, like floors, walls, and tables.
Examples
Drawing detected planes
Request plane tracking once, and the device’s walls, floors and tables show up in the entity list as it finds them.
public void StartPlanes()
{
Spatial.Request(SpatialCapability.PlaneTracking);
}
public void StopPlanes()
{
Spatial.Disable(SpatialCapability.PlaneTracking);
}
public void DrawPlanes()
{
foreach (SpatialEntity plane in SpatialEntity.With(SpatialComponent.Bounds2D))
{
// Quads face Forward, same as the plane's center pose
plane.TryGetBounds2D(out Pose center, out Vec2 size);
Mesh.Quad.Draw(Material.Default, center.ToMatrix(new Vec3(size.x, size.y, 1)));
}
}
Found an issue with these docs, or have some additional questions? Create an Issue on Github!