13#if MATH_SILENCE_WARNING
15 #pragma GCC diagnostic push
16 #pragma GCC diagnostic ignored "-Wpedantic"
18 #pragma clang diagnostic push
19 #pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
20 #pragma clang diagnostic ignored "-Wnested-anon-types"
23 #pragma warning(disable : 4201)
33#if MATH_SILENCE_WARNING
35 #pragma clang diagnostic pop
37 #pragma GCC diagnostic pop
50 x =
static_cast<T
>(0.0f);
51 y =
static_cast<T
>(0.0f);
52 z =
static_cast<T
>(0.0f);
53 w =
static_cast<T
>(0.0f);
63 vec4(
const T& _x,
const T& _y,
const T& _z,
const T& _w) {
70 explicit vec4(
const T& v) {
81 explicit vec4(
const T* v) {
100 vec4(
const V& v,
const T& _w) {
120 inline T
sum()
const {
return x +
y +
z +
w; }
161 return vec4<T>(lhs.
x * rhs.
x, lhs.
y * rhs.
y, lhs.
z * rhs.
z, lhs.
w * lhs.
w);
231 return lhs.
x == rhs.
x && lhs.
y == rhs.
y && lhs.
z == rhs.
z && lhs.
w == rhs.
w;
241 this->
x =
static_cast<T
>(V.
x);
242 this->
y =
static_cast<T
>(V.
y);
243 this->
z =
static_cast<T
>(V.
z);
244 this->
w =
static_cast<T
>(V.
w);
304 os << obj.
x <<
", " << obj.
y <<
", " << obj.
z <<
", " << obj.
w << std::endl;
317 vec4<T> out(values[0], values[1], values[2], values[3]);
T sum() const
Definition: vec4.h:120
constexpr vec4< T > & operator=(vec4< T > const &V)
Definition: vec4.h:240
friend vec4< T > operator-(vec4< T > lhs, const vec4< T > &rhs)
Definition: vec4.h:136
const T & operator[](const int &index) const
Definition: vec4.h:268
vec4(const V &v, const T &_w)
Definition: vec4.h:100
T & operator[](const int &index)
Definition: vec4.h:254
vec4(const vec4< T > &v)
Definition: vec4.h:92
vec4< T > & operator/=(const T &rhs)
Definition: vec4.h:215
vec4(const T *v)
Definition: vec4.h:81
vec4< T > normalize() const
Definition: vec4.h:118
friend vec4< T > operator*(vec4< T > lhs, const vec4< T > &rhs)
Definition: vec4.h:160
friend vec4< T > operator+(vec4< T > lhs, const vec4< T > &rhs)
Definition: vec4.h:129
friend vec4< T > operator*(vec4< T > lhs, const T &rhs)
Definition: vec4.h:144
friend vec4< T > operator/(vec4< T > lhs, const T &rhs)
Definition: vec4.h:169
vec4()
Definition: vec4.h:49
vec4(const T &_x, const T &_y, const T &_z, const T &_w)
Definition: vec4.h:63
const size_t dim
dimension of object
Definition: vec4.h:44
friend std::ostream & operator<<(std::ostream &, const vec4< U > &)
friend vec4< T > operator*(const T &lhs, vec4< T > rhs)
Definition: vec4.h:152
float length() const
Definition: vec4.h:112
vec4< T > & operator-=(const vec4< T > &rhs)
Definition: vec4.h:189
vec4< T > & operator+=(const vec4< T > &rhs)
Definition: vec4.h:177
vec4(const T &v)
Definition: vec4.h:70
vec4< T > & operator*=(const T &rhs)
Definition: vec4.h:202
friend bool operator==(const vec4< T > &lhs, const vec4< T > &rhs)
Definition: vec4.h:230
std::ostream & operator<<(std::ostream &os, const vec4< T > &obj)
Definition: vec4.h:302
vec4< T > build_vec4(void *in)
Definition: vec4.h:315