File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2014-2021 CNRS INRIA
2+ * Copyright 2014-2022 CNRS INRIA
33 */
44
55#ifndef __eigenpy_quaternion_hpp__
@@ -120,9 +120,11 @@ namespace eigenpy
120120 (bp::arg (" aa" ))),
121121 " Initialize from an angle axis.\n "
122122 " \t aa: angle axis object." )
123- .def (bp::init<Quaternion>((bp::arg (" self" ),bp::arg (" quat" )),
124- " Copy constructor.\n "
125- " \t quat: a quaternion." )[bp::return_value_policy<bp::return_by_value>()])
123+ .def (" __init__" ,bp::make_constructor (&QuaternionVisitor::FromOtherQuaternion,
124+ bp::default_call_policies (),
125+ (bp::arg (" quat" ))),
126+ " Copy constructor.\n "
127+ " \t quat: a quaternion." )
126128 .def (" __init__" ,bp::make_constructor (&QuaternionVisitor::FromTwoVectors,
127129 bp::default_call_policies (),
128130 (bp::arg (" u" ),bp::arg (" v" ))),
@@ -286,7 +288,13 @@ namespace eigenpy
286288 Quaternion* q (new Quaternion); q->setFromTwoVectors (u,v);
287289 return q;
288290 }
289-
291+
292+ static Quaternion* FromOtherQuaternion (const Quaternion & other)
293+ {
294+ Quaternion* q (new Quaternion (other));
295+ return q;
296+ }
297+
290298 static Quaternion* DefaultConstructor ()
291299 {
292300 return new Quaternion;
You can’t perform that action at this time.
0 commit comments