Skip to content
Snippets Groups Projects
Verified Commit 30bd0c65 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

geometry: fix quaternion static Identity constructor

parent b55c10dd
No related branches found
No related tags found
No related merge requests found
Pipeline #14610 passed with warnings
...@@ -234,8 +234,9 @@ namespace eigenpy ...@@ -234,8 +234,9 @@ namespace eigenpy
"Returns the quaternion which transforms a into b through a rotation.", "Returns the quaternion which transforms a into b through a rotation.",
bp::return_value_policy<bp::manage_new_object>()) bp::return_value_policy<bp::manage_new_object>())
.staticmethod("FromTwoVectors") .staticmethod("FromTwoVectors")
.def("Identity",&Quaternion::Identity, .def("Identity",&Identity,
"Returns a quaternion representing an identity rotation.") "Returns a quaternion representing an identity rotation.",
bp::return_value_policy<bp::manage_new_object>())
.staticmethod("Identity") .staticmethod("Identity")
; ;
} }
...@@ -254,6 +255,12 @@ namespace eigenpy ...@@ -254,6 +255,12 @@ namespace eigenpy
static Quaternion & assign(Quaternion & self, const OtherQuat & quat) static Quaternion & assign(Quaternion & self, const OtherQuat & quat)
{ return self = quat; } { return self = quat; }
static Quaternion* Identity()
{
Quaternion* q(new Quaternion); q->setIdentity();
return q;
}
static Quaternion* FromTwoVectors(const Vector3& u, const Vector3& v) static Quaternion* FromTwoVectors(const Vector3& u, const Vector3& v)
{ {
Quaternion* q(new Quaternion); q->setFromTwoVectors(u,v); Quaternion* q(new Quaternion); q->setFromTwoVectors(u,v);
......
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