Details
-
User Story
-
Resolution: Out of scope
-
P2: Important
-
None
-
None
Description
QRotationSensor's QRotationReading should be enhanced with new presentations: Quaternion and Transformation matrix
Euler angles (current x, y, z) suffer from Gimbal lock effect, quaternions and rotation matrix / transformation matrix are free from the effect. Quaternions and matrixes are used in games, which one is more optimal depends on the purpose, e.g. quaternions are more suited for SLERP and geodesic distance:
A.) QQuaternion QRotationReading::quaterion() OR
B.) qreal[] QRotationReading::quaternion() //array size is 4, less overhead in reading values
+ conversion utility: static QQuaternion QRotationSensor::quaternion(qreal[])
A.) QMatrix4x4 QRotationReading::transformationMatrix(); OR
B.) qreal[] QRotationReading::::transformationMatrix()
+ conversion utility: static QMatrix4x4 QRotationSensor::transformationMatrix(qreal[]);
Instead or in addition to the transformation matrix (qreal[16]) also rotation matrix (qreal[9]) could be provided.
Transformation vs. rotation matrix
Pros: Ready made Qt Core class with plenty of operations (rotate, translate, scale + normal, ortho, perspective, toAffine..)
Cons: GUI dependency, rotation + translation included , which cannot be got reliably -> needs to be zeros -> needless overhead compared to qreal[9]
Attachments
For Gerrit Dashboard: QTBUG-25840 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
30343,3 | WIP: Extend QRotationReading with new representations | master | qt/qtsensors | Status: ABANDONED | 0 | 0 |