20 #define BASE_MATH_NEW(struct_name, root_type, base_type) \
21 ((struct_name *)((base_type ? (base_type)->tp_alloc(base_type, 0) : \
22 _PyObject_GC_New(&(root_type)))))
38 #define BASE_MATH_FLAG_DEFAULT 0
40 #define BASE_MATH_MEMBERS(_data) \
47 unsigned char cb_type; \
50 unsigned char cb_subtype; \
66 #define BaseMathObject_CheckExact(v) (Py_TYPE(v)->tp_dealloc == (destructor)BaseMathObject_dealloc)
118 #define BaseMath_CheckCallback(_self) \
119 (((_self)->cb_user ? _BaseMathObject_CheckCallback((BaseMathObject *)_self) : 0))
120 #define BaseMath_ReadCallback(_self) \
121 (((_self)->cb_user ? _BaseMathObject_ReadCallback((BaseMathObject *)_self) : 0))
122 #define BaseMath_WriteCallback(_self) \
123 (((_self)->cb_user ? _BaseMathObject_WriteCallback((BaseMathObject *)_self) : 0))
124 #define BaseMath_ReadIndexCallback(_self, _index) \
125 (((_self)->cb_user ? _BaseMathObject_ReadIndexCallback((BaseMathObject *)_self, _index) : 0))
126 #define BaseMath_WriteIndexCallback(_self, _index) \
127 (((_self)->cb_user ? _BaseMathObject_WriteIndexCallback((BaseMathObject *)_self, _index) : 0))
130 #define BaseMath_ReadCallback_ForWrite(_self) \
131 (UNLIKELY((_self)->flag & BASE_MATH_FLAG_IS_FROZEN) ? \
132 (_BaseMathObject_RaiseFrozenExc((BaseMathObject *)_self), -1) : \
133 (BaseMath_ReadCallback(_self)))
135 #define BaseMath_ReadIndexCallback_ForWrite(_self, _index) \
136 (UNLIKELY((_self)->flag & BASE_MATH_FLAG_IS_FROZEN) ? \
137 (_BaseMathObject_RaiseFrozenExc((BaseMathObject *)_self), -1) : \
138 (BaseMath_ReadIndexCallback(_self, _index)))
140 #define BaseMath_Prepare_ForWrite(_self) \
141 (UNLIKELY((_self)->flag & BASE_MATH_FLAG_IS_FROZEN) ? \
142 (_BaseMathObject_RaiseFrozenExc((BaseMathObject *)_self), -1) : \
145 #define BaseMathObject_Prepare_ForHash(_self) \
146 (UNLIKELY(((_self)->flag & BASE_MATH_FLAG_IS_FROZEN) == 0) ? \
147 (_BaseMathObject_RaiseNotFrozenExc((BaseMathObject *)_self), -1) : \
156 float *
array,
int array_num_min,
int array_num_max, PyObject *value,
const char *error_prefix);
163 const char *error_prefix);
170 const char *error_prefix);
177 const char *error_prefix);
184 const char *error_prefix);
193 int **
array,
int **start_table,
int **len_table, PyObject *value,
const char *error_prefix);
204 #define MU_ARRAY_ZERO (1u << 30)
207 #define MU_ARRAY_SPILL (1u << 31)
209 #define MU_ARRAY_FLAGS (MU_ARRAY_ZERO | MU_ARRAY_SPILL)
224 #ifndef MATH_STANDALONE
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
int(* BaseMathGetFunc)(BaseMathObject *, int)
int EXPP_FloatsAreEqual(float A, float B, int maxDiff)
PyObject * BaseMathObject_freeze(BaseMathObject *self)
PyObject * BaseMathObject_is_valid_get(BaseMathObject *self, void *)
int _BaseMathObject_CheckCallback(BaseMathObject *self)
PyMODINIT_FUNC PyInit_mathutils(void)
@ BASE_MATH_FLAG_IS_FROZEN
int(* BaseMathGetIndexFunc)(BaseMathObject *, int, int)
PyObject * BaseMathObject_is_wrapped_get(BaseMathObject *self, void *)
PyObject * mathutils_dynstr_to_py(struct DynStr *ds)
int mathutils_array_parse_alloc(float **array, int array_num_min, PyObject *value, const char *error_prefix)
int mathutils_array_parse_alloc_viseq(int **array, int **start_table, int **len_table, PyObject *value, const char *error_prefix)
int(* BaseMathSetIndexFunc)(BaseMathObject *, int, int)
void _BaseMathObject_RaiseFrozenExc(const BaseMathObject *self)
void BaseMathObject_dealloc(BaseMathObject *self)
int _BaseMathObject_WriteCallback(BaseMathObject *self)
int mathutils_int_array_parse(int *array, int array_dim, PyObject *value, const char *error_prefix)
int EXPP_VectorsAreEqual(const float *vecA, const float *vecB, int size, int floatSteps)
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
int(* BaseMathSetFunc)(BaseMathObject *, int)
int mathutils_array_parse_alloc_vi(int **array, int array_dim, PyObject *value, const char *error_prefix)
Py_hash_t mathutils_array_hash(const float *float_array, size_t array_len)
int mathutils_array_parse_alloc_v(float **array, int array_dim, PyObject *value, const char *error_prefix)
char BaseMathObject_is_valid_doc[]
char BaseMathObject_is_wrapped_doc[]
char BaseMathObject_is_frozen_doc[]
int mathutils_any_to_rotmat(float rmat[3][3], PyObject *value, const char *error_prefix)
int column_vector_multiplication(float r_vec[4], VectorObject *vec, MatrixObject *mat)
PyObject * BaseMathObject_owner_get(BaseMathObject *self, void *)
#define BASE_MATH_MEMBERS(_data)
char BaseMathObject_owner_doc[]
int _BaseMathObject_WriteIndexCallback(BaseMathObject *self, int index)
char BaseMathObject_freeze_doc[]
int BaseMathObject_clear(BaseMathObject *self)
int _BaseMathObject_ReadIndexCallback(BaseMathObject *self, int index)
int _BaseMathObject_ReadCallback(BaseMathObject *self)
int(* BaseMathCheckFunc)(BaseMathObject *)
PyObject * BaseMathObject_is_frozen_get(BaseMathObject *self, void *)
unsigned char Mathutils_RegisterCallback(Mathutils_Callback *cb)
void _BaseMathObject_RaiseNotFrozenExc(const BaseMathObject *self)
int BaseMathObject_traverse(BaseMathObject *self, visitproc visit, void *arg)
BaseMathSetIndexFunc set_index
BaseMathGetIndexFunc get_index