Blender  V2.59
Classes | Defines | Typedefs | Functions | Variables
mathutils.h File Reference
#include "mathutils_Vector.h"
#include "mathutils_Matrix.h"
#include "mathutils_Quaternion.h"
#include "mathutils_Euler.h"
#include "mathutils_Color.h"
#include "mathutils_geometry.h"

Go to the source code of this file.

Classes

struct  BaseMathObject
struct  Mathutils_Callback

Defines

#define BASE_MATH_MEMBERS(_data)
#define Py_NEW   1
#define Py_WRAP   2
#define BaseMath_ReadCallback(_self)   (((_self)->cb_user ? _BaseMathObject_ReadCallback((BaseMathObject *)_self):0))
#define BaseMath_WriteCallback(_self)   (((_self)->cb_user ?_BaseMathObject_WriteCallback((BaseMathObject *)_self):0))
#define BaseMath_ReadIndexCallback(_self, _index)   (((_self)->cb_user ? _BaseMathObject_ReadIndexCallback((BaseMathObject *)_self, _index):0))
#define BaseMath_WriteIndexCallback(_self, _index)   (((_self)->cb_user ? _BaseMathObject_WriteIndexCallback((BaseMathObject *)_self, _index):0))

Typedefs

typedef struct Mathutils_Callback Mathutils_Callback
typedef int(* BaseMathCheckFunc )(BaseMathObject *)
typedef int(* BaseMathGetFunc )(BaseMathObject *, int)
typedef int(* BaseMathSetFunc )(BaseMathObject *, int)
typedef int(* BaseMathGetIndexFunc )(BaseMathObject *, int, int)
typedef int(* BaseMathSetIndexFunc )(BaseMathObject *, int, int)

Functions

PyObject * BaseMathObject_getOwner (BaseMathObject *self, void *)
PyObject * BaseMathObject_getWrapped (BaseMathObject *self, void *)
int BaseMathObject_traverse (BaseMathObject *self, visitproc visit, void *arg)
int BaseMathObject_clear (BaseMathObject *self)
void BaseMathObject_dealloc (BaseMathObject *self)
PyMODINIT_FUNC PyInit_mathutils (void)
int EXPP_FloatsAreEqual (float A, float B, int floatSteps)
int EXPP_VectorsAreEqual (float *vecA, float *vecB, int size, int floatSteps)
int Mathutils_RegisterCallback (Mathutils_Callback *cb)
int _BaseMathObject_ReadCallback (BaseMathObject *self)
int _BaseMathObject_WriteCallback (BaseMathObject *self)
int _BaseMathObject_ReadIndexCallback (BaseMathObject *self, int index)
int _BaseMathObject_WriteIndexCallback (BaseMathObject *self, int index)
int mathutils_array_parse (float *array, int array_min, int array_max, PyObject *value, const char *error_prefix)
int mathutils_any_to_rotmat (float rmat[3][3], PyObject *value, const char *error_prefix)
int column_vector_multiplication (float rvec[4], VectorObject *vec, MatrixObject *mat)

Variables

char BaseMathObject_Wrapped_doc []
char BaseMathObject_Owner_doc []

Define Documentation

#define BASE_MATH_MEMBERS (   _data)
Value:
PyObject_VAR_HEAD \
        float *_data;                           /* array of data (alias), wrapped status depends on wrapped status */ \
        PyObject *cb_user;                      /* if this vector references another object, otherwise NULL, *Note* this owns its reference */ \
        unsigned char cb_type;          /* which user funcs do we adhere to, RNA, GameObject, etc */ \
        unsigned char cb_subtype;       /* subtype: location, rotation... to avoid defining many new functions for every attribute of the same type */ \
        unsigned char wrapped;

Definition at line 44 of file mathutils.h.

#define BaseMath_ReadCallback (   _self)    (((_self)->cb_user ? _BaseMathObject_ReadCallback((BaseMathObject *)_self):0))

Definition at line 103 of file mathutils.h.

