The QRotationReading class represents one reading from the rotation sensor. More...
#include <QRotationReading>
Inherits: QSensorReading.
This class was introduced in Qt Mobility 1.0.
void | setX ( qreal x ) |
void | setY ( qreal y ) |
void | setZ ( qreal z ) |
qreal | x () const |
qreal | y () const |
qreal | z () const |
The QRotationReading class represents one reading from the rotation sensor.
The rotation reading contains 3 angles, measured in degrees that define the orientation of the device in three-dimensional space. These angles are similar to yaw, pitch and roll but are defined using only right hand rotation with axes as defined by the right hand cartesian coordinate system.
The three angles are applied to the device in the following order.
Here is a visualization showing the order in which angles are applied.
The 0 point for the z angle is defined as a fixed, external entity and is device-specific. While magnetic North is typically used as this reference point it may not be. Do not attempt to compare values for the z angle between devices or even on the same device if it has moved a significant distance.
If the device cannot detect a fixed, external entity the z angle will always be 0 and the QRotationSensor::hasZ property will be set to false.
The 0 point for the x and y angles are defined as when the x and y axes of the device are oriented towards the horizon. Here is an example of how the x value will change with device movement.
Here is an example of how the y value will change with device movement.
Note that when x is 90 or -90, values for z and y achieve rotation around the same axis (due to the order of operations). In this case the y rotation will be 0.
This property holds the rotation around the x axis.
Measured as degrees.
This property was introduced in Qt Mobility 1.0.
Access functions:
qreal | x () const |
See also QRotationReading Units.
This property holds the rotation around the y axis.
Measured as degrees.
This property was introduced in Qt Mobility 1.0.
Access functions:
qreal | y () const |
See also QRotationReading Units.
This property holds the rotation around the z axis.
Measured as degrees.
This property was introduced in Qt Mobility 1.0.
Access functions:
qreal | z () const |
See also QRotationReading Units.
Sets the rotation around the x axis to x.
This function was introduced in Qt Mobility 1.0.
See also x().
Sets the rotation around the y axis to y.
This function was introduced in Qt Mobility 1.0.
See also y().
Sets the rotation around the z axis to z.
This function was introduced in Qt Mobility 1.0.
See also z().
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.