Browse Source

Math: simplify Quaternion default constructor.

It should generate the same (constexpr) code, but this way it doesn't
go through replicating the zero value four times and just
zero-initializes the data array in vector. Also fixes "not a constexpr"
issues with GCC 4.6 in compatibility branch (but these shouldn't be
there anyway).
pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
eae48a3380
  1. 2
      src/Magnum/Math/Quaternion.h

2
src/Magnum/Math/Quaternion.h

@ -197,7 +197,7 @@ template<class T> class Quaternion {
* q = [\boldsymbol 0, 1]
* @f]
*/
constexpr /*implicit*/ Quaternion(IdentityInitT = IdentityInit): _vector{T(0)}, _scalar{T(1)} {}
constexpr /*implicit*/ Quaternion(IdentityInitT = IdentityInit): _scalar{T(1)} {}
/** @brief Construct zero-initialized quaternion */
constexpr explicit Quaternion(ZeroInitT): _vector{ZeroInit}, _scalar{T{0}} {}

Loading…
Cancel
Save