MCPcopy Create free account
hub / github.com/FastLED/FastLED / vec3

Class vec3

src/fl/math/geometry.h:17–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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_NOEXCEPT = default;
24 constexpr vec3(T x, T y, T z) FL_NOEXCEPT : x(x), y(y), z(z) {}
25
26 template <typename U>
27 explicit constexpr vec3(U xyz) FL_NOEXCEPT : x(xyz), y(xyz), z(xyz) {}
28
29 constexpr vec3(const vec3 &p) = default;
30 constexpr vec3(vec3 &&p) FL_NOEXCEPT = default;
31 vec3 &operator=(vec3 &&p) FL_NOEXCEPT = default;
32
33 vec3 &operator*=(const float &f) FL_NOEXCEPT {
34 x *= f;
35 y *= f;
36 z *= f;
37 return *this;
38 }
39 vec3 &operator/=(const float &f) FL_NOEXCEPT {
40 x /= f;
41 y /= f;
42 z /= f;
43 return *this;
44 }
45 vec3 &operator*=(const double &f) FL_NOEXCEPT {
46 x *= f;
47 y *= f;
48 z *= f;
49 return *this;
50 }
51 vec3 &operator/=(const double &f) FL_NOEXCEPT {
52 x /= f;
53 y /= f;
54 z /= f;
55 return *this;
56 }
57
58 vec3 &operator/=(const u16 &d) FL_NOEXCEPT {
59 x /= d;
60 y /= d;
61 z /= d;
62 return *this;
63 }
64
65 vec3 &operator/=(const int &d) FL_NOEXCEPT {
66 x /= d;
67 y /= d;
68 z /= d;
69 return *this;
70 }
71
72 vec3 &operator/=(const vec3 &p) FL_NOEXCEPT {
73 x /= p.x;
74 y /= p.y;

Callers 6

operator-Method · 0.70
operator+Method · 0.70
operator*Method · 0.70
operator/Method · 0.70
getMaxMethod · 0.70
getMinMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected