Reset Camera
Introduction
If you're building a seated or standing experience, you can recenter Unity's world origin at the user's current position and orientation by calling the API NRHMDPoseTracker.ResetWorldMatrix
. The HelloMR-ResetCamera sample scene demonstrates how to reset the camera with this API in an app.
The main script is CameraResetController.cs
which uses a boolean to support reset camera with pitch as well.
Developer Guide
Create a new project in Unity with NRSDK. Refer to Getting Started with NRSDK for more setting up instructions.
Create a canvas and a button;
Drag the script CameraResetController.cs and CanvasRaycastTarget.cs to the inspector of canvas;