Referenced by Color_add(), Color_ass_slice(), Color_copy(), Color_div(), Color_getChannelHSV(), Color_getHSV(), Color_iadd(), Color_idiv(), Color_imul(), Color_isub(), Color_mul(), Color_neg(), Color_repr(), Color_richcmpr(), Color_setChannelHSV(), Color_slice(), Color_sub(), Euler_ass_slice(), Euler_copy(), Euler_getOrder(), Euler_make_compatible(), Euler_repr(), Euler_richcmpr(), Euler_rotate(), Euler_rotate_axis(), Euler_slice(), Euler_to_matrix(), Euler_to_quaternion(), M_Geometry_area_tri(), M_Geometry_interpolate_bezier(), M_Geometry_intersect_line_line(), M_Geometry_intersect_line_line_2d(), M_Geometry_intersect_line_plane(), M_Geometry_intersect_line_sphere(), M_Geometry_intersect_line_sphere_2d(), M_Geometry_intersect_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(), mathutils_any_to_rotmat(), mathutils_array_parse(), mathutils_matrix_vector_check(), mathutils_matrix_vector_get(), mathutils_matrix_vector_get_index(), mathutils_matrix_vector_set(), mathutils_matrix_vector_set_index(), Matrix_add(), Matrix_ass_item(), Matrix_ass_slice(), Matrix_copy(), Matrix_decompose(), Matrix_determinant(), Matrix_identity(), Matrix_inv(), Matrix_invert(), Matrix_is_negative_get(), Matrix_is_orthogonal_get(), Matrix_item(), Matrix_lerp(), Matrix_median_scale_get(), Matrix_mul(), Matrix_repr(), Matrix_richcmpr(), Matrix_rotate(), Matrix_slice(), Matrix_sub(), Matrix_to_3x3(), Matrix_to_4x4(), Matrix_to_euler(), Matrix_to_quaternion(), Matrix_to_scale(), Matrix_to_translation(), Matrix_transpose(), Quaternion_add(), Quaternion_ass_slice(), Quaternion_conjugate(), Quaternion_copy(), Quaternion_cross(), Quaternion_dot(), Quaternion_getAngle(), Quaternion_getAxisVec(), Quaternion_getMagnitude(), Quaternion_identity(), Quaternion_invert(), Quaternion_mul(), Quaternion_neg(), Quaternion_negate(), Quaternion_normalize(), Quaternion_repr(), Quaternion_richcmpr(), Quaternion_rotate(), Quaternion_rotation_difference(), Quaternion_setAngle(), Quaternion_setAxisVec(), Quaternion_slerp(), Quaternion_slice(), Quaternion_sub(), Quaternion_to_euler(), Quaternion_to_matrix(), Vector_add(), Vector_angle(), Vector_ass_slice(), Vector_copy(), Vector_cross(), Vector_div(), Vector_dot(), Vector_getLength(), Vector_getLengthSquared(), Vector_getSwizzle(), Vector_iadd(), Vector_idiv(), Vector_imul(), Vector_isub(), Vector_lerp(), Vector_mul(), Vector_neg(), Vector_negate(), Vector_normalize(), Vector_project(), Vector_reflect(), Vector_repr(), Vector_richcmpr(), Vector_rotate(), Vector_rotation_difference(), Vector_setLength(), Vector_setSwizzle(), Vector_slice(), Vector_sub(), Vector_to_2d(), Vector_to_3d(), Vector_to_4d(), Vector_to_track_quat(), and Vector_to_tuple().

#define BaseMath_ReadIndexCallback (   _self,
  _index 
)    (((_self)->cb_user ? _BaseMathObject_ReadIndexCallback((BaseMathObject *)_self, _index):0))

Definition at line 105 of file mathutils.h.

Referenced by Color_item(), Euler_item(), Quaternion_item(), and vector_item_internal().

#define BaseMath_WriteCallback (   _self)    (((_self)->cb_user ?_BaseMathObject_WriteCallback((BaseMathObject *)_self):0))
#define BaseMath_WriteIndexCallback (   _self,
  _index 
)    (((_self)->cb_user ? _BaseMathObject_WriteIndexCallback((BaseMathObject *)_self, _index):0))
#define Py_NEW   1

Definition at line 76 of file mathutils.h.

