FastLED 3.10.8
Loading...
Searching...
No Matches
geometry.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/stl/int.h"
4#include "fl/math/math.h"
6#include "fl/stl/noexcept.h"
7#include "fl/stl/undef.h" // IWYU pragma: keep — re-clean min/max macros polluted by platform headers
8
9
14
15namespace fl {
16
17template <typename T> struct vec3 {
18 // value_type
19 using value_type = T;
20 T x = 0;
21 T y = 0;
22 T z = 0;
23 constexpr vec3() FL_NO_EXCEPT = default;
24 constexpr vec3(T x, T y, T z) FL_NO_EXCEPT : x(x), y(y), z(z) {}
25
26 template <typename U>
27 explicit constexpr vec3(U xyz) FL_NO_EXCEPT : x(xyz), y(xyz), z(xyz) {}
28
29 constexpr vec3(const vec3 &p) = default;
30 constexpr vec3(vec3 &&p) FL_NO_EXCEPT = default;
32
33 vec3 &operator*=(const float &f) FL_NO_EXCEPT {
34 x *= f;
35 y *= f;
36 z *= f;
37 return *this;
38 }
39 vec3 &operator/=(const float &f) FL_NO_EXCEPT {
40 x /= f;
41 y /= f;
42 z /= f;
43 return *this;
44 }
45 vec3 &operator*=(const double &f) FL_NO_EXCEPT {
46 x *= f;
47 y *= f;
48 z *= f;
49 return *this;
50 }
51 vec3 &operator/=(const double &f) FL_NO_EXCEPT {
52 x /= f;
53 y /= f;
54 z /= f;
55 return *this;
56 }
57
58 vec3 &operator/=(const u16 &d) FL_NO_EXCEPT {
59 x /= d;
60 y /= d;
61 z /= d;
62 return *this;
63 }
64
65 vec3 &operator/=(const int &d) FL_NO_EXCEPT {
66 x /= d;
67 y /= d;
68 z /= d;
69 return *this;
70 }
71
73 x /= p.x;
74 y /= p.y;
75 z /= p.z;
76 return *this;
77 }
78
80 x += p.x;
81 y += p.y;
82 z += p.z;
83 return *this;
84 }
85
87 x -= p.x;
88 y -= p.y;
89 z -= p.z;
90 return *this;
91 }
92
94 x = p.x;
95 y = p.y;
96 z = p.z;
97 return *this;
98 }
99
100 vec3 operator-(const vec3 &p) const FL_NO_EXCEPT {
101 return vec3(x - p.x, y - p.y, z - p.z);
102 }
103
104 vec3 operator+(const vec3 &p) const FL_NO_EXCEPT {
105 return vec3(x + p.x, y + p.y, z + p.z);
106 }
107
108 vec3 operator*(const vec3 &p) const FL_NO_EXCEPT {
109 return vec3(x * p.x, y * p.y, z * p.z);
110 }
111
112 vec3 operator/(const vec3 &p) const FL_NO_EXCEPT {
113 return vec3(x / p.x, y / p.y, z / p.z);
114 }
115
116 template <typename NumberT> vec3 operator+(const NumberT &p) const FL_NO_EXCEPT {
117 return vec3(x + p, y + p, z + p);
118 }
119
120 template <typename U> vec3 operator+(const vec3<U> &p) const FL_NO_EXCEPT {
121 return vec3(x + p.x, y + p.y, z + p.z);
122 }
123
124 template <typename NumberT> vec3 operator-(const NumberT &p) const FL_NO_EXCEPT {
125 return vec3(x - p, y - p, z - p);
126 }
127
128 template <typename NumberT> vec3 operator*(const NumberT &p) const FL_NO_EXCEPT {
129 return vec3(x * p, y * p, z * p);
130 }
131
132 template <typename NumberT> vec3 operator/(const NumberT &p) const FL_NO_EXCEPT {
133 T a = x / p;
134 T b = y / p;
135 T c = z / p;
136 return vec3<T>(a, b, c);
137 }
138
139 bool operator==(const vec3 &p) const FL_NO_EXCEPT {
140 return (x == p.x && y == p.y && z == p.z);
141 }
142
143 bool operator!=(const vec3 &p) const FL_NO_EXCEPT {
144 return (x != p.x || y != p.y || z != p.z);
145 }
146
147 template <typename U> bool operator==(const vec3<U> &p) const FL_NO_EXCEPT {
148 return (x == p.x && y == p.y && z == p.z);
149 }
150
151 template <typename U> bool operator!=(const vec3<U> &p) const FL_NO_EXCEPT {
152 return (x != p.x || y != p.y || z != p.z);
153 }
154
155 vec3 getMax(const vec3 &p) const FL_NO_EXCEPT {
156 return vec3(fl::max(x, p.x), fl::max(y, p.y), fl::max(z, p.z));
157 }
158
159 vec3 getMin(const vec3 &p) const FL_NO_EXCEPT {
160 return vec3(fl::min(x, p.x), fl::min(y, p.y), fl::min(z, p.z));
161 }
162
163 template <typename U> vec3<U> cast() const FL_NO_EXCEPT {
164 return vec3<U>(static_cast<U>(x), static_cast<U>(y), static_cast<U>(z));
165 }
166
167 template <typename U> vec3 getMax(const vec3<U> &p) const FL_NO_EXCEPT {
168 return vec3<U>(fl::max(x, p.x), fl::max(y, p.y), fl::max(z, p.z));
169 }
170
171 template <typename U> vec3 getMin(const vec3<U> &p) const FL_NO_EXCEPT {
172 return vec3<U>(fl::min(x, p.x), fl::min(y, p.y), fl::min(z, p.z));
173 }
174
175 T distance(const vec3 &p) const FL_NO_EXCEPT {
176 T dx = x - p.x;
177 T dy = y - p.y;
178 T dz = z - p.z;
179 return fl::sqrt(dx * dx + dy * dy + dz * dz);
180 }
181
182 bool is_zero() const FL_NO_EXCEPT { return (x == 0 && y == 0 && z == 0); }
183};
184
185using vec3f = vec3<float>; // Full precision but slow.
186
187template <typename T> struct vec2 {
188 // value_type
189 using value_type = T;
192 constexpr vec2() FL_NO_EXCEPT = default;
194
195 template <typename U> explicit constexpr vec2(U xy) FL_NO_EXCEPT : x(xy), y(xy) {}
196
197 constexpr vec2(const vec2 &p) = default;
198 constexpr vec2(vec2 &&p) FL_NO_EXCEPT = default;
200
201 vec2 &operator*=(const float &f) FL_NO_EXCEPT {
202 x *= f;
203 y *= f;
204 return *this;
205 }
206 vec2 &operator/=(const float &f) FL_NO_EXCEPT {
207 // *this = point_xy_math::div(*this, f);
208 x /= f;
209 y /= f;
210 return *this;
211 }
212 vec2 &operator*=(const double &f) FL_NO_EXCEPT {
213 // *this = point_xy_math::mul(*this, f);
214 x *= f;
215 y *= f;
216 return *this;
217 }
218 vec2 &operator/=(const double &f) FL_NO_EXCEPT {
219 // *this = point_xy_math::div(*this, f);
220 x /= f;
221 y /= f;
222 return *this;
223 }
224
225 vec2 &operator/=(const u16 &d) FL_NO_EXCEPT {
226 // *this = point_xy_math::div(*this, d);
227 x /= d;
228 y /= d;
229 return *this;
230 }
231
232 vec2 &operator/=(const int &d) FL_NO_EXCEPT {
233 // *this = point_xy_math::div(*this, d);
234 x /= d;
235 y /= d;
236 return *this;
237 }
238
240 // *this = point_xy_math::div(*this, p);
241 x /= p.x;
242 y /= p.y;
243 return *this;
244 }
245
247 //*this = point_xy_math::add(*this, p);
248 x += p.x;
249 y += p.y;
250 return *this;
251 }
252
254 // *this = point_xy_math::sub(*this, p);
255 x -= p.x;
256 y -= p.y;
257 return *this;
258 }
259
261 x = p.x;
262 y = p.y;
263 return *this;
264 }
265
266 vec2 operator-(const vec2 &p) const FL_NO_EXCEPT { return vec2(x - p.x, y - p.y); }
267
268 vec2 operator+(const vec2 &p) const FL_NO_EXCEPT { return vec2(x + p.x, y + p.y); }
269
270 vec2 operator*(const vec2 &p) const FL_NO_EXCEPT { return vec2(x * p.x, y * p.y); }
271
272 vec2 operator/(const vec2 &p) const FL_NO_EXCEPT { return vec2(x / p.x, y / p.y); }
273
274 template <typename NumberT> vec2 operator+(const NumberT &p) const FL_NO_EXCEPT {
275 return vec2(x + p, y + p);
276 }
277
278 template <typename U> vec2 operator+(const vec2<U> &p) const FL_NO_EXCEPT {
279 return vec2(x + p.x, y + p.x);
280 }
281
282 template <typename NumberT> vec2 operator-(const NumberT &p) const FL_NO_EXCEPT {
283 return vec2(x - p, y - p);
284 }
285
286 template <typename NumberT> vec2 operator*(const NumberT &p) const FL_NO_EXCEPT {
287 return vec2(x * p, y * p);
288 }
289
290 template <typename NumberT> vec2 operator/(const NumberT &p) const FL_NO_EXCEPT {
291 T a = x / p;
292 T b = y / p;
293 return vec2<T>(a, b);
294 }
295
296 bool operator==(const vec2 &p) const FL_NO_EXCEPT { return (x == p.x && y == p.y); }
297
298 bool operator!=(const vec2 &p) const FL_NO_EXCEPT { return (x != p.x || y != p.y); }
299
300 template <typename U> bool operator==(const vec2<U> &p) const FL_NO_EXCEPT {
301 return (x == p.x && y == p.y);
302 }
303
304 template <typename U> bool operator!=(const vec2<U> &p) const FL_NO_EXCEPT {
305 return (x != p.x || y != p.y);
306 }
307
308 vec2 getMax(const vec2 &p) const FL_NO_EXCEPT { return vec2(fl::max(x, p.x), fl::max(y, p.y)); }
309
310 vec2 getMin(const vec2 &p) const FL_NO_EXCEPT { return vec2(fl::min(x, p.x), fl::min(y, p.y)); }
311
312 template <typename U> vec2<U> cast() const FL_NO_EXCEPT {
313 return vec2<U>(static_cast<U>(x), static_cast<U>(y));
314 }
315
316 template <typename U> vec2 getMax(const vec2<U> &p) const FL_NO_EXCEPT {
317 return vec2<U>(fl::max(x, p.x), fl::max(y, p.y));
318 }
319
320 template <typename U> vec2 getMin(const vec2<U> &p) const FL_NO_EXCEPT {
321 return vec2<U>(fl::min(x, p.x), fl::min(y, p.y));
322 }
323
324 T distance(const vec2 &p) const FL_NO_EXCEPT {
325 T dx = x - p.x;
326 T dy = y - p.y;
327 return fl::sqrt(dx * dx + dy * dy);
328 }
329
330 bool is_zero() const FL_NO_EXCEPT { return (x == 0 && y == 0); }
331};
332
333using vec2f = vec2<float>; // Full precision but slow.
334using vec2u8 = vec2<fl::u8>; // 8-bit unsigned integer vector.
335using vec2i16 = vec2<i16>; // 16-bit signed integer vector.
336
337// vec2 partial specialization for map_range (base template in fl/stl/math.h)
339template <typename T, typename V> struct map_range_math<T, vec2<V>> {
340 static vec2<V> map(T value, T in_min, T in_max, vec2<V> out_min,
341 vec2<V> out_max) FL_NO_EXCEPT {
342 if (in_min == in_max) {
343 return out_min;
344 }
345 T scale = (value - in_min) / T(in_max - in_min);
346 V dx = out_max.x - out_min.x;
347 V dy = out_max.y - out_min.y;
348 V x = out_min.x + V(dx * scale);
349 V y = out_min.y + V(dy * scale);
350 return {x, y};
351 }
352};
353} // namespace map_range_detail
354
355// Legacy support for vec3
356using pair_xyz_float = vec3<float>; // Legacy name for vec3f
357
358// Legacy support for vec2
359
360using pair_xy_float = vec2<float>; // Legacy name for vec2f
361
362// pair_xy<T> is the legacy name for vec2<T>
363template <typename T> struct pair_xy : public vec2<T> {
364 using value_type = T;
365 using vec2<T>::vec2;
367 pair_xy(const vec2<T> &p) FL_NO_EXCEPT : vec2<T>(p) {}
368};
369
370template <typename T> struct line_xy {
373
375 line_xy(const vec2<T> &start, const vec2<T> &end) FL_NO_EXCEPT
376 : start(start), end(end) {}
377
378 line_xy(T start_x, T start_y, T end_x, T end_y) FL_NO_EXCEPT
379 : start(start_x, start_y), end(end_x, end_y) {}
380
381 line_xy(const line_xy &other) FL_NO_EXCEPT = default;
382 line_xy &operator=(const line_xy &other) = default;
383 line_xy(line_xy &&other) noexcept = default;
384 line_xy &operator=(line_xy &&other) noexcept = default;
385
386 bool empty() const FL_NO_EXCEPT { return (start == end); }
387
388 float distance_to(const vec2<T> &p,
389 vec2<T> *out_projected = nullptr) const FL_NO_EXCEPT {
390 return distance_to_line_with_point(p, start, end, out_projected);
391 }
392
393 private:
394 // Computes the closest distance from `p` to the line through `a` and `b`,
395 // and writes the projected point.
397 vec2<T> *out_projected) FL_NO_EXCEPT {
398 vec2<T> maybe;
399 vec2<T> &out_proj = out_projected ? *out_projected : maybe;
400 float dx = b.x - a.x;
401 float dy = b.y - a.y;
402 float len_sq = dx * dx + dy * dy;
403
406 const bool is_zero = (len_sq == 0.0f);
408
409 if (is_zero) {
410 // a == b, the segment is a point
411 out_proj = a;
412 dx = p.x - a.x;
413 dy = p.y - a.y;
414 return fl::sqrt(dx * dx + dy * dy);
415 }
416
417 // Project point p onto the line segment, computing parameter t
418 float t = ((p.x - a.x) * dx + (p.y - a.y) * dy) / len_sq;
419
420 // Clamp t to [0,1] to stay within the segment
421 if (t < 0.0f)
422 t = 0.0f;
423 else if (t > 1.0f)
424 t = 1.0f;
425
426 // Find the closest point
427 out_proj.x = a.x + t * dx;
428 out_proj.y = a.y + t * dy;
429
430 dx = p.x - out_proj.x;
431 dy = p.y - out_proj.y;
432 return fl::sqrt(dx * dx + dy * dy);
433 }
434};
435
436template <typename T> struct rect {
439
440 rect() FL_NO_EXCEPT = default;
441 rect(const vec2<T> &min, const vec2<T> &max) FL_NO_EXCEPT : mMin(min), mMax(max) {}
442
443 rect(T min_x, T min_y, T max_x, T max_y) FL_NO_EXCEPT
444 : mMin(min_x, min_y), mMax(max_x, max_y) {}
445
446 rect(const rect &other) FL_NO_EXCEPT = default;
447 rect &operator=(const rect &other) = default;
448 rect(rect &&other) noexcept = default;
449 rect &operator=(rect &&other) noexcept = default;
450
451 u16 width() const FL_NO_EXCEPT { return mMax.x - mMin.x; }
452
453 u16 height() const FL_NO_EXCEPT { return mMax.y - mMin.y; }
454
455 bool empty() const FL_NO_EXCEPT { return (mMin.x == mMax.x && mMin.y == mMax.y); }
456
457 void expand(const vec2<T> &p) FL_NO_EXCEPT { expand(p.x, p.y); }
458
459 void expand(const rect &r) FL_NO_EXCEPT {
460 expand(r.mMin);
461 expand(r.mMax);
462 }
463
464 void expand(T x, T y) FL_NO_EXCEPT {
465 mMin.x = fl::min(mMin.x, x);
466 mMin.y = fl::min(mMin.y, y);
467 mMax.x = fl::max(mMax.x, x);
468 mMax.y = fl::max(mMax.y, y);
469 }
470
471 bool contains(const vec2<T> &p) const FL_NO_EXCEPT {
472 return (p.x >= mMin.x && p.x < mMax.x && p.y >= mMin.y && p.y < mMax.y);
473 }
474
475 bool contains(const T &x, const T &y) const FL_NO_EXCEPT {
476 return contains(vec2<T>(x, y));
477 }
478
479 bool operator==(const rect &r) const FL_NO_EXCEPT {
480 return (mMin == r.mMin && mMax == r.mMax);
481 }
482
483 bool operator!=(const rect &r) const FL_NO_EXCEPT { return !(*this == r); }
484
485 template <typename U> bool operator==(const rect<U> &r) const FL_NO_EXCEPT {
486 return (mMin == r.mMin && mMax == r.mMax);
487 }
488
489 template <typename U> bool operator!=(const rect<U> &r) const FL_NO_EXCEPT {
490 return !(*this == r);
491 }
492};
493
494} // namespace fl
495
fl::UISlider scale("Scale", 4,.1, 4,.1)
unsigned int xy(unsigned int x, unsigned int y)
#define constexpr
Declares that it is possible to evaluate a value at compile time, introduced in C++11.
Definition cpp_compat.h:15
bool equal(Iterator1 first1, Iterator1 last1, Iterator2 first2) FL_NO_EXCEPT
Definition algorithm.h:99
constexpr common_type_t< T, U > max(T a, U b) FL_NO_EXCEPT
Definition math.h:75
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
constexpr int type_rank< T >::value
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NO_EXCEPT
Definition math.h:71
vec2< float > vec2f
Definition geometry.h:333
vec2< float > pair_xy_float
Definition geometry.h:360
vec3< float > vec3f
Definition geometry.h:185
vec2< i16 > vec2i16
Definition geometry.h:335
vec2< fl::u8 > vec2u8
Definition geometry.h:334
vec3< float > pair_xyz_float
Definition geometry.h:356
constexpr enable_if< is_fixed_point< T >::value, T >::type sqrt(T x) FL_NO_EXCEPT
Base definition for an LED controller.
#define FL_DISABLE_WARNING(warning)
#define FL_DISABLE_WARNING_IMPLICIT_INT_CONVERSION
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_SIGN_CONVERSION
#define FL_DISABLE_WARNING_POP
#define FL_DISABLE_WARNING_FLOAT_CONVERSION
float distance_to(const vec2< T > &p, vec2< T > *out_projected=nullptr) const FL_NO_EXCEPT
Definition geometry.h:388
line_xy(const line_xy &other) FL_NO_EXCEPT=default
vec2< T > end
Definition geometry.h:372
static float distance_to_line_with_point(vec2< T > p, vec2< T > a, vec2< T > b, vec2< T > *out_projected) FL_NO_EXCEPT
Definition geometry.h:396
line_xy(T start_x, T start_y, T end_x, T end_y) FL_NO_EXCEPT
Definition geometry.h:378
vec2< T > start
Definition geometry.h:371
bool empty() const FL_NO_EXCEPT
Definition geometry.h:386
line_xy & operator=(line_xy &&other) noexcept=default
line_xy(line_xy &&other) noexcept=default
line_xy() FL_NO_EXCEPT=default
line_xy & operator=(const line_xy &other)=default
static vec2< V > map(T value, T in_min, T in_max, vec2< V > out_min, vec2< V > out_max) FL_NO_EXCEPT
Definition geometry.h:340
pair_xy() FL_NO_EXCEPT=default
bool contains(const T &x, const T &y) const FL_NO_EXCEPT
Definition geometry.h:475
vec2< T > mMax
Definition geometry.h:438
rect(const rect &other) FL_NO_EXCEPT=default
bool empty() const FL_NO_EXCEPT
Definition geometry.h:455
bool operator!=(const rect< U > &r) const FL_NO_EXCEPT
Definition geometry.h:489
bool operator==(const rect &r) const FL_NO_EXCEPT
Definition geometry.h:479
u16 width() const FL_NO_EXCEPT
Definition geometry.h:451
rect & operator=(rect &&other) noexcept=default
u16 height() const FL_NO_EXCEPT
Definition geometry.h:453
rect() FL_NO_EXCEPT=default
rect(rect &&other) noexcept=default
void expand(const rect &r) FL_NO_EXCEPT
Definition geometry.h:459
bool operator==(const rect< U > &r) const FL_NO_EXCEPT
Definition geometry.h:485
bool contains(const vec2< T > &p) const FL_NO_EXCEPT
Definition geometry.h:471
bool operator!=(const rect &r) const FL_NO_EXCEPT
Definition geometry.h:483
rect & operator=(const rect &other)=default
void expand(const vec2< T > &p) FL_NO_EXCEPT
Definition geometry.h:457
rect(T min_x, T min_y, T max_x, T max_y) FL_NO_EXCEPT
Definition geometry.h:443
vec2< T > mMin
Definition geometry.h:437
void expand(T x, T y) FL_NO_EXCEPT
Definition geometry.h:464
vec2 operator*(const NumberT &p) const FL_NO_EXCEPT
Definition geometry.h:286
vec2 & operator/=(const u16 &d) FL_NO_EXCEPT
Definition geometry.h:225
constexpr vec2() FL_NO_EXCEPT=default
vec2 getMin(const vec2 &p) const FL_NO_EXCEPT
Definition geometry.h:310
vec2 & operator/=(const int &d) FL_NO_EXCEPT
Definition geometry.h:232
vec2 getMax(const vec2 &p) const FL_NO_EXCEPT
Definition geometry.h:308
vec2 & operator*=(const double &f) FL_NO_EXCEPT
Definition geometry.h:212
constexpr vec2(const vec2 &p)=default
vec2 & operator+=(const vec2 &p) FL_NO_EXCEPT
Definition geometry.h:246
vec2 & operator/=(const vec2 &p) FL_NO_EXCEPT
Definition geometry.h:239
bool operator==(const vec2 &p) const FL_NO_EXCEPT
Definition geometry.h:296
vec2 & operator/=(const float &f) FL_NO_EXCEPT
Definition geometry.h:206
vec2 operator+(const NumberT &p) const FL_NO_EXCEPT
Definition geometry.h:274
constexpr vec2(vec2 &&p) FL_NO_EXCEPT=default
vec2 operator-(const NumberT &p) const FL_NO_EXCEPT
Definition geometry.h:282
bool operator!=(const vec2< U > &p) const FL_NO_EXCEPT
Definition geometry.h:304
vec2 & operator/=(const double &f) FL_NO_EXCEPT
Definition geometry.h:218
vec2 & operator=(vec2 &&p) FL_NO_EXCEPT=default
vec2 operator-(const vec2 &p) const FL_NO_EXCEPT
Definition geometry.h:266
vec2 operator/(const NumberT &p) const FL_NO_EXCEPT
Definition geometry.h:290
bool operator!=(const vec2 &p) const FL_NO_EXCEPT
Definition geometry.h:298
value_type y
Definition geometry.h:191
value_type x
Definition geometry.h:190
vec2 & operator=(const vec2 &p) FL_NO_EXCEPT
Definition geometry.h:260
vec2 operator+(const vec2 &p) const FL_NO_EXCEPT
Definition geometry.h:268
bool operator==(const vec2< U > &p) const FL_NO_EXCEPT
Definition geometry.h:300
vec2 & operator*=(const float &f) FL_NO_EXCEPT
Definition geometry.h:201
vec2 getMax(const vec2< U > &p) const FL_NO_EXCEPT
Definition geometry.h:316
constexpr vec2(U xy) FL_NO_EXCEPT
Definition geometry.h:195
bool is_zero() const FL_NO_EXCEPT
Definition geometry.h:330
vec2 operator+(const vec2< U > &p) const FL_NO_EXCEPT
Definition geometry.h:278
vec2 operator*(const vec2 &p) const FL_NO_EXCEPT
Definition geometry.h:270
vec2 operator/(const vec2 &p) const FL_NO_EXCEPT
Definition geometry.h:272
vec2< U > cast() const FL_NO_EXCEPT
Definition geometry.h:312
T distance(const vec2 &p) const FL_NO_EXCEPT
Definition geometry.h:324
vec2 getMin(const vec2< U > &p) const FL_NO_EXCEPT
Definition geometry.h:320
vec2 & operator-=(const vec2 &p) FL_NO_EXCEPT
Definition geometry.h:253
constexpr vec3(const vec3 &p)=default
T distance(const vec3 &p) const FL_NO_EXCEPT
Definition geometry.h:175
bool operator==(const vec3 &p) const FL_NO_EXCEPT
Definition geometry.h:139
vec3 operator+(const vec3 &p) const FL_NO_EXCEPT
Definition geometry.h:104
T value_type
Definition geometry.h:19
vec3 operator+(const NumberT &p) const FL_NO_EXCEPT
Definition geometry.h:116
vec3 & operator=(vec3 &&p) FL_NO_EXCEPT=default
vec3 & operator/=(const int &d) FL_NO_EXCEPT
Definition geometry.h:65
vec3 & operator/=(const vec3 &p) FL_NO_EXCEPT
Definition geometry.h:72
vec3 operator*(const NumberT &p) const FL_NO_EXCEPT
Definition geometry.h:128
vec3 operator/(const NumberT &p) const FL_NO_EXCEPT
Definition geometry.h:132
vec3 & operator+=(const vec3 &p) FL_NO_EXCEPT
Definition geometry.h:79
vec3 & operator/=(const u16 &d) FL_NO_EXCEPT
Definition geometry.h:58
vec3 & operator/=(const double &f) FL_NO_EXCEPT
Definition geometry.h:51
vec3 getMin(const vec3 &p) const FL_NO_EXCEPT
Definition geometry.h:159
vec3 operator-(const NumberT &p) const FL_NO_EXCEPT
Definition geometry.h:124
bool is_zero() const FL_NO_EXCEPT
Definition geometry.h:182
constexpr vec3(U xyz) FL_NO_EXCEPT
Definition geometry.h:27
constexpr vec3() FL_NO_EXCEPT=default
vec3 operator*(const vec3 &p) const FL_NO_EXCEPT
Definition geometry.h:108
vec3 & operator*=(const float &f) FL_NO_EXCEPT
Definition geometry.h:33
vec3 & operator*=(const double &f) FL_NO_EXCEPT
Definition geometry.h:45
bool operator==(const vec3< U > &p) const FL_NO_EXCEPT
Definition geometry.h:147
vec3 operator+(const vec3< U > &p) const FL_NO_EXCEPT
Definition geometry.h:120
bool operator!=(const vec3< U > &p) const FL_NO_EXCEPT
Definition geometry.h:151
vec3 & operator/=(const float &f) FL_NO_EXCEPT
Definition geometry.h:39
vec3 getMax(const vec3< U > &p) const FL_NO_EXCEPT
Definition geometry.h:167
constexpr vec3(vec3 &&p) FL_NO_EXCEPT=default
vec3 operator-(const vec3 &p) const FL_NO_EXCEPT
Definition geometry.h:100
vec3< U > cast() const FL_NO_EXCEPT
Definition geometry.h:163
bool operator!=(const vec3 &p) const FL_NO_EXCEPT
Definition geometry.h:143
vec3 getMax(const vec3 &p) const FL_NO_EXCEPT
Definition geometry.h:155
vec3 operator/(const vec3 &p) const FL_NO_EXCEPT
Definition geometry.h:112
vec3 & operator-=(const vec3 &p) FL_NO_EXCEPT
Definition geometry.h:86
vec3 getMin(const vec3< U > &p) const FL_NO_EXCEPT
Definition geometry.h:171
vec3 & operator=(const vec3 &p) FL_NO_EXCEPT
Definition geometry.h:93