MathLib
Loading...
Searching...
No Matches
GenericObjects.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <tuple>
4#include <array>
5
6
7namespace Generic
8{
9
10template <typename T, std::size_t Count>
11struct VecArray : public std::array<T, Count>
12{
13};
14
15template <typename T>
16struct XY
17{
18 T x;
19 T y;
20};
21
22template <typename T>
23struct XYZ
24{
25 T x;
26 T y;
27 T z;
28};
29
30template <typename T>
31struct RGB
32{
33 T r;
34 T g;
35 T b;
36};
37
38template <typename T>
39struct RGBA
40{
41 T r;
42 T g;
43 T b;
44 T a;
45};
46
47template <typename T>
48struct UV
49{
50 T u;
51 T v;
52};
53
54template <typename T, std::size_t Count, std::size_t ... Indices>
56{
57 return VecArray<T, Count>( { input[Indices]... } );
58}
59
60}
VecArray< T, Count > swizzle(const VecArray< T, Count > &input)