OSSIA
Open Scenario System for Interactive Application
vec.hpp
1 #pragma once
2 #include <ossia/detail/config.hpp>
3 
4 #include <array>
5 
6 namespace ossia
7 {
8 class value;
9 
10 using vec2f = std::array<float, 2ul>;
11 using vec3f = std::array<float, 3ul>;
12 using vec4f = std::array<float, 4ul>;
13 
14 template <typename T, typename U>
15 inline vec2f make_vec(T f1, U f2)
16 {
17  return std::array<float, 2>{(float)f1, (float)f2};
18 }
19 
20 template <typename T, typename U, typename V>
21 inline vec3f make_vec(T f1, U f2, V f3)
22 {
23  return std::array<float, 3>{(float)f1, (float)f2, (float)f3};
24 }
25 
26 template <typename T, typename U, typename V, typename W>
27 inline vec4f make_vec(T f1, U f2, V f3, W f4)
28 {
29  return std::array<float, 4>{(float)f1, (float)f2, (float)f3, (float)f4};
30 }
31 template <std::size_t N>
32 std::array<float, N> fill_vec(float f)
33 {
34  std::array<float, N> arr;
35  arr.fill(f);
36  return arr;
37 }
38 }
Definition: git_info.h:7