MoveTool

The MoveTool will be the only script that requires ARKit-specific calls. In the Mixed Reality Toolkit, we cast a ray from the camera into the scene and looked for a hit point where it intersects with the spatial map of the environment. For ARKit, we do something similar, but instead of using Unity physics to do the calculation, we use the underlying ARKit SDK directly (from C#):

  1. Open the MoveTool.cs script and modify it to use mouse events.
  2. Remove all references to HoloToolkit and spatialMapping.

Then replace the Update() function as follows:

File: MoveTool.cs    void Update() {         List<ARHitTestResult> hitResults;         ARPoint point;         if (isEditing) {             Vector3 screenPosition = Camera.main.ScreenToViewportPoint(Input.mousePosition); point.x ...

Get Augmented Reality for Developers 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.