28 #include "../generic/py_capi_utils.h"
29 #include "../generic/python_utildefines.h"
31 #ifndef MATH_STANDALONE
60 PyTuple_SET_ITEM(
ret, i, PyFloat_FromDouble(
self->quat[i]));
68 ".. method:: to_euler(order, euler_compat)\n"
70 " Return Euler representation of the quaternion.\n"
72 " :arg order: Optional rotation order argument in\n"
73 " ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX'].\n"
74 " :type order: string\n"
75 " :arg euler_compat: Optional euler argument the new euler will be made\n"
76 " compatible with (no axis flipping between them).\n"
77 " Useful for converting a series of matrices to animation curves.\n"
78 " :type euler_compat: :class:`Euler`\n"
79 " :return: Euler representation of the quaternion.\n"
80 " :rtype: :class:`Euler`\n");
85 const char *order_str =
NULL;
89 if (!PyArg_ParseTuple(args,
"|sO!:to_euler", &order_str, &
euler_Type, &eul_compat)) {
132 ".. method:: to_matrix()\n"
134 " Return a matrix representation of the quaternion.\n"
136 " :return: A 3x3 rotation matrix representation of the quaternion.\n"
137 " :rtype: :class:`Matrix`\n");
151 ".. method:: to_axis_angle()\n"
153 " Return the axis, angle representation of the quaternion.\n"
155 " :return: axis, angle.\n"
156 " :rtype: (:class:`Vector`, float) pair\n");
175 ret = PyTuple_New(2);
181 ".. method:: to_swing_twist(axis)\n"
183 " Split the rotation into a swing quaternion with the specified\n"
184 " axis fixed at zero, and the remaining twist rotation angle.\n"
186 " :arg axis: twist axis as a string in ['X', 'Y', 'Z']\n"
187 " :return: swing, twist angle.\n"
188 " :rtype: (:class:`Quaternion`, float) pair\n");
193 const char *axis_str =
NULL;
194 float swing[4], twist;
197 if (axis_arg && PyUnicode_Check(axis_arg)) {
198 axis_str = PyUnicode_AsUTF8(axis_arg);
201 if (axis_str && axis_str[0] >=
'X' && axis_str[0] <=
'Z' && axis_str[1] == 0) {
202 axis = axis_str[0] -
'X';
205 PyErr_SetString(PyExc_ValueError,
206 "Quaternion.to_swing_twist(): "
207 "the axis argument must be "
208 "a string in 'X', 'Y', 'Z'");
218 ret = PyTuple_New(2);
225 Quaternion_to_exponential_map_doc,
226 ".. method:: to_exponential_map()\n"
228 " Return the exponential map representation of the quaternion.\n"
230 " This representation consist of the rotation axis multiplied by the rotation angle.\n"
231 " Such a representation is useful for interpolation between multiple orientations.\n"
233 " :return: exponential map.\n"
234 " :rtype: :class:`Vector` of size 3\n"
236 " To convert back to a quaternion, pass it to the :class:`Quaternion` constructor.\n");
250 ".. method:: cross(other)\n"
252 " Return the cross product of this quaternion and another.\n"
254 " :arg other: The other quaternion to perform the cross product with.\n"
255 " :type other: :class:`Quaternion`\n"
256 " :return: The cross product.\n"
257 " :rtype: :class:`Quaternion`\n");
267 tquat,
QUAT_SIZE,
QUAT_SIZE, value,
"Quaternion.cross(other), invalid 'other' arg") ==
277 ".. method:: dot(other)\n"
279 " Return the dot product of this quaternion and another.\n"
281 " :arg other: The other quaternion to perform the dot product with.\n"
282 " :type other: :class:`Quaternion`\n"
283 " :return: The dot product.\n"
303 ".. function:: rotation_difference(other)\n"
305 " Returns a quaternion representing the rotational difference.\n"
307 " :arg other: second quaternion.\n"
308 " :type other: :class:`Quaternion`\n"
309 " :return: the rotational difference between the two quat rotations.\n"
310 " :rtype: :class:`Quaternion`\n");
323 "Quaternion.difference(other), invalid 'other' arg") == -1) {
333 ".. function:: slerp(other, factor)\n"
335 " Returns the interpolation of two quaternions.\n"
337 " :arg other: value to interpolate with.\n"
338 " :type other: :class:`Quaternion`\n"
339 " :arg factor: The interpolation value in [0.0, 1.0].\n"
340 " :type factor: float\n"
341 " :return: The interpolated rotation.\n"
342 " :rtype: :class:`Quaternion`\n");
348 if (!PyArg_ParseTuple(args,
"Of:slerp", &value, &fac)) {
349 PyErr_SetString(PyExc_TypeError,
351 "expected Quaternion types and float");
360 tquat,
QUAT_SIZE,
QUAT_SIZE, value,
"Quaternion.slerp(other), invalid 'other' arg") ==
365 if (fac > 1.0f || fac < 0.0f) {
366 PyErr_SetString(PyExc_ValueError,
368 "interpolation factor must be between 0.0 and 1.0");
378 ".. method:: rotate(other)\n"
380 " Rotates the quaternion by another mathutils value.\n"
382 " :arg other: rotation component of mathutils value\n"
383 " :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n");
386 float self_rmat[3][3], other_rmat[3][3], rmat[3][3];
409 ".. method:: make_compatible(other)\n"
411 " Make this quaternion compatible with another,\n"
412 " so interpolating between them works as intended.\n");
426 "Quaternion.make_compatible(other), invalid 'other' arg") == -1) {
444 ".. function:: normalize()\n"
446 " Normalize the quaternion.\n");
459 ".. function:: normalized()\n"
461 " Return a new normalized quaternion.\n"
463 " :return: a normalized copy.\n"
464 " :rtype: :class:`Quaternion`\n");
471 ".. function:: invert()\n"
473 " Set the quaternion to its inverse.\n");
486 ".. function:: inverted()\n"
488 " Return a new, inverted quaternion.\n"
490 " :return: the inverted value.\n"
491 " :rtype: :class:`Quaternion`\n");
498 ".. function:: identity()\n"
500 " Set the quaternion to an identity quaternion.\n"
502 " :rtype: :class:`Quaternion`\n");
516 ".. function:: negate()\n"
518 " Set the quaternion to its negative.\n"
520 " :rtype: :class:`Quaternion`\n");
534 ".. function:: conjugate()\n"
536 " Set the quaternion to its conjugate (negate x, y, z).\n");
549 ".. function:: conjugated()\n"
551 " Return a new conjugated quaternion.\n"
553 " :return: a new quaternion.\n"
554 " :rtype: :class:`Quaternion`\n");
561 ".. function:: copy()\n"
563 " Returns a copy of this quaternion.\n"
565 " :return: A copy of the quaternion.\n"
566 " :rtype: :class:`Quaternion`\n"
568 " .. note:: use this to get a copy of a wrapped quaternion with\n"
569 " no reference to the original data.\n");
589 PyObject *
ret, *tuple;
597 ret = PyUnicode_FromFormat(
"Quaternion(%R)", tuple);
603 #ifndef MATH_STANDALONE
615 "<Quaternion (w=%.4f, x=%.4f, y=%.4f, z=%.4f)>",
646 res = ok ? Py_False : Py_True;
653 res = Py_NotImplemented;
660 return Py_INCREF_RET(res);
692 PyErr_SetString(PyExc_IndexError,
693 "quaternion[attribute]: "
694 "array index out of range");
702 return PyFloat_FromDouble(
self->quat[i]);
714 f = (
float)PyFloat_AsDouble(ob);
716 if (f == -1.0f && PyErr_Occurred()) {
717 PyErr_SetString(PyExc_TypeError,
718 "quaternion[index] = x: "
719 "assigned value not a number");
728 PyErr_SetString(PyExc_IndexError,
729 "quaternion[attribute] = x: "
730 "array assignment index out of range");
757 begin =
MIN2(begin, end);
759 tuple = PyTuple_New(end - begin);
761 PyTuple_SET_ITEM(tuple,
count - begin, PyFloat_FromDouble(
self->quat[
count]));
782 begin =
MIN2(begin, end);
785 quat, 0,
QUAT_SIZE, seq,
"mathutils.Quaternion[begin:end] = []")) == -1) {
789 if (
size != (end - begin)) {
790 PyErr_SetString(PyExc_ValueError,
791 "quaternion[begin:end] = []: "
792 "size mismatch in slice assignment");
797 for (i = 0; i <
size; i++) {
798 self->quat[begin + i] = quat[i];
807 if (PyIndex_Check(item)) {
809 i = PyNumber_AsSsize_t(item, PyExc_IndexError);
810 if (i == -1 && PyErr_Occurred()) {
818 if (PySlice_Check(item)) {
819 Py_ssize_t start, stop, step, slicelength;
821 if (PySlice_GetIndicesEx(item,
QUAT_SIZE, &start, &stop, &step, &slicelength) < 0) {
825 if (slicelength <= 0) {
826 return PyTuple_New(0);
832 PyErr_SetString(PyExc_IndexError,
"slice steps not supported with quaternions");
837 PyExc_TypeError,
"quaternion indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
843 if (PyIndex_Check(item)) {
844 Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
845 if (i == -1 && PyErr_Occurred()) {
853 if (PySlice_Check(item)) {
854 Py_ssize_t start, stop, step, slicelength;
856 if (PySlice_GetIndicesEx(item,
QUAT_SIZE, &start, &stop, &step, &slicelength) < 0) {
864 PyErr_SetString(PyExc_IndexError,
"slice steps not supported with quaternion");
869 PyExc_TypeError,
"quaternion indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
882 PyErr_Format(PyExc_TypeError,
883 "Quaternion addition: (%s + %s) "
884 "invalid type for this operation",
885 Py_TYPE(
q1)->tp_name,
886 Py_TYPE(q2)->tp_name);
908 PyErr_Format(PyExc_TypeError,
909 "Quaternion subtraction: (%s - %s) "
910 "invalid type for this operation",
911 Py_TYPE(
q1)->tp_name,
912 Py_TYPE(q2)->tp_name);
924 quat[
x] = quat1->quat[
x] - quat2->quat[
x];
958 if (quat1 && quat2) {
965 if (((scalar = PyFloat_AsDouble(
q1)) == -1.0f && PyErr_Occurred()) == 0) {
970 if ((((scalar = PyFloat_AsDouble(q2)) == -1.0f && PyErr_Occurred()) == 0)) {
975 PyErr_Format(PyExc_TypeError,
976 "Element-wise multiplication: "
977 "not supported between '%.200s' and '%.200s' types",
978 Py_TYPE(
q1)->tp_name,
979 Py_TYPE(q2)->tp_name);
1002 if (quat1 && quat2) {
1005 else if (quat1 && (((scalar = PyFloat_AsDouble(q2)) == -1.0f && PyErr_Occurred()) == 0)) {
1010 PyErr_Format(PyExc_TypeError,
1011 "Element-wise multiplication: "
1012 "not supported between '%.200s' and '%.200s' types",
1013 Py_TYPE(
q1)->tp_name,
1014 Py_TYPE(q2)->tp_name);
1042 if (quat1 && quat2) {
1052 if (vec2->
size != 3) {
1053 PyErr_SetString(PyExc_ValueError,
1054 "Vector multiplication: "
1055 "only 3D vector rotations (with quats) "
1056 "currently supported");
1070 PyErr_Format(PyExc_TypeError,
1071 "Quaternion multiplication: "
1072 "not supported between '%.200s' and '%.200s' types",
1073 Py_TYPE(
q1)->tp_name,
1074 Py_TYPE(q2)->tp_name);
1097 if (quat1 && quat2) {
1102 PyErr_Format(PyExc_TypeError,
1103 "In place quaternion multiplication: "
1104 "not supported between '%.200s' and '%.200s' types",
1105 Py_TYPE(
q1)->tp_name,
1106 Py_TYPE(q2)->tp_name);
1135 (ssizessizeargfunc)
NULL,
1137 (ssizessizeobjargproc)
NULL,
1188 PyDoc_STRVAR(Quaternion_axis_doc,
"Quaternion axis value.\n\n:type: float");
1199 PyDoc_STRVAR(Quaternion_magnitude_doc,
"Size of the quaternion (read-only).\n\n:type: float");
1209 PyDoc_STRVAR(Quaternion_angle_doc,
"Angle of the quaternion.\n\n:type: float");
1225 return PyFloat_FromDouble(
angle);
1233 float axis[3], angle_dummy;
1243 angle = PyFloat_AsDouble(value);
1245 if (
angle == -1.0f && PyErr_Occurred()) {
1246 PyErr_SetString(PyExc_TypeError,
"Quaternion.angle = value: float expected");
1264 PyDoc_STRVAR(Quaternion_axis_vector_doc,
"Quaternion axis as a vector.\n\n:type: :class:`Vector`");
1320 PyObject *seq =
NULL;
1321 double angle = 0.0f;
1325 if (kwds && PyDict_Size(kwds)) {
1326 PyErr_SetString(PyExc_TypeError,
1327 "mathutils.Quaternion(): "
1328 "takes no keyword args");
1332 if (!PyArg_ParseTuple(args,
"|Od:mathutils.Quaternion", &seq, &
angle)) {
1336 switch (PyTuple_GET_SIZE(args)) {
1378 Py_DECREF(ret_dummy);
1430 Quaternion_to_axis_angle_doc},
1434 Quaternion_to_swing_twist_doc},
1435 {
"to_exponential_map",
1438 Quaternion_to_exponential_map_doc},
1442 {
"dot", (PyCFunction)
Quaternion_dot, METH_O, Quaternion_dot_doc},
1443 {
"rotation_difference",
1446 Quaternion_rotation_difference_doc},
1447 {
"slerp", (PyCFunction)
Quaternion_slerp, METH_VARARGS, Quaternion_slerp_doc},
1452 Quaternion_make_compatible_doc},
1457 {
"copy", (PyCFunction)
Quaternion_copy, METH_NOARGS, Quaternion_copy_doc},
1458 {
"__copy__", (PyCFunction)
Quaternion_copy, METH_NOARGS, Quaternion_copy_doc},
1470 Quaternion_axis_doc,
1475 Quaternion_axis_doc,
1480 Quaternion_axis_doc,
1485 Quaternion_axis_doc,
1491 Quaternion_angle_doc,
1496 Quaternion_axis_vector_doc,
1514 ".. class:: Quaternion([seq, [angle]])\n"
1516 " This object gives access to Quaternions in Blender.\n"
1518 " :param seq: size 3 or 4\n"
1519 " :type seq: :class:`Vector`\n"
1520 " :param angle: rotation angle, in radians\n"
1521 " :type angle: float\n"
1523 " The constructor takes arguments in various forms:\n"
1526 " Create an identity quaternion\n"
1528 " Create a quaternion from a ``(w, x, y, z)`` vector.\n"
1529 " (*exponential_map*)\n"
1530 " Create a quaternion from a 3d exponential map vector.\n"
1532 " .. seealso:: :meth:`to_exponential_map`\n"
1533 " (*axis, angle*)\n"
1534 " Create a quaternion representing a rotation of *angle* radians over *axis*.\n"
1536 " .. seealso:: :meth:`to_axis_angle`\n");
1538 PyVarObject_HEAD_INIT(
NULL, 0)
"Quaternion",
1552 #ifndef MATH_STANDALONE
1560 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
1594 quat_alloc = PyMem_Malloc(
QUAT_SIZE *
sizeof(
float));
1596 PyErr_SetString(PyExc_MemoryError,
1598 "problem allocating data");
1604 self->quat = quat_alloc;
1606 self->cb_user =
NULL;
1607 self->cb_type =
self->cb_subtype = 0;
1619 PyMem_Free(quat_alloc);
1622 return (PyObject *)
self;
1632 self->cb_user =
NULL;
1633 self->cb_type =
self->cb_subtype = 0;
1639 return (PyObject *)
self;
1647 self->cb_user = cb_user;
1648 self->cb_type = cb_type;
1649 self->cb_subtype = cb_subtype;
1650 PyObject_GC_Track(
self);
1653 return (PyObject *)
self;
typedef float(TangentPoint)[2]
A dynamically sized string ADT.
DynStr * BLI_dynstr_new(void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_dynstr_appendf(DynStr *__restrict ds, const char *__restrict format,...) ATTR_PRINTF_FORMAT(2
MINLINE float saacos(float fac)
double double_round(double x, int ndigits)
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void quat_to_eulO(float eul[3], const short order, const float quat[4])
void rotation_between_quats_to_quat(float q[4], const float q1[4], const float q2[4])
void mul_qt_fl(float q[4], const float f)
void mat3_to_quat(float q[4], const float mat[3][3])
void axis_angle_to_quat(float r[4], const float axis[3], const float angle)
float normalize_qt(float q[4])
void invert_qt(float q[4])
void mul_qt_v3(const float q[4], float r[3])
void quat_to_compatible_eulO(float eul[3], const float old[3], const short order, const float quat[4])
void quat_to_eul(float eul[3], const float quat[4])
float normalize_qt_qt(float r[4], const float q[4])
float dot_qtqt(const float a[4], const float b[4])
void mul_qt_qtqt(float q[4], const float a[4], const float b[4])
void quat_to_axis_angle(float axis[3], float *angle, const float q[4])
void quat_to_expmap(float expmap[3], const float q[4])
void interp_qt_qtqt(float q[4], const float a[4], const float b[4], const float t)
void conjugate_qt(float q[4])
void quat_to_compatible_eul(float eul[3], const float oldrot[3], const float quat[4])
void copy_qt_qt(float q[4], const float a[4])
float angle_wrap_rad(float angle)
void quat_to_compatible_quat(float q[4], const float a[4], const float old[4])
void quat_to_mat3(float mat[3][3], const float q[4])
void expmap_to_quat(float r[4], const float expmap[3])
float quat_split_swing_and_twist(const float q[4], int axis, float r_swing[4], float r_twist[4])
void add_qt_qtqt(float q[4], const float a[4], const float b[4], const float t)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void mul_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const int size)
void mul_vn_vn(float *array_tar, const float *array_src, const int size)
MINLINE void negate_v4_v4(float r[4], const float a[3])
#define POINTER_AS_INT(i)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint order
Group RGB to Bright Vector Camera CLAMP
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
PyObject * BaseMathObject_freeze(BaseMathObject *self)
PyObject * BaseMathObject_is_frozen_get(BaseMathObject *self, void *UNUSED(closure))
int EXPP_FloatsAreEqual(float af, float bf, int maxDiff)
PyObject * BaseMathObject_is_wrapped_get(BaseMathObject *self, void *UNUSED(closure))
PyObject * mathutils_dynstr_to_py(struct DynStr *ds)
Py_hash_t mathutils_array_hash(const float *array, size_t array_len)
void BaseMathObject_dealloc(BaseMathObject *self)
int EXPP_VectorsAreEqual(const float *vecA, const float *vecB, int size, int floatSteps)
PyObject * BaseMathObject_owner_get(BaseMathObject *self, void *UNUSED(closure))
char BaseMathObject_is_wrapped_doc[]
char BaseMathObject_is_frozen_doc[]
int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *value, const char *error_prefix)
int mathutils_any_to_rotmat(float rmat[3][3], PyObject *value, const char *error_prefix)
char BaseMathObject_owner_doc[]
char BaseMathObject_freeze_doc[]
int BaseMathObject_clear(BaseMathObject *self)
int BaseMathObject_traverse(BaseMathObject *self, visitproc visit, void *arg)
#define BaseMath_ReadCallback_ForWrite(_self)
#define BaseMath_ReadIndexCallback(_self, _index)
#define BaseMath_WriteCallback(_self)
#define BASE_MATH_NEW(struct_name, root_type, base_type)
#define BaseMathObject_Prepare_ForHash(_self)
#define BASE_MATH_FLAG_DEFAULT
#define BaseMath_Prepare_ForWrite(_self)
#define BaseMath_ReadCallback(_self)
#define BaseMath_WriteIndexCallback(_self, _index)
short euler_order_from_string(const char *str, const char *error_prefix)
PyObject * Euler_CreatePyObject(const float eul[3], const short order, PyTypeObject *base_type)
PyObject * Matrix_CreatePyObject(const float *mat, const ushort num_col, const ushort num_row, PyTypeObject *base_type)
static PyObject * Quaternion_normalized(QuaternionObject *self)
static PyObject * Quaternion_neg(QuaternionObject *self)
static PyObject * Quaternion_axis_vector_get(QuaternionObject *self, void *UNUSED(closure))
static int Quaternion_axis_vector_set(QuaternionObject *self, PyObject *value, void *UNUSED(closure))
static PyObject * Quaternion_to_matrix(QuaternionObject *self)
static PyObject * Quaternion_inverted(QuaternionObject *self)
static PyObject * Quaternion_to_euler(QuaternionObject *self, PyObject *args)
static PyObject * Quaternion_repr(QuaternionObject *self)
static PyObject * Quaternion_normalize(QuaternionObject *self)
static PyObject * Quaternion_matmul(PyObject *q1, PyObject *q2)
static PySequenceMethods Quaternion_SeqMethods
static int Quaternion_len(QuaternionObject *UNUSED(self))
static PyMappingMethods Quaternion_AsMapping
static PyObject * Quaternion_imatmul(PyObject *q1, PyObject *q2)
static PyGetSetDef Quaternion_getseters[]
static int Quaternion_angle_set(QuaternionObject *self, PyObject *value, void *UNUSED(closure))
static PyObject * Quaternion_cross(QuaternionObject *self, PyObject *value)
static PyObject * Quaternion_invert(QuaternionObject *self)
static PyObject * Quaternion_make_compatible(QuaternionObject *self, PyObject *value)
PyObject * Quaternion_CreatePyObject(const float quat[4], PyTypeObject *base_type)
static PyObject * Quaternion_identity(QuaternionObject *self)
static PyObject * Quaternion_angle_get(QuaternionObject *self, void *UNUSED(closure))
PyDoc_STRVAR(Quaternion_to_euler_doc, ".. method:: to_euler(order, euler_compat)\n" "\n" " Return Euler representation of the quaternion.\n" "\n" " :arg order: Optional rotation order argument in\n" " ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX'].\n" " :type order: string\n" " :arg euler_compat: Optional euler argument the new euler will be made\n" " compatible with (no axis flipping between them).\n" " Useful for converting a series of matrices to animation curves.\n" " :type euler_compat: :class:`Euler`\n" " :return: Euler representation of the quaternion.\n" " :rtype: :class:`Euler`\n")
PyObject * Quaternion_CreatePyObject_wrap(float quat[4], PyTypeObject *base_type)
static PyObject * Quaternion_sub(PyObject *q1, PyObject *q2)
static PyObject * Quaternion_to_exponential_map(QuaternionObject *self)
static PyObject * Quaternion_dot(QuaternionObject *self, PyObject *value)
static PyObject * Quaternion_axis_get(QuaternionObject *self, void *type)
static PyObject * Quaternion_slice(QuaternionObject *self, int begin, int end)
static PyObject * Quaternion_rotation_difference(QuaternionObject *self, PyObject *value)
static void quat__axis_angle_sanitize(float axis[3], float *angle)
static PyObject * Quaternion_conjugate(QuaternionObject *self)
static PyObject * Quaternion_richcmpr(PyObject *a, PyObject *b, int op)
static PyObject * Quaternion_magnitude_get(QuaternionObject *self, void *UNUSED(closure))
static PyObject * Quaternion_to_swing_twist(QuaternionObject *self, PyObject *axis_arg)
static int Quaternion_ass_subscript(QuaternionObject *self, PyObject *item, PyObject *value)
PyObject * Quaternion_CreatePyObject_cb(PyObject *cb_user, uchar cb_type, uchar cb_subtype)
static PyObject * Quaternion_str(QuaternionObject *self)
static PyObject * Quaternion_deepcopy(QuaternionObject *self, PyObject *args)
static int Quaternion_ass_slice(QuaternionObject *self, int begin, int end, PyObject *seq)
static PyObject * Quaternion_mul(PyObject *q1, PyObject *q2)
static PyObject * Quaternion_slerp(QuaternionObject *self, PyObject *args)
static PyObject * Quaternion_negate(QuaternionObject *self)
static PyNumberMethods Quaternion_NumMethods
static PyObject * Quaternion_subscript(QuaternionObject *self, PyObject *item)
static PyObject * Quaternion_to_tuple_ext(QuaternionObject *self, int ndigits)
static PyObject * Quaternion_item(QuaternionObject *self, int i)
static PyObject * Quaternion_add(PyObject *q1, PyObject *q2)
PyTypeObject quaternion_Type
static PyObject * Quaternion_imul(PyObject *q1, PyObject *q2)
static PyObject * Quaternion_to_axis_angle(QuaternionObject *self)
static PyObject * Quaternion_rotate(QuaternionObject *self, PyObject *value)
static int Quaternion_axis_set(QuaternionObject *self, PyObject *value, void *type)
static PyObject * quat__apply_to_copy(PyObject *(*quat_func)(QuaternionObject *), QuaternionObject *self)
static Py_hash_t Quaternion_hash(QuaternionObject *self)
static PyObject * quat_mul_float(QuaternionObject *quat, const float scalar)
static PyObject * Quaternion_conjugated(QuaternionObject *self)
static PyObject * Quaternion_copy(QuaternionObject *self)
static PyObject * Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
static int Quaternion_ass_item(QuaternionObject *self, int i, PyObject *ob)
static struct PyMethodDef Quaternion_methods[]
#define QuaternionObject_Check(v)
PyObject * Vector_CreatePyObject(const float *vec, const int size, PyTypeObject *base_type)
#define VectorObject_Check(v)
int PyC_CheckArgs_DeepCopy(PyObject *args)
#define PyTuple_SET_ITEMS(op_arg,...)