Blender V2.61 - r43446
|
#include <Python.h>
#include "mathutils.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_dynstr.h"
Go to the source code of this file.
Defines | |
#define | MAX_DIMENSIONS 4 |
#define | SWIZZLE_BITS_PER_AXIS 3 |
#define | SWIZZLE_VALID_AXIS 0x4 |
#define | SWIZZLE_AXIS 0x3 |
Functions | |
static PyObject * | Vector_copy (VectorObject *self) |
static PyObject * | Vector_to_tuple_ext (VectorObject *self, int ndigits) |
static int | row_vector_multiplication (float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat) |
static PyObject * | Vector_new (PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds)) |
static PyObject * | vec__apply_to_copy (PyNoArgsFunction vec_func, VectorObject *self) |
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=0, 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) |
PyDoc_STRVAR (Vector_zero_doc,".. method:: zero()\n""\n"" Set all values to zero.\n") | |
static PyObject * | Vector_zero (VectorObject *self) |
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) |
PyDoc_STRVAR (Vector_resize_doc,".. method:: resize(size=3)\n""\n"" Resize the vector to have size number of elements.\n""\n"" :return: an instance of itself\n"" :rtype: :class:`Vector`\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""\n"" :return: an instance of itself\n"" :rtype: :class:`Vector`\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""\n"" :return: an instance of itself\n"" :rtype: :class:`Vector`\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""\n"" :return: an instance of itself\n"" :rtype: :class:`Vector`\n") | |
static PyObject * | Vector_resize_4d (VectorObject *self) |
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) |
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) |
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) |
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) |
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`\n""\n"" .. note:: both vectors must be 3D\n") | |
static PyObject * | Vector_cross (VectorObject *self, PyObject *value) |
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: :class:`Vector`\n") | |
static PyObject * | Vector_dot (VectorObject *self, PyObject *value) |
PyDoc_STRVAR (Vector_angle_doc,".. function:: angle(other, fallback)\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 value when the angle cant be calculated\n"" (zero length vector)\n"" :type fallback: any\n"" :return: angle in radians or fallback when given\n"" :rtype: float\n""\n"" .. note:: Zero length vectors raise an :exc:`AttributeError`.\n") | |
static PyObject * | Vector_angle (VectorObject *self, PyObject *args) |
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) |
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) |
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 rotation.\n"" :rtype: :class:`Vector`\n") | |
static PyObject * | Vector_lerp (VectorObject *self, PyObject *args) |
PyDoc_STRVAR (Vector_rotate_doc,".. function:: rotate(other)\n""\n"" Return vector by a rotation value.\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) |
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") | |
static PyObject * | Vector_repr (VectorObject *self) |
static PyObject * | Vector_str (VectorObject *self) |
static int | Vector_len (VectorObject *self) |
static PyObject * | vector_item_internal (VectorObject *self, int i, const int is_attr) |
static PyObject * | Vector_item (VectorObject *self, int i) |
static int | vector_ass_item_internal (VectorObject *self, int i, PyObject *value, const int 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_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 (PyObject *v1, PyObject *v2) |
static PyObject * | Vector_imul (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) |
static double | vec_magnitude_nosqrt (float *data, int size) |
static PyObject * | Vector_richcmpr (PyObject *objectA, PyObject *objectB, int comparison_type) |
static PyObject * | Vector_subscript (VectorObject *self, PyObject *item) |
static int | Vector_ass_subscript (VectorObject *self, PyObject *item, PyObject *value) |
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) |
PyDoc_STRVAR (Vector_negate_doc,".. method:: negate()\n""\n"" Set all values to their negative.\n""\n"" :return: an instance of itself\n"" :rtype: :class:`Vector`\n") | |
static PyObject * | Vector_negate (VectorObject *self) |
PyDoc_STRVAR (vector_doc,"This object gives access to Vectors in Blender.") | |
PyObject * | Vector_CreatePyObject (float *vec, const int size, const int type, PyTypeObject *base_type) |
PyObject * | Vector_CreatePyObject_cb (PyObject *cb_user, int size, int cb_type, int cb_subtype) |
PyObject * | Vector_CreatePyObject_alloc (float *vec, const int size, PyTypeObject *base_type) |
Variables | |
static PySequenceMethods | Vector_SeqMethods |
static PyMappingMethods | Vector_AsMapping |
static PyNumberMethods | Vector_NumMethods |
static PyGetSetDef | Vector_getseters [] |
static struct PyMethodDef | Vector_methods [] |
PyTypeObject | vector_Type |
Definition in file mathutils_Vector.c.
#define MAX_DIMENSIONS 4 |
Definition at line 40 of file mathutils_Vector.c.
Referenced by column_vector_multiplication(), row_vector_multiplication(), Vector_angle(), Vector_cross(), Vector_imul(), Vector_mul(), Vector_project(), Vector_reflect(), Vector_rotation_difference(), Vector_swizzle_get(), and Vector_swizzle_set().
#define SWIZZLE_AXIS 0x3 |
Definition at line 47 of file mathutils_Vector.c.
Referenced by Vector_swizzle_get(), and Vector_swizzle_set().
#define SWIZZLE_BITS_PER_AXIS 3 |
Definition at line 45 of file mathutils_Vector.c.
Referenced by Vector_swizzle_get(), and Vector_swizzle_set().
#define SWIZZLE_VALID_AXIS 0x4 |
Definition at line 46 of file mathutils_Vector.c.
Referenced by Vector_swizzle_get(), and Vector_swizzle_set().
static PyObject* C_Vector_Fill | ( | PyObject * | cls, |
PyObject * | args | ||
) | [static] |
Definition at line 116 of file mathutils_Vector.c.
References fill_vn_fl(), NULL, size(), and Vector_CreatePyObject_alloc().
static PyObject* C_Vector_Linspace | ( | PyObject * | cls, |
PyObject * | args | ||
) | [static] |
Definition at line 223 of file mathutils_Vector.c.
References NULL, range_vn_fl(), size(), step(), and Vector_CreatePyObject_alloc().
static PyObject* C_Vector_Range | ( | PyObject * | cls, |
PyObject * | args | ||
) | [static] |
Definition at line 158 of file mathutils_Vector.c.
References NULL, range_vn_fl(), size(), step(), and Vector_CreatePyObject_alloc().
static PyObject* C_Vector_Repeat | ( | PyObject * | cls, |
PyObject * | args | ||
) | [static] |
Definition at line 265 of file mathutils_Vector.c.
References i, mathutils_array_parse_alloc(), NULL, size(), and Vector_CreatePyObject_alloc().
int column_vector_multiplication | ( | float | r_vec[MAX_DIMENSIONS], |
VectorObject * | vec, | ||
MatrixObject * | mat | ||
) |
Definition at line 1491 of file mathutils_Vector.c.
References dot(), MATRIX_ITEM, MAX_DIMENSIONS, MatrixObject::num_col, MatrixObject::num_row, and VectorObject::size.
PyDoc_STRVAR | ( | C_Vector_Range_doc | , |
".. classmethod:: Range(start=0, 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 | ( | 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_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_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_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_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_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_resize_doc | , |
".. method:: resize(size=3)\n""\n"" Resize the vector to have size number of elements.\n""\n"" :return: an instance of itself\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_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_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`\n""\n"" .. note:: both vectors must be 3D\n" | |||
) |
PyDoc_STRVAR | ( | Vector_axis_w_doc | , |
"Vector W axis (4D Vectors only).\n\n:type: float" | |||
) |
PyDoc_STRVAR | ( | Vector_length_doc | , |
"Vector Length.\n\n:type: float" | |||
) |
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 | ( | 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_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: :class:`Vector`\n" | |||
) |
PyDoc_STRVAR | ( | Vector_length_squared_doc | , |
"Vector length squared (v.dot(v)).\n\n:type: float" | |||
) |
PyDoc_STRVAR | ( | Vector_angle_doc | , |
".. function:: angle(other, fallback)\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 value when the angle cant be calculated\n"" (zero length vector)\n"" :type fallback: any\n"" :return: angle in radians or fallback when given\n"" :rtype: float\n""\n"" .. note:: Zero length vectors raise an :exc:`AttributeError`.\n" | |||
) |
PyDoc_STRVAR | ( | Vector_negate_doc | , |
".. method:: negate()\n""\n"" Set all values to their negative.\n""\n"" :return: an instance of itself\n"" :rtype: :class:`Vector`\n" | |||
) |
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 | ( | Vector_resize_2d_doc | , |
".. method:: resize_2d()\n""\n"" Resize the vector to 2D (x, y).\n""\n"" :return: an instance of itself\n"" :rtype: :class:`Vector`\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_doc | , |
"This object gives access to Vectors in Blender." | |||
) |
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 | ( | 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_resize_3d_doc | , |
".. method:: resize_3d()\n""\n"" Resize the vector to 3D (x, y, z).\n""\n"" :return: an instance of itself\n"" :rtype: :class:`Vector`\n" | |||
) |
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 rotation.\n"" :rtype: :class:`Vector`\n" | [0.0, 1.0] | ||
) |
PyDoc_STRVAR | ( | Vector_rotate_doc | , |
".. function:: rotate(other)\n""\n"" Return vector by a rotation value.\n""\n"" :arg other: rotation component of mathutils value\n"" :type other: :class:`Euler` | , | ||
:class:`Quaternion`or:class:`Matrix`\n" | |||
) |
PyDoc_STRVAR | ( | Vector_zero_doc | , |
".. method:: zero()\n""\n"" Set all values to zero.\n" | |||
) |
PyDoc_STRVAR | ( | Vector_resize_4d_doc | , |
".. method:: resize_4d()\n""\n"" Resize the vector to 4D (x, y, z, w).\n""\n"" :return: an instance of itself\n"" :rtype: :class:`Vector`\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_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 int row_vector_multiplication | ( | float | rvec[MAX_DIMENSIONS], |
VectorObject * | vec, | ||
MatrixObject * | mat | ||
) | [static] |
Definition at line 2629 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot(), MATRIX_ITEM, MAX_DIMENSIONS, MatrixObject::num_col, MatrixObject::num_row, and VectorObject::size.
Referenced by Vector_mul().
static PyObject* vec__apply_to_copy | ( | PyNoArgsFunction | vec_func, |
VectorObject * | self | ||
) | [static] |
Definition at line 91 of file mathutils_Vector.c.
References NULL, and Vector_copy().
Referenced by Vector_normalized().
static double vec_magnitude_nosqrt | ( | float * | data, |
int | size | ||
) | [static] |
Definition at line 1803 of file mathutils_Vector.c.
References dot_vn_vn().
Referenced by Vector_richcmpr().
static PyObject* Vector_add | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 1335 of file mathutils_Vector.c.
References add_vn_vnvn(), BaseMath_ReadCallback, NULL, VectorObject::size, Vector_CreatePyObject_alloc(), and VectorObject_Check.
static PyObject* Vector_angle | ( | VectorObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 928 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot(), mathutils_array_parse(), MAX_DIMENSIONS, MIN2, NULL, saacos(), size(), and sqrt().
static int Vector_ass_item | ( | VectorObject * | self, |
int | i, | ||
PyObject * | value | ||
) | [static] |
Definition at line 1267 of file mathutils_Vector.c.
References FALSE, and vector_ass_item_internal().
Referenced by Vector_ass_subscript().
static int vector_ass_item_internal | ( | VectorObject * | self, |
int | i, | ||
PyObject * | value, | ||
const int | is_attr | ||
) | [static] |
Definition at line 1235 of file mathutils_Vector.c.
References BaseMath_WriteIndexCallback, and i.
Referenced by Vector_ass_item(), and Vector_axis_set().
static int Vector_ass_slice | ( | VectorObject * | self, |
int | begin, | ||
int | end, | ||
PyObject * | seq | ||
) | [static] |
Definition at line 1294 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, CLAMP(), mathutils_array_parse_alloc(), MIN2, NULL, and size().
Referenced by Vector_ass_subscript().
static int Vector_ass_subscript | ( | VectorObject * | self, |
PyObject * | item, | ||
PyObject * | value | ||
) | [static] |
Definition at line 1949 of file mathutils_Vector.c.
References i, step(), Vector_ass_item(), and Vector_ass_slice().
static PyObject* Vector_axis_get | ( | VectorObject * | self, |
void * | type | ||
) | [static] |
Definition at line 2034 of file mathutils_Vector.c.
References GET_INT_FROM_POINTER, TRUE, and vector_item_internal().
static int Vector_axis_set | ( | VectorObject * | self, |
PyObject * | value, | ||
void * | type | ||
) | [static] |
Definition at line 2039 of file mathutils_Vector.c.
References GET_INT_FROM_POINTER, TRUE, and vector_ass_item_internal().
static PyObject * Vector_copy | ( | VectorObject * | self | ) | [static] |
Definition at line 1156 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, Py_NEW, and Vector_CreatePyObject().
Referenced by vec__apply_to_copy().
PyObject* Vector_CreatePyObject | ( | float * | vec, |
const int | size, | ||
const int | type, | ||
PyTypeObject * | base_type | ||
) |
Definition at line 2821 of file mathutils_Vector.c.
References fill_vn_fl(), NULL, Py_NEW, Py_WRAP, and size().
Referenced by M_Geometry_barycentric_transform(), 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_ray_tri(), 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_mul(), Matrix_to_scale(), Matrix_to_translation(), pyrna_math_object_from_array(), pyrna_param_to_py(), Quaternion_axis_vector_get(), Quaternion_mul(), Quaternion_to_axis_angle(), Vector_copy(), Vector_CreatePyObject_alloc(), Vector_CreatePyObject_cb(), Vector_cross(), Vector_mul(), Vector_new(), Vector_project(), Vector_reflect(), Vector_swizzle_get(), Vector_to_2d(), Vector_to_3d(), and Vector_to_4d().
PyObject* Vector_CreatePyObject_alloc | ( | float * | vec, |
const int | size, | ||
PyTypeObject * | base_type | ||
) |
Definition at line 2880 of file mathutils_Vector.c.
References Py_NEW, Py_WRAP, and Vector_CreatePyObject().
Referenced by C_Vector_Fill(), C_Vector_Linspace(), C_Vector_Range(), C_Vector_Repeat(), Vector_add(), Vector_div(), Vector_lerp(), vector_mul_float(), Vector_neg(), Vector_resized(), and Vector_sub().
PyObject* Vector_CreatePyObject_cb | ( | PyObject * | cb_user, |
int | size, | ||
int | cb_type, | ||
int | cb_subtype | ||
) |
Definition at line 2865 of file mathutils_Vector.c.
References Py_NEW, and Vector_CreatePyObject().
Referenced by Matrix_item_col(), Matrix_item_row(), Matrix_slice(), Matrix_translation_get(), and pyrna_math_object_from_array().
static PyObject* Vector_cross | ( | VectorObject * | self, |
PyObject * | value | ||
) | [static] |
Definition at line 863 of file mathutils_Vector.c.
References BaseMath_ReadCallback, cross_v3_v3v3(), mathutils_array_parse(), MAX_DIMENSIONS, NULL, Py_NEW, and Vector_CreatePyObject().
static PyObject* Vector_div | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 1713 of file mathutils_Vector.c.
References BaseMath_ReadCallback, mul_vn_vn_fl(), NULL, VectorObject::size, Vector_CreatePyObject_alloc(), and VectorObject_Check.
static PyObject* Vector_dot | ( | VectorObject * | self, |
PyObject * | value | ||
) | [static] |
Definition at line 895 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), mathutils_array_parse_alloc(), and NULL.
static PyObject* Vector_iadd | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 1376 of file mathutils_Vector.c.
References add_vn_vn(), BaseMath_ReadCallback, BaseMath_WriteCallback, NULL, VectorObject::size, and VectorObject_Check.
static PyObject* Vector_idiv | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 1758 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, mul_vn_fl(), NULL, and VectorObject::size.
static PyObject* Vector_imul | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 1638 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, column_vector_multiplication(), MatrixObject_Check, MAX_DIMENSIONS, mul_qt_v3(), mul_vn_fl(), NULL, QuaternionObject_Check, and VectorObject::size.
static PyObject* Vector_isub | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 1448 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, NULL, VectorObject::size, sub_vn_vn(), and VectorObject_Check.
static PyObject* Vector_item | ( | VectorObject * | self, |
int | i | ||
) | [static] |
Definition at line 1230 of file mathutils_Vector.c.
References FALSE, and vector_item_internal().
Referenced by Vector_subscript().
static PyObject* vector_item_internal | ( | VectorObject * | self, |
int | i, | ||
const int | is_attr | ||
) | [static] |
Definition at line 1207 of file mathutils_Vector.c.
References BaseMath_ReadIndexCallback, i, and NULL.
Referenced by Vector_axis_get(), and Vector_item().
static int Vector_len | ( | VectorObject * | self | ) | [static] |
Definition at line 1202 of file mathutils_Vector.c.
static PyObject* Vector_length_get | ( | VectorObject * | self, |
void * | UNUSEDclosure | ||
) | [static] |
Definition at line 2049 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), NULL, and sqrt().
static int Vector_length_set | ( | VectorObject * | self, |
PyObject * | value | ||
) | [static] |
Definition at line 2057 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, dot(), dot_vn_vn(), fill_vn_fl(), mul_vn_fl(), and sqrt().
static PyObject* Vector_length_squared_get | ( | VectorObject * | self, |
void * | UNUSEDclosure | ||
) | [static] |
Definition at line 2103 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), and NULL.
static PyObject* Vector_lerp | ( | VectorObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 1073 of file mathutils_Vector.c.
References BaseMath_ReadCallback, mathutils_array_parse_alloc(), NULL, size(), and Vector_CreatePyObject_alloc().
static PyObject* Vector_mul | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 1539 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BLI_assert, copy_v3_v3(), dot_vn_vn(), MatrixObject_Check, MAX_DIMENSIONS, mul_qt_v3(), NULL, Py_NEW, QuaternionObject_Check, row_vector_multiplication(), VectorObject::size, Vector_CreatePyObject(), vector_mul_float(), and VectorObject_Check.
static PyObject* vector_mul_float | ( | VectorObject * | vec, |
const float | scalar | ||
) | [static] |
Definition at line 1524 of file mathutils_Vector.c.
References mul_vn_vn_fl(), NULL, VectorObject::size, and Vector_CreatePyObject_alloc().
Referenced by Vector_mul().
static PyObject* Vector_neg | ( | VectorObject * | self | ) | [static] |
Definition at line 1790 of file mathutils_Vector.c.
References BaseMath_ReadCallback, negate_vn_vn(), NULL, and Vector_CreatePyObject_alloc().
static PyObject* Vector_negate | ( | VectorObject * | self | ) | [static] |
Definition at line 2672 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, negate_vn(), and NULL.
static PyObject* Vector_new | ( | PyTypeObject * | type, |
PyObject * | args, | ||
PyObject * | UNUSEDkwds | ||
) | [static] |
Definition at line 56 of file mathutils_Vector.c.
References fill_vn_fl(), mathutils_array_parse_alloc(), NULL, Py_NEW, size(), and Vector_CreatePyObject().
static PyObject* Vector_normalize | ( | VectorObject * | self | ) | [static] |
Definition at line 342 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, normalize_vn(), NULL, and size().
Referenced by Vector_normalized().
static PyObject* Vector_normalized | ( | VectorObject * | self | ) | [static] |
Definition at line 361 of file mathutils_Vector.c.
References vec__apply_to_copy(), and Vector_normalize().
static PyObject* Vector_project | ( | VectorObject * | self, |
PyObject * | value | ||
) | [static] |
Definition at line 1025 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot(), mathutils_array_parse(), MAX_DIMENSIONS, NULL, Py_NEW, size(), and Vector_CreatePyObject().
static PyObject* Vector_reflect | ( | VectorObject * | self, |
PyObject * | value | ||
) | [static] |
Definition at line 816 of file mathutils_Vector.c.
References BaseMath_ReadCallback, mathutils_array_parse(), MAX_DIMENSIONS, normalize_v3(), NULL, Py_NEW, reflect(), reflect_v3_v3v3(), and Vector_CreatePyObject().
static PyObject* Vector_repr | ( | VectorObject * | self | ) | [static] |
Definition at line 1164 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, and Vector_to_tuple_ext().
static PyObject* Vector_resize | ( | VectorObject * | self, |
PyObject * | value | ||
) | [static] |
Definition at line 374 of file mathutils_Vector.c.
References fill_vn_fl(), NULL, Py_WRAP, and size().
static PyObject* Vector_resize_2d | ( | VectorObject * | self | ) | [static] |
Definition at line 469 of file mathutils_Vector.c.
static PyObject* Vector_resize_3d | ( | VectorObject * | self | ) | [static] |
Definition at line 504 of file mathutils_Vector.c.
static PyObject* Vector_resize_4d | ( | VectorObject * | self | ) | [static] |
Definition at line 542 of file mathutils_Vector.c.
static PyObject* Vector_resized | ( | VectorObject * | self, |
PyObject * | value | ||
) | [static] |
Definition at line 429 of file mathutils_Vector.c.
References fill_vn_fl(), NULL, size(), and Vector_CreatePyObject_alloc().
static PyObject* Vector_richcmpr | ( | PyObject * | objectA, |
PyObject * | objectB, | ||
int | comparison_type | ||
) | [static] |
Definition at line 1815 of file mathutils_Vector.c.
References BaseMath_ReadCallback, KDL::epsilon, EXPP_VectorsAreEqual(), NULL, VectorObject::size, vec_magnitude_nosqrt(), and VectorObject_Check.
static PyObject* Vector_rotate | ( | VectorObject * | self, |
PyObject * | value | ||
) | [static] |
Definition at line 1123 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, mathutils_any_to_rotmat(), mul_m3_v3(), and NULL.
static PyObject* Vector_rotation_difference | ( | VectorObject * | self, |
PyObject * | value | ||
) | [static] |
Definition at line 990 of file mathutils_Vector.c.
References BaseMath_ReadCallback, mathutils_array_parse(), MAX_DIMENSIONS, normalize_v3(), normalize_v3_v3(), NULL, Py_NEW, Quaternion_CreatePyObject(), and rotation_between_vecs_to_quat().
static PyObject* Vector_slice | ( | VectorObject * | self, |
int | begin, | ||
int | end | ||
) | [static] |
Definition at line 1273 of file mathutils_Vector.c.
References BaseMath_ReadCallback, CLAMP(), MIN2, and NULL.
Referenced by Vector_subscript().
static PyObject* Vector_str | ( | VectorObject * | self | ) | [static] |
Definition at line 1177 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BLI_dynstr_append(), BLI_dynstr_appendf(), BLI_dynstr_new(), i, mathutils_dynstr_to_py(), and NULL.
static PyObject* Vector_sub | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 1408 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, VectorObject::size, sub_vn_vnvn(), Vector_CreatePyObject_alloc(), and VectorObject_Check.
static PyObject* Vector_subscript | ( | VectorObject * | self, |
PyObject * | item | ||
) | [static] |
Definition at line 1912 of file mathutils_Vector.c.
References i, NULL, step(), Vector_item(), and Vector_slice().
static PyObject* Vector_swizzle_get | ( | VectorObject * | self, |
void * | closure | ||
) | [static] |
Definition at line 2114 of file mathutils_Vector.c.
References BaseMath_ReadCallback, GET_INT_FROM_POINTER, MAX_DIMENSIONS, NULL, Py_NEW, SWIZZLE_AXIS, SWIZZLE_BITS_PER_AXIS, SWIZZLE_VALID_AXIS, and Vector_CreatePyObject().
static int Vector_swizzle_set | ( | VectorObject * | self, |
PyObject * | value, | ||
void * | closure | ||
) | [static] |
Definition at line 2154 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, GET_INT_FROM_POINTER, i, mathutils_array_parse(), MAX_DIMENSIONS, SWIZZLE_AXIS, SWIZZLE_BITS_PER_AXIS, and SWIZZLE_VALID_AXIS.
static PyObject* Vector_to_2d | ( | VectorObject * | self | ) | [static] |
Definition at line 583 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, Py_NEW, and Vector_CreatePyObject().
static PyObject* Vector_to_3d | ( | VectorObject * | self | ) | [static] |
Definition at line 598 of file mathutils_Vector.c.
References BaseMath_ReadCallback, MIN2, NULL, Py_NEW, and Vector_CreatePyObject().
static PyObject* Vector_to_4d | ( | VectorObject * | self | ) | [static] |
Definition at line 616 of file mathutils_Vector.c.
References BaseMath_ReadCallback, MIN2, NULL, Py_NEW, and Vector_CreatePyObject().
static PyObject* Vector_to_track_quat | ( | VectorObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 694 of file mathutils_Vector.c.
References BaseMath_ReadCallback, negate_v3_v3(), NULL, Py_NEW, Quaternion_CreatePyObject(), strlen(), and vec_to_quat().
static PyObject* Vector_to_tuple | ( | VectorObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 659 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, and Vector_to_tuple_ext().
static PyObject * Vector_to_tuple_ext | ( | VectorObject * | self, |
int | ndigits | ||
) | [static] |
Definition at line 638 of file mathutils_Vector.c.
References double_round(), and i.
Referenced by Vector_repr(), and Vector_to_tuple().
static PyObject* Vector_zero | ( | VectorObject * | self | ) | [static] |
Definition at line 322 of file mathutils_Vector.c.
References BaseMath_WriteCallback, fill_vn_fl(), and NULL.
PyMappingMethods Vector_AsMapping [static] |
{ (lenfunc)Vector_len, (binaryfunc)Vector_subscript, (objobjargproc)Vector_ass_subscript }
Definition at line 1981 of file mathutils_Vector.c.
PyGetSetDef Vector_getseters[] [static] |
Definition at line 2232 of file mathutils_Vector.c.
struct PyMethodDef Vector_methods[] [static] |
Definition at line 2683 of file mathutils_Vector.c.
PyNumberMethods Vector_NumMethods [static] |
Definition at line 1988 of file mathutils_Vector.c.
PySequenceMethods Vector_SeqMethods [static] |
{ (lenfunc) Vector_len, (binaryfunc) NULL, (ssizeargfunc) NULL, (ssizeargfunc) Vector_item, NULL, (ssizeobjargproc) Vector_ass_item, NULL, (objobjproc) NULL, (binaryfunc) NULL, (ssizeargfunc) NULL, }
Definition at line 1899 of file mathutils_Vector.c.
PyTypeObject vector_Type |
Definition at line 2734 of file mathutils_Vector.c.
Referenced by M_Geometry_area_tri(), M_Geometry_barycentric_transform(), M_Geometry_distance_point_to_plane(), 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_quad_2d(), M_Geometry_intersect_point_tri_2d(), M_Geometry_intersect_ray_tri(), M_Geometry_normal(), M_Geometry_tesselate_polygon(), and PyInit_mathutils().