8 #ifndef _PyImathQuat_h_
9 #define _PyImathQuat_h_
12 #define HBOOST_BIND_GLOBAL_PLACEHOLDERS
13 #include <hboost/python.hpp>
20 template <
class T> hboost::python::class_<IMATH_NAMESPACE::Quat<T> >
register_Quat();
21 template <
class T> hboost::python::class_<PyImath::FixedArray<IMATH_NAMESPACE::Quat<T> > >
register_QuatArray();
22 typedef FixedArray<IMATH_NAMESPACE::Quatf>
QuatfArray;
23 typedef FixedArray<IMATH_NAMESPACE::Quatd>
QuatdArray;
27 template <
class T>
inline IMATH_NAMESPACE::Vec3<T>
operator * (
const IMATH_NAMESPACE::Vec3<T> &
v,
const IMATH_NAMESPACE::Quat<T> &
q) {
return v * q.toMatrix33(); }
56 static PyObject *
wrap (
const IMATH_NAMESPACE::Quat<T> &
q);
57 static int convert (PyObject *p, IMATH_NAMESPACE::Quat<T> *q);
64 typename hboost::python::return_by_value::apply < IMATH_NAMESPACE::Quat<T> >
::type converter;
65 PyObject *p = converter (q);
73 hboost::python::extract <IMATH_NAMESPACE::Quatf> extractorQf (p);
74 if (extractorQf.check())
82 hboost::python::extract <IMATH_NAMESPACE::Quatd> extractorQd (p);
83 if (extractorQd.check())
91 hboost::python::extract <hboost::python::tuple> extractorTuple (p);
92 if (extractorTuple.check())
94 hboost::python::tuple
t = extractorTuple();
95 if (t.attr (
"__len__") () == 4)
101 double r = hboost::python::extract <double> (t[0]);
102 double x = hboost::python::extract <double> (t[1]);
103 double y = hboost::python::extract <double> (t[2]);
104 double z = hboost::python::extract <double> (t[3]);
106 q->v.setValue (
T(x),
T(y),
T(z));
Mat3< typename promote< S, T >::type > operator*(S scalar, const Mat3< T > &m)
Multiply each element of the given matrix by scalar and return the result.
static int convert(PyObject *p, IMATH_NAMESPACE::Quat< T > *q)
GLdouble GLdouble GLdouble z
GLdouble GLdouble GLdouble q
GLint GLint GLsizei GLint GLenum GLenum type
FixedArray< IMATH_NAMESPACE::Quatf > QuatfArray
hboost::python::class_< IMATH_NAMESPACE::Quat< T > > register_Quat()
Quat< double > Quatd
Quaternion of type double.
Quat< float > Quatf
Quaternion of type float.
FixedArray< IMATH_NAMESPACE::Quatd > QuatdArray
static PyObject * wrap(const IMATH_NAMESPACE::Quat< T > &q)
hboost::python::class_< PyImath::FixedArray< IMATH_NAMESPACE::Quat< T > > > register_QuatArray()