summaryrefslogtreecommitdiffstats
path: root/src/gui/math3d/qquaternion.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QQuaternion: long live Axes / toAxes()Marc Mutz6 days1-12/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compilers hate out parameters, so provide a replacement for getAxes(), toAxes(), that returns the result in a struct Axes { x, y, z } instead. Then make getAxes() an inline wrapper around a toAxes() call, porting from Q_ASSERT(x && y && z) to Q_PRE(x); Q_PRE(y); Q_PRE(z); as a drive-by. The separation gives a more detailed error when triggered, and produces a shorter assertion string. Add tests, naturally, and port getAxes() calls that don't test getAxes() to the new function. There appear to be no other in-tree users that could be ported. For symmetry reasons, also add a fromAxes(Axes) overload. Take the argument by value, to avoid the compiler having to deal with aliasing analysis. At worst, pass-by-value is like pass-by-cref, and whether or not the extra copy is added or, since C++17, elided, depends on the specific call. Suppress Clazy's schizophrenic warning, which complains that we don't take (QVector3D, QVector3D, QVector3D) by value, but also if we take struct {QVector x,y,z} by value. [ChangeLog][QtGui][QQuaternion] Added toAxes(), a getAxes() replacement. Task-number: QTBUG-138199 Change-Id: Ie26e16528dc06806e59e54eff2d656a33c322bad Reviewed-by: Volker Hilsheimer <[email protected]>
* QQuaternion: document some get*() preconditionsMarc Mutz7 days1-0/+12
| | | | | | | | | | | | | | | | | | | | The functions assert that the pointers are all non-null, so we should document it as a precondition. There may be more preconditions inherited from the underlying math, but I can't find my Algebra book, and it's pre-existing, so maybe for another patch. Amends: - 1e441d298db5e7ad1635067106e4b7ed251fd4bd (getAxes()) - 88142e73d5e062cf26638511a42140b59ef736cc (getEulerAngles()) - 5d784deb71edd1e6584cd2f118d27dd3be2da5e6 (getAxisAndAngle() née toAxisAndAngle()). Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Idadb6183c8cabdaf3bdedb73794d3fc5d6052bac Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Edward Welbourne <[email protected]>
* [docs] QQuaternion: fix links to QVector3D functionsMarc Mutz8 days1-2/+3
| | | | | | | | | | | | | | Without qualification, qdoc links x() to this class' x(). But the documentation means QVector3D::x(), so we need an explicit \l here. Similar to ab1ce95c8ce38683477373cf84ba5686ea00efed for QString/QByteArray. Amends 88142e73d5e062cf26638511a42140b59ef736cc. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I6eb5ca38f328ce36988e10e3221b801e68629938 Reviewed-by: Volker Hilsheimer <[email protected]>
* [docs] QQuaternion: fix grammarMarc Mutz8 days1-1/+1
| | | | | | | | | | "Angles" are plural, so the verb has to be in plural form, too. Amends 88142e73d5e062cf26638511a42140b59ef736cc. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ic19ba9de8b7f33fafb35eff7f256698ebf4b8443 Reviewed-by: Volker Hilsheimer <[email protected]>
* [docs] QQuaternion: fix grammar in toRotationMatrix()Marc Mutz8 days1-2/+2
| | | | | | | | | | Need definite acticles here, not indefinite one. Amends ba640a75a5cc9fec63a5204ccf143dbb7f398842. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I843b9d97276308412d566fbd453c706c9570c876 Reviewed-by: Volker Hilsheimer <[email protected]>
* QQuaternion: rename the fromEulerAngles() argumentMarc Mutz9 days1-4/+4
| | | | | | | | | | | | The eulerAngles name will clash with a function I intend to add, of the same name, probably triggering -Wshadow. Besides, this fixes long lines and isn't any less readable. Picking all the way since it's 100% risk-free. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Iea552c6cad4ad20164cf0cc462cb1dcb2bc752c0 Reviewed-by: Volker Hilsheimer <[email protected]>
* [docs] QQuaternion: fix \overload in toEulerAngles() docsMarc Mutz11 days1-1/+0
| | | | | | | | | | | | | The function is no longer overloaded. getEulerAngles() used to be called toEulerAngles() (88142e73d5e062cf26638511a42140b59ef736cc), but was later renamed to the idiomatic get-prefix (1872857ca72658cd58c0c39b31da493f794be6ca). Amends 1872857ca72658cd58c0c39b31da493f794be6ca. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ibc71635aa836e9c33fb2b88ce30cc7a35fbf1291 Reviewed-by: Volker Hilsheimer <[email protected]>
* QQuaternion: make a mutable function-static int[] constexprMarc Mutz2025-06-251-1/+1
| | | | | | | | | | | | | | | The array, despite being declared mutable, is never modified (and doing so would be a data race if threads concurrently call QQuaternion::fromRotationMatrix(), because it was declared static). Fix by making it constexpr instead. It need not be static, as the compiler will just optimize it away, anyway. Amends ba640a75a5cc9fec63a5204ccf143dbb7f398842. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I0a37f7718b1e79f34d8dd56dc56d951cb8a1d44c Reviewed-by: Friedemann Kleint <[email protected]>
* QQuaternion: make methods constexpr, noexcept; fix styleVolker Hilsheimer2023-12-091-41/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The class stores all data inline, and most member functions are inline already with trivial arithmetic operations on those data members. So we can make the class almost completely constexpr. This includes member functions that construct or use QVector3D/4D, as those types are also fully constexpr. Almost all inline (and now constexpr) member functions can then also be made noexcept, with the exception of the division operators that don't check the divisor for 0. qFuzzyCompare(float, float) is not noexcept, but it has no preconditions and never throws, so we can make the QQuaternion overload noexcept. Remove const from values returned by arithmetic operators, and fix whitespace style in prototypes (also the few that are not already touched by the other changes). Prepare unexporting the class wholesale in Qt 7; we only have to export out-of-line functions, but can't make that change in Qt 6, as the implicitly defined special member functions are exported (at least on MSVC). Change-Id: I3e43232bf66009352e8de937c07b2985147fb33c Reviewed-by: Edward Welbourne <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Sami Varanka <[email protected]>
* Use atan2() in Quaternion axis-and-angleEdward Welbourne2023-08-181-1/+1
| | | | | | | | | | | | | | | | | It's more numerically robust than acos() - we can't hit a range error if we get strange rounding effects - and we've got the value of the sin of the angle already (it's the length of the x, y, z part), so might as well use it. As length is necessarily positive, atan2() will give an upper-half-plane resolution, matching what acos() gave us. This incidentally means that you no longer need to normalize() your quaternion before you ask for axis and angle. Task-number: QTBUG-114313 Change-Id: If3fa2b371c72991f1f8f151f78ef7f9180aa87cf Reviewed-by: Matthias Rauter <[email protected]> Reviewed-by: Jøger Hansegård <[email protected]> Reviewed-by: Eirik Aavitsland <[email protected]>
* Fix for QQuaternion normalize when length > 1Paul Olav Tvete2023-06-121-3/+1
| | | | | | | | | | | | If the length of the quaternion was slightly larger than 1, the resulting quaternion would be invalid, causing getAxisAndAngle() to fail. Fixes: QTBUG-114313 Pick-to: 6.5 6.6 Change-Id: I8f0616e74590dd6cfee0ce913d214c8e280c4df4 Reviewed-by: Laszlo Agocs <[email protected]> Reviewed-by: Andy Nichols <[email protected]>
* Fix typos in docs and commentsKai Köhne2022-06-151-1/+1
| | | | | | | | | Found by codespell Pick-to: 6.4 Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb Reviewed-by: Nicholas Bennett <[email protected]> Reviewed-by: Edward Welbourne <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Update comments in QQuaternion::getEulerAnglesInho Lee2022-04-271-2/+3
| | | | | | | | | | | A comment from the patch 6ffc8d8eb6c44fbd51e37770e7013c4610ead96d is a little ambiguous. This patch is just to give information about the modification. Task-number: QTBUG-72103 Pick-to: 6.3 6.2 5.15 Change-Id: I6bfc3ae926c118de0d969a4b44f438c24f8d4f72 Reviewed-by: Edward Welbourne <[email protected]>
* QtGui/math3d: Fix QQuaternion::getEulerAngles for GimbalLock casesYuya Nishihara2022-01-161-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is heavily inspired by the patch written by Inho Lee <[email protected]>, which says "There is a precision problem in the previous algorithm when checking pitch value. (In the case that the rotation on the X-axis makes Gimbal lock.)" In order to work around the precision problem, this patch does: 1. switch to the algorithm described in the inline comment to make the story simple. 2. forcibly normalize the {x, y, z, w} components to eliminate fractional errors. 3. set threshold to avoid hidden division by cos(pitch) =~ 0. From my testing which compares dot product of the original quaternion and the one recreated from Euler angles, calculation within float range seems okay. (abs(normalize(q_orig) * normalize(q_roundtrip)) >= 0.99999) Many thanks to Inho Lee for the original patch and discussion about rounding errors. Fixes: QTBUG-72103 Pick-to: 6.3 6.2 5.15 Change-Id: I8995e4affe603111ff2303a0dfcbdb0b1ae03f10 Reviewed-by: Yuya Nishihara <[email protected]> Reviewed-by: Inho Lee <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* QtGui/math3d : Fix QQuaternion::getEulerAnglesInho Lee2021-06-011-1/+5
| | | | | | | | | | | When rotating M_PI_2 based on x-axis, quaternion to euler conversion makes NaN for the x-rotation value. This patch fixes this corner case. Fixes: QTBUG-93600 Pick-to: 6.1 6.0 5.15 Change-Id: Ice321a80ad90dba9cf3ee3a14ec7d3d047c21bd3 Reviewed-by: Laszlo Agocs <[email protected]> Reviewed-by: Andy Nichols <[email protected]>
* Rationalize QQuaternion's length-scaling codeEdward Welbourne2021-02-041-56/+40
| | | | | | | | | | | | | | | | | | | | | Use qHypot() to implement length(), avoid duplicating its code and use its result more carefully, saving the need for casting to and from double. Subtracting a double from 1.0f still got a double, so the qFuzzyIsNull() checks were using double's tolerance, where the use of 1.0f indicates the float tolerance would have been more apt. Also, use qFuzzyCompare(_, 1.0f) instead of qFuzzyIsNull(_ - 1.0f). In getEulerAngles(), scale co-ordinates by length before multiplying (to ensure O(1) quantities) rather than scaling the products by the squared length (possibly after {ov,und}erflowing). Change-Id: Id8792d6eb047ee9567a9bbb246657b0217b0849f Reviewed-by: Andreas Buhr <[email protected]> Reviewed-by: Laszlo Agocs <[email protected]> Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Andrei Golubev <[email protected]>
* Math 3D classes: make comparison operators hidden friendsVolker Hilsheimer2020-10-291-4/+2
| | | | | | | | | Reduce ADL noise from QVector2/3/4D and from QQuaternion. Also mark as noexcept. Task-number: QTBUG-87973 Change-Id: Id14fd17c0da43517766b218ed85c3b41f91b43c8 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Remove deprecated method QQuaternion::conjugateMarcel Krems2020-09-071-7/+0
| | | | | Change-Id: If539e47618357ef329925033842f266447632e6f Reviewed-by: Volker Hilsheimer <[email protected]>
* Remove QVariant(int type, void *data, ...) constructorLars Knoll2020-08-151-1/+1
| | | | | | | | It was marked internal anyway. Use the constructor taking a QMetaType instead. Change-Id: I15b9cd0911aac063a0f0fe0352fa2c84b7f7c691 Reviewed-by: Lars Knoll <[email protected]>
* Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <[email protected]>
* Doc: Move literal code block to a separate fileCristian Maureira-Fredes2018-10-151-6/+2
| | | | | | | | | | | We need to override this snippet for the documentation we generate for Qt for Python, and it is easier to have it on a separate file. Task-number: PYSIDE-801 Task-number: PYSIDE-691 Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e Reviewed-by: Topi Reiniö <[email protected]>
* Use qRadiansToDegrees() and qDegreesToRadians() more widelyEdward Welbourne2017-07-051-2/+2
| | | | | | | | | | | | | | | | Especially in examples, where we should show off our convenience functions, prefer calling these functions over doing arithmetic with M_PI (or approximations thereto) and 180 (give or take simple factors). This incidentally documents what's going on, just by the name of the function used (and reveals at least one place where variables were misnamed; the return from atan is in radians, *not* degrees). Task-number: QTBUG-58083 Change-Id: I6e5d66721cafab423378f970af525400423e971e Reviewed-by: Jüri Valdmann <[email protected]> Reviewed-by: Allan Sandfeld Jensen <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <[email protected]>
* QQuaternion: Deprecate conjugate() and introduce conjugated()Sérgio Martins2015-05-131-3/+11
| | | | | | | | | Change-Id: I9aa835138e1e33448fea920f7a5ba99b26a95ebf Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Konstantin Ritt <[email protected]> Reviewed-by: Giuseppe D'Angelo <[email protected]> Reviewed-by: Sean Harmer <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
* Introduce QQuaternion::fromDirection()Konstantin Ritt2015-04-071-0/+30
| | | | | | | | | | ...which constructs a quaternion using specified forward and upward directions, so that the resulting Z axis "faces" a given forward direction. Change-Id: Ib77b8ab5c359a4880b0d946face87026acdc6f0b Reviewed-by: Paul Lemire <[email protected]> Reviewed-by: Michael Krasnyk <[email protected]> Reviewed-by: Lars Knoll <[email protected]>
* Use QDebugStateSaver to restore space setting in stream operators.Friedemann Kleint2015-03-301-1/+2
| | | | | | | | Returning dbg.space() breaks formatting on streams that already have nospace() set. Change-Id: I55e38b018679a67eb40be6b4664505483a3a7d8e Reviewed-by: David Faure <[email protected]>
* Introduce QQuaternion::rotationTo(vecFrom, vecTo)Konstantin Ritt2015-03-071-0/+32
| | | | | | | | | which returns the shortest arc quaternion to rotate vector from to the destination vector to. Change-Id: Ibd7a746789ecdfe6f7fe17e4ac9049f7ac46560d Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Paul Lemire <[email protected]>
* [QQuaternion] Add a way to convert to/from orthonormal axesKonstantin Ritt2015-03-071-2/+49
| | | | | | | | It is just a convenience wrapper around convertion to/from the rotation matrix. Change-Id: I27511b43866827172960b0152f1c7b65da857f6f Reviewed-by: Lars Knoll <[email protected]>
* Introduce QQuaternion::dotProduct()Konstantin Ritt2015-03-051-17/+20
| | | | | Change-Id: I14b9857ca0a43808b7d536fc258a6bb10f611211 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Optimize quaternion to rotation matrix convertionKonstantin Ritt2015-02-261-19/+22
| | | | | | | | Rearrange operands to get rid of 50% of multiplications (i.e. `2 * (x * x + z * z)` -> `(x + x) * x + (z + z) * z`). Change-Id: Ib5279425ead999fc571b4964ac1681b6e22f9a7e Reviewed-by: Sean Harmer <[email protected]>
* [QQuaternion] Add operator* that rotates a vector with a quaternionKonstantin Ritt2015-02-261-0/+12
| | | | | | | | Same as quaternion.rotatedVector(vec). Expression like `vec = quat * vec` quite common in the 3D world. Change-Id: I0edd5a5f80537bd149f03f682b3de15c54463e23 Reviewed-by: Sean Harmer <[email protected]>
* [QQuaternion] Fix naming of the new methodsKonstantin Ritt2015-02-261-6/+6
| | | | | | | | | | | According to the Qt naming policy, methods that return value(s) via the mutable parameter(s) should have "get" prefix to mention that. [ChangeLog][QtGui][QQuaternion] Added methods to convert a quaternion to/from Euler angles and to/from rotation matrix. Change-Id: I95704e1f4623dc4ca54cd237ea203539fb60d452 Reviewed-by: Sean Harmer <[email protected]>
* QtGui: Fix some qdoc-warnings.Friedemann Kleint2015-02-251-4/+4
| | | | | | | | | | | | | | qtbase/src/gui/math3d/qquaternion.cpp:466: warning: Undocumented parameter 'eulerAngles' in QQuaternion::fromEulerAngles() qtbase/src/gui/math3d/qquaternion.cpp:466: warning: No such parameter 'eulerAngles.y()' in QQuaternion::fromEulerAngles() qtbase/src/gui/math3d/qquaternion.cpp:466: warning: No such parameter 'eulerAngles.x()' in QQuaternion::fromEulerAngles() qtbase/src/gui/math3d/qquaternion.cpp:466: warning: No such parameter 'eulerAngles.z()' in QQuaternion::fromEulerAngles() qtbase/src/gui/math3d/qquaternion.cpp:455: warning: No such parameter 'pitch' in QQuaternion::toEulerAngles() qtbase/src/gui/math3d/qquaternion.cpp:455: warning: No such parameter 'roll' in QQuaternion::toEulerAngles() qtbase/src/gui/math3d/qquaternion.cpp:455: warning: No such parameter 'yaw' in QQuaternion::toEulerAngles() qtbase/src/gui/opengl/qopenglshaderprogram.cpp:2757: warning: No such parameter 'value' in QOpenGLShaderProgram::setUniformValueArray() Change-Id: Ib825ecb0db798380d97414ca3c3eba8bee3ab6ea Reviewed-by: Konstantin Ritt <[email protected]>
* Use C++ <cmath> instead of <math.h>Allan Sandfeld Jensen2015-02-161-27/+27
| | | | | | | | | | | | | | Including math.h can pollute the default namespace, and break some compilers if cmath versions of the method are declared as using. Switching to C++ math functions also greatly simplifies handling of float qreal as C++ automatically chooses the right method. [ChangeLog][QtCore][QtMath] qmath.h no longer includes math.h, so any sources depending on that indirect inclusion may fail to build. Change-Id: I4d0e331dafba354ec05dc5052e61ef4ff8d387fe Reviewed-by: Rafael Roquetto <[email protected]>
* [QQuaternion] Introduce to/from euler angles conversion routinesKonstantin Ritt2015-02-141-0/+125
| | | | | Change-Id: I26c0a9d1ce9258048cf44eed5b5238920c2317b1 Reviewed-by: Laszlo Agocs <[email protected]>
* [QQuaternion] Introduce toAxisAndAngle()Konstantin Ritt2015-02-141-0/+50
| | | | | | | | | This operation is the exact opposite to QQuaternion::fromAxisAndAngle() (so that it is a way to extract the axis and angle values suitable to create the same quaternion via QQuaternion::fromAxisAndAngle()). Change-Id: I41fda58f5fb2b867cccd6b2faf58ab671fa070da Reviewed-by: Laszlo Agocs <[email protected]>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <[email protected]>
* [QQuaternion] Introduce to/from rotation matrix conversion routinesKonstantin Ritt2015-02-061-0/+85
| | | | | | Change-Id: Ic19824e7e135f53a9ce3f2ea7ecd078a589e7425 Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Sean Harmer <[email protected]>
* [QMath3D] Add public c-tors that do not initialize the contentsKonstantin Ritt2015-02-041-0/+8
| | | | | | Change-Id: I1a28766451e6750986a239c989e7f30c14479057 Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Friedemann Kleint <[email protected]>
* Introduce QQuaternion::inverted()Konstantin Ritt2015-01-281-0/+10
| | | | | Change-Id: I6de77082bb7c32e48fb7f7d765a58fdbe68db1fd Reviewed-by: Sean Harmer <[email protected]>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <[email protected]>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-7/+7
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <[email protected]> Reviewed-by: Jerome Pasion <[email protected]>
* Fix a typo and make the QQuaternion constructor documentation even more explicitLaszlo Papp2013-01-251-2/+3
| | | | | Change-Id: I913ef98b706f29f1bab7564d6d6fff0a91ebfdc0 Reviewed-by: Sean Harmer <[email protected]>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <[email protected]>
* WINCE: Fix missing cosfAndreas Holzammer2012-12-031-0/+2
| | | | | | | | | cosf seems to be defined in the cmath header for Windows CE, so include it to fix the issue of not finding the symbol cosf. Change-Id: I7317668838912325d45be0d4087ae3055940d3cd Reviewed-by: Sean Harmer <[email protected]>
* Remove last usages of qSin and friends from QQuaternionSean Harmer2012-11-261-6/+6
| | | | | Change-Id: I93fe1d22313da4cfa671603ccdbe9ac8f02cd73b Reviewed-by: Lars Knoll <[email protected]>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Sergio Ahumada <[email protected]>
* Make gui/math3d classes use float rather than qrealSean Harmer2012-09-071-44/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This corrects the mismatch between using floats for internal storage and qreal in the API of QVector*D which leads to lots of implicit casts between double and float. This change also stops users from being surprised by the loss of precision when using these classes on desktop platforms and removes the need for the private constructors taking a dummy int as the final argument. The QMatrix4x4 and QQuaternion classes have been changed to use float for their internal storage since these are meant to be used in conjunction with the QVector*D classes. This is to prevent unexpected loss of precision and to improve performance. The on-disk format has also been changed from double to float thereby reducing the storage required when streaming vectors and matrices. This is potentially a large saving when working with complex 3D meshes etc. This also has a significant performance improvement when passing matrices to QOpenGLShaderProgram (and QGLShaderProgram) as we no longer have to iterate and convert the data to floats. This is an operation that could easily be needed many times per frame. This change also opens the door for further optimisations of these classes to be implemented by using SIMD intrinsics. This needs to be applied in conjunction with https://codereview.qt-project.org/#change,33548 Task-number: QTBUG-21035 Task-number: QTBUG-20661 Change-Id: I9321b06040ffb93ae1cbd72fd2013267ac901b2e Reviewed-by: Lars Knoll <[email protected]>
* Move the QDataStream operator<< for QPair to qdatastream.hThiago Macieira2012-06-281-0/+1
| | | | | | | | | | QPair is small and is no problem to include from qdatastream.h. However, including QDataStream from qpair.h means including QIODevice and QObject too. Change-Id: I344321e9f68438008ec329a165135c3a346c6058 Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Oswald Buddenhagen <[email protected]>