This commit is contained in:
Jorijn van der Graaf 2025-05-05 05:14:39 +02:00
commit 8535fd1211
30 changed files with 1297 additions and 1181 deletions

View file

@ -7,37 +7,5 @@ module;
export module Crafter.Math:BasicTypes;
namespace Crafter {
export struct Float2 {
float x;
float y;
};
export struct Float3 {
float x;
float y;
float z;
};
export struct Float4 {
float x;
float y;
float z;
float w;
};
export struct Float4x4 {
float c1[4];
float c2[4];
float c3[4];
float c4[4];
};
}
template <>
struct std::formatter<Crafter::Float4x4> : std::formatter<std::string> {
auto format(const Crafter::Float4x4& obj, format_context& ctx) const {
return std::formatter<std::string>::format(std::format("{{{}, {}, {}, {}\n{}, {}, {}, {}\n{}, {}, {}, {}\n{}, {}, {}, {}}}",
obj.c1[0], obj.c2[0], obj.c3[0], obj.c4[0],
obj.c1[1], obj.c2[1], obj.c3[1], obj.c4[1],
obj.c1[2], obj.c2[2], obj.c3[2], obj.c4[2],
obj.c1[3], obj.c2[3], obj.c3[3], obj.c4[3]
), ctx);
}
};
}