Add vector constructors (#115)

This commit is contained in:
maybegreat48 2023-05-09 20:18:42 +00:00 committed by GitHub
parent 57548ccd87
commit 9de17746d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,18 @@ namespace rage
{
T data[2];
struct { T x, y; };
vector2(T x, T y) :
x(x),
y(y)
{
}
vector2() :
x(),
y()
{
}
};
template<typename T>
@ -14,6 +26,20 @@ namespace rage
{
T data[3];
struct { T x, y, z; };
vector3(T x, T y, T z) :
x(x),
y(y),
z(z)
{
}
vector3() :
x(),
y(),
z()
{
}
};
template<typename T>
@ -21,6 +47,22 @@ namespace rage
{
T data[4];
struct { T x, y, z, w; };
vector4(T x, T y, T z, T w) :
x(x),
y(y),
z(z),
w(w)
{
}
vector4() :
x(),
y(),
z(),
w()
{
}
};
template<typename T>