MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / vec

Class vec

Source/ThirdParty/basis_universal/encoder/basisu_math.h:44–1064  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42
43 template <uint32_t N, typename T>
44 class vec : public basisu::rel_ops<vec<N, T> >
45 {
46 public:
47 typedef T scalar_type;
48 enum
49 {
50 num_elements = N
51 };
52
53 inline vec()
54 {
55 }
56
57 inline vec(basisu::eClear)
58 {
59 clear();
60 }
61
62 inline vec(const vec& other)
63 {
64 for (uint32_t i = 0; i < N; i++)
65 m_s[i] = other.m_s[i];
66 }
67
68 template <uint32_t O, typename U>
69 inline vec(const vec<O, U>& other)
70 {
71 set(other);
72 }
73
74 template <uint32_t O, typename U>
75 inline vec(const vec<O, U>& other, T w)
76 {
77 *this = other;
78 m_s[N - 1] = w;
79 }
80
81 template <typename... Args>
82 inline explicit vec(Args... args)
83 {
84 // static_assert(sizeof...(args) <= N);
85 set(args...);
86 }
87
88 inline void clear()
89 {
90 if (N > 4)
91 memset(m_s, 0, sizeof(m_s));
92 else
93 {
94 for (uint32_t i = 0; i < N; i++)
95 m_s[i] = 0;
96 }
97 }
98
99 template <uint32_t ON, typename OT>
100 inline vec& set(const vec<ON, OT>& other)
101 {

Callers 4

broadcastMethod · 0.70
swizzleMethod · 0.70
dot_vectorMethod · 0.70
perpMethod · 0.70

Calls 6

minimumFunction · 0.85
set_allFunction · 0.85
fillFunction · 0.85
setFunction · 0.85
clampFunction · 0.70
normalizeFunction · 0.50

Tested by

no test coverage detected