Skip to content
Snippets Groups Projects
Commit be1f78a1 authored by Marco Biasini's avatar Marco Biasini
Browse files

added constructor to initialize Mat3 with diagonal elements

parent c970c9c2
No related branches found
No related tags found
No related merge requests found
...@@ -58,6 +58,7 @@ void export_Mat3() ...@@ -58,6 +58,7 @@ void export_Mat3()
class_<Mat3>("Mat3",init<>()) class_<Mat3>("Mat3",init<>())
.def(init<Real,Real,Real,Real,Real,Real,Real,Real,Real>()) .def(init<Real,Real,Real,Real,Real,Real,Real,Real,Real>())
.def(init<const Mat2&>()) .def(init<const Mat2&>())
.def(init<Real,Real,Real>())
.def(self += self) .def(self += self)
.def(self -= self) .def(self -= self)
.def(self + self) .def(self + self)
......
...@@ -27,10 +27,8 @@ ...@@ -27,10 +27,8 @@
#include <ost/geom/module_config.hh> #include <ost/geom/module_config.hh>
#include <ost/geom/mat2.hh> #include <ost/geom/mat2.hh>
namespace geom { namespace geom {
class Mat2;
class Vec3; class Vec3;
class DLLEXPORT_OST_GEOM Mat3: class DLLEXPORT_OST_GEOM Mat3:
...@@ -76,8 +74,12 @@ public: ...@@ -76,8 +74,12 @@ public:
explicit Mat3(const Real arr[9]) explicit Mat3(const Real arr[9])
{ {
this->set(arr[0],arr[1],arr[2],arr[3],arr[4],arr[5],arr[6],arr[7],arr[8]); this->set(arr[0],arr[1],arr[2],arr[3],arr[4],arr[5],arr[6],arr[7],arr[8]);
} }
explicit Mat3(Real x, Real y, Real z)
{
this->set(x, 0.0, 0.0, 0.0, y, 0.0, 0.0, 0.0, z);
}
//! element access //! element access
Real& operator()(std::size_t r, std::size_t c) Real& operator()(std::size_t r, std::size_t c)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment