mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-25 01:40:58 +01:00
vector_math: Ensure members are always initialized
Ensures that values are always in a well-defined state.
This commit is contained in:
parent
8262aeeac8
commit
acc10c7ee2
1 changed files with 9 additions and 9 deletions
|
@ -52,8 +52,8 @@ static inline Vec4<T> MakeVec(const T& x, const T& y, const T& z, const T& w);
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class Vec2 {
|
class Vec2 {
|
||||||
public:
|
public:
|
||||||
T x;
|
T x{};
|
||||||
T y;
|
T y{};
|
||||||
|
|
||||||
Vec2() = default;
|
Vec2() = default;
|
||||||
Vec2(const T& _x, const T& _y) : x(_x), y(_y) {}
|
Vec2(const T& _x, const T& _y) : x(_x), y(_y) {}
|
||||||
|
@ -192,9 +192,9 @@ inline float Vec2<float>::Normalize() {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class Vec3 {
|
class Vec3 {
|
||||||
public:
|
public:
|
||||||
T x;
|
T x{};
|
||||||
T y;
|
T y{};
|
||||||
T z;
|
T z{};
|
||||||
|
|
||||||
Vec3() = default;
|
Vec3() = default;
|
||||||
Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {}
|
Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {}
|
||||||
|
@ -392,10 +392,10 @@ typedef Vec3<float> Vec3f;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class Vec4 {
|
class Vec4 {
|
||||||
public:
|
public:
|
||||||
T x;
|
T x{};
|
||||||
T y;
|
T y{};
|
||||||
T z;
|
T z{};
|
||||||
T w;
|
T w{};
|
||||||
|
|
||||||
Vec4() = default;
|
Vec4() = default;
|
||||||
Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {}
|
Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {}
|
||||||
|
|
Loading…
Reference in a new issue