Interface IAlignmentManager
Manage pinning the world-locked space to user defined coordinate frame at a discrete set of points in the world.
Namespace: Microsoft.MixedReality.WorldLocking.Core
Assembly: cs.temp.dll.dll
Syntax
public interface IAlignmentManager
Properties
NeedSave
True if the persistent state of the alignment manager has changed since the last save.
Declaration
bool NeedSave { get; }
Property Value
Type | Description |
---|---|
Boolean |
PinnedFromLocked
The pose to insert into the camera's hierarchy above the WorldLocking Adjustment transform (if any).
Declaration
Pose PinnedFromLocked { get; }
Property Value
Type | Description |
---|---|
Pose |
Methods
AddAlignmentAnchor(String, Pose, Pose)
Add an anchor for aligning a virtual pose to a pose in real space.
Declaration
AnchorId AddAlignmentAnchor(string uniqueName, Pose virtualPose, Pose lockedPose)
Parameters
Type | Name | Description |
---|---|---|
String | uniqueName | |
Pose | virtualPose | The pose in modeling space. |
Pose | lockedPose | The pose in world locked space. |
Returns
Type | Description |
---|---|
AnchorId | The id for the added anchor if successful, else AnchorId.Unknown. See remarks. |
Remarks
This must be followed by SendAlignmentAnchors() before it will have any effect. The returned AnchorId may be stored for future manipulation of the created anchor (e.g. for individual removal in RemoveAlignmentAnchor(AnchorId)). The system must be currently tracking to successfully add an alignment anchor. The alignment anchor will be in the current Fragment. The current fragment will be available when there is no tracking, and so this call will fail. If this call fails, indicated by a return of AnchorId.Unknown, then it should be called again on a later frame until it succeeds.
ClearAlignmentAnchors()
Remove all alignment anchors that have been added. More efficient than removing them individually, and doesn't require having stored their ids on creation.
Declaration
void ClearAlignmentAnchors()
Remarks
This is more efficient than removing one by one, but take care to discard all existing AnchorIds returned by AddAlignmentAnchor(String, Pose, Pose) after this call, as it will be an error to try to use any of them. Also note that this clears the Alignment Anchors staged for commit with the next SendAlignmentAnchors(), but the current ones will remain effective until the next call to SendAlignmentAnchors, which will send an empty list, unless it has been repopulated after the call to ClearAlignmentAnchors.
ComputePinnedPose(Pose)
Update based on new head position.
Declaration
void ComputePinnedPose(Pose lockedHeadPose)
Parameters
Type | Name | Description |
---|---|---|
Pose | lockedHeadPose | Head pose in world locked space. |
GetAlignmentPose(AnchorId, out Pose)
Get the world locked space pose associated with this alignment anchor.
Declaration
bool GetAlignmentPose(AnchorId anchorId, out Pose lockedPose)
Parameters
Type | Name | Description |
---|---|---|
AnchorId | anchorId | Which anchor. |
Pose | lockedPose | Pose to fill out if alignment anchor is found. |
Returns
Type | Description |
---|---|
Boolean | True if anchor is found and lockedPose filled in, else false and lockedPose set to identity. |
Load()
Load all persisted state required for reconstructing the current pinning.
Declaration
bool Load()
Returns
Type | Description |
---|---|
Boolean | True if loaded. |
Remarks
The state required for reconstructing the pinning is loaded, but the reconstruction does not occur. Rather, the PostAlignmentLoadedDelegate is triggered, to prompt external actors to use the RestoreAlignmentAnchor(String, Pose) API to effect the reconstruction. 👍
RegisterForLoad(PostAlignmentLoadedDelegate)
Register for notification that pin data has finished loaded and is available.
Declaration
void RegisterForLoad(PostAlignmentLoadedDelegate del)
Parameters
Type | Name | Description |
---|---|---|
PostAlignmentLoadedDelegate | del | Delegate to notify. |
Remarks
The delegate should be unregistered when no longer needed, e.g. owning object is destroyed.
RemoveAlignmentAnchor(AnchorId)
Remove the given alignment anchor from the system.
Declaration
bool RemoveAlignmentAnchor(AnchorId anchorId)
Parameters
Type | Name | Description |
---|---|---|
AnchorId | anchorId | The anchor to remove (as returned by AddAlignmentAnchor(String, Pose, Pose) |
Returns
Type | Description |
---|---|
Boolean | True if the anchor was found. |
RestoreAlignmentAnchor(String, Pose)
Attempt to restore an alignment anchor from an earlier session. Stored alignment anchor must match in both uniqueName and virtual pose.
Declaration
AnchorId RestoreAlignmentAnchor(string uniqueName, Pose virtualPose)
Parameters
Type | Name | Description |
---|---|---|
String | uniqueName | Unique name use previously to create the alignment anchor. |
Pose | virtualPose | Virtual pose to match with stored anchor pose. |
Returns
Type | Description |
---|---|
AnchorId | AnchorId of restored Alignment Anchor on success, else AnchorId.Invalid. |
Remarks
If successful, alignment anchor is added but not sent. It must be followed by a call to SendAlignmentAnchors to take effect.
Save()
Save state needed to reconstruct later from persistent storage.
Declaration
bool Save()
Returns
Type | Description |
---|---|
Boolean | True if saved (even if empty). |
SendAlignmentAnchors()
Submit all accumulated alignment anchors.
Declaration
void SendAlignmentAnchors()
Remarks
All anchors previously submitted via SendAlignmentAnchors() will be cleared and replaced by the current set. SendAlignmentAnchors() submits the current set of anchors, but they will have no effect until the next Refreeze() is successfully performed.
UnregisterForLoad(PostAlignmentLoadedDelegate)
Unregister for notification that pin data has finished loaded and is available.
Declaration
void UnregisterForLoad(PostAlignmentLoadedDelegate del)
Parameters
Type | Name | Description |
---|---|---|
PostAlignmentLoadedDelegate | del | Delegate to remove from notifications. |
Events
OnTriangulationBuilt
New triangulation was built based upon recent poses.
Declaration
event EventHandler<ITriangulator> OnTriangulationBuilt
Event Type
Type | Description |
---|---|
EventHandler<ITriangulator> |