Node

Within Visual Studio, create a new class called Node in the Content folder. This class acts as our breadcrumb, which is essentially a wrapper around SpatialAnchor. To gain access to SpatialAnchor, we must import the following namespace: Windows.Perception.Spatial. Copy the following snippet to the newly created Node class:

internal class Node{  static int NodeID = 0;  public string Name { get; private set; }  public Vector3 Position { get; set; }  public Vector3 Forward { get; set; }  public long Timestamp { get; set; }  public SpatialAnchor Anchor { get; set; }  public Node(Spatial​Anchor anchor, Vector3 position, Vector3 forward)   {    Name = $"Node_{++Node.NodeID}";    Anchor = anchor;    Position = position;    Forward = forward; Timestamp = Utils.GetCurrentUnixTimestampMillis(); ...

Get Microsoft HoloLens By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.