Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
Vec.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3**
4*/
5
6/*
7** MIT License
8**
9** Copyright (c) 2025 Robin Toillon
10**
11** Permission is hereby granted, free of charge, to any person obtaining
12** a copy of this software and associated documentation files (the
13** "Software"), to deal in the Software without restriction, including
14** without limitation the rights to use, copy, modify, merge, publish,
15** distribute, sublicense, and/or sell copies of the Software, and to
16** permit persons to whom the Software is furnished to do so, subject to
17** the following conditions:
18**
19** The above copyright notice and this permission notice shall be
20** included in all copies or substantial portions of the Software.
21**
22** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
26** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29*/
30
37#ifndef RTYPE_VECTOR_HPP_
38 #define RTYPE_VECTOR_HPP_
39
40 #include "RType/Math/Vec2.hpp"
41 #include "RType/Math/Vec3.hpp"
42 #include "RType/Math/Vec4.hpp"
44 #include <type_traits>
45
46namespace rtp
47{
51 template <Numeric T, std::size_t N>
52 using Vec = std::conditional_t<N == 2, Vec2<T>,
53 std::conditional_t<N == 3, Vec3<T>,
54 std::conditional_t<N == 4, Vec4<T>,
55 details::VecN<T, N>>>>;
56}
57
58#endif /* !RTYPE_VECTOR_HPP_ */
Declaration of the 2-dimensional vector class.
Declaration of the 3-dimensional vector class.
Declaration of the 4-dimensional vector class.
std::conditional_t< N==2, Vec2< T >, std::conditional_t< N==3, Vec3< T >, std::conditional_t< N==4, Vec4< T >, details::VecN< T, N > > > > Vec
Smart alias that selects the optimized struct based on N.
Definition Vec.hpp:55