#pragma once #include #include namespace lt::math { template struct mat4_impl { using Column_T = vec4_impl; explicit mat4_impl(T scalar = 0) : values( { Column_T { scalar }, Column_T { scalar }, Column_T { scalar }, Column_T { scalar }, } ) { } // clang-format off mat4_impl( const T& x0, const T& y0, const T& z0, const T& w0, const T& x1, const T& y1, const T& z1, const T& w1, const T& x2, const T& y2, const T& z2, const T& w2, const T& x3, const T& y3, const T& z3, const T& w3 ) // clang-format on : values({ { x0, x1, x2, x3 }, { y0, y1, y2, y3 }, { z0, z1, z2, z3 }, { w0, w1, w2, w3 } }) { } mat4_impl( const Column_T &column_x, const Column_T &column_y, const Column_T &column_z, const Column_T &column_w ) : values({ column_x, column_y, column_z, column_w }) { } [[nodiscard]] constexpr auto identity() -> mat4_impl { return mat4_impl { { 1 }, {}, {}, {}, // {}, { 1 }, {}, {}, // {}, {}, { 1 }, {}, // {}, {}, {}, { 1 }, // }; } [[nodiscard]] auto operator[](size_t idx) -> Column_T & { return values[idx]; } [[nodiscard]] auto operator[](size_t idx) const -> const Column_T & { return values[idx]; } [[nodiscard]] auto operator*(const mat4_impl &other) const -> mat4_impl { return mat4_impl {}; } [[nodiscard]] auto operator*(const vec4_impl &other) const -> vec4_impl { return vec4_impl {}; } std::array values; // NOLINT }; template [[nodiscard]] inline auto translate(const vec3_impl &value) -> mat4_impl { return mat4_impl {}; } template [[nodiscard]] inline auto rotate(float value, const vec3_impl &xyz) -> mat4_impl { return mat4_impl {}; } template [[nodiscard]] inline auto scale(const vec3_impl &value) -> mat4_impl { return mat4_impl {}; } template [[nodiscard]] inline auto inverse(const mat4_impl &value) -> mat4_impl { return mat4_impl {}; } using mat4 = mat4_impl; using imat4 = mat4_impl; using umat4 = mat4_impl; } // namespace lt::math