36 boost::python::register_ptr_to_python<std::shared_ptr<Quat>>();
40 "Quaternions are the 3D generalization of complex numbers. "
41 "Quaternions are used for roations in 3D spaces and often "
43 "computer graphics applications.",
44 init<>(arg(
"self"),
"Construct a default Quat that will perform no transformation."))
45 .def(init<double, double, double, double>((arg(
"self"), arg(
"w"), arg(
"a"), arg(
"b"), arg(
"c")),
46 "Constructor with values"))
47 .def(init<V3D, V3D>((arg(
"self"), arg(
"src"), arg(
"dest")),
"Construct a Quat between two vectors"))
48 .def(init<V3D, V3D, V3D>((arg(
"self"), arg(
"rX"), arg(
"rY"), arg(
"rZ")),
49 "Construct a Quaternion that performs a "
50 "reference frame rotation.\nThe initial X,Y,Z "
51 "vectors are aligned as expected: X=(1,0,0), "
52 "Y=(0,1,0), Z=(0,0,1)"))
53 .def(init<double, V3D>((arg(
"self"), arg(
"deg"), arg(
"axis")),
"Constructor from an angle(degrees) and an axis."))
54 .def(
"rotate", &
Quat::rotate, (arg(
"self"), arg(
"v")),
"Rotate the quaternion by the given vector")
55 .def(
"real", &
Quat::real, arg(
"self"),
"Returns the real part of the quaternion")
56 .def(
"imagI", &
Quat::imagI, arg(
"self"),
"Returns the ith imaginary component")
57 .def(
"imagJ", &
Quat::imagJ, arg(
"self"),
"Returns the jth imaginary component")
58 .def(
"imagK", &
Quat::imagK, arg(
"self"),
"Returns the kth imaginary component")
59 .def(
"len", &
Quat::len, arg(
"self"),
"Returns the 'length' of the quaternion")
60 .def(
"len2", &
Quat::len2, arg(
"self"),
"Returns the square of the 'length' of the quaternion")
62 "Default convention is \'YZX\'.")
63 .def(
"getAngleAxis", &
getAngleAxis, arg(
"self"),
"Extracts the angle of rotation and the axis")
65 .def(
"__add__", &Quat::operator+, (arg(
"left"), arg(
"right")))
66 .def(
"__iadd__", &Quat::operator+=, boost::python::return_self<>(), (arg(
"self"), arg(
"other")))
67 .def(
"__sub__", &Quat::operator-, (arg(
"left"), arg(
"right")))
68 .def(
"__isub__", &Quat::operator-=, boost::python::return_self<>(), (arg(
"self"), arg(
"other")))
69 .def(
"__mul__", &Quat::operator*, (arg(
"left"), arg(
"right")))
70 .def(
"__imul__", &Quat::operator*=, boost::python::return_self<>(), (arg(
"self"), arg(
"other")))
71 .def(
"__eq__", &Quat::operator==, (arg(
"self"), arg(
"other")))
72 .def(
"__ne__", &Quat::operator!=, (arg(
"self"), arg(
"other")))
73 .def(
"__getitem__", (
double (
Quat::*)(
int)
const) & Quat::operator[], (arg(
"self"), arg(
"index")))