Blender
V3.3
|
#include <Python.h>
#include "mathutils.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "../generic/py_capi_utils.h"
#include "BLI_dynstr.h"
Go to the source code of this file.
Macros | |
#define | MAX_DIMENSIONS 4 |
#define | SWIZZLE_BITS_PER_AXIS 3 |
#define | SWIZZLE_VALID_AXIS 0x4 |
#define | SWIZZLE_AXIS 0x3 |
Functions | |
Vector Methods: Copy/Deep-Copy | |
static PyObject * | Vector_copy (VectorObject *self) |
static PyObject * | Vector_deepcopy (VectorObject *self, PyObject *args) |
PyDoc_STRVAR (Vector_copy_doc, ".. function:: copy()\n" "\n" " Returns a copy of this vector.\n" "\n" " :return: A copy of the vector.\n" " :rtype: :class:`Vector`\n" "\n" " .. note:: use this to get a copy of a wrapped vector with\n" " no reference to the original data.\n") | |
Utilities | |
static int | row_vector_multiplication (float r_vec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat) |
static PyObject * | vec__apply_to_copy (PyObject *(*vec_func)(VectorObject *), VectorObject *self) |
static PyObject * | Vector_to_tuple_ex (VectorObject *self, int ndigits) |
Vector Type: <tt>__new__</tt> / <tt>mathutils.Vector()</tt> | |
static PyObject * | Vector_new (PyTypeObject *type, PyObject *args, PyObject *kwds) |
Vector Class Methods | |
PyDoc_STRVAR (C_Vector_Fill_doc, ".. classmethod:: Fill(size, fill=0.0)\n" "\n" " Create a vector of length size with all values set to fill.\n" "\n" " :arg size: The length of the vector to be created.\n" " :type size: int\n" " :arg fill: The value used to fill the vector.\n" " :type fill: float\n") | |
static PyObject * | C_Vector_Fill (PyObject *cls, PyObject *args) |
PyDoc_STRVAR (C_Vector_Range_doc, ".. classmethod:: Range(start, stop, step=1)\n" "\n" " Create a filled with a range of values.\n" "\n" " :arg start: The start of the range used to fill the vector.\n" " :type start: int\n" " :arg stop: The end of the range used to fill the vector.\n" " :type stop: int\n" " :arg step: The step between successive values in the vector.\n" " :type step: int\n") | |
static PyObject * | C_Vector_Range (PyObject *cls, PyObject *args) |
PyDoc_STRVAR (C_Vector_Linspace_doc, ".. classmethod:: Linspace(start, stop, size)\n" "\n" " Create a vector of the specified size which is filled with linearly spaced " "values between start and stop values.\n" "\n" " :arg start: The start of the range used to fill the vector.\n" " :type start: int\n" " :arg stop: The end of the range used to fill the vector.\n" " :type stop: int\n" " :arg size: The size of the vector to be created.\n" " :type size: int\n") | |
static PyObject * | C_Vector_Linspace (PyObject *cls, PyObject *args) |
PyDoc_STRVAR (C_Vector_Repeat_doc, ".. classmethod:: Repeat(vector, size)\n" "\n" " Create a vector by repeating the values in vector until the required size is reached.\n" "\n" " :arg tuple: The vector to draw values from.\n" " :type tuple: :class:`mathutils.Vector`\n" " :arg size: The size of the vector to be created.\n" " :type size: int\n") | |
static PyObject * | C_Vector_Repeat (PyObject *cls, PyObject *args) |
Vector Methods: Zero | |
PyDoc_STRVAR (Vector_zero_doc, ".. method:: zero()\n" "\n" " Set all values to zero.\n") | |
static PyObject * | Vector_zero (VectorObject *self) |
Vector Methods: Normalize | |
PyDoc_STRVAR (Vector_normalize_doc, ".. method:: normalize()\n" "\n" " Normalize the vector, making the length of the vector always 1.0.\n" "\n" " .. warning:: Normalizing a vector where all values are zero has no effect.\n" "\n" " .. note:: Normalize works for vectors of all sizes,\n" " however 4D Vectors w axis is left untouched.\n") | |
static PyObject * | Vector_normalize (VectorObject *self) |
PyDoc_STRVAR (Vector_normalized_doc, ".. method:: normalized()\n" "\n" " Return a new, normalized vector.\n" "\n" " :return: a normalized copy of the vector\n" " :rtype: :class:`Vector`\n") | |
static PyObject * | Vector_normalized (VectorObject *self) |
Vector Methods: Resize | |
PyDoc_STRVAR (Vector_resize_doc, ".. method:: resize(size=3)\n" "\n" " Resize the vector to have size number of elements.\n") | |
static PyObject * | Vector_resize (VectorObject *self, PyObject *value) |
PyDoc_STRVAR (Vector_resized_doc, ".. method:: resized(size=3)\n" "\n" " Return a resized copy of the vector with size number of elements.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n") | |
static PyObject * | Vector_resized (VectorObject *self, PyObject *value) |
PyDoc_STRVAR (Vector_resize_2d_doc, ".. method:: resize_2d()\n" "\n" " Resize the vector to 2D (x, y).\n") | |
static PyObject * | Vector_resize_2d (VectorObject *self) |
PyDoc_STRVAR (Vector_resize_3d_doc, ".. method:: resize_3d()\n" "\n" " Resize the vector to 3D (x, y, z).\n") | |
static PyObject * | Vector_resize_3d (VectorObject *self) |
PyDoc_STRVAR (Vector_resize_4d_doc, ".. method:: resize_4d()\n" "\n" " Resize the vector to 4D (x, y, z, w).\n") | |
static PyObject * | Vector_resize_4d (VectorObject *self) |
Vector Methods: To N-dimensions | |
PyDoc_STRVAR (Vector_to_2d_doc, ".. method:: to_2d()\n" "\n" " Return a 2d copy of the vector.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n") | |
static PyObject * | Vector_to_2d (VectorObject *self) |
PyDoc_STRVAR (Vector_to_3d_doc, ".. method:: to_3d()\n" "\n" " Return a 3d copy of the vector.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n") | |
static PyObject * | Vector_to_3d (VectorObject *self) |
PyDoc_STRVAR (Vector_to_4d_doc, ".. method:: to_4d()\n" "\n" " Return a 4d copy of the vector.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n") | |
static PyObject * | Vector_to_4d (VectorObject *self) |
Vector Methods: To Tuple | |
PyDoc_STRVAR (Vector_to_tuple_doc, ".. method:: to_tuple(precision=-1)\n" "\n" " Return this vector as a tuple with.\n" "\n" " :arg precision: The number to round the value to in [-1, 21].\n" " :type precision: int\n" " :return: the values of the vector rounded by *precision*\n" " :rtype: tuple\n") | |
static PyObject * | Vector_to_tuple (VectorObject *self, PyObject *args) |
Vector Methods: To Track Quaternion | |
PyDoc_STRVAR (Vector_to_track_quat_doc, ".. method:: to_track_quat(track, up)\n" "\n" " Return a quaternion rotation from the vector and the track and up axis.\n" "\n" " :arg track: Track axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z'].\n" " :type track: string\n" " :arg up: Up axis in ['X', 'Y', 'Z'].\n" " :type up: string\n" " :return: rotation from the vector and the track and up axis.\n" " :rtype: :class:`Quaternion`\n") | |
static PyObject * | Vector_to_track_quat (VectorObject *self, PyObject *args) |
Vector Methods: Orthogonal | |
PyDoc_STRVAR (Vector_orthogonal_doc, ".. method:: orthogonal()\n" "\n" " Return a perpendicular vector.\n" "\n" " :return: a new vector 90 degrees from this vector.\n" " :rtype: :class:`Vector`\n" "\n" " .. note:: the axis is undefined, only use when any orthogonal vector is acceptable.\n") | |
static PyObject * | Vector_orthogonal (VectorObject *self) |
Vector Methods: Reflect | |
| |
PyDoc_STRVAR (Vector_reflect_doc, ".. method:: reflect(mirror)\n" "\n" " Return the reflection vector from the *mirror* argument.\n" "\n" " :arg mirror: This vector could be a normal from the reflecting surface.\n" " :type mirror: :class:`Vector`\n" " :return: The reflected vector matching the size of this vector.\n" " :rtype: :class:`Vector`\n") | |
static PyObject * | Vector_reflect (VectorObject *self, PyObject *value) |
Vector Methods: Cross Product | |
PyDoc_STRVAR (Vector_cross_doc, ".. method:: cross(other)\n" "\n" " Return the cross product of this vector and another.\n" "\n" " :arg other: The other vector to perform the cross product with.\n" " :type other: :class:`Vector`\n" " :return: The cross product.\n" " :rtype: :class:`Vector` or float when 2D vectors are used\n" "\n" " .. note:: both vectors must be 2D or 3D\n") | |
static PyObject * | Vector_cross (VectorObject *self, PyObject *value) |
Vector Methods: Dot Product | |
PyDoc_STRVAR (Vector_dot_doc, ".. method:: dot(other)\n" "\n" " Return the dot product of this vector and another.\n" "\n" " :arg other: The other vector to perform the dot product with.\n" " :type other: :class:`Vector`\n" " :return: The dot product.\n" " :rtype: float\n") | |
static PyObject * | Vector_dot (VectorObject *self, PyObject *value) |
Vector Methods: Angle | |
PyDoc_STRVAR (Vector_angle_doc, ".. function:: angle(other, fallback=None)\n" "\n" " Return the angle between two vectors.\n" "\n" " :arg other: another vector to compare the angle with\n" " :type other: :class:`Vector`\n" " :arg fallback: return this when the angle can't be calculated (zero length vector),\n" " (instead of raising a :exc:`ValueError`).\n" " :type fallback: any\n" " :return: angle in radians or fallback when given\n" " :rtype: float\n") | |
static PyObject * | Vector_angle (VectorObject *self, PyObject *args) |
Vector Methods: Angle Signed | |
PyDoc_STRVAR (Vector_angle_signed_doc, ".. function:: angle_signed(other, fallback)\n" "\n" " Return the signed angle between two 2D vectors (clockwise is positive).\n" "\n" " :arg other: another vector to compare the angle with\n" " :type other: :class:`Vector`\n" " :arg fallback: return this when the angle can't be calculated (zero length vector),\n" " (instead of raising a :exc:`ValueError`).\n" " :type fallback: any\n" " :return: angle in radians or fallback when given\n" " :rtype: float\n") | |
static PyObject * | Vector_angle_signed (VectorObject *self, PyObject *args) |
Vector Methods: Rotation Difference | |
PyDoc_STRVAR (Vector_rotation_difference_doc, ".. function:: rotation_difference(other)\n" "\n" " Returns a quaternion representing the rotational difference between this\n" " vector and another.\n" "\n" " :arg other: second vector.\n" " :type other: :class:`Vector`\n" " :return: the rotational difference between the two vectors.\n" " :rtype: :class:`Quaternion`\n" "\n" " .. note:: 2D vectors raise an :exc:`AttributeError`.\n") | |
static PyObject * | Vector_rotation_difference (VectorObject *self, PyObject *value) |
Vector Methods: Project | |
PyDoc_STRVAR (Vector_project_doc, ".. function:: project(other)\n" "\n" " Return the projection of this vector onto the *other*.\n" "\n" " :arg other: second vector.\n" " :type other: :class:`Vector`\n" " :return: the parallel projection vector\n" " :rtype: :class:`Vector`\n") | |
static PyObject * | Vector_project (VectorObject *self, PyObject *value) |
Vector Methods: Linear Interpolation | |
PyDoc_STRVAR (Vector_lerp_doc, ".. function:: lerp(other, factor)\n" "\n" " Returns the interpolation of two vectors.\n" "\n" " :arg other: value to interpolate with.\n" " :type other: :class:`Vector`\n" " :arg factor: The interpolation value in [0.0, 1.0].\n" " :type factor: float\n" " :return: The interpolated vector.\n" " :rtype: :class:`Vector`\n") | |
static PyObject * | Vector_lerp (VectorObject *self, PyObject *args) |
Vector Methods: Spherical Interpolation | |
PyDoc_STRVAR (Vector_slerp_doc, ".. function:: slerp(other, factor, fallback=None)\n" "\n" " Returns the interpolation of two non-zero vectors (spherical coordinates).\n" "\n" " :arg other: value to interpolate with.\n" " :type other: :class:`Vector`\n" " :arg factor: The interpolation value typically in [0.0, 1.0].\n" " :type factor: float\n" " :arg fallback: return this when the vector can't be calculated (zero length " "vector or direct opposites),\n" " (instead of raising a :exc:`ValueError`).\n" " :type fallback: any\n" " :return: The interpolated vector.\n" " :rtype: :class:`Vector`\n") | |
static PyObject * | Vector_slerp (VectorObject *self, PyObject *args) |
Vector Methods: Rotate | |
PyDoc_STRVAR (Vector_rotate_doc, ".. function:: rotate(other)\n" "\n" " Rotate the vector by a rotation value.\n" "\n" " .. note:: 2D vectors are a special case that can only be rotated by a 2x2 matrix.\n" "\n" " :arg other: rotation component of mathutils value\n" " :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n") | |
static PyObject * | Vector_rotate (VectorObject *self, PyObject *value) |
Vector Methods: Negate | |
PyDoc_STRVAR (Vector_negate_doc, ".. method:: negate()\n" "\n" " Set all values to their negative.\n") | |
static PyObject * | Vector_negate (VectorObject *self) |
Vector Type: <tt>__repr__</tt> & <tt>__str__</tt> | |
static PyObject * | Vector_repr (VectorObject *self) |
static PyObject * | Vector_str (VectorObject *self) |
Vector Type: Rich Compare | |
static PyObject * | Vector_richcmpr (PyObject *objectA, PyObject *objectB, int comparison_type) |
Vector Type: Hash (<tt>__hash__</tt>) | |
static Py_hash_t | Vector_hash (VectorObject *self) |
Vector Type: Sequence & Mapping Protocols Implementation | |
static int | Vector_len (VectorObject *self) |
static PyObject * | vector_item_internal (VectorObject *self, int i, const bool is_attr) |
static PyObject * | Vector_item (VectorObject *self, int i) |
static int | vector_ass_item_internal (VectorObject *self, int i, PyObject *value, const bool is_attr) |
static int | Vector_ass_item (VectorObject *self, int i, PyObject *value) |
static PyObject * | Vector_slice (VectorObject *self, int begin, int end) |
static int | Vector_ass_slice (VectorObject *self, int begin, int end, PyObject *seq) |
static PyObject * | Vector_subscript (VectorObject *self, PyObject *item) |
static int | Vector_ass_subscript (VectorObject *self, PyObject *item, PyObject *value) |
Vector Type: Numeric Protocol Implementation | |
static PyObject * | Vector_add (PyObject *v1, PyObject *v2) |
static PyObject * | Vector_iadd (PyObject *v1, PyObject *v2) |
static PyObject * | Vector_sub (PyObject *v1, PyObject *v2) |
static PyObject * | Vector_isub (PyObject *v1, PyObject *v2) |
int | column_vector_multiplication (float r_vec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat) |
static PyObject * | vector_mul_float (VectorObject *vec, const float scalar) |
static PyObject * | vector_mul_vec (VectorObject *vec1, VectorObject *vec2) |
static PyObject * | Vector_mul (PyObject *v1, PyObject *v2) |
static PyObject * | Vector_imul (PyObject *v1, PyObject *v2) |
static PyObject * | Vector_matmul (PyObject *v1, PyObject *v2) |
static PyObject * | Vector_imatmul (PyObject *v1, PyObject *v2) |
static PyObject * | Vector_div (PyObject *v1, PyObject *v2) |
static PyObject * | Vector_idiv (PyObject *v1, PyObject *v2) |
static PyObject * | Vector_neg (VectorObject *self) |
Vector Type: C/API Constructors | |
PyObject * | Vector_CreatePyObject (const float *vec, const int vec_num, PyTypeObject *base_type) |
PyObject * | Vector_CreatePyObject_wrap (float *vec, const int vec_num, PyTypeObject *base_type) |
PyObject * | Vector_CreatePyObject_cb (PyObject *cb_user, int vec_num, uchar cb_type, uchar cb_subtype) |
PyObject * | Vector_CreatePyObject_alloc (float *vec, const int vec_num, PyTypeObject *base_type) |
Variables | |
Vector Type: Protocol Declarations | |
static PySequenceMethods | Vector_SeqMethods |
static PyMappingMethods | Vector_AsMapping |
static PyNumberMethods | Vector_NumMethods |
Vector Type: Get/Set Item Definitions | |
static PyGetSetDef | Vector_getseters [] |
Vector Type: Method Definitions | |
static struct PyMethodDef | Vector_methods [] |
Vector Type: Get/Set Item Implementation | |
#define | _SWIZZLE1(a) ((a) | SWIZZLE_VALID_AXIS) |
#define | _SWIZZLE2(a, b) (_SWIZZLE1(a) | (((b) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS))) |
#define | _SWIZZLE3(a, b, c) (_SWIZZLE2(a, b) | (((c) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))) |
#define | _SWIZZLE4(a, b, c, d) (_SWIZZLE3(a, b, c) | (((d) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) |
#define | SWIZZLE2(a, b) POINTER_FROM_INT(_SWIZZLE2(a, b)) |
#define | SWIZZLE3(a, b, c) POINTER_FROM_INT(_SWIZZLE3(a, b, c)) |
#define | SWIZZLE4(a, b, c, d) POINTER_FROM_INT(_SWIZZLE4(a, b, c, d)) |
PyDoc_STRVAR (Vector_axis_x_doc, "Vector X axis.\n\n:type: float") | |
PyDoc_STRVAR (Vector_axis_y_doc, "Vector Y axis.\n\n:type: float") | |
PyDoc_STRVAR (Vector_axis_z_doc, "Vector Z axis (3D Vectors only).\n\n:type: float") | |
PyDoc_STRVAR (Vector_axis_w_doc, "Vector W axis (4D Vectors only).\n\n:type: float") | |
static PyObject * | Vector_axis_get (VectorObject *self, void *type) |
static int | Vector_axis_set (VectorObject *self, PyObject *value, void *type) |
PyDoc_STRVAR (Vector_length_doc, "Vector Length.\n\n:type: float") | |
static PyObject * | Vector_length_get (VectorObject *self, void *UNUSED(closure)) |
static int | Vector_length_set (VectorObject *self, PyObject *value) |
PyDoc_STRVAR (Vector_length_squared_doc, "Vector length squared (v.dot(v)).\n\n:type: float") | |
static PyObject * | Vector_length_squared_get (VectorObject *self, void *UNUSED(closure)) |
static PyObject * | Vector_swizzle_get (VectorObject *self, void *closure) |
static int | Vector_swizzle_set (VectorObject *self, PyObject *value, void *closure) |
Vector Type: Python Object Definition | |
| |
PyTypeObject | vector_Type |
PyDoc_STRVAR (vector_doc, ".. class:: Vector(seq)\n" "\n" " This object gives access to Vectors in Blender.\n" "\n" " :param seq: Components of the vector, must be a sequence of at least two\n" " :type seq: sequence of numbers\n") | |
#define _SWIZZLE1 | ( | a | ) | ((a) | SWIZZLE_VALID_AXIS) |
Definition at line 2722 of file mathutils_Vector.c.
#define _SWIZZLE2 | ( | a, | |
b | |||
) | (_SWIZZLE1(a) | (((b) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS))) |
Definition at line 2723 of file mathutils_Vector.c.
#define _SWIZZLE3 | ( | a, | |
b, | |||
c | |||
) | (_SWIZZLE2(a, b) | (((c) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))) |
Definition at line 2724 of file mathutils_Vector.c.
#define _SWIZZLE4 | ( | a, | |
b, | |||
c, | |||
d | |||
) | (_SWIZZLE3(a, b, c) | (((d) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) |
Definition at line 2726 of file mathutils_Vector.c.
#define MAX_DIMENSIONS 4 |
Higher dimensions are supported, for many common operations (dealing with vector/matrix multiply or handling as 3D locations) stack memory is used with a fixed size - defined here.
Definition at line 25 of file mathutils_Vector.c.
#define SWIZZLE2 | ( | a, | |
b | |||
) | POINTER_FROM_INT(_SWIZZLE2(a, b)) |
Definition at line 2729 of file mathutils_Vector.c.
#define SWIZZLE3 | ( | a, | |
b, | |||
c | |||
) | POINTER_FROM_INT(_SWIZZLE3(a, b, c)) |
Definition at line 2730 of file mathutils_Vector.c.
#define SWIZZLE4 | ( | a, | |
b, | |||
c, | |||
d | |||
) | POINTER_FROM_INT(_SWIZZLE4(a, b, c, d)) |
Definition at line 2731 of file mathutils_Vector.c.
#define SWIZZLE_AXIS 0x3 |
Definition at line 34 of file mathutils_Vector.c.
#define SWIZZLE_BITS_PER_AXIS 3 |
Swizzle axes get packed into a single value that is used as a closure. Each axis uses SWIZZLE_BITS_PER_AXIS bits. The first bit (SWIZZLE_VALID_AXIS) is used as a sentinel: if it is unset, the axis is not valid.
Definition at line 32 of file mathutils_Vector.c.
#define SWIZZLE_VALID_AXIS 0x4 |
Definition at line 33 of file mathutils_Vector.c.
|
static |
Definition at line 189 of file mathutils_Vector.c.
References copy_vn_fl(), NULL, and Vector_CreatePyObject_alloc().
|
static |
Definition at line 305 of file mathutils_Vector.c.
References NULL, range_vn_fl(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 229 of file mathutils_Vector.c.
References NULL, range_vn_fl(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 346 of file mathutils_Vector.c.
References mathutils_array_parse_alloc(), NULL, and Vector_CreatePyObject_alloc().
int column_vector_multiplication | ( | float | r_vec[MAX_DIMENSIONS], |
VectorObject * | vec, | ||
MatrixObject * | mat | ||
) |
Definition at line 2047 of file mathutils_Vector.c.
References col, MatrixObject::col_num, double(), float(), MATRIX_ITEM, MAX_DIMENSIONS, MatrixObject::row_num, VectorObject::vec_num, and z.
PyDoc_STRVAR | ( | C_Vector_Fill_doc | , |
".. classmethod:: Fill(size, fill=0.0)\n" "\n" " Create a vector of length size with all values set to fill.\n" "\n" " :arg size: The length of the vector to be created.\n" " :type size: int\n" " :arg fill: The value used to fill the vector.\n" " :type fill: float\n" | |||
) |
PyDoc_STRVAR | ( | C_Vector_Linspace_doc | , |
".. classmethod:: Linspace(start, stop, size)\n" "\n" " Create a vector of the specified size which is filled with linearly spaced " "values between start and stop values.\n" "\n" " :arg start: The start of the range used to fill the vector.\n" " :type start: int\n" " :arg stop: The end of the range used to fill the vector.\n" " :type stop: int\n" " :arg size: The size of the vector to be created.\n" " :type size: int\n" | |||
) |
PyDoc_STRVAR | ( | C_Vector_Range_doc | , |
".. classmethod:: Range(start, stop, step=1)\n" "\n" " Create a filled with a range of values.\n" "\n" " :arg start: The start of the range used to fill the vector.\n" " :type start: int\n" " :arg stop: The end of the range used to fill the vector.\n" " :type stop: int\n" " :arg step: The step between successive values in the vector.\n" " :type step: int\n" | |||
) |
PyDoc_STRVAR | ( | C_Vector_Repeat_doc | , |
".. classmethod:: Repeat(vector, size)\n" "\n" " Create a vector by repeating the values in vector until the required size is reached.\n" "\n" " :arg tuple: The vector to draw values from.\n" " :type tuple: :class:`mathutils.Vector`\n" " :arg size: The size of the vector to be created.\n" " :type size: int\n" | |||
) |
PyDoc_STRVAR | ( | Vector_angle_doc | , |
".. function:: | angleother, fallback=None)\n" "\n" " Return the angle between two vectors.\n" "\n" " :arg other: another vector to compare the angle with\n" " :type other: :class:`Vector`\n" " :arg fallback: return this when the angle can't be calculated (zero length vector, | ||
\n" "(instead of raising a :exc:`ValueError`).\n" " :type fallback:any\n" " :return:angle in radians or fallback when given\n" " :rtype:float\n" | |||
) |
PyDoc_STRVAR | ( | Vector_angle_signed_doc | , |
".. function:: | angle_signedother, fallback)\n" "\n" " Return the signed angle between two 2D vectors (clockwise is positive).\n" "\n" " :arg other: another vector to compare the angle with\n" " :type other: :class:`Vector`\n" " :arg fallback: return this when the angle can't be calculated (zero length vector, | ||
\n" "(instead of raising a :exc:`ValueError`).\n" " :type fallback:any\n" " :return:angle in radians or fallback when given\n" " :rtype:float\n" | |||
) |
PyDoc_STRVAR | ( | Vector_copy_doc | , |
".. function:: copy()\n" "\n" " Returns a copy of this vector.\n" "\n" " :return: A copy of the vector.\n" " :rtype: :class:`Vector`\n" "\n" " .. note:: use this to get a copy of a wrapped vector with\n" " no reference to the original data.\n" | |||
) |
PyDoc_STRVAR | ( | Vector_cross_doc | , |
".. method:: cross(other)\n" "\n" " Return the cross product of this vector and another.\n" "\n" " :arg other: The other vector to perform the cross product with.\n" " :type other: :class:`Vector`\n" " :return: The cross product.\n" " :rtype: :class:`Vector` or float when 2D vectors are used\n" "\n" " .. note:: both vectors must be 2D or 3D\n" | |||
) |
PyDoc_STRVAR | ( | vector_doc | , |
".. class:: Vector(seq)\n" "\n" " This object gives access to Vectors in Blender.\n" "\n" " :param seq: Components of the | vector, | ||
must be a sequence of at least two\n" " :type seq:sequence of numbers\n" | |||
) |
PyDoc_STRVAR | ( | Vector_dot_doc | , |
".. method:: dot(other)\n" "\n" " Return the dot product of this vector and another.\n" "\n" " :arg other: The other vector to perform the dot product with.\n" " :type other: :class:`Vector`\n" " :return: The dot product.\n" " :rtype: float\n" | |||
) |
PyDoc_STRVAR | ( | Vector_length_doc | , |
"Vector Length.\n\n:type: float" | |||
) |
PyDoc_STRVAR | ( | Vector_lerp_doc | , |
".. function:: lerp(other, factor)\n" "\n" " Returns the interpolation of two vectors.\n" "\n" " :arg other: value to interpolate with.\n" " :type other: :class:`Vector`\n" " :arg factor: The interpolation value in .\n" " :type factor: float\n" " :return: The interpolated vector.\n" " :rtype: :class:`Vector`\n" | [0.0, 1.0] | ||
) |
PyDoc_STRVAR | ( | Vector_negate_doc | , |
".. method:: negate()\n" "\n" " Set all values to their negative.\n" | |||
) |
PyDoc_STRVAR | ( | Vector_normalize_doc | , |
".. method:: normalize()\n" "\n" " Normalize the | vector, | ||
making the length of the vector always 1.0.\n" "\n" " .. warning::Normalizing a vector where all values are zero has no effect.\n" "\n" " .. note::Normalize works for vectors of all | sizes, | ||
\n" " however 4D Vectors w axis is left untouched.\n" | |||
) |
PyDoc_STRVAR | ( | Vector_normalized_doc | , |
".. method:: normalized()\n" "\n" " Return a | new, | ||
normalized vector.\n" "\n" " :return:a normalized copy of the vector\n" " :rtype::class:`Vector`\n" | |||
) |
PyDoc_STRVAR | ( | Vector_orthogonal_doc | , |
".. method:: orthogonal()\n" "\n" " Return a perpendicular vector.\n" "\n" " :return: a new vector 90 degrees from this vector.\n" " :rtype: :class:`Vector`\n" "\n" " .. note:: the axis is | undefined, | ||
only use when any orthogonal vector is acceptable.\n" | |||
) |
PyDoc_STRVAR | ( | Vector_project_doc | , |
".. function:: project(other)\n" "\n" " Return the projection of this vector onto the *other*.\n" "\n" " :arg other: second vector.\n" " :type other: :class:`Vector`\n" " :return: the parallel projection vector\n" " :rtype: :class:`Vector`\n" | |||
) |
PyDoc_STRVAR | ( | Vector_reflect_doc | , |
".. method:: reflect(mirror)\n" "\n" " Return the reflection vector from the *mirror* argument.\n" "\n" " :arg mirror: This vector could be a normal from the reflecting surface.\n" " :type mirror: :class:`Vector`\n" " :return: The reflected vector matching the size of this vector.\n" " :rtype: :class:`Vector`\n" | |||
) |
PyDoc_STRVAR | ( | Vector_resize_2d_doc | , |
".. method:: resize_2d()\n" "\n" " Resize the vector to 2D (x, y).\n" | |||
) |
PyDoc_STRVAR | ( | Vector_resize_3d_doc | , |
".. method:: resize_3d()\n" "\n" " Resize the vector to 3D (x, y, z).\n" | |||
) |
PyDoc_STRVAR | ( | Vector_resize_4d_doc | , |
".. method:: resize_4d()\n" "\n" " Resize the vector to 4D (x, y, z, w).\n" | |||
) |
PyDoc_STRVAR | ( | Vector_resize_doc | , |
".. method:: resize(size=3)\n" "\n" " Resize the vector to have size number of elements.\n" | |||
) |
PyDoc_STRVAR | ( | Vector_resized_doc | , |
".. method:: resized(size=3)\n" "\n" " Return a resized copy of the vector with size number of elements.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n" | |||
) |
PyDoc_STRVAR | ( | Vector_rotate_doc | , |
".. function:: rotate(other)\n" "\n" " Rotate the vector by a rotation value.\n" "\n" " .. note:: 2D vectors are a special case that can only be rotated by a 2x2 matrix.\n" "\n" " :arg other: rotation component of mathutils value\n" " :type other: :class:`Euler` | , | ||
:class:`Quaternion` or :class:`Matrix`\n" | |||
) |
PyDoc_STRVAR | ( | Vector_rotation_difference_doc | , |
".. function:: rotation_difference(other)\n" "\n" " Returns a quaternion representing the rotational difference between this\n" " vector and another.\n" "\n" " :arg other: second vector.\n" " :type other: :class:`Vector`\n" " :return: the rotational difference between the two vectors.\n" " :rtype: :class:`Quaternion`\n" "\n" " .. note:: 2D vectors raise an :exc:`AttributeError`.\n" | |||
) |
PyDoc_STRVAR | ( | Vector_slerp_doc | , |
".. function:: | slerp(other, factor, fallback=None)\n" "\n" " Returns the interpolation of two non-zero vectors (spherical coordinates).\n" "\n" " :arg other: value to interpolate with.\n" " :type other: :class:`Vector`\n" " :arg factor: The interpolation value typically in .\n" " :type factor: float\n" " :arg fallback: return this when the vector can't be calculated (zero length " "vector or direct opposites)[0.0, 1.0], | ||
\n" "(instead of raising a :exc:`ValueError`).\n" " :type fallback:any\n" " :return:The interpolated vector.\n" " :rtype::class:`Vector`\n" | |||
) |
PyDoc_STRVAR | ( | Vector_to_2d_doc | , |
".. method:: to_2d()\n" "\n" " Return a 2d copy of the vector.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n" | |||
) |
PyDoc_STRVAR | ( | Vector_to_3d_doc | , |
".. method:: to_3d()\n" "\n" " Return a 3d copy of the vector.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n" | |||
) |
PyDoc_STRVAR | ( | Vector_to_4d_doc | , |
".. method:: to_4d()\n" "\n" " Return a 4d copy of the vector.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n" | |||
) |
PyDoc_STRVAR | ( | Vector_to_track_quat_doc | , |
".. method:: to_track_quat(track, up)\n" "\n" " Return a quaternion rotation from the vector and the track and up axis.\n" "\n" " :arg track: Track axis in .\n" " :type track: string\n" " :arg up: Up axis in .\n" " :type up: string\n" " :return: rotation from the vector and the track and up axis.\n" " :rtype: :class:`Quaternion`\n" | [ 'X', 'Y', 'Z', '-X', '-Y', '-Z'][ 'X', 'Y', 'Z'] | ||
) |
PyDoc_STRVAR | ( | Vector_to_tuple_doc | , |
".. method:: to_tuple(precision=-1)\n" "\n" " Return this vector as a tuple with.\n" "\n" " :arg precision: The number to round the value to in .\n" " :type precision: int\n" " :return: the values of the vector rounded by *precision*\n" " :rtype: tuple\n" | [-1, 21] | ||
) |
PyDoc_STRVAR | ( | Vector_zero_doc | , |
".. method:: zero()\n" "\n" " Set all values to zero.\n" | |||
) |
|
static |
Row vector multiplication - (Vector * Matrix)
[x][y][z] * [1][4][7] [2][5][8] [3][6][9]
Definition at line 52 of file mathutils_Vector.c.
References BaseMath_ReadCallback, col, MatrixObject::col_num, double(), float(), MATRIX_ITEM, MAX_DIMENSIONS, MatrixObject::row_num, VectorObject::vec_num, and z.
Referenced by Vector_matmul().
|
static |
Definition at line 89 of file mathutils_Vector.c.
References NULL, ret, and Vector_copy().
Referenced by Vector_normalized().
|
static |
Addition: object + object
.
Definition at line 1895 of file mathutils_Vector.c.
References add_vn_vnvn(), BaseMath_ReadCallback, NULL, v1, v2, VectorObject::vec_num, Vector_CreatePyObject_alloc(), and VectorObject_Check.
|
static |
Definition at line 1074 of file mathutils_Vector.c.
References BaseMath_ReadCallback, double(), mathutils_array_parse(), MAX_DIMENSIONS, MIN2, NULL, saacos(), self, sqrt(), and x.
|
static |
Definition at line 1145 of file mathutils_Vector.c.
References angle_signed_v2v2(), BaseMath_ReadCallback, is_zero_v2(), mathutils_array_parse(), NULL, and self.
|
static |
Sequence accessor (set): object[i] = x
.
Definition at line 1750 of file mathutils_Vector.c.
References vector_ass_item_internal().
Referenced by Vector_ass_subscript().
|
static |
Definition at line 1707 of file mathutils_Vector.c.
References BaseMath_Prepare_ForWrite, BaseMath_WriteIndexCallback, and self.
Referenced by Vector_ass_item(), and Vector_axis_set().
|
static |
Sequence slice accessor (set): object[i:j] = x
.
Definition at line 1781 of file mathutils_Vector.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, CLAMP, mathutils_array_parse_alloc(), MIN2, NULL, and self.
Referenced by Vector_ass_subscript().
|
static |
Sequence generic subscript (set): object[...] = x
.
Definition at line 1856 of file mathutils_Vector.c.
References self, Vector_ass_item(), and Vector_ass_slice().
|
static |
Definition at line 2460 of file mathutils_Vector.c.
References POINTER_AS_INT, type, and vector_item_internal().
|
static |
Definition at line 2465 of file mathutils_Vector.c.
References POINTER_AS_INT, type, and vector_ass_item_internal().
|
static |
Definition at line 1496 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, self, and Vector_CreatePyObject().
Referenced by vec__apply_to_copy(), and Vector_deepcopy().
PyObject* Vector_CreatePyObject | ( | const float * | vec, |
const int | vec_num, | ||
PyTypeObject * | base_type | ||
) |
Definition at line 3284 of file mathutils_Vector.c.
References BASE_MATH_FLAG_DEFAULT, BASE_MATH_NEW, copy_vn_fl(), NULL, self, UNLIKELY, and vector_Type.
Referenced by bpy_bmedge_calc_tangent(), bpy_bmface_calc_center_bounds(), bpy_bmface_calc_center_mean(), bpy_bmface_calc_center_median_weighted(), bpy_bmface_calc_tangent_edge(), bpy_bmface_calc_tangent_edge_diagonal(), bpy_bmface_calc_tangent_edge_pair(), bpy_bmface_calc_tangent_vert_diagonal(), bpy_bmloop_calc_normal(), bpy_bmloop_calc_tangent(), bpy_slot_to_py(), Freestyle_blendRamp(), Freestyle_evaluateColorRamp(), kdtree_nearest_to_py_tuple(), M_Geometry_barycentric_transform(), M_Geometry_closest_point_on_tri(), M_Geometry_interpolate_bezier(), M_Geometry_intersect_line_line(), M_Geometry_intersect_line_line_2d(), M_Geometry_intersect_line_plane(), M_Geometry_intersect_line_sphere(), M_Geometry_intersect_line_sphere_2d(), M_Geometry_intersect_plane_plane(), M_Geometry_intersect_point_line(), M_Geometry_intersect_point_tri(), M_Geometry_intersect_ray_tri(), M_Geometry_intersect_sphere_sphere_2d(), M_Geometry_normal(), M_Noise_noise_vector(), M_Noise_random_unit_vector(), M_Noise_turbulence_vector(), M_Noise_voronoi(), Matrix_decompose(), Matrix_matmul(), Matrix_to_scale(), Matrix_to_translation(), points_in_planes_fn(), py_bvhtree_nearest_to_py_tuple(), py_bvhtree_raycast_to_py_tuple(), pyrna_math_object_from_array(), pyrna_param_to_py(), Quaternion_axis_vector_get(), Quaternion_matmul(), Quaternion_to_axis_angle(), Quaternion_to_exponential_map(), Vector_copy(), Vector_CreatePyObject_cb(), Vector_cross(), Vector_from_Vec2f(), Vector_from_Vec3f(), Vector_from_Vec3r(), Vector_matmul(), Vector_orthogonal(), Vector_reflect(), Vector_slerp(), Vector_swizzle_get(), Vector_to_2d(), Vector_to_3d(), and Vector_to_4d().
PyObject* Vector_CreatePyObject_alloc | ( | float * | vec, |
int | vec_num, | ||
PyTypeObject * | base_type | ||
) |
vec | Initialized vector value to use in-place, allocated with #PyMem_Malloc |
Definition at line 3366 of file mathutils_Vector.c.
References BASE_MATH_FLAG_IS_WRAP, and Vector_CreatePyObject_wrap().
Referenced by C_Vector_Fill(), C_Vector_Linspace(), C_Vector_Range(), C_Vector_Repeat(), M_Noise_random_vector(), Vector_add(), Vector_div(), Vector_lerp(), vector_mul_float(), vector_mul_vec(), Vector_neg(), Vector_new(), Vector_project(), Vector_resized(), and Vector_sub().
PyObject* Vector_CreatePyObject_cb | ( | PyObject * | user, |
int | vec_num, | ||
unsigned char | cb_type, | ||
unsigned char | subtype | ||
) |
Create a vector where the value is defined by registered callbacks, see: Mathutils_RegisterCallback
Definition at line 3352 of file mathutils_Vector.c.
References NULL, and Vector_CreatePyObject().
Referenced by BPy_BMLoopColor_CreatePyObject(), FEdgeSharp_normal_left_get(), FEdgeSharp_normal_right_get(), FEdgeSmooth_normal_get(), FrsMaterial_ambient_get(), FrsMaterial_diffuse_get(), FrsMaterial_emission_get(), FrsMaterial_line_get(), FrsMaterial_specular_get(), Matrix_item_col(), Matrix_item_row(), Matrix_slice(), Matrix_translation_get(), pyrna_math_object_from_array(), StrokeAttribute_thickness_get(), StrokeVertex_point_get(), SVertex_point_2d_get(), and SVertex_point_3d_get().
PyObject* Vector_CreatePyObject_wrap | ( | float * | vec, |
int | vec_num, | ||
PyTypeObject * | base_type | ||
) |
Create a vector that wraps existing memory.
vec | Use this vector in-place. |
Definition at line 3329 of file mathutils_Vector.c.
References BASE_MATH_FLAG_DEFAULT, BASE_MATH_FLAG_IS_WRAP, BASE_MATH_NEW, NULL, and vector_Type.
Referenced by bpy_bmface_normal_get(), BPy_BMLayerItem_GetItem(), bpy_bmloopuv_uv_get(), bpy_bmvert_co_get(), bpy_bmvert_normal_get(), bpy_bmvertskin_radius_get(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 990 of file mathutils_Vector.c.
References BaseMath_ReadCallback, cross_v2v2(), cross_v3_v3v3(), mathutils_array_parse(), NULL, ret, self, and Vector_CreatePyObject().
|
static |
Definition at line 1504 of file mathutils_Vector.c.
References NULL, PyC_CheckArgs_DeepCopy(), and Vector_copy().
|
static |
Division: object / object
.
Definition at line 2290 of file mathutils_Vector.c.
References BaseMath_ReadCallback, mul_vn_vn_fl(), NULL, v1, v2, VectorObject::vec_num, Vector_CreatePyObject_alloc(), and VectorObject_Check.
|
static |
Definition at line 1036 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), mathutils_array_parse_alloc(), NULL, ret, and self.
|
static |
Definition at line 1650 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMathObject_Prepare_ForHash, mathutils_array_hash(), and self.
|
static |
Addition in-place: object += object
.
Definition at line 1937 of file mathutils_Vector.c.
References add_vn_vn(), BaseMath_ReadCallback, BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, NULL, v1, v2, VectorObject::vec_num, VectorObject_Check, and void.
|
static |
Division in-place: object /= object
.
Definition at line 2337 of file mathutils_Vector.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, mul_vn_fl(), NULL, v1, v2, VectorObject::vec_num, and void.
|
static |
Multiplication in-place (matrix multiply): object @= object
.
Definition at line 2279 of file mathutils_Vector.c.
|
static |
Multiplication in-place (element-wise or scalar): object *= object
.
Definition at line 2161 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, mul_vn_fl(), mul_vn_vn(), NULL, v1, v2, VectorObject::vec_num, VectorObject_Check, and void.
|
static |
Subtraction in-place: object -= object
.
Definition at line 2012 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, NULL, sub_vn_vn(), v1, v2, VectorObject::vec_num, VectorObject_Check, and void.
|
static |
Sequence accessor (get): x = object[i]
.
Definition at line 1702 of file mathutils_Vector.c.
References vector_item_internal().
Referenced by Vector_subscript().
|
static |
Definition at line 1675 of file mathutils_Vector.c.
References BaseMath_ReadIndexCallback, NULL, and self.
Referenced by Vector_axis_get(), and Vector_item().
|
static |
Sequence length: len(object)
.
Definition at line 1670 of file mathutils_Vector.c.
|
static |
Definition at line 2473 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), NULL, self, and sqrt().
|
static |
Definition at line 2482 of file mathutils_Vector.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, copy_vn_fl(), dot_vn_vn(), mul_vn_fl(), self, sqrt(), and void.
|
static |
Definition at line 2528 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), NULL, and self.
|
static |
Definition at line 1294 of file mathutils_Vector.c.
References BaseMath_ReadCallback, interp_vn_vn(), mathutils_array_parse_alloc(), NULL, self, and Vector_CreatePyObject_alloc().
|
static |
Multiplication (matrix multiply): object @ object
.
Definition at line 2215 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), MatrixObject_Check, MAX_DIMENSIONS, NULL, row_vector_multiplication(), v1, v2, VectorObject::vec_num, Vector_CreatePyObject(), and VectorObject_Check.
|
static |
Multiplication (element-wise or scalar): object * object
.
Definition at line 2109 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, v1, v2, VectorObject::vec_num, vector_mul_float(), vector_mul_vec(), and VectorObject_Check.
|
static |
Definition at line 2080 of file mathutils_Vector.c.
References mul_vn_vn_fl(), NULL, VectorObject::vec_num, and Vector_CreatePyObject_alloc().
Referenced by Vector_mul().
|
static |
Definition at line 2094 of file mathutils_Vector.c.
References mul_vn_vnvn(), NULL, VectorObject::vec_num, and Vector_CreatePyObject_alloc().
Referenced by Vector_mul().
|
static |
Negative (returns the negative of this object): -object
.
Definition at line 2370 of file mathutils_Vector.c.
References BaseMath_ReadCallback, negate_vn_vn(), NULL, self, and Vector_CreatePyObject_alloc().
|
static |
Definition at line 1468 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, negate_vn(), NULL, self, and void.
|
static |
Supports 2D, 3D, and 4D vector objects both int and float values accepted. Mixed float and int values accepted. Ints are parsed to float
Definition at line 134 of file mathutils_Vector.c.
References copy_vn_fl(), mathutils_array_parse_alloc(), NULL, type, and Vector_CreatePyObject_alloc().
|
static |
Definition at line 435 of file mathutils_Vector.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, normalize_vn(), NULL, self, and void.
Referenced by Vector_normalized().
|
static |
Definition at line 454 of file mathutils_Vector.c.
References vec__apply_to_copy(), and Vector_normalize().
|
static |
Definition at line 895 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, ortho_v2_v2(), ortho_v3_v3(), self, and Vector_CreatePyObject().
|
static |
Definition at line 1248 of file mathutils_Vector.c.
References BaseMath_ReadCallback, double(), float(), mathutils_array_parse_alloc(), NULL, self, Vector_CreatePyObject_alloc(), and x.
|
static |
Definition at line 938 of file mathutils_Vector.c.
References BaseMath_ReadCallback, mathutils_array_parse(), MAX_DIMENSIONS, normalize_v3(), NULL, reflect(), reflect_v3_v3v3(), self, and Vector_CreatePyObject().
|
static |
Definition at line 1518 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, ret, and Vector_to_tuple_ex().
|
static |
Definition at line 469 of file mathutils_Vector.c.
References BASE_MATH_FLAG_IS_WRAP, copy_vn_fl(), NULL, and self.
|
static |
Definition at line 555 of file mathutils_Vector.c.
References BASE_MATH_FLAG_IS_WRAP, NULL, and self.
|
static |
Definition at line 586 of file mathutils_Vector.c.
References BASE_MATH_FLAG_IS_WRAP, NULL, and self.
|
static |
Definition at line 621 of file mathutils_Vector.c.
References BASE_MATH_FLAG_IS_WRAP, NULL, and self.
|
static |
Definition at line 522 of file mathutils_Vector.c.
References copy_vn_fl(), NULL, self, and Vector_CreatePyObject_alloc().
|
static |
Definition at line 1563 of file mathutils_Vector.c.
References BaseMath_ReadCallback, blender::robust_pred::epsilon, EXPP_VectorsAreEqual(), len_squared_vn(), NULL, result, VectorObject::vec_num, and VectorObject_Check.
|
static |
Definition at line 1427 of file mathutils_Vector.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, mathutils_any_to_rotmat(), Matrix_Parse2x2(), mul_m2_v2(), mul_m3_v3(), normalize_m2_m2(), NULL, self, and void.
|
static |
Definition at line 1204 of file mathutils_Vector.c.
References BaseMath_ReadCallback, mathutils_array_parse(), MAX_DIMENSIONS, normalize_v3(), normalize_v3_v3(), NULL, Quaternion_CreatePyObject(), rotation_between_vecs_to_quat(), and self.
|
static |
Definition at line 1340 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), float(), interp_dot_slerp(), mathutils_array_parse(), normalize_vn(), normalize_vn_vn(), NULL, self, UNLIKELY, Vector_CreatePyObject(), w(), and x.
|
static |
Sequence slice accessor (get): x = object[i:j]
.
Definition at line 1756 of file mathutils_Vector.c.
References BaseMath_ReadCallback, CLAMP, count, MIN2, NULL, and self.
Referenced by Vector_subscript().
|
static |
Definition at line 1533 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BLI_dynstr_append(), BLI_dynstr_appendf(), BLI_dynstr_new(), mathutils_dynstr_to_py(), NULL, and self.
|
static |
Subtraction: object - object
.
Definition at line 1971 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, sub_vn_vnvn(), v1, v2, VectorObject::vec_num, Vector_CreatePyObject_alloc(), and VectorObject_Check.
|
static |
Sequence generic subscript (get): x = object[...]
.
Definition at line 1819 of file mathutils_Vector.c.
References NULL, self, Vector_item(), and Vector_slice().
|
static |
Python script used to make swizzle array:
Get a new Vector according to the provided swizzle bits.
Definition at line 2598 of file mathutils_Vector.c.
References BaseMath_ReadCallback, MAX_DIMENSIONS, NULL, POINTER_AS_INT, self, SWIZZLE_AXIS, SWIZZLE_BITS_PER_AXIS, SWIZZLE_VALID_AXIS, and Vector_CreatePyObject().
|
static |
Set the items of this vector using a swizzle.
Definition at line 2640 of file mathutils_Vector.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, mathutils_array_parse(), MAX_DIMENSIONS, POINTER_AS_INT, self, SWIZZLE_AXIS, SWIZZLE_BITS_PER_AXIS, and SWIZZLE_VALID_AXIS.
|
static |
Definition at line 668 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, self, and Vector_CreatePyObject().
|
static |
Definition at line 683 of file mathutils_Vector.c.
References BaseMath_ReadCallback, MIN2, NULL, self, and Vector_CreatePyObject().
|
static |
Definition at line 701 of file mathutils_Vector.c.
References BaseMath_ReadCallback, MIN2, NULL, self, and Vector_CreatePyObject().
|
static |
Definition at line 771 of file mathutils_Vector.c.
References BaseMath_ReadCallback, negate_v3_v3(), NULL, Quaternion_CreatePyObject(), self, and vec_to_quat().
|
static |
Definition at line 728 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, and Vector_to_tuple_ex().
|
static |
Definition at line 103 of file mathutils_Vector.c.
References double_round(), ret, and self.
Referenced by Vector_repr(), and Vector_to_tuple().
|
static |
Definition at line 405 of file mathutils_Vector.c.
References BaseMath_Prepare_ForWrite, BaseMath_WriteCallback, copy_vn_fl(), NULL, and self.
|
static |
Definition at line 2402 of file mathutils_Vector.c.
|
static |
Definition at line 2739 of file mathutils_Vector.c.
|
static |
Definition at line 2739 of file mathutils_Vector.c.
|
static |
Definition at line 2408 of file mathutils_Vector.c.
|
static |
Definition at line 2389 of file mathutils_Vector.c.
PyTypeObject vector_Type |
Definition at line 3193 of file mathutils_Vector.c.
Referenced by PyInit_mathutils(), Vector_CreatePyObject(), and Vector_CreatePyObject_wrap().