iOS设备处于横向右侧时方位角计算出现问题

iOS设备处于横向右侧时方位角计算出现问题,ios,augmented-reality,compass-geolocation,heading,azimuth,Ios,Augmented Reality,Compass Geolocation,Heading,Azimuth,我已经为iOS编写了一个增强现实应用程序,它使用定位服务和GPS,当设备处于横向左侧时一切正常,但当设备旋转为横向右侧时,无法正确计算中心方位角,我目前正在使用didUpdateHeading方法中的真实航向减去90度的航向调整来计算。我是否应该检查

我已经为iOS编写了一个增强现实应用程序,它使用定位服务和GPS,当设备处于横向左侧时一切正常,但当设备旋转为横向右侧时,无法正确计算中心方位角,我目前正在使用didUpdateHeading方法中的真实航向减去90度的航向调整来计算。我是否应该检查<0


谢谢。

这是一个非常烦人的问题,设置
headingOrientation
属性实际上没有任何作用

以下代码适用于横向左侧方向(右侧的“主页”按钮):

因此,对于横向正确的方向,这应该做到:

orientation  = (float) manager.heading.magneticHeading;
orientation -= 90.0f;
if(orientation < 0.0f)
   orientation += 360.0f;
orientation=(float)manager.heading.magneticeheading;
方向-=90.0f;
如果(方向<0.0f)
方向+=360.0f;
看看这个
orientation  = (float) manager.heading.magneticHeading;
orientation -= 90.0f;
if(orientation < 0.0f)
   orientation += 360.0f;