Support for arbitrary sized vectors - (was limited by 2-4 previously)
patch http://codereview.appspot.com/5482043 from Andrew Hale * Text from the submission * This patch adds the ability to use arbitrary sized vectors from mathutils. Currently vectors are only of size 2, 3 or 4 since they are generally restricted to geometric applications. However, we can use arbitrary sized vectors for efficient calculations and data manipulation.
This commit is contained in:
@@ -41,11 +41,12 @@ extern PyTypeObject vector_Type;
|
||||
typedef struct {
|
||||
BASE_MATH_MEMBERS(vec);
|
||||
|
||||
unsigned char size; /* vec size 2,3 or 4 */
|
||||
int size; /* vec size 2,3 or 4 */
|
||||
} VectorObject;
|
||||
|
||||
/*prototypes*/
|
||||
PyObject *Vector_CreatePyObject(float *vec, const int size, const int type, PyTypeObject *base_type);
|
||||
PyObject *Vector_CreatePyObject_cb(PyObject *user, int size, int callback_type, int subtype);
|
||||
PyObject *Vector_CreatePyObject_alloc(float *vec, const int size, PyTypeObject *base_type);
|
||||
|
||||
#endif /* MATHUTILS_VECTOR_H */
|
||||
|
||||
Reference in New Issue
Block a user