private WorldLockingManager() { CreateUpdaterNode(); /// It might look nicer to pull these off into internal setup functions, /// but by leaving them in the constructor, these fields can be marked "readonly", /// which they conceptually are. if (Core.Plugin.HasEngine()) { Plugin = new Plugin(); } else { Plugin = new PluginNoop(); } DiagnosticRecordings.Start(Plugin); headPoseTracker = new HeadPoseTrackerCamera(); /// This should never fail. It's a null-manager. anchorManager = AnchorManagerNull.TryCreate(Plugin, headPoseTracker); Debug.Assert(anchorManager != null, "Null manager creation should never fail"); var fm = new FragmentManager(Plugin); fragmentManager = fm; attachmentPointManager = fm; /// Note the alignmentManager accesses the FragmentManager in its constructor /// to register for refit notifications. Either FragmentManager needs to be fully /// setup before constructing AlignmentManager, or that registration needs to be deferred. alignmentManager = new AlignmentManager(this); }
/// <summary> /// When the reference point position is initially set, create an attachment point if there isn't one, /// or if there is, updated its position. /// </summary> private void CheckAttachmentPoint() { IAttachmentPointManager mgr = manager.AttachmentPointManager; if (attachmentPoint == null) { attachmentPoint = mgr.CreateAttachmentPoint(LockedPose.position, null, OnLocationUpdate, null); } else { mgr.TeleportAttachmentPoint(attachmentPoint, LockedPose.position, null); } }
private WorldLockingManager() { CreateUpdaterNode(); /// It might look nicer to pull these off into internal setup functions, /// but by leaving them in the constructor, these fields can be marked "readonly", /// which they conceptually are. Plugin = new Plugin(); DiagnosticRecordings.Start(Plugin); var am = new AnchorManager(Plugin); anchorManager = am; var fm = new FragmentManager(Plugin); fragmentManager = fm; attachmentPointManager = fm; /// Note the alignmentManager accesses the FragmentManager in its constructor /// to register for refit notifications. Either FragmentManager needs to be fully /// setup before constructing AlignmentManager, or that registration needs to be deferred. alignmentManager = new AlignmentManager(this); }
/// <inheritdoc /> public void TeleportTo(IAttachmentPointManager manager, Vector3 newFrozenPosition, IAttachmentPoint parent) { manager.TeleportAttachmentPoint(this, newFrozenPosition, parent); }
/// <inheritdoc /> public void MoveTo(IAttachmentPointManager manager, Vector3 newFrozenPosition) { manager.MoveAttachmentPoint(this, newFrozenPosition); }