31#ifndef FENNEC_MATH_SWIZZLE_H
32#define FENNEC_MATH_SWIZZLE_H
46#include <fennec/math/swizzle_storage.h>
59template<
typename VectorT,
typename DataT,
typename ScalarT,
size_t...IndicesV>
60struct swizzle :
public detail::swizzle_storage<DataT, ScalarT, IndicesV...>
71 inline static constexpr size_t dimension =
sizeof...(IndicesV);
73 inline static constexpr size_t size =
sizeof...(IndicesV);
74 inline static constexpr size_t N =
sizeof...(IndicesV);
80 constexpr VectorT
decay()
const {
88 constexpr explicit operator VectorT()
const {
95 template<
size_t...VecIndicesV>
97 return ((
vec[VecIndicesV] = this->data[IndicesV]), ...,
vec);
Structure for Handling Vector Swizzling.
Definition swizzle.h:61
static constexpr size_t size
size of the swizzle
Definition swizzle.h:73
static constexpr size_t num_components
number of components
Definition swizzle.h:72
static constexpr size_t N
size of the swizzle
Definition swizzle.h:74
constexpr VectorT decay() const
Decay the Swizzle into a Vector.
Definition swizzle.h:80
ScalarT scalar_t
alias for the scalar type
Definition swizzle.h:66
static constexpr size_t dimension
dimension of the swizzle
Definition swizzle.h:71
decltype(detail::_gen_vector< vector, ScalarT >(make_index_metasequence< SizeV >{})) vec
Main vector template.
Definition vector.h:124