Referenced by C_Matrix_OrthoProjection(), C_Matrix_Rotation(), C_Matrix_Scale(), C_Matrix_Shear(), C_Matrix_Translation(), Color_add(), Color_copy(), color_mul_float(), Color_neg(), Color_new(), Color_sub(), Euler_copy(), Euler_new(), Euler_to_matrix(), Euler_to_quaternion(), 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_point_line(), M_Geometry_intersect_ray_tri(), M_Geometry_normal(), Matrix_add(), Matrix_copy(), Matrix_decompose(), Matrix_lerp(), Matrix_mul(), matrix_mul_float(), Matrix_new(), Matrix_sub(), Matrix_to_3x3(), Matrix_to_4x4(), Matrix_to_euler(), Matrix_to_quaternion(), Matrix_to_scale(), Matrix_to_translation(), newColorObject(), newColorObject_cb(), newEulerObject(), newEulerObject_cb(), newMatrixObject(), newMatrixObject_cb(), newQuaternionObject(), newQuaternionObject_cb(), newVectorObject(), newVectorObject_cb(), pyrna_math_object_from_array(), pyrna_param_to_py(), quat_mul_float(), Quaternion_add(), Quaternion_copy(), Quaternion_cross(), Quaternion_getAxisVec(), Quaternion_mul(), Quaternion_neg(), Quaternion_new(), Quaternion_rotation_difference(), Quaternion_slerp(), Quaternion_sub(), Quaternion_to_euler(), Quaternion_to_matrix(), Vector_add(), Vector_copy(), Vector_cross(), Vector_div(), Vector_getSwizzle(), Vector_lerp(), Vector_mul(), vector_mul_float(), Vector_neg(), Vector_new(), Vector_project(), Vector_reflect(), Vector_rotation_difference(), Vector_sub(), Vector_to_2d(), Vector_to_3d(), Vector_to_4d(), and Vector_to_track_quat().

#define Py_WRAP   2

Typedef Documentation

typedef int(* BaseMathCheckFunc)(BaseMathObject *)

Definition at line 81 of file mathutils.h.

typedef int(* BaseMathGetFunc)(BaseMathObject *, int)

Definition at line 82 of file mathutils.h.

typedef int(* BaseMathGetIndexFunc)(BaseMathObject *, int, int)

Definition at line 84 of file mathutils.h.

typedef int(* BaseMathSetFunc)(BaseMathObject *, int)

Definition at line 83 of file mathutils.h.

typedef int(* BaseMathSetIndexFunc)(BaseMathObject *, int, int)

Definition at line 85 of file mathutils.h.

Definition at line 79 of file mathutils.h.


Function Documentation

int _BaseMathObject_ReadCallback ( BaseMathObject self)

Definition at line 233 of file mathutils.c.

References Mathutils_Callback::get.

int _BaseMathObject_ReadIndexCallback ( BaseMathObject self,
int  index 
)

Definition at line 261 of file mathutils.c.

References Mathutils_Callback::get_index.

int _BaseMathObject_WriteCallback ( BaseMathObject self)

Definition at line 247 of file mathutils.c.

References Mathutils_Callback::set.

int _BaseMathObject_WriteIndexCallback ( BaseMathObject self,
int  index 
)

Definition at line 275 of file mathutils.c.

References Mathutils_Callback::set_index.

int BaseMathObject_clear ( BaseMathObject self)

Definition at line 310 of file mathutils.c.

Referenced by BaseMathObject_dealloc().

void BaseMathObject_dealloc ( BaseMathObject self)

Definition at line 316 of file mathutils.c.

References BaseMathObject_clear(), and Py_WRAP.

PyObject* BaseMathObject_getOwner ( BaseMathObject self,
void *   
)
PyObject* BaseMathObject_getWrapped ( BaseMathObject self,
void *   
)
int BaseMathObject_traverse ( BaseMathObject self,
visitproc  visit,
void *  arg 
)

Definition at line 304 of file mathutils.c.

int column_vector_multiplication ( float  rvec[4],
VectorObject vec,
MatrixObject mat 
)

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

int EXPP_FloatsAreEqual ( float  A,
float  B,
int  floatSteps 
)
int EXPP_VectorsAreEqual ( float *  vecA,
float *  vecB,
int  size,
int  floatSteps 
)
int mathutils_any_to_rotmat ( float  rmat[3][3],
PyObject *  value,
const char *  error_prefix 
)
int mathutils_array_parse ( float *  array,
int  array_min,
int  array_max,
PyObject *  value,
const char *  error_prefix 
)
int Mathutils_RegisterCallback ( Mathutils_Callback cb)

Definition at line 218 of file mathutils.c.

References i.

Referenced by BPY_rna_init(), and PyInit_mathutils().

PyMODINIT_FUNC PyInit_mathutils ( void  )

Variable Documentation

Definition at line 290 of file mathutils.c.

Definition at line 298 of file mathutils.c.