HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
identity.hpp
1// Copyright Take Vos 2021.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LidentityCENSE_1_0.txt or copy at https://www.boost.org/LidentityCENSE_1_0.txt)
4
5#pragma once
6
7#include "matrix.hpp"
8
9namespace tt::geo {
10
11class identity {
12public:
13 constexpr identity(identity const &) noexcept = default;
14 constexpr identity(identity &&) noexcept = default;
15 constexpr identity &operator=(identity const &) noexcept = default;
16 constexpr identity &operator=(identity &&) noexcept = default;
17
18 constexpr identity() noexcept = default;
19
20 template<int E>
21 constexpr operator matrix<E>() const noexcept
22 {
23 return matrix<E>();
24 }
25
26 template<int E>
27 [[nodiscard]] constexpr vector<E> operator*(vector<E> const &rhs) const noexcept
28 {
29 return rhs;
30 }
31
32 template<int E>
33 [[nodiscard]] constexpr point<E> operator*(point<E> const &rhs) const noexcept
34 {
35 return rhs;
36 }
37
38 [[nodiscard]] constexpr color operator*(color const &rhs) const noexcept
39 {
40 return rhs;
41 }
42
43 template<int E>
44 [[nodiscard]] constexpr matrix<E> operator*(matrix<E> const &rhs) const noexcept
45 {
46 return rhs;
47 }
48
49 template<int E>
50 [[nodiscard]] constexpr identity operator*(identity const &) const noexcept
51 {
52 return {};
53 }
54
55 [[nodiscard]] constexpr bool is_valid() const noexcept
56 {
57 return true;
58 }
59};
60
61}
This is a RGBA floating point color.
Definition color.hpp:39
Definition identity.hpp:11
Definition matrix.hpp:18
A high-level geometric point Part of the high-level vec, point, mat and color types.
Definition point.hpp:21
A high-level geometric vector Part of the high-level vector, point, mat and color types.
Definition vector.hpp:20