Compass.rawVector in Windows Store App

We’re experiencing issues with Compass.rawVector on an HP ElitePad. The z value is fixed at 0 while x and y jump around sporadically as the device is moved. The true and magnetic headings seem ok.

Has anybody had similar experiences with Windows Store apps? Is the compass fully supported by Unity for Windows Store?

Thanks!

Compass is supported, but there were fixes for it, which will come out with Unity 4.5.

Nice one, thanks! Can you expand a bit on what the fixes will be?

Location services will be more reliable.
I’m also thinking about forcing to use CompassInput instead of heading from Geolocator, right now we use the later as primary source and fallback to compass (this might be the reason why you see that behaviour). But it’s too late for that to go to 4.5.

CompassInput? Are you talking about CompassReading from the Windows.Devices.Sensors namespace or something else?

Also, how are you converting from a heading value to a raw vector?

It would be fine for now if I could get the raw vector directly through the Windows Store API but it doesn’t seem to provide access to the Magnetometer (like with Windows Phone).

Compass class for getting CompassReading. Namespace is right.

As I remember, we use sin() and cos() for that, nothing fancy.

You should be able to use Windows.Devices.Sensors.Compass class.