Blender  V2.59
Defines | Functions | Variables
mathutils_Vector.c File Reference
#include <Python.h>
#include "mathutils.h"
#include "BLI_math.h"
#include "BLI_utildefines.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

void PyC_LineSpit (void)
static PyObject * Vector_copy (VectorObject *self)
static PyObject * Vector_to_tuple_ext (VectorObject *self, int ndigits)
static PyObject * Vector_new (PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds))
static PyObject * vec__apply_to_copy (PyNoArgsFunction vec_func, VectorObject *self)
 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 results\n"" in all axis having a nan value (not a number).\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_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:: 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 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 rvec[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)
static PyObject * Vector_getAxis (VectorObject *self, void *type)
static int Vector_setAxis (VectorObject *self, PyObject *value, void *type)
static PyObject * Vector_getLength (VectorObject *self, void *UNUSED(closure))
static int Vector_setLength (VectorObject *self, PyObject *value)
static PyObject * Vector_getLengthSquared (VectorObject *self, void *UNUSED(closure))
static PyObject * Vector_getSwizzle (VectorObject *self, void *closure)
static int Vector_setSwizzle (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 * newVectorObject (float *vec, const int size, const int type, PyTypeObject *base_type)
PyObject * newVectorObject_cb (PyObject *cb_user, int size, int cb_type, int cb_subtype)

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

Define Documentation

#define MAX_DIMENSIONS   4
#define SWIZZLE_AXIS   0x3

Definition at line 49 of file mathutils_Vector.c.

Referenced by Vector_getSwizzle(), and Vector_setSwizzle().

#define SWIZZLE_BITS_PER_AXIS   3

Definition at line 47 of file mathutils_Vector.c.

Referenced by Vector_getSwizzle(), and Vector_setSwizzle().

#define SWIZZLE_VALID_AXIS   0x4

Definition at line 48 of file mathutils_Vector.c.

Referenced by Vector_getSwizzle(), and Vector_setSwizzle().


Function Documentation

int column_vector_multiplication ( float  rvec[MAX_DIMENSIONS],
VectorObject vec,
MatrixObject mat 
)
PyObject* newVectorObject ( float *  vec,
const int  size,
const int  type,
PyTypeObject *  base_type 
)
PyObject* newVectorObject_cb ( PyObject *  cb_user,
int  size,
int  cb_type,
int  cb_subtype 
)

Definition at line 2491 of file mathutils_Vector.c.

References newVectorObject(), and Py_NEW.

Referenced by Matrix_item(), Matrix_slice(), and pyrna_math_object_from_array().

void PyC_LineSpit ( void  )

Definition at line 129 of file py_capi_utils.c.

References PyC_FileAndNum(), and PYC_INTERPRETER_ACTIVE.

Referenced by RNA_warning(), Vector_imul(), and Vector_mul().

PyDoc_STRVAR ( Vector_zero_doc  ,
".. method:: zero()\n""\n"" Set all values to zero.\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 results\n""in all axis having a nan value(not a number).\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_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_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_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_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_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_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_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_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_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_rotation_difference_doc  ,
".. function:: 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_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_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_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_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 ( vector_doc  ,
"This object gives access to Vectors in Blender."   
)
static PyObject* vec__apply_to_copy ( PyNoArgsFunction  vec_func,
VectorObject self 
) [static]

Definition at line 78 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 1425 of file mathutils_Vector.c.

References dot(), i, and size().

Referenced by Vector_richcmpr().

static PyObject* Vector_add ( PyObject *  v1,
PyObject *  v2 
) [static]
static PyObject* Vector_angle ( VectorObject self,
PyObject *  args 
) [static]
static int Vector_ass_item ( VectorObject self,
int  i,
PyObject *  value 
) [static]

Definition at line 896 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 864 of file mathutils_Vector.c.

References BaseMath_WriteIndexCallback, and i.

Referenced by Vector_ass_item(), and Vector_setAxis().

static int Vector_ass_slice ( VectorObject self,
int  begin,
int  end,
PyObject *  seq 
) [static]
static int Vector_ass_subscript ( VectorObject self,
PyObject *  item,
PyObject *  value 
) [static]

Definition at line 1577 of file mathutils_Vector.c.

References i, Vector_ass_item(), and Vector_ass_slice().

static PyObject * Vector_copy ( VectorObject self) [static]

Definition at line 808 of file mathutils_Vector.c.

References BaseMath_ReadCallback, newVectorObject(), NULL, and Py_NEW.

Referenced by vec__apply_to_copy().

static PyObject* Vector_cross ( VectorObject self,
PyObject *  value 
) [static]
static PyObject* Vector_div ( PyObject *  v1,
PyObject *  v2 
) [static]
static PyObject* Vector_dot ( VectorObject self,
PyObject *  value 
) [static]
static PyObject* Vector_getAxis ( VectorObject self,
void *  type 
) [static]

Definition at line 1659 of file mathutils_Vector.c.

References GET_INT_FROM_POINTER, TRUE, and vector_item_internal().

static PyObject* Vector_getLength ( VectorObject self,
void *  UNUSEDclosure 
) [static]

Definition at line 1670 of file mathutils_Vector.c.

References BaseMath_ReadCallback, dot(), i, NULL, and sqrt().

static PyObject* Vector_getLengthSquared ( VectorObject self,
void *  UNUSEDclosure 
) [static]

Definition at line 1732 of file mathutils_Vector.c.

References BaseMath_ReadCallback, dot(), i, and NULL.

static PyObject* Vector_getSwizzle ( VectorObject self,
void *  closure 
) [static]
static PyObject* Vector_iadd ( PyObject *  v1,
PyObject *  v2 
) [static]
static PyObject* Vector_idiv ( PyObject *  v1,
PyObject *  v2 
) [static]
static PyObject* Vector_imul ( PyObject *  v1,
PyObject *  v2 
) [static]
static PyObject* Vector_isub ( PyObject *  v1,
PyObject *  v2 
) [static]
static PyObject* Vector_item ( VectorObject self,
int  i 
) [static]

Definition at line 859 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 836 of file mathutils_Vector.c.

References BaseMath_ReadIndexCallback, i, and NULL.

Referenced by Vector_getAxis(), and Vector_item().

static int Vector_len ( VectorObject self) [static]

Definition at line 831 of file mathutils_Vector.c.

static PyObject* Vector_lerp ( VectorObject self,
PyObject *  args 
) [static]
static PyObject* Vector_mul ( PyObject *  v1,
PyObject *  v2 
) [static]
static PyObject* vector_mul_float ( VectorObject vec,
const float  scalar 
) [static]

Definition at line 1120 of file mathutils_Vector.c.

References MAX_DIMENSIONS, mul_vn_vn_fl(), newVectorObject(), Py_NEW, and VectorObject::size.

Referenced by Vector_mul().

static PyObject* Vector_neg ( VectorObject self) [static]
static PyObject* Vector_negate ( VectorObject self) [static]

Definition at line 2306 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 57 of file mathutils_Vector.c.

References mathutils_array_parse(), newVectorObject(), NULL, Py_NEW, and size().

static PyObject* Vector_normalize ( VectorObject self) [static]

Definition at line 119 of file mathutils_Vector.c.

References BaseMath_ReadCallback, BaseMath_WriteCallback, i, norm(), NULL, and sqrt().

Referenced by Vector_normalized().

static PyObject* Vector_normalized ( VectorObject self) [static]

Definition at line 146 of file mathutils_Vector.c.

References vec__apply_to_copy(), and Vector_normalize().

static PyObject* Vector_project ( VectorObject self,
PyObject *  value 
) [static]
static PyObject* Vector_reflect ( VectorObject self,
PyObject *  value 
) [static]
static PyObject* Vector_repr ( VectorObject self) [static]

Definition at line 816 of file mathutils_Vector.c.

References BaseMath_ReadCallback, NULL, and Vector_to_tuple_ext().

static PyObject* Vector_resize_2d ( VectorObject self) [static]

Definition at line 159 of file mathutils_Vector.c.

References NULL, and Py_WRAP.

static PyObject* Vector_resize_3d ( VectorObject self) [static]

Definition at line 194 of file mathutils_Vector.c.

References NULL, and Py_WRAP.

static PyObject* Vector_resize_4d ( VectorObject self) [static]

Definition at line 232 of file mathutils_Vector.c.

References NULL, and Py_WRAP.

static PyObject* Vector_richcmpr ( PyObject *  objectA,
PyObject *  objectB,
int  comparison_type 
) [static]
static PyObject* Vector_rotate ( VectorObject self,
PyObject *  value 
) [static]
static PyObject* Vector_rotation_difference ( VectorObject self,
PyObject *  value 
) [static]
static int Vector_setAxis ( VectorObject self,
PyObject *  value,
void *  type 
) [static]

Definition at line 1664 of file mathutils_Vector.c.

References GET_INT_FROM_POINTER, TRUE, and vector_ass_item_internal().

static int Vector_setLength ( VectorObject self,
PyObject *  value 
) [static]

Definition at line 1684 of file mathutils_Vector.c.

References BaseMath_ReadCallback, BaseMath_WriteCallback, dot(), fill_vn(), i, and sqrt().

static int Vector_setSwizzle ( VectorObject self,
PyObject *  value,
void *  closure 
) [static]
static PyObject* Vector_slice ( VectorObject self,
int  begin,
int  end 
) [static]

Definition at line 902 of file mathutils_Vector.c.

References BaseMath_ReadCallback, CLAMP(), MIN2, and NULL.

Referenced by Vector_subscript().

static PyObject* Vector_sub ( PyObject *  v1,
PyObject *  v2 
) [static]
static PyObject* Vector_subscript ( VectorObject self,
PyObject *  item 
) [static]

Definition at line 1540 of file mathutils_Vector.c.

References i, NULL, Vector_item(), and Vector_slice().

static PyObject* Vector_to_2d ( VectorObject self) [static]

Definition at line 273 of file mathutils_Vector.c.

References BaseMath_ReadCallback, newVectorObject(), NULL, and Py_NEW.

static PyObject* Vector_to_3d ( VectorObject self) [static]

Definition at line 288 of file mathutils_Vector.c.

References BaseMath_ReadCallback, MIN2, newVectorObject(), NULL, and Py_NEW.

static PyObject* Vector_to_4d ( VectorObject self) [static]

Definition at line 306 of file mathutils_Vector.c.

References BaseMath_ReadCallback, MIN2, newVectorObject(), NULL, and Py_NEW.

static PyObject* Vector_to_track_quat ( VectorObject self,
PyObject *  args 
) [static]
static PyObject* Vector_to_tuple ( VectorObject self,
PyObject *  args 
) [static]

Definition at line 349 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 328 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 98 of file mathutils_Vector.c.

References BaseMath_WriteCallback, fill_vn(), and NULL.


Variable Documentation

PyMappingMethods Vector_AsMapping [static]
Initial value:
 {
        (lenfunc)Vector_len,
        (binaryfunc)Vector_subscript,
        (objobjargproc)Vector_ass_subscript
}

Definition at line 1609 of file mathutils_Vector.c.

PyGetSetDef Vector_getseters[] [static]

Definition at line 1863 of file mathutils_Vector.c.

struct PyMethodDef Vector_methods[] [static]

Definition at line 2317 of file mathutils_Vector.c.

PyNumberMethods Vector_NumMethods [static]

Definition at line 1616 of file mathutils_Vector.c.

PySequenceMethods Vector_SeqMethods [static]
Initial value:
 {
        (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 1527 of file mathutils_Vector.c.

PyTypeObject vector_Type