// ===================================================================================================================== // fennec, a free and open source game engine // Copyright © 2025 Medusa Slockbower // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // ===================================================================================================================== #ifndef FENNEC_MATH_VECTOR_BASE_H #define FENNEC_MATH_VECTOR_BASE_H #include #include #include #include namespace fennec::detail { /// /// \brief helper class for generating vectors /// \tparam scalar base scalar type /// \tparam size size of the vector type template struct vector_base_type_helper { /// /// \var SizeV /// \brief size of the vector type inline static constexpr size_t SizeV = size; /// /// \brief Base scalar type using ScalarT = scalar; /// /// \brief Base vector type using VectorT = vec; /// /// \brief Backing array holding the elements using DataT = array; /// /// \brief Helper for generating a swizzle from a set of indices /// \tparam IndicesV Indices of the vector to pull from template struct SwizzleGen { /// \brief generated swizzle type using type = swizzle; }; /// /// \tparam IndicesV Indices of the vector to pull from template struct SwizzleGen { /// \brief decayed scalar type using type = ScalarT; }; /// /// \brief backing storage type using StorageT = vector_storage; }; /// /// \brief helper for getting the storage type of the vector constructed with the provided size and scalar type template using vector_base_type = typename vector_base_type_helper::StorageT; } #endif // FENNEC_MATH_VECTOR_BASE_H