Share via


AnchorManager Class

Definition

Encapsulation of spongy world (raw input) state. Its primary duty is the creation and maintenance of the graph of (spongy) anchors built up over the space traversed by the camera.

public abstract class AnchorManager : IDisposable, Microsoft.MixedReality.WorldLocking.Core.IAnchorManager
type AnchorManager = class
    interface IAnchorManager
    interface IDisposable
Public MustInherit Class AnchorManager
Implements IAnchorManager, IDisposable
Inheritance
AnchorManager
Derived
Implements

Remarks

Anchor and Edge creation algorithm:

Goal: a simple and robust algorithm that guarantees an even distribution of anchors, fully connected by edges between nearest neighbors with a minimum of redundant edges

For simplicity, the algorithm should be stateless between time steps

Rules * two parameters define spheres MIN and MAX around current position * whenever MIN does not contain any anchors, a new anchor is created * when a new anchor is created is is linked by edges to all anchors within MAX * the MAX radius is 20cm larger than MIN radius which would require 12 m/s beyond world record sprinting speed to cover in one frame * whenever MIN contains more than one anchor, the anchor closest to current position is connected to all others within MIN

Constructors

AnchorManager(IPlugin, IHeadPoseTracker)

Set up an anchor manager.

Properties

AnchorFromSpongy

Get the transform from spongy space to the space anchors are located in.

ErrorStatus

Error string for last error, cleared at beginning of each update.

MaxAnchorEdgeLength

Maximum distance between two anchors to create an edge between them.

MaxLocalAnchors

Maximum number of local anchors in the internal anchor graph.

MinNewAnchorDistance

Minimum distance of head to nearest anchor to create a new anchor.

NumAnchors

Return the current number of spongy anchors.

NumEdges

The number of edges connecting spongy anchors.

SpongyAnchors
SupportsPersistence

Whether the underlying anchors can be locally persisted and reloaded.

TrackingStartDelayTime

Methods

CreateAnchor(AnchorId, Transform, Pose)

Platform dependent instantiation of a local anchor at given position.

DebugLogExtra(String)
DebugLogSetup(String)
DestroyAnchor(AnchorId, SpongyAnchor)

Platform dependent disposal of local anchors.

Dispose()

Explicit dispose to release resources.

Finalize()

GC release of resources.

IsTracking()
LoadAnchors()

Load the spongy anchors from persistent storage

LoadAnchors(IPlugin, AnchorId, Transform, List<AnchorManager.SpongyAnchorWithId>)
RemoveSpongyAnchorById(AnchorId)

Remove all internal references to the anchor identified.

Reset()

Delete all spongy anchor objects and reset internal state

SaveAnchors()

Save the spongy anchors to persistent storage

SaveAnchors(List<AnchorManager.SpongyAnchorWithId>)
Update()

Create missing spongy anchors/edges and feed plugin with up-to-date input

Applies to