|
Blender V4.3
|
#include <algorithm>#include <Python.h>#include "mathutils.hh"#include "BLI_math_base_safe.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BLI_utildefines.h"#include "../generic/py_capi_utils.hh"#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 vector: The vector to draw values from.\n" " :type vector: :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[float]\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: str\n" " :arg up: Up axis in ['X', 'Y', 'Z'].\n" " :type up: str\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 as a vector or a float when 2D vectors are used.\n" " :rtype: :class:`Vector` | float\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 | Any\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 | Any\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` | :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 Py_ssize_t | Vector_len (VectorObject *self) |
| static PyObject * | vector_item_internal (VectorObject *self, int i, const bool is_attr) |
| static PyObject * | Vector_item (VectorObject *self, Py_ssize_t i) |
| static int | vector_ass_item_internal (VectorObject *self, int i, PyObject *value, const bool is_attr) |
| static int | Vector_ass_item (VectorObject *self, Py_ssize_t 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 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)) |
| #define | VECTOR_SWIZZLE2_RW_DEF(attr, a, b) |
| #define | VECTOR_SWIZZLE2_RO_DEF(attr, a, b) |
| #define | VECTOR_SWIZZLE3_RW_DEF(attr, a, b, c) |
| #define | VECTOR_SWIZZLE3_RO_DEF(attr, a, b, c) |
| #define | VECTOR_SWIZZLE4_RW_DEF(attr, a, b, c, d) |
| #define | VECTOR_SWIZZLE4_RO_DEF(attr, 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 *) |
| 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 *) |
| PyDoc_STRVAR (Vector_swizzle_doc, ":type: :class:`Vector`") | |
| 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" " :arg seq: Components of the vector, must be a sequence of at least two.\n" " :type seq: Sequence[float]\n") | |
| #define _SWIZZLE1 | ( | a | ) | ((a) | SWIZZLE_VALID_AXIS) |
Definition at line 2856 of file mathutils_Vector.cc.
| #define _SWIZZLE2 | ( | a, | |
| b ) (_SWIZZLE1(a) | (((b) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS))) |
Definition at line 2857 of file mathutils_Vector.cc.
| #define _SWIZZLE3 | ( | a, | |
| b, | |||
| c ) (_SWIZZLE2(a, b) | (((c) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))) |
Definition at line 2858 of file mathutils_Vector.cc.
| #define _SWIZZLE4 | ( | a, | |
| b, | |||
| c, | |||
| d ) (_SWIZZLE3(a, b, c) | (((d) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) |
Definition at line 2860 of file mathutils_Vector.cc.
| #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 32 of file mathutils_Vector.cc.
Referenced by column_vector_multiplication(), row_vector_multiplication(), Vector_angle(), Vector_matmul(), Vector_reflect(), Vector_rotation_difference(), Vector_swizzle_get(), and Vector_swizzle_set().
| #define SWIZZLE2 | ( | a, | |
| b ) POINTER_FROM_INT(_SWIZZLE2(a, b)) |
Definition at line 2863 of file mathutils_Vector.cc.
| #define SWIZZLE3 | ( | a, | |
| b, | |||
| c ) POINTER_FROM_INT(_SWIZZLE3(a, b, c)) |
Definition at line 2864 of file mathutils_Vector.cc.
| #define SWIZZLE4 | ( | a, | |
| b, | |||
| c, | |||
| d ) POINTER_FROM_INT(_SWIZZLE4(a, b, c, d)) |
Definition at line 2865 of file mathutils_Vector.cc.
| #define SWIZZLE_AXIS 0x3 |
Definition at line 41 of file mathutils_Vector.cc.
Referenced by Vector_swizzle_get(), and Vector_swizzle_set().
| #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 39 of file mathutils_Vector.cc.
Referenced by Vector_swizzle_get(), and Vector_swizzle_set().
| #define SWIZZLE_VALID_AXIS 0x4 |
Definition at line 40 of file mathutils_Vector.cc.
Referenced by Vector_swizzle_get(), and Vector_swizzle_set().
Definition at line 2872 of file mathutils_Vector.cc.
Definition at line 2867 of file mathutils_Vector.cc.
Definition at line 2881 of file mathutils_Vector.cc.
Definition at line 2876 of file mathutils_Vector.cc.
Definition at line 2890 of file mathutils_Vector.cc.
Definition at line 2885 of file mathutils_Vector.cc.
|
static |
Definition at line 199 of file mathutils_Vector.cc.
References copy_vn_fl(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 319 of file mathutils_Vector.cc.
References range_vn_fl(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 241 of file mathutils_Vector.cc.
References range_vn_fl(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 361 of file mathutils_Vector.cc.
References mathutils_array_parse_alloc(), and Vector_CreatePyObject_alloc().
| int column_vector_multiplication | ( | float | r_vec[MAX_DIMENSIONS], |
| VectorObject * | vec, | ||
| MatrixObject * | mat ) |
Definition at line 2119 of file mathutils_Vector.cc.
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 vector: The vector to draw values from.\n" " :type vector: :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|Any\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|Any\n" | ) |
| 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_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 as a vector or a float when 2D vectors are used.\n" " :rtype: :class:`Vector` | float\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" " :arg seq: Components of the | vector, | ||
| must be a sequence of at least two.\n" " :type seq:Sequence\n" | [float] ) |
| 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_length_squared_doc | , |
| "Vector length squared (v.dot(v)).\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` | :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_swizzle_doc | , |
| ":type: :class:`Vector`" | ) |
| 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: str\n" " :arg up: Up axis in .\n" " :type up: str\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][float] ) |
| 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 59 of file mathutils_Vector.cc.
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 96 of file mathutils_Vector.cc.
References ret, self, and Vector_copy().
Referenced by Vector_normalized().
|
static |
Addition: object + object.
Definition at line 1967 of file mathutils_Vector.cc.
References add_vn_vnvn(), BaseMath_ReadCallback, v2, VectorObject::vec_num, Vector_CreatePyObject_alloc(), and VectorObject_Check.
|
static |
Definition at line 1127 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, double(), mathutils_array_parse(), MAX_DIMENSIONS, safe_acosf(), self, sqrt(), and x.
|
static |
Definition at line 1200 of file mathutils_Vector.cc.
References angle_signed_v2v2(), BaseMath_ReadCallback, is_zero_v2(), mathutils_array_parse(), and self.
|
static |
Sequence accessor (set): object[i] = x.
Definition at line 1822 of file mathutils_Vector.cc.
References self, and vector_ass_item_internal().
Referenced by Vector_ass_subscript().
|
static |
Definition at line 1779 of file mathutils_Vector.cc.
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 1853 of file mathutils_Vector.cc.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, CLAMP, mathutils_array_parse_alloc(), and self.
Referenced by Vector_ass_subscript().
|
static |
Sequence generic subscript (set): object[...] = x.
Definition at line 1928 of file mathutils_Vector.cc.
References self, Vector_ass_item(), and Vector_ass_slice().
|
static |
Definition at line 2552 of file mathutils_Vector.cc.
References POINTER_AS_INT, self, and vector_item_internal().
|
static |
Definition at line 2557 of file mathutils_Vector.cc.
References POINTER_AS_INT, self, and vector_ass_item_internal().
|
static |
Definition at line 1568 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, self, and Vector_CreatePyObject().
Referenced by vec__apply_to_copy(), and Vector_deepcopy().
Definition at line 3472 of file mathutils_Vector.cc.
References BASE_MATH_FLAG_DEFAULT, BASE_MATH_NEW, copy_vn_fl(), 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_delaunay_2d_cdt(), 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_cell_vector(), 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().
| vec | Initialized vector value to use in-place, allocated with #PyMem_Malloc |
Definition at line 3555 of file mathutils_Vector.cc.
References self, 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 * | cb_user, |
| int | vec_num, | ||
| unsigned char | cb_type, | ||
| unsigned char | cb_subtype ) |
Create a vector where the value is defined by registered callbacks, see: Mathutils_RegisterCallback
Definition at line 3540 of file mathutils_Vector.cc.
References BLI_assert, self, 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().
Create a vector that wraps existing memory.
| vec | Use this vector in-place. |
Definition at line 3517 of file mathutils_Vector.cc.
References BASE_MATH_FLAG_DEFAULT, BASE_MATH_FLAG_IS_WRAP, BASE_MATH_NEW, self, 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 1038 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, cross_v2v2(), cross_v3_v3v3(), mathutils_array_parse(), ret, self, and Vector_CreatePyObject().
|
static |
Definition at line 1576 of file mathutils_Vector.cc.
References PyC_CheckArgs_DeepCopy(), self, and Vector_copy().
|
static |
Division: object / object.
Definition at line 2362 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, mul_vn_vn_fl(), v2, VectorObject::vec_num, Vector_CreatePyObject_alloc(), and VectorObject_Check.
|
static |
Definition at line 1087 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, dot_vn_vn(), mathutils_array_parse_alloc(), ret, and self.
|
static |
Definition at line 1722 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, BaseMathObject_Prepare_ForHash, mathutils_array_hash(), and self.
|
static |
Addition in-place: object += object.
Definition at line 2009 of file mathutils_Vector.cc.
References add_vn_vn(), BaseMath_ReadCallback, BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, v2, VectorObject::vec_num, and VectorObject_Check.
|
static |
Division in-place: object /= object.
Definition at line 2409 of file mathutils_Vector.cc.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, mul_vn_fl(), v2, and VectorObject::vec_num.
|
static |
Multiplication in-place (matrix multiply): object @= object.
Definition at line 2351 of file mathutils_Vector.cc.
References v2.
|
static |
Multiplication in-place (element-wise or scalar): object *= object.
Definition at line 2233 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, mul_vn_fl(), mul_vn_vn(), v2, VectorObject::vec_num, and VectorObject_Check.
|
static |
Subtraction in-place: object -= object.
Definition at line 2084 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, sub_vn_vn(), v2, VectorObject::vec_num, and VectorObject_Check.
|
static |
Sequence accessor (get): x = object[i].
Definition at line 1774 of file mathutils_Vector.cc.
References self, and vector_item_internal().
Referenced by Vector_subscript().
|
static |
Definition at line 1747 of file mathutils_Vector.cc.
References BaseMath_ReadIndexCallback, and self.
Referenced by Vector_axis_get(), and Vector_item().
|
static |
|
static |
Definition at line 2570 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, dot_vn_vn(), self, and sqrt().
|
static |
Definition at line 2579 of file mathutils_Vector.cc.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, copy_vn_fl(), dot_vn_vn(), mul_vn_fl(), self, and sqrt().
|
static |
Definition at line 2630 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, dot_vn_vn(), and self.
|
static |
Definition at line 1357 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, interp_vn_vn(), mathutils_array_parse_alloc(), self, and Vector_CreatePyObject_alloc().
|
static |
Multiplication (matrix multiply): object @ object.
Definition at line 2287 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, dot_vn_vn(), MatrixObject_Check, MAX_DIMENSIONS, row_vector_multiplication(), v2, VectorObject::vec_num, Vector_CreatePyObject(), and VectorObject_Check.
|
static |
Multiplication (element-wise or scalar): object * object.
Definition at line 2181 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, v2, VectorObject::vec_num, vector_mul_float(), vector_mul_vec(), and VectorObject_Check.
|
static |
Definition at line 2152 of file mathutils_Vector.cc.
References mul_vn_vn_fl(), VectorObject::vec_num, and Vector_CreatePyObject_alloc().
Referenced by Vector_mul().
|
static |
Definition at line 2166 of file mathutils_Vector.cc.
References mul_vn_vnvn(), VectorObject::vec_num, and Vector_CreatePyObject_alloc().
Referenced by Vector_mul().
|
static |
Negative (returns the negative of this object): -object.
Definition at line 2442 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, negate_vn_vn(), self, and Vector_CreatePyObject_alloc().
|
static |
Definition at line 1538 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, BaseMath_WriteCallback, negate_vn(), and self.
|
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 141 of file mathutils_Vector.cc.
References copy_vn_fl(), mathutils_array_parse_alloc(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 455 of file mathutils_Vector.cc.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, normalize_vn(), and self.
Referenced by Vector_normalized().
|
static |
Definition at line 476 of file mathutils_Vector.cc.
References self, vec__apply_to_copy(), and Vector_normalize().
|
static |
Definition at line 938 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, ortho_v2_v2(), ortho_v3_v3(), self, and Vector_CreatePyObject().
|
static |
Definition at line 1308 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, double(), float, mathutils_array_parse_alloc(), self, Vector_CreatePyObject_alloc(), and x.
|
static |
Definition at line 983 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, mathutils_array_parse(), MAX_DIMENSIONS, normalize_v3(), reflect(), reflect_v3_v3v3(), self, and Vector_CreatePyObject().
|
static |
Definition at line 1590 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, ret, self, and Vector_to_tuple_ex().
|
static |
Definition at line 493 of file mathutils_Vector.cc.
References BASE_MATH_FLAG_IS_WRAP, copy_vn_fl(), and self.
|
static |
Definition at line 583 of file mathutils_Vector.cc.
References BASE_MATH_FLAG_IS_WRAP, and self.
|
static |
Definition at line 616 of file mathutils_Vector.cc.
References BASE_MATH_FLAG_IS_WRAP, and self.
|
static |
Definition at line 653 of file mathutils_Vector.cc.
References BASE_MATH_FLAG_IS_WRAP, and self.
|
static |
Definition at line 548 of file mathutils_Vector.cc.
References copy_vn_fl(), self, and Vector_CreatePyObject_alloc().
|
static |
Definition at line 1635 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, EXPP_VectorsAreEqual(), len_squared_vn(), printf, VectorObject::vec_num, and VectorObject_Check.
|
static |
Definition at line 1495 of file mathutils_Vector.cc.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, mathutils_any_to_rotmat(), Matrix_Parse2x2(), mul_m2_v2(), mul_m3_v3(), normalize_m2_m2(), and self.
|
static |
Definition at line 1262 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, mathutils_array_parse(), MAX_DIMENSIONS, normalize_v3(), normalize_v3_v3(), Quaternion_CreatePyObject(), rotation_between_vecs_to_quat(), and self.
|
static |
Definition at line 1406 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, dot_vn_vn(), float, interp_dot_slerp(), mathutils_array_parse(), normalize_vn(), normalize_vn_vn(), self, UNLIKELY, Vector_CreatePyObject(), w(), and x.
|
static |
Sequence slice accessor (get): x = object[i:j].
Definition at line 1828 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, CLAMP, count, and self.
Referenced by Vector_subscript().
|
static |
Definition at line 1605 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, BLI_dynstr_append(), BLI_dynstr_appendf(), BLI_dynstr_new(), mathutils_dynstr_to_py(), and self.
|
static |
Subtraction: object - object.
Definition at line 2043 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, sub_vn_vnvn(), v2, VectorObject::vec_num, Vector_CreatePyObject_alloc(), and VectorObject_Check.
|
static |
Sequence generic subscript (get): x = object[...].
Definition at line 1891 of file mathutils_Vector.cc.
References 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 2731 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, MAX_DIMENSIONS, 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.
min(len(source), len(destination)) values will be copied.Definition at line 2773 of file mathutils_Vector.cc.
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 702 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, self, and Vector_CreatePyObject().
|
static |
Definition at line 719 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, self, and Vector_CreatePyObject().
|
static |
Definition at line 739 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, self, and Vector_CreatePyObject().
|
static |
Definition at line 813 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, negate_v3_v3(), Quaternion_CreatePyObject(), self, and vec_to_quat().
|
static |
Definition at line 768 of file mathutils_Vector.cc.
References BaseMath_ReadCallback, self, and Vector_to_tuple_ex().
|
static |
Definition at line 110 of file mathutils_Vector.cc.
References double_round(), ret, and self.
Referenced by Vector_repr(), and Vector_to_tuple().
|
static |
Definition at line 423 of file mathutils_Vector.cc.
References BaseMath_Prepare_ForWrite, BaseMath_WriteCallback, copy_vn_fl(), and self.
|
static |
Definition at line 2474 of file mathutils_Vector.cc.
|
static |
Definition at line 2906 of file mathutils_Vector.cc.
|
static |
Definition at line 3332 of file mathutils_Vector.cc.
|
static |
Definition at line 2480 of file mathutils_Vector.cc.
|
static |
Definition at line 2461 of file mathutils_Vector.cc.
| PyTypeObject vector_Type |
Definition at line 3410 of file mathutils_Vector.cc.
Referenced by PyInit_mathutils(), Vector_CreatePyObject(), and Vector_CreatePyObject_wrap().