1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
template<typename typeT, unsigned int sizeT>
struct vecxyzw;
template<typename typeT, unsigned int sizeT>
struct veccolor;
template<typename typeT, unsigned int sizeT>
struct vecmeta
{
union
{
typeT _a[sizeT];
struct _xyzw : vecxyzw<typeT, sizeT> {};
struct _color: veccolor<typeT, sizeT> {};
};
};
template<typename typeT>
struct kazu::vecxyzw<typeT, 1>
{
union{typeT x; typeT s; typeT _0;};
};
template<typename typeT>
struct kazu::vecxyzw<typeT, 2> : kazu::vecxyzw<typeT, 1>
{
union{typeT y; typeT t; typeT _1;};
};
template<typename typeT>
struct kazu::vecxyzw<typeT, 3> : kazu::vecxyzw<typeT, 2>
{
union{typeT z; typeT p; typeT _2;};
};
template<typename typeT>
struct kazu::vecxyzw<typeT, 4> : kazu::vecxyzw<typeT, 3>
{
union{typeT w; typeT q; typeT _3;};
};
template<typename typeT>
struct kazu::veccolor<typeT, 2>
{
typeT i, a;
};
template<typename typeT>
struct kazu::veccolor<typeT, 3>
{
typeT r, g, b;
};
template<typename typeT>
struct kazu::veccolor<typeT, 4> : kazu::veccolor<typeT, 3>
{
typeT a;
}; |
Partager