14 #include "../generic/py_capi_utils.h"
15 #include "../generic/python_utildefines.h"
17 #ifndef MATH_STANDALONE
86 PyTuple_SET_ITEM(
ret, i, PyFloat_FromDouble(
self->quat[i]));
101 PyObject *seq =
NULL;
106 if (kwds && PyDict_Size(kwds)) {
107 PyErr_SetString(PyExc_TypeError,
108 "mathutils.Quaternion(): "
109 "takes no keyword args");
113 if (!PyArg_ParseTuple(args,
"|Od:mathutils.Quaternion", &seq, &
angle)) {
117 switch (PyTuple_GET_SIZE(args)) {
160 ".. method:: to_euler(order, euler_compat)\n"
162 " Return Euler representation of the quaternion.\n"
164 " :arg order: Optional rotation order argument in\n"
165 " ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX'].\n"
166 " :type order: string\n"
167 " :arg euler_compat: Optional euler argument the new euler will be made\n"
168 " compatible with (no axis flipping between them).\n"
169 " Useful for converting a series of matrices to animation curves.\n"
170 " :type euler_compat: :class:`Euler`\n"
171 " :return: Euler representation of the quaternion.\n"
172 " :rtype: :class:`Euler`\n");
177 const char *order_str =
NULL;
181 if (!PyArg_ParseTuple(args,
"|sO!:to_euler", &order_str, &
euler_Type, &eul_compat)) {
230 ".. method:: to_matrix()\n"
232 " Return a matrix representation of the quaternion.\n"
234 " :return: A 3x3 rotation matrix representation of the quaternion.\n"
235 " :rtype: :class:`Matrix`\n");
255 ".. method:: to_axis_angle()\n"
257 " Return the axis, angle representation of the quaternion.\n"
259 " :return: axis, angle.\n"
260 " :rtype: (:class:`Vector`, float) pair\n");
279 ret = PyTuple_New(2);
291 ".. method:: to_swing_twist(axis)\n"
293 " Split the rotation into a swing quaternion with the specified\n"
294 " axis fixed at zero, and the remaining twist rotation angle.\n"
296 " :arg axis: twist axis as a string in ['X', 'Y', 'Z']\n"
297 " :return: swing, twist angle.\n"
298 " :rtype: (:class:`Quaternion`, float) pair\n");
303 const char *axis_str =
NULL;
304 float swing[4], twist;
307 if (axis_arg && PyUnicode_Check(axis_arg)) {
308 axis_str = PyUnicode_AsUTF8(axis_arg);
311 if (axis_str && axis_str[0] >=
'X' && axis_str[0] <=
'Z' && axis_str[1] == 0) {
312 axis = axis_str[0] -
'X';
315 PyErr_SetString(PyExc_ValueError,
316 "Quaternion.to_swing_twist(): "
317 "the axis argument must be "
318 "a string in 'X', 'Y', 'Z'");
328 ret = PyTuple_New(2);
341 Quaternion_to_exponential_map_doc,
342 ".. method:: to_exponential_map()\n"
344 " Return the exponential map representation of the quaternion.\n"
346 " This representation consist of the rotation axis multiplied by the rotation angle.\n"
347 " Such a representation is useful for interpolation between multiple orientations.\n"
349 " :return: exponential map.\n"
350 " :rtype: :class:`Vector` of size 3\n"
352 " To convert back to a quaternion, pass it to the :class:`Quaternion` constructor.\n");
372 ".. method:: cross(other)\n"
374 " Return the cross product of this quaternion and another.\n"
376 " :arg other: The other quaternion to perform the cross product with.\n"
377 " :type other: :class:`Quaternion`\n"
378 " :return: The cross product.\n"
379 " :rtype: :class:`Quaternion`\n");
389 tquat,
QUAT_SIZE,
QUAT_SIZE, value,
"Quaternion.cross(other), invalid 'other' arg") ==
405 ".. method:: dot(other)\n"
407 " Return the dot product of this quaternion and another.\n"
409 " :arg other: The other quaternion to perform the dot product with.\n"
410 " :type other: :class:`Quaternion`\n"
411 " :return: The dot product.\n"
437 ".. function:: rotation_difference(other)\n"
439 " Returns a quaternion representing the rotational difference.\n"
441 " :arg other: second quaternion.\n"
442 " :type other: :class:`Quaternion`\n"
443 " :return: the rotational difference between the two quat rotations.\n"
444 " :rtype: :class:`Quaternion`\n");
457 "Quaternion.rotation_difference(other), invalid 'other' arg") == -1) {
473 ".. function:: slerp(other, factor)\n"
475 " Returns the interpolation of two quaternions.\n"
477 " :arg other: value to interpolate with.\n"
478 " :type other: :class:`Quaternion`\n"
479 " :arg factor: The interpolation value in [0.0, 1.0].\n"
480 " :type factor: float\n"
481 " :return: The interpolated rotation.\n"
482 " :rtype: :class:`Quaternion`\n");
488 if (!PyArg_ParseTuple(args,
"Of:slerp", &value, &fac)) {
489 PyErr_SetString(PyExc_TypeError,
491 "expected Quaternion types and float");
500 tquat,
QUAT_SIZE,
QUAT_SIZE, value,
"Quaternion.slerp(other), invalid 'other' arg") ==
505 if (fac > 1.0f || fac < 0.0f) {
506 PyErr_SetString(PyExc_ValueError,
508 "interpolation factor must be between 0.0 and 1.0");
524 ".. method:: rotate(other)\n"
526 " Rotates the quaternion by another mathutils value.\n"
528 " :arg other: rotation component of mathutils value\n"
529 " :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n");
532 float self_rmat[3][3], other_rmat[3][3], rmat[3][3];
560 ".. method:: make_compatible(other)\n"
562 " Make this quaternion compatible with another,\n"
563 " so interpolating between them works as intended.\n");
577 "Quaternion.make_compatible(other), invalid 'other' arg") == -1) {
601 ".. function:: normalize()\n"
603 " Normalize the quaternion.\n");
616 ".. function:: normalized()\n"
618 " Return a new normalized quaternion.\n"
620 " :return: a normalized copy.\n"
621 " :rtype: :class:`Quaternion`\n");
637 ".. function:: invert()\n"
639 " Set the quaternion to its inverse.\n");
652 ".. function:: inverted()\n"
654 " Return a new, inverted quaternion.\n"
656 " :return: the inverted value.\n"
657 " :rtype: :class:`Quaternion`\n");
670 ".. function:: identity()\n"
672 " Set the quaternion to an identity quaternion.\n"
674 " :rtype: :class:`Quaternion`\n");
694 ".. function:: negate()\n"
696 " Set the quaternion to its negative.\n"
698 " :rtype: :class:`Quaternion`\n");
718 ".. function:: conjugate()\n"
720 " Set the quaternion to its conjugate (negate x, y, z).\n");
733 ".. function:: conjugated()\n"
735 " Return a new conjugated quaternion.\n"
737 " :return: a new quaternion.\n"
738 " :rtype: :class:`Quaternion`\n");
751 ".. function:: copy()\n"
753 " Returns a copy of this quaternion.\n"
755 " :return: A copy of the quaternion.\n"
756 " :rtype: :class:`Quaternion`\n"
758 " .. note:: use this to get a copy of a wrapped quaternion with\n"
759 " no reference to the original data.\n");
784 PyObject *
ret, *tuple;
792 ret = PyUnicode_FromFormat(
"Quaternion(%R)", tuple);
798 #ifndef MATH_STANDALONE
810 "<Quaternion (w=%.4f, x=%.4f, y=%.4f, z=%.4f)>",
847 res = ok ? Py_False : Py_True;
854 res = Py_NotImplemented;
861 return Py_INCREF_RET(res);
903 PyErr_SetString(PyExc_IndexError,
904 "quaternion[attribute]: "
905 "array index out of range");
913 return PyFloat_FromDouble(
self->quat[i]);
925 f = (
float)PyFloat_AsDouble(ob);
927 if (f == -1.0f && PyErr_Occurred()) {
928 PyErr_SetString(PyExc_TypeError,
929 "quaternion[index] = x: "
930 "assigned value not a number");
939 PyErr_SetString(PyExc_IndexError,
940 "quaternion[attribute] = x: "
941 "array assignment index out of range");
968 begin =
MIN2(begin, end);
970 tuple = PyTuple_New(end - begin);
972 PyTuple_SET_ITEM(tuple,
count - begin, PyFloat_FromDouble(
self->quat[
count]));
993 begin =
MIN2(begin, end);
996 quat, 0,
QUAT_SIZE, seq,
"mathutils.Quaternion[begin:end] = []")) == -1) {
1000 if (
size != (end - begin)) {
1001 PyErr_SetString(PyExc_ValueError,
1002 "quaternion[begin:end] = []: "
1003 "size mismatch in slice assignment");
1008 for (i = 0; i <
size; i++) {
1009 self->quat[begin + i] = quat[i];
1019 if (PyIndex_Check(item)) {
1021 i = PyNumber_AsSsize_t(item, PyExc_IndexError);
1022 if (i == -1 && PyErr_Occurred()) {
1030 if (PySlice_Check(item)) {
1031 Py_ssize_t start, stop, step, slicelength;
1033 if (PySlice_GetIndicesEx(item,
QUAT_SIZE, &start, &stop, &step, &slicelength) < 0) {
1037 if (slicelength <= 0) {
1038 return PyTuple_New(0);
1044 PyErr_SetString(PyExc_IndexError,
"slice steps not supported with quaternions");
1049 PyExc_TypeError,
"quaternion indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
1056 if (PyIndex_Check(item)) {
1057 Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
1058 if (i == -1 && PyErr_Occurred()) {
1066 if (PySlice_Check(item)) {
1067 Py_ssize_t start, stop, step, slicelength;
1069 if (PySlice_GetIndicesEx(item,
QUAT_SIZE, &start, &stop, &step, &slicelength) < 0) {
1077 PyErr_SetString(PyExc_IndexError,
"slice steps not supported with quaternion");
1082 PyExc_TypeError,
"quaternion indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
1099 PyErr_Format(PyExc_TypeError,
1100 "Quaternion addition: (%s + %s) "
1101 "invalid type for this operation",
1102 Py_TYPE(
q1)->tp_name,
1103 Py_TYPE(q2)->tp_name);
1113 add_qt_qtqt(quat, quat1->quat, quat2->quat, 1.0f);
1125 PyErr_Format(PyExc_TypeError,
1126 "Quaternion subtraction: (%s - %s) "
1127 "invalid type for this operation",
1128 Py_TYPE(
q1)->tp_name,
1129 Py_TYPE(q2)->tp_name);
1141 quat[
x] = quat1->quat[
x] - quat2->quat[
x];
1174 if (quat1 && quat2) {
1181 if (((scalar = PyFloat_AsDouble(
q1)) == -1.0f && PyErr_Occurred()) == 0) {
1186 if ((((scalar = PyFloat_AsDouble(q2)) == -1.0f && PyErr_Occurred()) == 0)) {
1191 PyErr_Format(PyExc_TypeError,
1192 "Element-wise multiplication: "
1193 "not supported between '%.200s' and '%.200s' types",
1194 Py_TYPE(
q1)->tp_name,
1195 Py_TYPE(q2)->tp_name);
1218 if (quat1 && quat2) {
1221 else if (quat1 && (((scalar = PyFloat_AsDouble(q2)) == -1.0f && PyErr_Occurred()) == 0)) {
1226 PyErr_Format(PyExc_TypeError,
1227 "Element-wise multiplication: "
1228 "not supported between '%.200s' and '%.200s' types",
1229 Py_TYPE(
q1)->tp_name,
1230 Py_TYPE(q2)->tp_name);
1258 if (quat1 && quat2) {
1269 PyErr_SetString(PyExc_ValueError,
1270 "Vector multiplication: "
1271 "only 3D vector rotations (with quats) "
1272 "currently supported");
1286 PyErr_Format(PyExc_TypeError,
1287 "Quaternion multiplication: "
1288 "not supported between '%.200s' and '%.200s' types",
1289 Py_TYPE(
q1)->tp_name,
1290 Py_TYPE(q2)->tp_name);
1313 if (quat1 && quat2) {
1318 PyErr_Format(PyExc_TypeError,
1319 "In place quaternion multiplication: "
1320 "not supported between '%.200s' and '%.200s' types",
1321 Py_TYPE(
q1)->tp_name,
1322 Py_TYPE(q2)->tp_name);
1355 (ssizessizeargfunc)
NULL,
1357 (ssizessizeobjargproc)
NULL,
1414 PyDoc_STRVAR(Quaternion_axis_doc,
"Quaternion axis value.\n\n:type: float");
1425 PyDoc_STRVAR(Quaternion_magnitude_doc,
"Size of the quaternion (read-only).\n\n:type: float");
1435 PyDoc_STRVAR(Quaternion_angle_doc,
"Angle of the quaternion.\n\n:type: float");
1451 return PyFloat_FromDouble(
angle);
1459 float axis[3], angle_dummy;
1469 angle = PyFloat_AsDouble(value);
1471 if (
angle == -1.0f && PyErr_Occurred()) {
1472 PyErr_SetString(PyExc_TypeError,
"Quaternion.angle = value: float expected");
1490 PyDoc_STRVAR(Quaternion_axis_vector_doc,
"Quaternion axis as a vector.\n\n:type: :class:`Vector`");
1553 Quaternion_axis_doc,
1558 Quaternion_axis_doc,
1563 Quaternion_axis_doc,
1568 Quaternion_axis_doc,
1574 Quaternion_angle_doc,
1579 Quaternion_axis_vector_doc,
1627 Quaternion_to_axis_angle_doc},
1631 Quaternion_to_swing_twist_doc},
1632 {
"to_exponential_map",
1635 Quaternion_to_exponential_map_doc},
1639 {
"dot", (PyCFunction)
Quaternion_dot, METH_O, Quaternion_dot_doc},
1640 {
"rotation_difference",
1643 Quaternion_rotation_difference_doc},
1644 {
"slerp", (PyCFunction)
Quaternion_slerp, METH_VARARGS, Quaternion_slerp_doc},
1649 Quaternion_make_compatible_doc},
1654 {
"copy", (PyCFunction)
Quaternion_copy, METH_NOARGS, Quaternion_copy_doc},
1655 {
"__copy__", (PyCFunction)
Quaternion_copy, METH_NOARGS, Quaternion_copy_doc},
1667 ".. class:: Quaternion([seq, [angle]])\n"
1669 " This object gives access to Quaternions in Blender.\n"
1671 " :param seq: size 3 or 4\n"
1672 " :type seq: :class:`Vector`\n"
1673 " :param angle: rotation angle, in radians\n"
1674 " :type angle: float\n"
1676 " The constructor takes arguments in various forms:\n"
1679 " Create an identity quaternion\n"
1681 " Create a quaternion from a ``(w, x, y, z)`` vector.\n"
1682 " (*exponential_map*)\n"
1683 " Create a quaternion from a 3d exponential map vector.\n"
1685 " .. seealso:: :meth:`to_exponential_map`\n"
1686 " (*axis, angle*)\n"
1687 " Create a quaternion representing a rotation of *angle* radians over *axis*.\n"
1689 " .. seealso:: :meth:`to_axis_angle`\n");
1691 PyVarObject_HEAD_INIT(
NULL, 0)
"Quaternion",
1705 #ifndef MATH_STANDALONE
1713 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
1753 quat_alloc = PyMem_Malloc(
QUAT_SIZE *
sizeof(
float));
1755 PyErr_SetString(PyExc_MemoryError,
1757 "problem allocating data");
1763 self->quat = quat_alloc;
1765 self->cb_user =
NULL;
1766 self->cb_type =
self->cb_subtype = 0;
1778 PyMem_Free(quat_alloc);
1781 return (PyObject *)
self;
1791 self->cb_user =
NULL;
1792 self->cb_type =
self->cb_subtype = 0;
1798 return (PyObject *)
self;
1806 self->cb_user = cb_user;
1807 self->cb_type = cb_type;
1808 self->cb_subtype = cb_subtype;
1809 PyObject_GC_Track(
self);
1812 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)
bool is_negative_m3(const float mat[3][3])
void negate_m3(float R[3][3])
void normalize_m3(float R[3][3]) ATTR_NONNULL()
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void rotation_between_quats_to_quat(float q[4], const float q1[4], const float q2[4])
void interp_qt_qtqt(float q[4], const float a[4], const float b[4], float t)
void axis_angle_to_quat(float r[4], const float axis[3], float angle)
float normalize_qt(float q[4])
void invert_qt(float q[4])
void mul_qt_fl(float q[4], float f)
void mul_qt_v3(const float q[4], float r[3])
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 quat_to_compatible_eulO(float eul[3], const float old[3], short order, const float quat[4])
void quat_to_eulO(float eul[3], short order, const float quat[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 add_qt_qtqt(float q[4], const float a[4], const float b[4], 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 mat3_normalized_to_quat(float q[4], const float mat[3][3])
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
MINLINE void negate_v4_v4(float r[4], const float a[4])
void mul_vn_vn(float *array_tar, const float *array_src, int size)
void mul_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size)
#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 Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
SyclQueue void void size_t num_bytes void
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)
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
char BaseMathObject_is_valid_doc[]
PyObject * BaseMathObject_owner_get(BaseMathObject *self, void *UNUSED(closure))
char BaseMathObject_is_wrapped_doc[]
char BaseMathObject_is_frozen_doc[]
int mathutils_any_to_rotmat(float rmat[3][3], PyObject *value, const char *error_prefix)
PyObject * BaseMathObject_is_valid_get(BaseMathObject *self, void *UNUSED(closure))
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 col_num, const ushort row_num, 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 vec_num, PyTypeObject *base_type)
#define VectorObject_Check(v)
T length(const vec_base< T, Size > &a)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
int PyC_CheckArgs_DeepCopy(PyObject *args)
#define PyTuple_SET_ITEMS(op_arg,...)