42 TVector4(SizeType InX, SizeType InY, SizeType InZ, SizeType InW)
106 return TVector4((X - Other.X), (Y - Other.Y), (Z - Other.Z), (W - Other.W));
111 return TVector4((X + Other.X), (Y + Other.Y), (Z + Other.Z), (W + Other.W));
114 bool operator==(
const TVector4& Other)
const
116 return ((X == Other.X) && (Y == Other.Y) && (Z == Other.Z) && (W == Other.W));
119 bool operator!=(
const TVector4& Other)
const
121 return !(*
this == Other);
134 std::string ToString()
const
136 return LK_FMT_LIB::format(
"({:.2f}, {:.2f}, {:.2f}, {:.2f})", X, Y, Z, W);
139 friend std::ostream& operator<<(std::ostream& os,
const TVector4& Vector)
141 os << *Vector.ToString();
145 operator glm::vec4() {
return glm::vec4(X, Y, Z, W); }
146 operator ImVec4() {
return ImVec4(X, Y, Z, W); }
148 static_assert(std::disjunction_v<
149 std::is_same<SizeType, int>,
150 std::is_same<SizeType, uint16_t>,
151 std::is_same<SizeType, uint32_t>,
152 std::is_same<SizeType, uint64_t>,
153 std::is_same<SizeType, int16_t>,
154 std::is_same<SizeType, int32_t>,
155 std::is_same<SizeType, int64_t>,
156 std::is_same<SizeType, float>,
157 std::is_same<SizeType, double>
158 >,
"TVector4 can only be instantiated with int, float or double types");
161 #if LK_VECTOR_ANONYMOUS_STRUCT
164 struct { SizeType X, Y, Z, W; };
165 struct { SizeType R, G, B, A; };
166 struct { SizeType S, T, P, Q; };
169 union { SizeType X, R, S; };
170 union { SizeType Y, G, T; };
171 union { SizeType Z, B, P; };
172 union { SizeType W, A, Q; };