more F16 math

This commit is contained in:
Jorijn van der Graaf 2026-03-19 05:53:17 +01:00
commit f1fbbe0faf
3 changed files with 82 additions and 42 deletions

View file

@ -318,7 +318,7 @@ namespace Crafter {
T fLength = Length();
fLength = 1.0f / fLength;
for(std::uint32_t i = 0; i < Len; i++) {
this->v[i] *= fLength;
}
@ -480,7 +480,7 @@ template <typename T, std::uint32_t Aligment>
struct std::formatter<Crafter::Vector<T, 4, Aligment>> : std::formatter<std::string> {
auto format(const Crafter::Vector<T, 4, Aligment>& obj, format_context& ctx) const {
return std::formatter<std::string>::format(std::format("{{{}, {}, {}, {}}}",
obj.x, obj.y, obj.z, obj.w
(float)obj.x, (float)obj.y, (float)obj.z, (float)obj.w
), ctx);
}
};