Преглед изворни кода

common/quaternion: Ensure that w is always initialized

Previously xyz was always being zero initialized due to its constructor,
but w wasn't. Ensures that we always have a deterministic initial state.
Lioncash пре 7 година
родитељ
комит
acddf16e57
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/common/quaternion.h

+ 1 - 1
src/common/quaternion.h

@@ -12,7 +12,7 @@ template <typename T>
 class Quaternion {
 public:
     Math::Vec3<T> xyz;
-    T w;
+    T w{};
 
     Quaternion<decltype(-T{})> Inverse() const {
         return {-xyz, w};