constructors use array size rather than pointers

This commit is contained in:
Daniel Agar
2018-08-27 15:39:29 -04:00
committed by Beat Küng
parent f1bee775a0
commit dc3af80977
7 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ public:
* *
* @param data_ array * @param data_ array
*/ */
AxisAngle(const Type *data_) : AxisAngle(const Type data_[3]) :
Vector<Type, 3>(data_) Vector<Type, 3>(data_)
{ {
} }
+3 -3
View File
@@ -24,7 +24,7 @@ namespace matrix
template <typename Type, size_t M> template <typename Type, size_t M>
class Vector; class Vector;
template<typename Type, size_t M, size_t N> template<typename Type, size_t M, size_t N>
class Matrix class Matrix
{ {
@@ -35,12 +35,12 @@ public:
// Constructors // Constructors
Matrix() = default; Matrix() = default;
Matrix(const Type data_[][N]) Matrix(const Type data_[M*N])
{ {
memcpy(_data, data_, sizeof(_data)); memcpy(_data, data_, sizeof(_data));
} }
Matrix(const Type *data_) Matrix(const Type data_[M][N])
{ {
memcpy(_data, data_, sizeof(_data)); memcpy(_data, data_, sizeof(_data));
} }
+1 -1
View File
@@ -62,7 +62,7 @@ public:
* *
* @param data_ array * @param data_ array
*/ */
Quaternion(const Type *data_) : Quaternion(const Type data_[4]) :
Vector<Type, 4>(data_) Vector<Type, 4>(data_)
{ {
} }
+1 -1
View File
@@ -26,7 +26,7 @@ class SquareMatrix : public Matrix<Type, M, M>
public: public:
SquareMatrix() = default; SquareMatrix() = default;
SquareMatrix(const Type *data_) : SquareMatrix(const Type data_[M][M]) :
Matrix<Type, M, M>(data_) Matrix<Type, M, M>(data_)
{ {
} }
+1 -1
View File
@@ -29,7 +29,7 @@ public:
{ {
} }
Vector(const Type *data_) : Vector(const Type data_[M]) :
MatrixM1(data_) MatrixM1(data_)
{ {
} }
+1 -1
View File
@@ -30,7 +30,7 @@ public:
{ {
} }
Vector2(const Type *data_) : Vector2(const Type data_[2]) :
Vector<Type, 2>(data_) Vector<Type, 2>(data_)
{ {
} }
+1 -1
View File
@@ -36,7 +36,7 @@ public:
{ {
} }
Vector3(const Type *data_) : Vector3(const Type data_[3]) :
Vector<Type, 3>(data_) Vector<Type, 3>(data_)
{ {
} }