2
3
4
5
6
7
8
9
10
14 #define _MSTD_VEC_HPP_
16 #include <mstd/config.hpp>
19_MSTD_WARNING(
"this is only available for c++17 and greater!");
22 #include <mstd/arithmetic_types.hpp>
23 #include <mstd/math_functions.hpp>
30 template<size_t N,
class T, std::enable_if_t<(N > 0 && std::is_arithmetic_v<T>),
bool> >
40 #pragma region PRIVATE_METHODS
42 template<arithmetic... Ts, size_t... Idxs>
44 template<
class... Ts, size_t... Idxs>
47 ((_values[Idxs] =
static_cast<T>(values)), ...);
53 if (firstIdx >= N) {
return; }
54 std::fill_n(&_values[0] + firstIdx, N - firstIdx, value);
58 template<arithmetic OT>
63 if _MSTD_CONSTEXPR17 (std::is_same_v<OT, T>) { std::memcpy(&_values[0], values, std::min(N, size) *
sizeof(T)); }
65 for (size_t i = 0; i != std::min(N, size); ++i) { _values[i] =
static_cast<T>(values[i]); }
70 template<size_t TN, arithmetic OT>
72 template<size_t TN,
class OT>
76 std::memcpy(&_values[0], &values[0], std::min(N, TN) *
sizeof(T));
79 for (size_t i = 0; i != std::min(N, TN); ++i) { _values[i] =
static_cast<T>(values[i]); }
84 template<size_t ON, arithmetic OT>
87 template<size_t ON,
class OT>
91 std::memcpy(&_values[0],
static_cast<
const T*>(other), std::min(N, ON) *
sizeof(T));
94 for (size_t i = 0; i != std::min(N, ON); ++i) { _values[i] =
static_cast<T>(other[i]); }
101 #pragma region CONSTRUCTORS
108 template<arithmetic... Ts>
109 requires (
sizeof...(Ts) > 0 &&
sizeof...(Ts) <= N)
111 template<
class... Ts,
112 std::enable_if_t<(
sizeof...(Ts) > 0 &&
sizeof...(Ts) <= N && are_all_v<std::is_arithmetic, Ts...>),
bool> =
true>
115 _set_values<Ts...>(std::index_sequence_for<Ts...>(), values...);
116 _fill_values_from(
sizeof...(Ts), 0);
121 template<size_t ON, arithmetic OT, arithmetic... Ts>
122 requires (
sizeof...(Ts) > 0 &&
sizeof...(Ts) <= N - ON && ON < N)
124 template<size_t ON,
class OT,
class... Ts,
125 std::enable_if_t<(
sizeof...(Ts) > 0 &&
sizeof...(Ts) <= N - ON && ON < N && are_all_v<std::is_arithmetic, OT, Ts...>),
129 _copy_values_from(other);
130 _set_values<Ts...>(make_index_sequence_for_from<ON, Ts...>(), values...);
131 _fill_values_from(
sizeof...(Ts) + ON, 0);
136 template<size_t TN, arithmetic OT>
138 template<size_t TN,
class OT, std::enable_if_t<std::is_arithmetic_v<OT>,
bool> =
true>
141 _copy_values_from(values);
142 _fill_values_from(TN, 0);
147 template<arithmetic OT>
149 template<
class OT, std::enable_if_t<std::is_arithmetic_v<OT>,
bool> =
true>
152 _copy_values_from(values, size);
153 _fill_values_from(size, 0);
158 template<size_t ON, arithmetic OT>
160 template<size_t ON,
class OT>
163 _copy_values_from(other);
164 _fill_values_from(ON, 0);
167 #pragma region VECTOR_3_CONSTRUCTORS
169 template<arithmetic AT, arithmetic BT, size_t ON>
172 template<
class AT,
class BT, size_t ON, std::enable_if_t<(ON == 3),
bool> =
true>
180 #pragma region DESTRUCTOR
184 #pragma region ASSIGN
186 template<size_t TN, arithmetic OT>
188 template<size_t TN,
class OT, std::enable_if_t<std::is_arithmetic_v<OT>,
bool> =
true>
191 _copy_values_from(values);
192 _fill_values_from(TN, 0);
196 template<size_t ON, arithmetic OT>
198 template<size_t ON,
class OT, std::enable_if_t<std::is_arithmetic_v<OT>,
bool> =
true>
201 _copy_values_from(other);
202 _fill_values_from(ON, 0);
208 #pragma region PREDEFINED
216 res._fill_values(value);
222 #pragma region PREDEFINED_CHECKS
229 for (size_t i = 0; i != N; ++i) {
230 if (_values[i] != value) {
return false; }
239 #pragma region VECTOR_GETTERS
293 #pragma region VECTOR_OPERATIONS
296 T value =
static_cast<T>(0);
297 for (size_t i = 0; i != N; ++i) { value += _values[i] * _values[i]; }
298 return static_cast<T>(std::sqrt(value));
303 if (len ==
static_cast<T>(0)) {
return *
this; }
309 vec<N, T> res = *
this;
310 return res.normalize();
314 T res =
static_cast<T>(0);
315 for (size_t i = 0; i != N; ++i) { res += _values[i] * other[i]; }
320 T thisLen = length();
321 if (thisLen ==
static_cast<T>(0)) {
return static_cast<T>(0); }
323 T otherLen = other.length();
324 if (otherLen ==
static_cast<T>(0)) {
return static_cast<T>(0); }
326 return static_cast<T>(std::acos(dot(other) / (thisLen * otherLen)));
331 *
this -= two *
this->dot(normal) * normal;
336 vec<N, T> res = *
this;
337 return res.reflect(normal);
341 *
this =
this->refracted(normal, eta);
346 float cosTheta = std::min((-(*
this)).dot(normal), 1.0f);
347 vec<N, T> rOutPerp = eta * (*
this + (cosTheta * normal));
348 float length = rOutPerp.length();
349 vec<N, T> rOutParallel = -std::sqrt(std::abs(1.0f - (length * length))) * normal;
350 return rOutPerp + rOutParallel;
354 for (size_t i = 0; i != N; ++i) { _values[i] = ::mstd::saturate(_values[i]); }
359 vec<N, T> res = *
this;
360 return res.saturate();
364 for (size_t i = 0; i != N; ++i) { _values[i] = ::mstd::fract(_values[i]); }
369 vec<N, T> res = *
this;
374 for (size_t i = 0; i != N; ++i) { _values[i] -= y * std::floor(_values[i] / y); }
379 vec<N, T> res = *
this;
384 for (size_t i = 0; i != N; ++i) { _values[i] -= other[i] * std::floor(_values[i] / other[i]); }
389 vec<N, T> res = *
this;
390 return res.mod(other);
394 for (size_t i = 0; i != N; ++i) { _values[i] = std::pow(_values[i], y); }
399 vec<N, T> res = *
this;
404 for (size_t i = 0; i != N; ++i) { _values[i] = std::pow(_values[i], other[i]); }
409 vec<N, T> res = *
this;
410 return res.pow(other);
414 for (size_t i = 0; i != N; ++i) { _values[i] = std::clamp(_values[i], minVal, maxVal); }
419 vec<N, T> res = *
this;
420 return res.clamp(minVal, maxVal);
424 for (size_t i = 0; i != N; ++i) { _values[i] = std::clamp(_values[i], minVal[i], maxVal[i]); }
429 vec<N, T> res = *
this;
430 return res.clamp(minVal, maxVal);
434 for (size_t i = 0; i != N; ++i) { _values[i] = ::mstd::step(edge, _values[i]); }
439 for (size_t i = 0; i != N; ++i) { _values[i] = ::mstd::step(edge[i], _values[i]); }
444 vec<N, T> res = *
this;
445 return res.step(edge);
449 vec<N, T> res = *
this;
450 return res.step(edge);
453 #pragma region VECTOR_3_OPERATIONS
457 return vec<N, T>((_values[1] * other[2]) - (_values[2] * other[1]), (_values[2] * other[0]) - (_values[0] * other[2]),
458 (_values[0] * other[1]) - (_values[1] * other[0]));
464 const quat<T> p(T(0), *
this);
466 vec<N, T> normAxis = axis;
467 if (!normAxis.is_zero()) { normAxis.normalize(); }
469 const quat<T>& q = quat<T>::rotation(normAxis, radians);
471 const quat<T>& inversQ = q.inverted();
473 *
this = (q * p * inversQ).v;
479 vec<N, T> res = *
this;
480 return res.rotate(axis, radians);
486 #pragma region OPERATORS
489 for (size_t i = 0; i != N; ++i) { _values[i] += other[i]; }
494 for (size_t i = 0; i != N; ++i) { _values[i] -= other[i]; }
499 for (size_t i = 0; i != N; ++i) { _values[i] *= other[i]; }
504 if (other == vec<N, T>::zero()) {
return *
this; }
505 for (size_t i = 0; i != N; ++i) { _values[i] /= other[i]; }
510 for (size_t i = 0; i != N; ++i) { _values[i] += other; }
515 for (size_t i = 0; i != N; ++i) { _values[i] -= other; }
520 for (size_t i = 0; i != N; ++i) { _values[i] *= other; }
525 if (other ==
static_cast<T>(0)) {
return *
this; }
526 for (size_t i = 0; i != N; ++i) { _values[i] /= other; }
531 vec<N, T> res = *
this;
537 vec<N, T> res = *
this;
543 vec<N, T> res = *
this;
549 vec<N, T> res = *
this;
555 vec<N, T> res = *
this;
561 vec<N, T> res = *
this;
567 vec<N, T> res = *
this;
575 vec<N, T> res = *
this;
587 vec<N, T> old = *
this;
595 vec<N, T> old = *
this;
602 if constexpr (N != ON) {
return false; }
603 else {
return std::memcmp(_values,
static_cast<
const T*>(other), N *
sizeof(T)) == 0; }
608 return !(*
this == other);
617 friend std::ostream& operator<<(std::ostream& str,
const vec<N, T>& vector) {
619 for (size_t i = 0; i != N; ++i) {
620 str << std::to_string(vector[i]);
621 if (i != N - 1) { str <<
", "; }
629 #pragma region EXTRA_OPERATORS
631 template<
class T, size_t N>
636 template<
class T, size_t N>
641 template<
class T, size_t N>
648 template<
class T, size_t N>
655 template<
class T, size_t N>
664 template<
class T, size_t N, std::enable_if_t<(N == 3),
bool> =
true>
670 template<
class T, size_t N>
675 template<
class T, size_t N>
680 template<
class T, size_t N>
685 template<
class T, size_t N>
690 template<
class T, size_t N>
695 template<
class T, size_t N>
700 template<
class T, size_t N>
705 template<
class T, size_t N>
710 template<
class T, size_t N>
715 template<
class T, size_t N>
720 template<
class T, size_t N>
725 template<
class T, size_t N>
730 template<
class T, size_t N>
738 #include <mstd/quat.hpp>
_MSTD_CONSTEXPR20 T length() const
Definition vec.hpp:295
_MSTD_CONSTEXPR20 void _copy_values_from(const vec< ON, OT > &other)
Definition vec.hpp:89
_MSTD_CONSTEXPR20 void _copy_values_from(const OT(&values)[TN])
Definition vec.hpp:74
_MSTD_CONSTEXPR20 T & w() _MSTD_REQUIRES(N > 3)
Definition vec.hpp:279
_MSTD_CONSTEXPR20 vec< N, T > & operator=(const vec< ON, OT > &other)
Definition vec.hpp:200
_MSTD_CONSTEXPR20 vec< N, T > & pow(const vec< N, T > &other)
Definition vec.hpp:403
_MSTD_CONSTEXPR20 vec< N, T > & operator/=(const vec< N, T > &other)
Definition vec.hpp:503
_MSTD_CONSTEXPR20 void _copy_values_from(const OT *&values, const size_t &size)
Definition vec.hpp:62
_MSTD_CONSTEXPR20 vec< N, T > operator-(const T &other) const
Definition vec.hpp:560
_MSTD_CONSTEXPR20 vec< N, T > powed(const T &y) const
Definition vec.hpp:398
_MSTD_CONSTEXPR20 bool operator==(const vec< ON, T > &other) const
Definition vec.hpp:601
_MSTD_CONSTEXPR20 bool is_normalized() const
Definition vec.hpp:235
_MSTD_CONSTEXPR20 T & operator[](const size_t &idx)
Definition vec.hpp:613
_MSTD_CONSTEXPR20 T operator[](const size_t &idx) const
Definition vec.hpp:615
_MSTD_CONSTEXPR20 T g() const _MSTD_REQUIRES(N > 1)
Definition vec.hpp:261
_MSTD_CONSTEXPR20 vec< N, T > fracted() const noexcept
Definition vec.hpp:368
_MSTD_CONSTEXPR20 T & y() _MSTD_REQUIRES(N > 1)
Definition vec.hpp:251
T _values[N]
Definition vec.hpp:38
_MSTD_CONSTEXPR20 T y() const _MSTD_REQUIRES(N > 1)
Definition vec.hpp:254
_MSTD_CONSTEXPR20 bool operator!=(const vec< ON, T > &other) const
Definition vec.hpp:607
static _MSTD_CONSTEXPR20 vec< N, T > fill(const T &value)
Definition vec.hpp:214
_MSTD_CONSTEXPR20 vec< N, T > & normalize()
Definition vec.hpp:301
_MSTD_CONSTEXPR20 vec< N, T > operator+(const vec< N, T > &other) const
Definition vec.hpp:530
_MSTD_CONSTEXPR20 T & g() _MSTD_REQUIRES(N > 1)
Definition vec.hpp:258
_MSTD_CONSTEXPR20 void _set_values(const std::index_sequence< Idxs... > &, const Ts &... values)
Definition vec.hpp:46
_MSTD_CONSTEXPR20 vec< N, T > modded(const T &y) const
Definition vec.hpp:378
_MSTD_CONSTEXPR20 vec< N, T > & operator*=(const vec< N, T > &other)
Definition vec.hpp:498
_MSTD_CONSTEXPR20 vec< N, T > clampped(const vec< N, T > &minVal, const vec< N, T > &maxVal) const
Definition vec.hpp:428
_MSTD_CONSTEXPR20 operator const T *() const
Definition vec.hpp:611
_MSTD_CONSTEXPR20 T a() const _MSTD_REQUIRES(N > 3)
Definition vec.hpp:289
_MSTD_CONSTEXPR20 vec< N, T > & step(const T &edge) noexcept
Definition vec.hpp:433
_MSTD_CONSTEXPR20 vec(const OT(&values)[TN])
Definition vec.hpp:140
_MSTD_CONSTEXPR20 vec< N, T > & clamp(const vec< N, T > &minVal, const vec< N, T > &maxVal)
Definition vec.hpp:423
friend _MSTD_CONSTEXPR20 vec< N, T > operator*(const T &other, const vec< N, T > &vector)
Definition vec.hpp:572
_MSTD_CONSTEXPR20 vec< N, T > & operator++()
Definition vec.hpp:584
_MSTD_CONSTEXPR20 vec< N, T > T T rotated(const vec< N, T > &axis, const T &radians) _MSTD_REQUIRES(N
_MSTD_CONSTEXPR20 T z() const _MSTD_REQUIRES(N > 2)
Definition vec.hpp:268
_MSTD_CONSTEXPR20 vec< N, T > operator/(const vec< N, T > &other) const
Definition vec.hpp:548
_MSTD_CONSTEXPR20 vec< N, T > powed(const vec< N, T > &other) const
Definition vec.hpp:408
_MSTD_CONSTEXPR20 vec< N, T > & operator+=(const T &other)
Definition vec.hpp:509
_MSTD_CONSTEXPR20 vec< N, T > & fract() noexcept
Definition vec.hpp:363
_MSTD_CONSTEXPR20 vec< N, T > & refract(const vec< N, T > &normal, const T &eta)
Definition vec.hpp:340
static _MSTD_CONSTEXPR20 vec< N, T > zero()
Definition vec.hpp:210
_MSTD_CONSTEXPR20 T angle_between(const vec< N, T > &other) const
Definition vec.hpp:319
_MSTD_CONSTEXPR20 T & a() _MSTD_REQUIRES(N > 3)
Definition vec.hpp:286
_MSTD_CONSTEXPR20 vec< N, T > operator*(const vec< N, T > &other) const
Definition vec.hpp:542
_MSTD_CONSTEXPR20 T & z() _MSTD_REQUIRES(N > 2)
Definition vec.hpp:265
_MSTD_CONSTEXPR20 T b() const _MSTD_REQUIRES(N > 2)
Definition vec.hpp:275
_MSTD_CONSTEXPR20 void _fill_values(const T &value)
Definition vec.hpp:50
_MSTD_CONSTEXPR20 vec< N, T > & saturate() noexcept
Definition vec.hpp:353
_MSTD_CONSTEXPR20 vec< N, T > normalized() const
Definition vec.hpp:308
_MSTD_CONSTEXPR20 bool is_zero() const
Definition vec.hpp:224
_MSTD_CONSTEXPR20 vec< N, T > T & rotate(const vec< N, T > &axis, const T &radians) _MSTD_REQUIRES(N
_MSTD_CONSTEXPR20 vec< N, T > operator++(int)
Definition vec.hpp:586
_MSTD_CONSTEXPR20 vec< N, T > & operator--()
Definition vec.hpp:592
_MSTD_CONSTEXPR20 vec< N, T > stepped(const vec< N, T > &edge) const noexcept
Definition vec.hpp:448
_MSTD_CONSTEXPR20 T x() const
Definition vec.hpp:243
_MSTD_CONSTEXPR20 vec(const vec< ON, AT > &otherA, const vec< ON, BT > &otherB)
Definition vec.hpp:174
_MSTD_CONSTEXPR20 T dot(const vec< N, T > &other) const
Definition vec.hpp:313
_MSTD_CONSTEXPR20 vec< N, T > & operator=(const OT(&values)[TN])
Definition vec.hpp:190
_MSTD_CONSTEXPR20 vec< N, T > & operator/=(const T &other)
Definition vec.hpp:524
_MSTD_CONSTEXPR20 vec< N, T > & operator-=(const T &other)
Definition vec.hpp:514
static _MSTD_CONSTEXPR20 vec< N, T > one()
Definition vec.hpp:212
_MSTD_CONSTEXPR20 T & b() _MSTD_REQUIRES(N > 2)
Definition vec.hpp:272
_MSTD_CONSTEXPR20 bool is_one() const
Definition vec.hpp:226
_MSTD_CONSTEXPR20 vec< N, T > operator/(const T &other) const
Definition vec.hpp:574
static _MSTD_CONSTEXPR20 const size_t size
Definition vec.hpp:34
_MSTD_CONSTEXPR20 vec(const vec< ON, OT > &other)
Definition vec.hpp:162
T value_type
Definition vec.hpp:35
_MSTD_CONSTEXPR20 vec< N, T > reflected(const vec< N, T > &normal) const noexcept
Definition vec.hpp:335
_MSTD_CONSTEXPR20 T w() const _MSTD_REQUIRES(N > 3)
Definition vec.hpp:282
_MSTD_CONSTEXPR20 T r() const
Definition vec.hpp:247
_MSTD_CONSTEXPR20 vec< N, T > & clamp(const T &minVal, const T &maxVal)
Definition vec.hpp:413
_MSTD_CONSTEXPR20 bool is_filled_with(const T &value) const
Definition vec.hpp:228
_MSTD_CONSTEXPR20 vec< N, T > stepped(const T &edge) const noexcept
Definition vec.hpp:443
_MSTD_CONSTEXPR20 vec< N, T > & mod(const T &y)
Definition vec.hpp:373
_MSTD_CONSTEXPR20 vec()
Definition vec.hpp:104
_MSTD_CONSTEXPR20 vec< N, T > saturated() const noexcept
Definition vec.hpp:358
_MSTD_CONSTEXPR20 vec< N, T > & mod(const vec< N, T > &other)
Definition vec.hpp:383
_MSTD_CONSTEXPR20 vec< N, T > & reflect(const vec< N, T > &normal) noexcept
Definition vec.hpp:329
_MSTD_CONSTEXPR20 vec< N, T > refracted(const vec< N, T > &normal, const T &eta) const
Definition vec.hpp:345
_MSTD_CONSTEXPR20 vec< N, T > modded(const vec< N, T > &other) const
Definition vec.hpp:388
_MSTD_CONSTEXPR20 vec(const Ts &... values)
Definition vec.hpp:114
_MSTD_CONSTEXPR20 vec< N, T > & pow(const T &y)
Definition vec.hpp:393
_MSTD_CONSTEXPR20 vec< N, T > operator*(const T &other) const
Definition vec.hpp:566
_MSTD_CONSTEXPR20 vec< N, T > operator+(const T &other) const
Definition vec.hpp:554
_MSTD_CONSTEXPR20 vec< N, T > & step(const vec< N, T > &edge) noexcept
Definition vec.hpp:438
_MSTD_CONSTEXPR20 T & r()
Definition vec.hpp:245
_MSTD_CONSTEXPR20 vec< N, T > cross(const vec< N, T > &other) const _MSTD_REQUIRES(N
_MSTD_CONSTEXPR20 vec< N, T > & operator-=(const vec< N, T > &other)
Definition vec.hpp:493
_MSTD_CONSTEXPR20 vec(const OT *values, const size_t &size)
Definition vec.hpp:151
_MSTD_CONSTEXPR20 vec(const vec< ON, OT > &other, const Ts &... values)
Definition vec.hpp:128
_MSTD_CONSTEXPR20 vec< N, T > operator-(const vec< N, T > &other) const
Definition vec.hpp:536
_MSTD_CONSTEXPR20 vec< N, T > operator+() const
Definition vec.hpp:580
_MSTD_CONSTEXPR20 ~vec()=default
_MSTD_CONSTEXPR20 void _fill_values_from(size_t firstIdx, const T &value)
Definition vec.hpp:52
_MSTD_CONSTEXPR20 vec< N, T > operator-() const
Definition vec.hpp:582
_MSTD_CONSTEXPR20 vec< N, T > & operator*=(const T &other)
Definition vec.hpp:519
_MSTD_CONSTEXPR20 vec< N, T > clampped(const T &minVal, const T &maxVal) const
Definition vec.hpp:418
_MSTD_CONSTEXPR20 T & x()
Definition vec.hpp:241
_MSTD_CONSTEXPR20 vec< N, T > operator--(int)
Definition vec.hpp:594
_MSTD_CONSTEXPR20 vec< N, T > T T T & operator+=(const vec< N, T > &other)
Definition vec.hpp:488
#define _MSTD_HAS_CXX17
Definition config.hpp:45
#define _MSTD_CONSTEXPR17
Definition config.hpp:76
#define _MSTD_HAS_CXX20
Definition config.hpp:52
#define _MSTD_REQUIRES(condition)
Definition config.hpp:86
#define _MSTD_ENABLE_IF_TEMPLATE(class_name, condition)
Definition config.hpp:87
#define _MSTD_INLINE17
Definition config.hpp:83
#define _MSTD_CONSTEXPR20
Definition config.hpp:84
Definition arithmetic_types.hpp:23
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > normalize(const vec< N, T > &a) noexcept
Definition vec.hpp:637
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > fract(const vec< N, T > &a)
Definition vec.hpp:691
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > clamp(const vec< N, T > &a, const vec< N, T > &minVal, const vec< N, T > &maxVal)
Definition vec.hpp:721
_MSTD_INLINE17 _MSTD_CONSTEXPR20 T angle_between(const vec< N, T > &a, const vec< N, T > &b)
Definition vec.hpp:671
_MSTD_INLINE17 _MSTD_CONSTEXPR20 T dot(const vec< N, T > &a, const vec< N, T > &b)
Definition vec.hpp:656
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > mod(const vec< N, T > &a, const T &y)
Definition vec.hpp:696
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > clamp(const vec< N, T > &a, const T &minVal, const T &maxVal)
Definition vec.hpp:716
_MSTD_INLINE17 _MSTD_CONSTEXPR20 T length(const vec< N, T > &a) noexcept
Definition vec.hpp:632
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > mod(const vec< N, T > &a, const vec< N, T > &b)
Definition vec.hpp:701
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > pow(const vec< N, T > &a, const vec< N, T > &b)
Definition vec.hpp:711
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > cross(const vec< N, T > &a, const vec< N, T > &b)
Definition vec.hpp:666
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > step(const vec< N, T > &edge, const vec< N, T > &a)
Definition vec.hpp:731
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > pow(const vec< N, T > &a, const T &y)
Definition vec.hpp:706
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > reflect(const vec< N, T > &dir, const vec< N, T > &normal)
Definition vec.hpp:676
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > min(const vec< N, T > &a, const vec< N, T > &b) noexcept
Definition vec.hpp:649
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > refract(const vec< N, T > &dir, const vec< N, T > &normal, const T &eta)
Definition vec.hpp:681
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > max(const vec< N, T > &a, const vec< N, T > &b) noexcept
Definition vec.hpp:642
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > step(const T &edge, const vec< N, T > &a)
Definition vec.hpp:726
_MSTD_INLINE17 _MSTD_CONSTEXPR20 vec< N, T > saturate(const vec< N, T > &a)
Definition vec.hpp:686