1#ifndef LIBSBX_MATH_VECTOR4_HPP_
2#define LIBSBX_MATH_VECTOR4_HPP_
12#include <fmt/format.h>
14#include <yaml-cpp/yaml.h>
16#include <libsbx/math/concepts.hpp>
17#include <libsbx/math/vector3.hpp>
26 inline static constexpr auto x_axis = std::size_t{0u};
27 inline static constexpr auto y_axis = std::size_t{1u};
28 inline static constexpr auto z_axis = std::size_t{2u};
29 inline static constexpr auto w_axis = std::size_t{3u};
33 using value_type = base_type::value_type;
34 using reference = base_type::reference;
35 using const_reference = base_type::const_reference;
36 using size_type = base_type::size_type;
37 using length_type = base_type::length_type;
39 inline static constexpr basic_vector4 zero{base_type::fill(value_type{0})};
40 inline static constexpr basic_vector4 one{base_type::fill(value_type{1})};
42 using base_type::base_type;
46 template<scalar Other>
47 constexpr basic_vector4(Other x, Other y, Other z, Other w)
noexcept;
49 template<scalar Other, scalar Scalar = Other>
58 [[nodiscard]]
constexpr auto x()
noexcept -> reference;
60 [[nodiscard]]
constexpr auto x()
const noexcept -> const_reference;
62 [[nodiscard]]
constexpr auto y()
noexcept -> reference;
64 [[nodiscard]]
constexpr auto y()
const noexcept -> const_reference;
66 [[nodiscard]]
constexpr auto z()
noexcept -> reference;
68 [[nodiscard]]
constexpr auto z()
const noexcept -> const_reference;
70 [[nodiscard]]
constexpr auto w()
noexcept -> reference;
72 [[nodiscard]]
constexpr auto w()
const noexcept -> const_reference;
76template<scalar Lhs, scalar Rhs>
79template<scalar Lhs, scalar Rhs>
85template<scalar Lhs, scalar Rhs>
88template<scalar Lhs, scalar Rhs>
91template<scalar Lhs, scalar Rhs>
104template<sbx::math::scalar Type>
105struct std::hash<sbx::math::basic_vector4<Type>> {
111template<sbx::math::scalar Type>
112struct fmt::formatter<sbx::math::basic_vector4<Type>> {
114 template<
typename ParseContext>
115 constexpr auto parse(ParseContext& context)
noexcept ->
decltype(context.begin());
117 template<
typename FormatContext>
122template<sbx::math::scalar Type>
123struct YAML::convert<sbx::math::basic_vector4<Type>> {
131#include <libsbx/math/vector4.ipp>
Definition: vector3.hpp:22
Definition: vector4.hpp:22
Definition: vector.hpp:19