SpatialGraphPlacement Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public class SpatialGraphPlacement
type SpatialGraphPlacement = class
Public Class SpatialGraphPlacement
- Inheritance
-
SpatialGraphPlacement
Constructors
SpatialGraphPlacement(IntPtr, Boolean) |
Methods
ComputeOriginForView(SpatialPose, Matrix4x4) |
Computes the origin of the mapped coordinate space, optimized for the specified view. The view and origin poses are expressed in an app-defined "world" coordinate system, determined by the transform provided relative to the reference coordinate system used to initialize this placement. The pose is computed by weighting the control points according to their proximity to the view. |
Finalize() | |
GetControlPoints() |
Returns the set of control points which define this placement in the Spatial Graph. These may be stored and used to recreate the placement in a future session - however, the static nodes referenced by the control points may not be valid unless they have also been persisted using TryPersistStaticNodesAsync(String). |
TryCreate(SpatialGraphCoordinateSystem, SpatialGraphPlacementControlPoint[]) |
Initializes an object which maps coordinates in an application-defined coordinate space onto a set of corresponding locations in the Spatial Graph. The placement of the origin of the coordinate space depends on where it is being viewed from, and will be computed by weighting each control point by its proximity to the view. This enables large objects or scenes to smoothly span across a large physical space as the user moves around, despite non-rigid correspondence between the spaces, e.g. due to head tracking error. A reference coordinate system must be provided to enable efficient per-frame computation of the pose of the origin of the mapped space. The view pose provided each frame must be expressed in this reference coordinate system, though for convenience this may be moderated through a separate "world" coordinate system if necessary (for example, the native coordinate system used by the application versus the interop coordinate system used to initialize the placement). |
TryPersistStaticNodesAsync(String) |
Attempts to persist the static nodes referenced by this placement's control points to the platform's SpatialAnchorStore, using unique keys based on the the given name and each static node's id. This ensures that these static nodes will remain valid for future sessions. May return false if the platform's storage is full, or does not support storing static nodes. Note that recreating a placement from control points does not require any steps to load the static nodes from persistence; this happens implicity during TryCreate(SpatialGraphCoordinateSystem, SpatialGraphPlacementControlPoint[]). All previously persisted entries associated with the given name are removed regardless of success or failure. |
UnpersistStaticNodesAsync(String) |
Releases platform resources associated with a placement previously persisted with the given name. Specifically, removes entries from the platform's SpatialAnchorStore associated with the placement's static nodes. Those static nodes may remain valid if they are actively being used or have been persisted under a different name for another placement, but will become eligable for the platform to reclaim when they are no longer in use. No exception will be thrown if there are no entries corresponding to the given name; the operation simply has no effect. |