diff --git a/sources/reactphysics3d/mathematics/Matrix.cpp b/sources/reactphysics3d/mathematics/Matrix.cpp index 69f982f0..31eaf512 100644 --- a/sources/reactphysics3d/mathematics/Matrix.cpp +++ b/sources/reactphysics3d/mathematics/Matrix.cpp @@ -79,6 +79,27 @@ Matrix::Matrix(const Matrix& matrix) } } +// Conversion from Matrix3x3 +Matrix::Matrix(const Matrix3x3& matrix) + :nbRow(3), nbColumn(3) { + + // Create the two dimensional dynamic array + array = new double*[nbRow]; + + assert(array != 0); // Array pointer musn't be null + + for(int i=0; i #include @@ -45,6 +46,7 @@ class Matrix { Matrix(); // Constructor without argument Matrix(int nbRow, int nbColum) throw(std::invalid_argument); // Constructor of the class Matrix Matrix(const Matrix& matrix); // Copy constructor of the class Matrix + Matrix(const Matrix3x3& matrix); // Conversion from Matrix3x3 virtual ~Matrix(); // Destructor of the class Matrix double getValue(int i, int j) const throw(std::invalid_argument); // Return a value in the matrix void setValue(int i, int j, double value) throw(std::invalid_argument); // Set a value in the matrix