Matt McCarthy edited Our Prototype1.tex  about 10 years ago

Commit id: 7c6546af3fbdf45bcd10bac16b274b8242b32010

deletions | additions      

       

The changeMapDirection method handles updating the view of the map, orienting it in the direction of the rotation vector, and scrolling forward according to the speed value. In order to interpret the raw data given by the rotation vector sensor, this method calls the getOrientation method.  getOrientation uses built in methods within the SensorManager class to interpret the rotation vector values into a value for the rotation of the device around the x axis. It uses SensorManager.getRotationMatrixFromVector 'SensorManager.getRotationMatrixFromVector'  to get the rotation matrix from the 3 rotation vector values. It then uses SensorManager.getOrientation 'SensorManager.getOrientation'  to calculate an array of rotations around each axis, from the rotation matrix. The method then returns the value of the x axis orientation + 90, since the orientation values start from a west heading, and the Google Maps API starts from north.