Skip to content
Snippets Groups Projects
Commit 8092604a authored by jcarpent's avatar jcarpent
Browse files

[Geometry] Make Quaternion with newest versions of Eigen

parent 86156dcb
No related branches found
No related tags found
No related merge requests found
...@@ -71,16 +71,16 @@ namespace eigenpy ...@@ -71,16 +71,16 @@ namespace eigenpy
"The [] operator numbers them differently, 0...4 for *x* *y* *z* *w*!")) "The [] operator numbers them differently, 0...4 for *x* *y* *z* *w*!"))
.add_property("x", .add_property("x",
(Scalar (Quaternion::*)()const)&Quaternion::x, &QuaternionVisitor::getCoeff<0>,
&QuaternionVisitor::setCoeff<0>,"The x coefficient.") &QuaternionVisitor::setCoeff<0>,"The x coefficient.")
.add_property("y", .add_property("y",
(Scalar (Quaternion::*)()const)&Quaternion::y, &QuaternionVisitor::getCoeff<1>,
&QuaternionVisitor::setCoeff<1>,"The y coefficient.") &QuaternionVisitor::setCoeff<1>,"The y coefficient.")
.add_property("z", .add_property("z",
(Scalar (Quaternion::*)()const)&Quaternion::z, &QuaternionVisitor::getCoeff<2>,
&QuaternionVisitor::setCoeff<2>,"The z coefficient.") &QuaternionVisitor::setCoeff<2>,"The z coefficient.")
.add_property("w", .add_property("w",
(Scalar (Quaternion::*)()const)&Quaternion::w, &QuaternionVisitor::getCoeff<3>,
&QuaternionVisitor::setCoeff<3>,"The w coefficient.") &QuaternionVisitor::setCoeff<3>,"The w coefficient.")
// .def("isApprox",(bool (Quaternion::*)(const Quaternion &))&Quaternion::template isApprox<Quaternion>, // .def("isApprox",(bool (Quaternion::*)(const Quaternion &))&Quaternion::template isApprox<Quaternion>,
...@@ -151,6 +151,9 @@ namespace eigenpy ...@@ -151,6 +151,9 @@ namespace eigenpy
template<int i> template<int i>
static void setCoeff(Quaternion & self, Scalar value) { self.coeffs()[i] = value; } static void setCoeff(Quaternion & self, Scalar value) { self.coeffs()[i] = value; }
template<int i>
static Scalar getCoeff(Quaternion & self) { return self.coeffs()[i]; }
static Quaternion & setFromTwoVectors(Quaternion & self, const Vector3 & a, const Vector3 & b) static Quaternion & setFromTwoVectors(Quaternion & self, const Vector3 & a, const Vector3 & b)
{ return self.setFromTwoVectors(a,b); } { return self.setFromTwoVectors(a,b); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment