I started to work with Hololens (1 gen.) and now I need to recognize, if the glasses are moving (like somebody wears them and e.g. rotates the head or goes forward) or they are staying motionless (e.g. lie on the table). Is there any tool or library for it? Or maybe any access to the sensors data?
EDIT: I took the example app from Microsoft, prebuilt it in Unity and run in VS2017. Then I found the code to get Camera position:
float quaternionX = Camera.main.transform.rotation.x;
but it always throws me System.AccessViolationException
EDIT 2:
Ok, it looks like I call Camera
in wrong thread. If I put the same call inside of SpatialMappingObserver.Update()
(Part of this Microsoft example), it works fine. I'm wondering, how the exceptions in VS2017 are unclear.