16#if MATH_SILENCE_WARNING
18 #pragma GCC diagnostic push
19 #pragma GCC diagnostic ignored "-Wpedantic"
21 #pragma clang diagnostic push
22 #pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
23 #pragma clang diagnostic ignored "-Wnested-anon-types"
26 #pragma warning(disable : 4201)
40#if MATH_SILENCE_WARNING
42 #pragma clang diagnostic pop
44 #pragma GCC diagnostic pop
54 x =
static_cast<T
>(0.0f);
55 y =
static_cast<T
>(0.0f);
56 z =
static_cast<T
>(0.0f);
65 vec3(
const T& _x,
const T& _y,
const T& _z) {
97 explicit vec3(
const U& _v) {
98 this->
x =
static_cast<T
>(_v);
99 this->
y =
static_cast<T
>(_v);
100 this->
z =
static_cast<T
>(_v);
126 (
float)
y * rhs.
z - (
float)
z * rhs.
y, (
float)
z * rhs.
x - (
float)
x * rhs.
z, (
float)
x * rhs.
y -
y * rhs.
x);
143 return ((len != 0.0f) ? (*
this / len) : *
this);
257 return lhs.
x == rhs.
x && lhs.
y == rhs.
y && lhs.
z == rhs.
z;
284 this->
x =
static_cast<T
>(V.
x);
285 this->
y =
static_cast<T
>(V.
y);
286 this->
z =
static_cast<T
>(V.
z);
342 os << obj.
x <<
", " << obj.
y <<
", " << obj.
z << std::endl;
356 vec3<T> out(values[0], values[1], values[2]);
static vec3< T > lowest()
Definition: vec3.h:373
static vec3< T > min()
Definition: vec3.h:383
static vec3< T > max()
Definition: vec3.h:378
friend bool operator>(const vec3< T > &lhs, const vec3< T > &rhs)
Definition: vec3.h:266
friend bool operator==(const vec3< T > &lhs, const vec3< T > &rhs)
Definition: vec3.h:256
vec3< T > & operator+=(const vec3< T > &rhs)
Definition: vec3.h:209
const size_t dim
dimension of object
Definition: vec3.h:38
vec3(const U &_v)
Definition: vec3.h:97
friend vec3< T > operator-(vec3< T > lhs, const vec3< T > &rhs)
Definition: vec3.h:160
const T & operator[](const int &index) const
Definition: vec3.h:309
vec3(const T *v)
Definition: vec3.h:111
friend T operator*(vec3< T > lhs, const vec3< T > &rhs)
Definition: vec3.h:184
friend vec3< T > operator/(vec3< T > lhs, const vec3< T > &rhs)
Definition: vec3.h:201
friend vec3< T > operator/(vec3< T > lhs, const T &rhs)
Definition: vec3.h:192
friend vec3< T > operator+(vec3< T > lhs, const vec3< T > &rhs)
Definition: vec3.h:153
vec3< T > normalize() const
Definition: vec3.h:141
constexpr vec3< T > & operator=(vec3< T > const &V)
Definition: vec3.h:283
T & operator[](const int &index)
Definition: vec3.h:296
vec3< T > & operator*=(const T &rhs)
Definition: vec3.h:231
vec3< T > & operator/=(const T &rhs)
Definition: vec3.h:242
vec3(const T &_x, const T &_y, const T &_z)
Definition: vec3.h:65
friend bool operator<(const vec3< T > &lhs, const vec3< T > &rhs)
Definition: vec3.h:274
vec3(const vec3< T > &v)
Definition: vec3.h:106
friend std::ostream & operator<<(std::ostream &, const vec3< U > &)
float length() const
Definition: vec3.h:136
vec3(const vec2< T > &a, const T &z)
Definition: vec3.h:86
vec3(const vec4< T > &a)
Definition: vec3.h:75
friend vec3< T > operator*(const T &lhs, vec3< T > rhs)
Definition: vec3.h:176
vec3< T > cross(const vec3< T > &rhs) const
Definition: vec3.h:124
friend vec3< T > operator*(vec3< T > lhs, const T &rhs)
Definition: vec3.h:168
vec3< T > & operator-=(const vec3< T > &rhs)
Definition: vec3.h:220
vec3()
Definition: vec3.h:53
vec3< T > build_vec3(void *in)
Definition: vec3.h:354
std::ostream & operator<<(std::ostream &os, const vec3< T > &obj)
Definition: vec3.h:339