Spatial.Disable
static void Disable(SpatialCapability capabilities)
Stop tracking these capabilities. Their entities leave
the entity list, and any SpatialEntity identifiers you still
hold stop resolving. Persisted entities are the exception, they
wait with Status Pending, and come back if the capability is
requested again. This also overrides StereoKit’s own use of a
capability. The Anchor system turns on
SpatialCapability.Anchor the first time you use it, and calling
this before SK.Initialize keeps Anchor from using spatial
entities at all.
| SpatialCapability capabilities | One or more capabilities to disable. |
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!