Mathter
A configurable 3D math library for game developers.
ZeroBuilder.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 
4 #include "../Matrix/MatrixImpl.hpp"
5 #include "ZeroBuilder.hpp"
6 
7 
8 namespace mathter {
9 
10 
11 class ZeroBuilder {
12 public:
13  ZeroBuilder() = default;
14  ZeroBuilder& operator=(const ZeroBuilder&) = delete;
15 
16  template <class T, int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
19  Set(m);
20  return m;
21  }
22 
23 private:
24  template <class T, int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
26  for (auto& stripe : m.stripes) {
27  Fill(stripe, T(0));
28  }
29  }
30 };
31 
32 
34 inline auto Zero() {
35  return ZeroBuilder{};
36 }
37 
38 
39 } // namespace mathter
void Fill(Vector< T, Dim, Packed > &lhs, T all)
Sets all elements of the vector to the same value.
Definition: VectorFunction.hpp:97
std::array< Vector< T, StripeDim, Packed >, StripeCount > stripes
Definition: MatrixImpl.hpp:46
Definition: Approx.hpp:11
ZeroBuilder & operator=(const ZeroBuilder &)=delete
Definition: Definitions.hpp:63
Definition: ZeroBuilder.hpp:11
auto Zero()
Creates a matrix with all elements zero.
Definition: ZeroBuilder.hpp:34