formatting edits in py api, no functional changes
[blender.git] / source / blender / python / mathutils / mathutils_Vector.c
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19  * All rights reserved.
20  *
21  *
22  * Contributor(s): Willian P. Germano, Joseph Gilbert, Ken Hughes, Alex Fraser, Campbell Barton
23  *
24  * ***** END GPL LICENSE BLOCK *****
25  */
26
27 /** \file blender/python/mathutils/mathutils_Vector.c
28  *  \ingroup pymathutils
29  */
30
31
32 #include <Python.h>
33
34 #include "mathutils.h"
35
36 #include "BLI_math.h"
37 #include "BLI_utildefines.h"
38
39 #define MAX_DIMENSIONS 4
40
41 /* Swizzle axes get packed into a single value that is used as a closure. Each
42    axis uses SWIZZLE_BITS_PER_AXIS bits. The first bit (SWIZZLE_VALID_AXIS) is
43    used as a sentinel: if it is unset, the axis is not valid. */
44 #define SWIZZLE_BITS_PER_AXIS 3
45 #define SWIZZLE_VALID_AXIS 0x4
46 #define SWIZZLE_AXIS       0x3
47
48 static PyObject *Vector_copy(VectorObject *self);
49 static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits);
50 static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat);
51
52 /* Supports 2D, 3D, and 4D vector objects both int and float values
53  * accepted. Mixed float and int values accepted. Ints are parsed to float
54  */
55 static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds))
56 {
57         float *vec= NULL;
58         int size= 3; /* default to a 3D vector */
59
60         switch (PyTuple_GET_SIZE(args)) {
61         case 0:
62                 vec= PyMem_Malloc(size * sizeof(float));
63
64                 if (vec == NULL) {
65                         PyErr_SetString(PyExc_MemoryError,
66                                                         "Vector(): "
67                                                         "problem allocating pointer space");
68                         return NULL;
69                 }
70
71                 fill_vn_fl(vec, size, 0.0f);
72                 break;
73         case 1:
74                 if ((size=mathutils_array_parse_alloc(&vec, 2, PyTuple_GET_ITEM(args, 0), "mathutils.Vector()")) == -1) {
75                         if (vec) {
76                                 PyMem_Free(vec);
77                         }
78                         return NULL;
79                 }
80                 break;
81         default:
82                 PyErr_SetString(PyExc_TypeError,
83                                 "mathutils.Vector(): "
84                                 "more then a single arg given");
85                 return NULL;
86         }
87         return Vector_CreatePyObject(vec, size, Py_NEW, type);
88 }
89
90 static PyObject *vec__apply_to_copy(PyNoArgsFunction vec_func, VectorObject *self)
91 {
92         PyObject *ret= Vector_copy(self);
93         PyObject *ret_dummy= vec_func(ret);
94         if (ret_dummy) {
95                 Py_DECREF(ret_dummy);
96                 return (PyObject *)ret;
97         }
98         else { /* error */
99                 Py_DECREF(ret);
100                 return NULL;
101         }
102 }
103
104 /*-----------------------CLASS-METHODS----------------------------*/
105 PyDoc_STRVAR(C_Vector_Fill_doc,
106 ".. classmethod:: Fill(size, fill=0.0)\n"
107 "\n"
108 "   Create a vector of length size with all values set to fill.\n"
109 "\n"
110 "   :arg size: The length of the vector to be created.\n"
111 "   :type size: int\n"
112 "   :arg fill: The value used to fill the vector.\n"
113 "   :type fill: float\n"
114 );
115 static PyObject *C_Vector_Fill(PyObject *cls, PyObject *args)
116 {
117         float *vec;
118         int size;
119         float fill= 0.0f;
120
121         if (!PyArg_ParseTuple(args, "i|f:Vector.Fill", &size, &fill)) {
122                 return NULL;
123         }
124
125         if (size < 2) {
126                 PyErr_SetString(PyExc_RuntimeError,
127                                 "Vector(): invalid size");
128                 return NULL;
129         }
130
131         vec= PyMem_Malloc(size * sizeof(float));
132
133         if (vec == NULL) {
134                 PyErr_SetString(PyExc_MemoryError,
135                                                 "Vector.Fill(): "
136                                 "problem allocating pointer space");
137                 return NULL;
138         }
139
140         fill_vn_fl(vec, size, fill);
141
142         return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
143 }
144
145 PyDoc_STRVAR(C_Vector_Range_doc,
146 ".. classmethod:: Range(start=0, stop, step=1)\n"
147 "\n"
148 "   Create a filled with a range of values.\n"
149 "\n"
150 "   :arg start: The start of the range used to fill the vector.\n"
151 "   :type start: int\n"
152 "   :arg stop: The end of the range used to fill the vector.\n"
153 "   :type stop: int\n"
154 "   :arg step: The step between successive values in the vector.\n"
155 "   :type step: int\n"
156 );
157 static PyObject *C_Vector_Range(PyObject *cls, PyObject *args)
158 {
159         float *vec;
160         int stop, size;
161         int start= 0;
162         int step= 1;
163
164         if (!PyArg_ParseTuple(args, "i|ii:Vector.Range", &start, &stop, &step)) {
165                 return NULL;
166         }
167
168         switch (PyTuple_GET_SIZE(args)) {
169         case 1:
170                 size = start;
171                 start= 0;
172                 break;
173         case 2:
174                 if (start >= stop) {
175                         PyErr_SetString(PyExc_RuntimeError,
176                                 "Start value is larger"
177                                                 "than the stop value");
178                         return NULL;
179                 }
180
181                 size= stop - start;
182                 break;
183         default:
184                 if (start >= stop) {
185                         PyErr_SetString(PyExc_RuntimeError,
186                                 "Start value is larger"
187                                                 "than the stop value");
188                         return NULL;
189                 }
190                 size= (stop - start)/step;
191                 if (size%step)
192                         size++;
193                 break;
194         }
195
196         vec= PyMem_Malloc(size * sizeof(float));
197
198         if (vec == NULL) {
199                 PyErr_SetString(PyExc_MemoryError,
200                                                 "Vector.Range(): "
201                                 "problem allocating pointer space");
202                 return NULL;
203         }
204
205         range_vn_fl(vec, size, (float)start, (float)step);
206
207         return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
208 }
209
210 PyDoc_STRVAR(C_Vector_Linspace_doc,
211 ".. classmethod:: Linspace(start, stop, size)\n"
212 "\n"
213 "   Create a vector of the specified size which is filled with linearly spaced values between start and stop values.\n"
214 "\n"
215 "   :arg start: The start of the range used to fill the vector.\n"
216 "   :type start: int\n"
217 "   :arg stop: The end of the range used to fill the vector.\n"
218 "   :type stop: int\n"
219 "   :arg size: The size of the vector to be created.\n"
220 "   :type size: int\n"
221 );
222 static PyObject *C_Vector_Linspace(PyObject *cls, PyObject *args)
223 {
224         float *vec;
225         int size;
226         float start, end, step;
227
228         if (!PyArg_ParseTuple(args, "ffi:Vector.Linspace", &start, &end, &size)) {
229                 return NULL;
230         }
231
232         if (size < 2) {
233                 PyErr_SetString(PyExc_RuntimeError,
234                                 "Vector.Linspace(): invalid size");
235                 return NULL;
236         }
237
238         step= (end - start)/(float)(size-1);
239
240         vec= PyMem_Malloc(size * sizeof(float));
241
242         if (vec == NULL) {
243                 PyErr_SetString(PyExc_MemoryError,
244                                                 "Vector.Linspace(): "
245                                 "problem allocating pointer space");
246                 return NULL;
247         }
248
249         range_vn_fl(vec, size, start, step);
250
251         return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
252 }
253
254 PyDoc_STRVAR(C_Vector_Repeat_doc,
255 ".. classmethod:: Repeat(vector, size)\n"
256 "\n"
257 "   Create a vector by repeating the values in vector until the required size is reached.\n"
258 "\n"
259 "   :arg tuple: The vector to draw values from.\n"
260 "   :type tuple: :class:`mathutils.Vector`\n"
261 "   :arg size: The size of the vector to be created.\n"
262 "   :type size: int\n"
263 );
264 static PyObject *C_Vector_Repeat(PyObject *cls, PyObject *args)
265 {
266         float *vec;
267         float *iter_vec= NULL;
268         int i, size, value_size;
269         PyObject *value;
270
271         if (!PyArg_ParseTuple(args, "Oi:Vector.Repeat", &value, &size)) {
272                 return NULL;
273         }
274
275         if (size < 2) {
276                 PyErr_SetString(PyExc_RuntimeError,
277                                 "Vector.Repeat(): invalid size");
278                 return NULL;
279         }
280
281         if ((value_size=mathutils_array_parse_alloc(&iter_vec, 2, value, "Vector.Repeat(vector, size), invalid 'vector' arg")) == -1) {
282                 PyMem_Free(iter_vec);
283                 return NULL;
284         }
285
286         if (iter_vec == NULL) {
287                 PyErr_SetString(PyExc_MemoryError,
288                                                 "Vector.Repeat(): "
289                                 "problem allocating pointer space");
290                 return NULL;
291         }
292
293         vec= PyMem_Malloc(size * sizeof(float));
294
295         if (vec == NULL) {
296                 PyErr_SetString(PyExc_MemoryError,
297                                                 "Vector.Repeat(): "
298                                 "problem allocating pointer space");
299                 return NULL;
300         }
301
302         i= 0;
303         while (i < size) {
304                 vec[i]= iter_vec[i % value_size];
305                 i++;
306         }
307
308         PyMem_Free(iter_vec);
309
310         return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
311 }
312
313 /*-----------------------------METHODS---------------------------- */
314 PyDoc_STRVAR(Vector_zero_doc,
315 ".. method:: zero()\n"
316 "\n"
317 "   Set all values to zero.\n"
318 );
319 static PyObject *Vector_zero(VectorObject *self)
320 {
321         fill_vn_fl(self->vec, self->size, 0.0f);
322
323         if (BaseMath_WriteCallback(self) == -1)
324                 return NULL;
325
326         Py_RETURN_NONE;
327 }
328
329 PyDoc_STRVAR(Vector_normalize_doc,
330 ".. method:: normalize()\n"
331 "\n"
332 "   Normalize the vector, making the length of the vector always 1.0.\n"
333 "\n"
334 "   .. warning:: Normalizing a vector where all values are zero results\n"
335 "      in all axis having a nan value (not a number).\n"
336 "\n"
337 "   .. note:: Normalize works for vectors of all sizes,\n"
338 "      however 4D Vectors w axis is left untouched.\n"
339 );
340 static PyObject *Vector_normalize(VectorObject *self)
341 {
342         if (BaseMath_ReadCallback(self) == -1)
343                 return NULL;
344
345         normalize_vn(self->vec, self->size);
346
347         (void)BaseMath_WriteCallback(self);
348         Py_RETURN_NONE;
349 }
350 PyDoc_STRVAR(Vector_normalized_doc,
351 ".. method:: normalized()\n"
352 "\n"
353 "   Return a new, normalized vector.\n"
354 "\n"
355 "   :return: a normalized copy of the vector\n"
356 "   :rtype: :class:`Vector`\n"
357 );
358 static PyObject *Vector_normalized(VectorObject *self)
359 {
360         return vec__apply_to_copy((PyNoArgsFunction)Vector_normalize, self);
361 }
362
363 PyDoc_STRVAR(Vector_resize_doc,
364 ".. method:: resize(size=3)\n"
365 "\n"
366 "   Resize the vector to have size number of elements.\n"
367 "\n"
368 "   :return: an instance of itself\n"
369 "   :rtype: :class:`Vector`\n"
370 );
371 static PyObject *Vector_resize(VectorObject *self, PyObject *value)
372 {
373         int size;
374
375         if (self->wrapped==Py_WRAP) {
376                 PyErr_SetString(PyExc_TypeError,
377                                 "Vector.resize(): "
378                                 "cannot resize wrapped data - only python vectors");
379                 return NULL;
380         }
381         if (self->cb_user) {
382                 PyErr_SetString(PyExc_TypeError,
383                                 "Vector.resize(): "
384                                 "cannot resize a vector that has an owner");
385                 return NULL;
386         }
387
388         if ((size = PyLong_AsLong(value)) == -1) {
389                 PyErr_SetString(PyExc_TypeError,
390                                 "Vector.resize(size): "
391                                 "expected size argument to be an integer");
392                 return NULL;
393         }
394
395         if (size < 2) {
396                 PyErr_SetString(PyExc_RuntimeError,
397                                 "Vector.resize(): invalid size");
398                 return NULL;
399         }
400
401         self->vec = PyMem_Realloc(self->vec, (size * sizeof(float)));
402         if (self->vec == NULL) {
403                 PyErr_SetString(PyExc_MemoryError,
404                                                 "Vector.resize(): "
405                                 "problem allocating pointer space");
406                 return NULL;
407         }
408
409         /* If the vector has increased in length, set all new elements to 0.0f */
410         if (size > self->size) {
411                 fill_vn_fl(self->vec + self->size, size - self->size, 0.0f);
412         }
413
414         self->size = size;
415         Py_RETURN_NONE;
416 }
417
418 PyDoc_STRVAR(Vector_resized_doc,
419 ".. method:: resized(size=3)\n"
420 "\n"
421 "   Return a resized copy of the vector with size number of elements.\n"
422 "\n"
423 "   :return: a new vector\n"
424 "   :rtype: :class:`Vector`\n"
425 );
426 static PyObject *Vector_resized(VectorObject *self, PyObject *value)
427 {
428         int size;
429         float *vec;
430
431         /*if (!PyArg_ParseTuple(args, "i:resize", &size))
432                 return NULL;*/
433         if ((size = PyLong_AsLong(value)) == -1) {
434                 return NULL;
435         }
436
437         if (size < 2) {
438                 PyErr_SetString(PyExc_RuntimeError,
439                                 "Vector.resized(): invalid size");
440                 return NULL;
441         }
442
443         vec= PyMem_Malloc(size * sizeof(float));
444
445         if (vec == NULL) {
446                 PyErr_SetString(PyExc_MemoryError,
447                                                 "Vector.resized(): "
448                                 "problem allocating pointer space");
449                 return NULL;
450         }
451
452         fill_vn_fl(vec, size, 0.0f);
453         memcpy(vec, self->vec, self->size * sizeof(float));
454
455         return Vector_CreatePyObject_alloc(vec, size, NULL);
456 }
457
458 PyDoc_STRVAR(Vector_resize_2d_doc,
459 ".. method:: resize_2d()\n"
460 "\n"
461 "   Resize the vector to 2D  (x, y).\n"
462 "\n"
463 "   :return: an instance of itself\n"
464 "   :rtype: :class:`Vector`\n"
465 );
466 static PyObject *Vector_resize_2d(VectorObject *self)
467 {
468         if (self->wrapped==Py_WRAP) {
469                 PyErr_SetString(PyExc_TypeError,
470                                 "Vector.resize_2d(): "
471                                 "cannot resize wrapped data - only python vectors");
472                 return NULL;
473         }
474         if (self->cb_user) {
475                 PyErr_SetString(PyExc_TypeError,
476                                 "Vector.resize_2d(): "
477                                 "cannot resize a vector that has an owner");
478                 return NULL;
479         }
480
481         self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 2));
482         if (self->vec == NULL) {
483                 PyErr_SetString(PyExc_MemoryError,
484                                 "Vector.resize_2d(): "
485                                 "problem allocating pointer space");
486                 return NULL;
487         }
488
489         self->size = 2;
490         Py_RETURN_NONE;
491 }
492
493 PyDoc_STRVAR(Vector_resize_3d_doc,
494 ".. method:: resize_3d()\n"
495 "\n"
496 "   Resize the vector to 3D  (x, y, z).\n"
497 "\n"
498 "   :return: an instance of itself\n"
499 "   :rtype: :class:`Vector`\n"
500 );
501 static PyObject *Vector_resize_3d(VectorObject *self)
502 {
503         if (self->wrapped==Py_WRAP) {
504                 PyErr_SetString(PyExc_TypeError,
505                                 "Vector.resize_3d(): "
506                                 "cannot resize wrapped data - only python vectors");
507                 return NULL;
508         }
509         if (self->cb_user) {
510                 PyErr_SetString(PyExc_TypeError,
511                                 "Vector.resize_3d(): "
512                                 "cannot resize a vector that has an owner");
513                 return NULL;
514         }
515
516         self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 3));
517         if (self->vec == NULL) {
518                 PyErr_SetString(PyExc_MemoryError,
519                                 "Vector.resize_3d(): "
520                                 "problem allocating pointer space");
521                 return NULL;
522         }
523
524         if (self->size == 2)
525                 self->vec[2] = 0.0f;
526
527         self->size = 3;
528         Py_RETURN_NONE;
529 }
530
531 PyDoc_STRVAR(Vector_resize_4d_doc,
532 ".. method:: resize_4d()\n"
533 "\n"
534 "   Resize the vector to 4D (x, y, z, w).\n"
535 "\n"
536 "   :return: an instance of itself\n"
537 "   :rtype: :class:`Vector`\n"
538 );
539 static PyObject *Vector_resize_4d(VectorObject *self)
540 {
541         if (self->wrapped==Py_WRAP) {
542                 PyErr_SetString(PyExc_TypeError,
543                                 "Vector.resize_4d(): "
544                                 "cannot resize wrapped data - only python vectors");
545                 return NULL;
546         }
547         if (self->cb_user) {
548                 PyErr_SetString(PyExc_TypeError,
549                                 "Vector.resize_4d(): "
550                                 "cannot resize a vector that has an owner");
551                 return NULL;
552         }
553
554         self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 4));
555         if (self->vec == NULL) {
556                 PyErr_SetString(PyExc_MemoryError,
557                                 "Vector.resize_4d(): "
558                                 "problem allocating pointer space");
559                 return NULL;
560         }
561
562         if (self->size == 2) {
563                 self->vec[2] = 0.0f;
564                 self->vec[3] = 1.0f;
565         }
566         else if (self->size == 3) {
567                 self->vec[3] = 1.0f;
568         }
569         self->size = 4;
570         Py_RETURN_NONE;
571 }
572 PyDoc_STRVAR(Vector_to_2d_doc,
573 ".. method:: to_2d()\n"
574 "\n"
575 "   Return a 2d copy of the vector.\n"
576 "\n"
577 "   :return: a new vector\n"
578 "   :rtype: :class:`Vector`\n"
579 );
580 static PyObject *Vector_to_2d(VectorObject *self)
581 {
582         if (BaseMath_ReadCallback(self) == -1)
583                 return NULL;
584
585         return Vector_CreatePyObject(self->vec, 2, Py_NEW, Py_TYPE(self));
586 }
587 PyDoc_STRVAR(Vector_to_3d_doc,
588 ".. method:: to_3d()\n"
589 "\n"
590 "   Return a 3d copy of the vector.\n"
591 "\n"
592 "   :return: a new vector\n"
593 "   :rtype: :class:`Vector`\n"
594 );
595 static PyObject *Vector_to_3d(VectorObject *self)
596 {
597         float tvec[3]= {0.0f};
598
599         if (BaseMath_ReadCallback(self) == -1)
600                 return NULL;
601
602         memcpy(tvec, self->vec, sizeof(float) * MIN2(self->size, 3));
603         return Vector_CreatePyObject(tvec, 3, Py_NEW, Py_TYPE(self));
604 }
605 PyDoc_STRVAR(Vector_to_4d_doc,
606 ".. method:: to_4d()\n"
607 "\n"
608 "   Return a 4d copy of the vector.\n"
609 "\n"
610 "   :return: a new vector\n"
611 "   :rtype: :class:`Vector`\n"
612 );
613 static PyObject *Vector_to_4d(VectorObject *self)
614 {
615         float tvec[4]= {0.0f, 0.0f, 0.0f, 1.0f};
616
617         if (BaseMath_ReadCallback(self) == -1)
618                 return NULL;
619
620         memcpy(tvec, self->vec, sizeof(float) * MIN2(self->size, 4));
621         return Vector_CreatePyObject(tvec, 4, Py_NEW, Py_TYPE(self));
622 }
623
624 PyDoc_STRVAR(Vector_to_tuple_doc,
625 ".. method:: to_tuple(precision=-1)\n"
626 "\n"
627 "   Return this vector as a tuple with.\n"
628 "\n"
629 "   :arg precision: The number to round the value to in [-1, 21].\n"
630 "   :type precision: int\n"
631 "   :return: the values of the vector rounded by *precision*\n"
632 "   :rtype: tuple\n"
633 );
634 /* note: BaseMath_ReadCallback must be called beforehand */
635 static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits)
636 {
637         PyObject *ret;
638         int i;
639
640         ret= PyTuple_New(self->size);
641
642         if (ndigits >= 0) {
643                 for (i = 0; i < self->size; i++) {
644                         PyTuple_SET_ITEM(ret, i, PyFloat_FromDouble(double_round((double)self->vec[i], ndigits)));
645                 }
646         }
647         else {
648                 for (i = 0; i < self->size; i++) {
649                         PyTuple_SET_ITEM(ret, i, PyFloat_FromDouble(self->vec[i]));
650                 }
651         }
652
653         return ret;
654 }
655
656 static PyObject *Vector_to_tuple(VectorObject *self, PyObject *args)
657 {
658         int ndigits= 0;
659
660         if (!PyArg_ParseTuple(args, "|i:to_tuple", &ndigits))
661                 return NULL;
662
663         if (ndigits > 22 || ndigits < 0) {
664                 PyErr_SetString(PyExc_ValueError,
665                                 "Vector.to_tuple(ndigits): "
666                                 "ndigits must be between 0 and 21");
667                 return NULL;
668         }
669
670         if (PyTuple_GET_SIZE(args)==0)
671                 ndigits= -1;
672
673         if (BaseMath_ReadCallback(self) == -1)
674                 return NULL;
675
676         return Vector_to_tuple_ext(self, ndigits);
677 }
678
679 PyDoc_STRVAR(Vector_to_track_quat_doc,
680 ".. method:: to_track_quat(track, up)\n"
681 "\n"
682 "   Return a quaternion rotation from the vector and the track and up axis.\n"
683 "\n"
684 "   :arg track: Track axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z'].\n"
685 "   :type track: string\n"
686 "   :arg up: Up axis in ['X', 'Y', 'Z'].\n"
687 "   :type up: string\n"
688 "   :return: rotation from the vector and the track and up axis.\n"
689 "   :rtype: :class:`Quaternion`\n"
690 );
691 static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
692 {
693         float vec[3], quat[4];
694         const char *strack, *sup;
695         short track = 2, up = 1;
696
697         if (!PyArg_ParseTuple(args, "|ss:to_track_quat", &strack, &sup))
698                 return NULL;
699
700         if (self->size != 3) {
701                 PyErr_SetString(PyExc_TypeError,
702                                 "Vector.to_track_quat(): "
703                                 "only for 3D vectors");
704                 return NULL;
705         }
706
707         if (BaseMath_ReadCallback(self) == -1)
708                 return NULL;
709
710         if (strack) {
711                 const char *axis_err_msg= "only X, -X, Y, -Y, Z or -Z for track axis";
712
713                 if (strlen(strack) == 2) {
714                         if (strack[0] == '-') {
715                                 switch (strack[1]) {
716                                         case 'X':
717                                                 track = 3;
718                                                 break;
719                                         case 'Y':
720                                                 track = 4;
721                                                 break;
722                                         case 'Z':
723                                                 track = 5;
724                                                 break;
725                                         default:
726                                                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
727                                                 return NULL;
728                                 }
729                         }
730                         else {
731                                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
732                                 return NULL;
733                         }
734                 }
735                 else if (strlen(strack) == 1) {
736                         switch (strack[0]) {
737                         case '-':
738                         case 'X':
739                                 track = 0;
740                                 break;
741                         case 'Y':
742                                 track = 1;
743                                 break;
744                         case 'Z':
745                                 track = 2;
746                                 break;
747                         default:
748                                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
749                                 return NULL;
750                         }
751                 }
752                 else {
753                         PyErr_SetString(PyExc_ValueError, axis_err_msg);
754                         return NULL;
755                 }
756         }
757
758         if (sup) {
759                 const char *axis_err_msg= "only X, Y or Z for up axis";
760                 if (strlen(sup) == 1) {
761                         switch (*sup) {
762                         case 'X':
763                                 up = 0;
764                                 break;
765                         case 'Y':
766                                 up = 1;
767                                 break;
768                         case 'Z':
769                                 up = 2;
770                                 break;
771                         default:
772                                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
773                                 return NULL;
774                         }
775                 }
776                 else {
777                         PyErr_SetString(PyExc_ValueError, axis_err_msg);
778                         return NULL;
779                 }
780         }
781
782         if (track == up) {
783                 PyErr_SetString(PyExc_ValueError,
784                                 "Can't have the same axis for track and up");
785                 return NULL;
786         }
787
788         /*
789                 flip vector around, since vectoquat expect a vector from target to tracking object
790                 and the python function expects the inverse (a vector to the target).
791         */
792         negate_v3_v3(vec, self->vec);
793
794         vec_to_quat(quat, vec, track, up);
795
796         return Quaternion_CreatePyObject(quat, Py_NEW, NULL);
797 }
798
799 /*
800  * Vector.reflect(mirror): return a reflected vector on the mirror normal
801  *  vec - ((2 * DotVecs(vec, mirror)) * mirror)
802  */
803 PyDoc_STRVAR(Vector_reflect_doc,
804 ".. method:: reflect(mirror)\n"
805 "\n"
806 "   Return the reflection vector from the *mirror* argument.\n"
807 "\n"
808 "   :arg mirror: This vector could be a normal from the reflecting surface.\n"
809 "   :type mirror: :class:`Vector`\n"
810 "   :return: The reflected vector matching the size of this vector.\n"
811 "   :rtype: :class:`Vector`\n"
812 );
813 static PyObject *Vector_reflect(VectorObject *self, PyObject *value)
814 {
815         int value_size;
816         float mirror[3], vec[3];
817         float reflect[3] = {0.0f};
818         float tvec[MAX_DIMENSIONS];
819
820         if (BaseMath_ReadCallback(self) == -1)
821                 return NULL;
822
823         if ((value_size= mathutils_array_parse(tvec, 2, 4, value, "Vector.reflect(other), invalid 'other' arg")) == -1)
824                 return NULL;
825
826         if (self->size < 2 || self->size > 4) {
827                 PyErr_SetString(PyExc_ValueError,
828                                 "Vector must be 2D, 3D or 4D");
829                 return NULL;
830         }
831
832         mirror[0] = tvec[0];
833         mirror[1] = tvec[1];
834         if (value_size > 2)             mirror[2] = tvec[2];
835         else                                    mirror[2] = 0.0;
836
837         vec[0] = self->vec[0];
838         vec[1] = self->vec[1];
839         if (self->size > 2)             vec[2] = self->vec[2];
840         else                                    vec[2] = 0.0;
841
842         normalize_v3(mirror);
843         reflect_v3_v3v3(reflect, vec, mirror);
844
845         return Vector_CreatePyObject(reflect, self->size, Py_NEW, Py_TYPE(self));
846 }
847
848 PyDoc_STRVAR(Vector_cross_doc,
849 ".. method:: cross(other)\n"
850 "\n"
851 "   Return the cross product of this vector and another.\n"
852 "\n"
853 "   :arg other: The other vector to perform the cross product with.\n"
854 "   :type other: :class:`Vector`\n"
855 "   :return: The cross product.\n"
856 "   :rtype: :class:`Vector`\n"
857 "\n"
858 "   .. note:: both vectors must be 3D\n"
859 );
860 static PyObject *Vector_cross(VectorObject *self, PyObject *value)
861 {
862         VectorObject *ret;
863         float tvec[MAX_DIMENSIONS];
864
865         if (BaseMath_ReadCallback(self) == -1)
866                 return NULL;
867
868         if (mathutils_array_parse(tvec, self->size, self->size, value, "Vector.cross(other), invalid 'other' arg") == -1)
869                 return NULL;
870
871         if (self->size != 3) {
872                 PyErr_SetString(PyExc_ValueError,
873                                 "Vector must be 3D");
874                 return NULL;
875         }
876
877         ret= (VectorObject *)Vector_CreatePyObject(NULL, 3, Py_NEW, Py_TYPE(self));
878         cross_v3_v3v3(ret->vec, self->vec, tvec);
879         return (PyObject *)ret;
880 }
881
882 PyDoc_STRVAR(Vector_dot_doc,
883 ".. method:: dot(other)\n"
884 "\n"
885 "   Return the dot product of this vector and another.\n"
886 "\n"
887 "   :arg other: The other vector to perform the dot product with.\n"
888 "   :type other: :class:`Vector`\n"
889 "   :return: The dot product.\n"
890 "   :rtype: :class:`Vector`\n"
891 );
892 static PyObject *Vector_dot(VectorObject *self, PyObject *value)
893 {
894         float *tvec;
895
896         if (BaseMath_ReadCallback(self) == -1)
897                 return NULL;
898
899         if (mathutils_array_parse_alloc(&tvec, self->size, value, "Vector.dot(other), invalid 'other' arg") == -1) {
900                 goto cleanup;
901         }
902
903         return PyFloat_FromDouble(dot_vn_vn(self->vec, tvec, self->size));
904
905 cleanup:
906         PyMem_Free(tvec);
907         return NULL;
908 }
909
910 PyDoc_STRVAR(Vector_angle_doc,
911 ".. function:: angle(other, fallback)\n"
912 "\n"
913 "   Return the angle between two vectors.\n"
914 "\n"
915 "   :arg other: another vector to compare the angle with\n"
916 "   :type other: :class:`Vector`\n"
917 "   :arg fallback: return this value when the angle cant be calculated\n"
918 "      (zero length vector)\n"
919 "   :type fallback: any\n"
920 "   :return: angle in radians or fallback when given\n"
921 "   :rtype: float\n"
922 "\n"
923 "   .. note:: Zero length vectors raise an :exc:`AttributeError`.\n"
924 );
925 static PyObject *Vector_angle(VectorObject *self, PyObject *args)
926 {
927         const int size= MIN2(self->size, 3); /* 4D angle makes no sense */
928         float tvec[MAX_DIMENSIONS];
929         PyObject *value;
930         double dot= 0.0f, dot_self= 0.0f, dot_other= 0.0f;
931         int x;
932         PyObject *fallback= NULL;
933
934         if (!PyArg_ParseTuple(args, "O|O:angle", &value, &fallback))
935                 return NULL;
936
937         if (BaseMath_ReadCallback(self) == -1)
938                 return NULL;
939
940         /* don't use clamped size, rule of thumb is vector sizes must match,
941          * even though n this case 'w' is ignored */
942         if (mathutils_array_parse(tvec, self->size, self->size, value, "Vector.angle(other), invalid 'other' arg") == -1)
943                 return NULL;
944
945         if (self->size > 4) {
946                 PyErr_SetString(PyExc_ValueError,
947                                 "Vector must be 2D, 3D or 4D");
948                 return NULL;
949         }
950
951         for (x = 0; x < size; x++) {
952                 dot_self  += (double)self->vec[x] * (double)self->vec[x];
953                 dot_other += (double)tvec[x]      * (double)tvec[x];
954                 dot       += (double)self->vec[x] * (double)tvec[x];
955         }
956
957         if (!dot_self || !dot_other) {
958                 /* avoid exception */
959                 if (fallback) {
960                         Py_INCREF(fallback);
961                         return fallback;
962                 }
963                 else {
964                         PyErr_SetString(PyExc_ValueError,
965                                         "Vector.angle(other): "
966                                         "zero length vectors have no valid angle");
967                         return NULL;
968                 }
969         }
970
971         return PyFloat_FromDouble(saacos(dot / (sqrt(dot_self) * sqrt(dot_other))));
972 }
973
974 PyDoc_STRVAR(Vector_rotation_difference_doc,
975 ".. function:: rotation_difference(other)\n"
976 "\n"
977 "   Returns a quaternion representing the rotational difference between this\n"
978 "   vector and another.\n"
979 "\n"
980 "   :arg other: second vector.\n"
981 "   :type other: :class:`Vector`\n"
982 "   :return: the rotational difference between the two vectors.\n"
983 "   :rtype: :class:`Quaternion`\n"
984 "\n"
985 "   .. note:: 2D vectors raise an :exc:`AttributeError`.\n"
986 );
987 static PyObject *Vector_rotation_difference(VectorObject *self, PyObject *value)
988 {
989         float quat[4], vec_a[3], vec_b[3];
990
991         if (self->size < 3 || self->size > 4) {
992                 PyErr_SetString(PyExc_ValueError,
993                                 "vec.difference(value): "
994                                 "expects both vectors to be size 3 or 4");
995                 return NULL;
996         }
997
998         if (BaseMath_ReadCallback(self) == -1)
999                 return NULL;
1000
1001         if (mathutils_array_parse(vec_b, 3, MAX_DIMENSIONS, value, "Vector.difference(other), invalid 'other' arg") == -1)
1002                 return NULL;
1003
1004         normalize_v3_v3(vec_a, self->vec);
1005         normalize_v3(vec_b);
1006
1007         rotation_between_vecs_to_quat(quat, vec_a, vec_b);
1008
1009         return Quaternion_CreatePyObject(quat, Py_NEW, NULL);
1010 }
1011
1012 PyDoc_STRVAR(Vector_project_doc,
1013 ".. function:: project(other)\n"
1014 "\n"
1015 "   Return the projection of this vector onto the *other*.\n"
1016 "\n"
1017 "   :arg other: second vector.\n"
1018 "   :type other: :class:`Vector`\n"
1019 "   :return: the parallel projection vector\n"
1020 "   :rtype: :class:`Vector`\n"
1021 );
1022 static PyObject *Vector_project(VectorObject *self, PyObject *value)
1023 {
1024         const int size= self->size;
1025         float tvec[MAX_DIMENSIONS];
1026         float vec[MAX_DIMENSIONS];
1027         double dot = 0.0f, dot2 = 0.0f;
1028         int x;
1029
1030         if (BaseMath_ReadCallback(self) == -1)
1031                 return NULL;
1032
1033         if (mathutils_array_parse(tvec, size, size, value, "Vector.project(other), invalid 'other' arg") == -1)
1034                 return NULL;
1035
1036         if (self->size > 4) {
1037                 PyErr_SetString(PyExc_ValueError,
1038                                 "Vector must be 2D, 3D or 4D");
1039                 return NULL;
1040         }
1041
1042         if (BaseMath_ReadCallback(self) == -1)
1043                 return NULL;
1044
1045         //get dot products
1046         for (x = 0; x < size; x++) {
1047                 dot += (double)(self->vec[x] * tvec[x]);
1048                 dot2 += (double)(tvec[x] * tvec[x]);
1049         }
1050         //projection
1051         dot /= dot2;
1052         for (x = 0; x < size; x++) {
1053                 vec[x] = (float)dot * tvec[x];
1054         }
1055         return Vector_CreatePyObject(vec, size, Py_NEW, Py_TYPE(self));
1056 }
1057
1058 PyDoc_STRVAR(Vector_lerp_doc,
1059 ".. function:: lerp(other, factor)\n"
1060 "\n"
1061 "   Returns the interpolation of two vectors.\n"
1062 "\n"
1063 "   :arg other: value to interpolate with.\n"
1064 "   :type other: :class:`Vector`\n"
1065 "   :arg factor: The interpolation value in [0.0, 1.0].\n"
1066 "   :type factor: float\n"
1067 "   :return: The interpolated rotation.\n"
1068 "   :rtype: :class:`Vector`\n"
1069 );
1070 static PyObject *Vector_lerp(VectorObject *self, PyObject *args)
1071 {
1072         const int size= self->size;
1073         PyObject *value= NULL;
1074         float fac, ifac;
1075         float *tvec, *vec;
1076         int x;
1077
1078         if (!PyArg_ParseTuple(args, "Of:lerp", &value, &fac))
1079                 return NULL;
1080
1081         if (mathutils_array_parse_alloc(&tvec, size, value, "Vector.lerp(other), invalid 'other' arg") == -1) {
1082                 goto cleanup;
1083         }
1084
1085         if (BaseMath_ReadCallback(self) == -1) {
1086                 goto cleanup;
1087         }
1088
1089         vec= PyMem_Malloc(size * sizeof(float));
1090         if (vec == NULL) {
1091                 PyErr_SetString(PyExc_MemoryError,
1092                                 "Vector.lerp(): "
1093                                 "problem allocating pointer space");
1094                 return NULL;
1095         }
1096
1097         ifac= 1.0f - fac;
1098
1099         for (x = 0; x < size; x++) {
1100                 vec[x] = (ifac * self->vec[x]) + (fac * tvec[x]);
1101         }
1102
1103         PyMem_Free(tvec);
1104
1105         return Vector_CreatePyObject_alloc(vec, size, Py_TYPE(self));
1106
1107 cleanup:
1108         PyMem_Free(tvec);
1109         return NULL;
1110 }
1111
1112 PyDoc_STRVAR(Vector_rotate_doc,
1113 ".. function:: rotate(other)\n"
1114 "\n"
1115 "   Return vector by a rotation value.\n"
1116 "\n"
1117 "   :arg other: rotation component of mathutils value\n"
1118 "   :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n"
1119 );
1120 static PyObject *Vector_rotate(VectorObject *self, PyObject *value)
1121 {
1122         float other_rmat[3][3];
1123
1124         if (BaseMath_ReadCallback(self) == -1)
1125                 return NULL;
1126
1127         if (mathutils_any_to_rotmat(other_rmat, value, "Vector.rotate(value)") == -1)
1128                 return NULL;
1129
1130         if (self->size < 3 || self->size > 4) {
1131                 PyErr_SetString(PyExc_ValueError,
1132                                 "Vector must be 3D or 4D");
1133                 return NULL;
1134         }
1135
1136         mul_m3_v3(other_rmat, self->vec);
1137
1138         (void)BaseMath_WriteCallback(self);
1139         Py_RETURN_NONE;
1140 }
1141
1142 PyDoc_STRVAR(Vector_copy_doc,
1143 ".. function:: copy()\n"
1144 "\n"
1145 "   Returns a copy of this vector.\n"
1146 "\n"
1147 "   :return: A copy of the vector.\n"
1148 "   :rtype: :class:`Vector`\n"
1149 "\n"
1150 "   .. note:: use this to get a copy of a wrapped vector with\n"
1151 "      no reference to the original data.\n"
1152 );
1153 static PyObject *Vector_copy(VectorObject *self)
1154 {
1155         if (BaseMath_ReadCallback(self) == -1)
1156                 return NULL;
1157
1158         return Vector_CreatePyObject(self->vec, self->size, Py_NEW, Py_TYPE(self));
1159 }
1160
1161 static PyObject *Vector_repr(VectorObject *self)
1162 {
1163         PyObject *ret, *tuple;
1164
1165         if (BaseMath_ReadCallback(self) == -1)
1166                 return NULL;
1167
1168         tuple= Vector_to_tuple_ext(self, -1);
1169         ret= PyUnicode_FromFormat("Vector(%R)", tuple);
1170         Py_DECREF(tuple);
1171         return ret;
1172 }
1173
1174 /* Sequence Protocol */
1175 /* sequence length len(vector) */
1176 static int Vector_len(VectorObject *self)
1177 {
1178         return self->size;
1179 }
1180 /* sequence accessor (get): vector[index] */
1181 static PyObject *vector_item_internal(VectorObject *self, int i, const int is_attr)
1182 {
1183         if (i<0)        i= self->size-i;
1184
1185         if (i < 0 || i >= self->size) {
1186                 if (is_attr)    {
1187                         PyErr_Format(PyExc_AttributeError,
1188                                      "Vector.%c: unavailable on %dd vector",
1189                                      *(((char *)"xyzw") + i), self->size);
1190                 }
1191                 else {
1192                         PyErr_SetString(PyExc_IndexError,
1193                                         "vector[index]: out of range");
1194                 }
1195                 return NULL;
1196         }
1197
1198         if (BaseMath_ReadIndexCallback(self, i) == -1)
1199                 return NULL;
1200
1201         return PyFloat_FromDouble(self->vec[i]);
1202 }
1203
1204 static PyObject *Vector_item(VectorObject *self, int i)
1205 {
1206         return vector_item_internal(self, i, FALSE);
1207 }
1208 /* sequence accessor (set): vector[index] = value */
1209 static int vector_ass_item_internal(VectorObject *self, int i, PyObject *value, const int is_attr)
1210 {
1211         float scalar;
1212         if ((scalar=PyFloat_AsDouble(value))==-1.0f && PyErr_Occurred()) { /* parsed item not a number */
1213                 PyErr_SetString(PyExc_TypeError,
1214                                 "vector[index] = x: "
1215                                 "index argument not a number");
1216                 return -1;
1217         }
1218
1219         if (i<0)        i= self->size-i;
1220
1221         if (i < 0 || i >= self->size) {
1222                 if (is_attr) {
1223                         PyErr_Format(PyExc_AttributeError,
1224                                      "Vector.%c = x: unavailable on %dd vector",
1225                                      *(((char *)"xyzw") + i), self->size);
1226                 }
1227                 else {
1228                         PyErr_SetString(PyExc_IndexError,
1229                                         "vector[index] = x: "
1230                                         "assignment index out of range");
1231                 }
1232                 return -1;
1233         }
1234         self->vec[i] = scalar;
1235
1236         if (BaseMath_WriteIndexCallback(self, i) == -1)
1237                 return -1;
1238         return 0;
1239 }
1240
1241 static int Vector_ass_item(VectorObject *self, int i, PyObject *value)
1242 {
1243         return vector_ass_item_internal(self, i, value, FALSE);
1244 }
1245
1246 /* sequence slice (get): vector[a:b] */
1247 static PyObject *Vector_slice(VectorObject *self, int begin, int end)
1248 {
1249         PyObject *tuple;
1250         int count;
1251
1252         if (BaseMath_ReadCallback(self) == -1)
1253                 return NULL;
1254
1255         CLAMP(begin, 0, self->size);
1256         if (end<0) end= self->size+end+1;
1257         CLAMP(end, 0, self->size);
1258         begin= MIN2(begin, end);
1259
1260         tuple= PyTuple_New(end - begin);
1261         for (count = begin; count < end; count++) {
1262                 PyTuple_SET_ITEM(tuple, count - begin, PyFloat_FromDouble(self->vec[count]));
1263         }
1264
1265         return tuple;
1266 }
1267 /* sequence slice (set): vector[a:b] = value */
1268 static int Vector_ass_slice(VectorObject *self, int begin, int end, PyObject *seq)
1269 {
1270         int size = 0;
1271         float *vec= NULL;
1272
1273         if (BaseMath_ReadCallback(self) == -1)
1274                 return -1;
1275
1276         CLAMP(begin, 0, self->size);
1277         CLAMP(end, 0, self->size);
1278         begin = MIN2(begin, end);
1279
1280         size = (end - begin);
1281         if (mathutils_array_parse_alloc(&vec, size, seq, "vector[begin:end] = [...]") == -1) {
1282                 goto cleanup;
1283         }
1284
1285         if (vec == NULL) {
1286                 PyErr_SetString(PyExc_MemoryError,
1287                                                 "vec[:] = seq: "
1288                                 "problem allocating pointer space");
1289                 return -1;
1290         }
1291
1292         /*parsed well - now set in vector*/
1293         memcpy(self->vec + begin, vec, size * sizeof(float));
1294
1295         if (BaseMath_WriteCallback(self) == -1)
1296                 return -1;
1297
1298         PyMem_Free(vec);
1299
1300         return 0;
1301
1302 cleanup:
1303         PyMem_Free(vec);
1304         return -1;
1305 }
1306
1307 /* Numeric Protocols */
1308 /* addition: obj + obj */
1309 static PyObject *Vector_add(PyObject *v1, PyObject *v2)
1310 {
1311         VectorObject *vec1 = NULL, *vec2 = NULL;
1312         float *vec= NULL;
1313
1314         if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
1315                 PyErr_Format(PyExc_AttributeError,
1316                              "Vector addition: (%s + %s) "
1317                              "invalid type for this operation",
1318                              Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1319                 return NULL;
1320         }
1321         vec1 = (VectorObject*)v1;
1322         vec2 = (VectorObject*)v2;
1323
1324         if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
1325                 return NULL;
1326
1327         /*VECTOR + VECTOR*/
1328         if (vec1->size != vec2->size) {
1329                 PyErr_SetString(PyExc_AttributeError,
1330                                 "Vector addition: "
1331                                 "vectors must have the same dimensions for this operation");
1332                 return NULL;
1333         }
1334
1335         vec= PyMem_Malloc(vec1->size * sizeof(float));
1336
1337         if (vec == NULL) { /*allocation failure*/
1338                 PyErr_SetString(PyExc_MemoryError,
1339                                 "Vector(): "
1340                                 "problem allocating pointer space");
1341                 return NULL;
1342         }
1343
1344         add_vn_vnvn(vec, vec1->vec, vec2->vec, vec1->size);
1345
1346         return Vector_CreatePyObject_alloc(vec, vec1->size, Py_TYPE(v1));
1347 }
1348
1349 /* addition in-place: obj += obj */
1350 static PyObject *Vector_iadd(PyObject *v1, PyObject *v2)
1351 {
1352         VectorObject *vec1 = NULL, *vec2 = NULL;
1353
1354         if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
1355                 PyErr_Format(PyExc_AttributeError,
1356                              "Vector addition: (%s += %s) "
1357                              "invalid type for this operation",
1358                              Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1359                 return NULL;
1360         }
1361         vec1 = (VectorObject*)v1;
1362         vec2 = (VectorObject*)v2;
1363
1364         if (vec1->size != vec2->size) {
1365                 PyErr_SetString(PyExc_AttributeError,
1366                                 "Vector addition: "
1367                                 "vectors must have the same dimensions for this operation");
1368                 return NULL;
1369         }
1370
1371         if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
1372                 return NULL;
1373
1374         add_vn_vn(vec1->vec, vec2->vec, vec1->size);
1375
1376         (void)BaseMath_WriteCallback(vec1);
1377         Py_INCREF(v1);
1378         return v1;
1379 }
1380
1381 /* subtraction: obj - obj */
1382 static PyObject *Vector_sub(PyObject *v1, PyObject *v2)
1383 {
1384         VectorObject *vec1 = NULL, *vec2 = NULL;
1385         float *vec;
1386
1387         if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
1388                 PyErr_Format(PyExc_AttributeError,
1389                              "Vector subtraction: (%s - %s) "
1390                              "invalid type for this operation",
1391                              Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1392                 return NULL;
1393         }
1394         vec1 = (VectorObject*)v1;
1395         vec2 = (VectorObject*)v2;
1396
1397         if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
1398                 return NULL;
1399
1400         if (vec1->size != vec2->size) {
1401                 PyErr_SetString(PyExc_AttributeError,
1402                                 "Vector subtraction: "
1403                                 "vectors must have the same dimensions for this operation");
1404                 return NULL;
1405         }
1406
1407         vec= PyMem_Malloc(vec1->size * sizeof(float));
1408
1409         if (vec == NULL) { /*allocation failure*/
1410                 PyErr_SetString(PyExc_MemoryError,
1411                                 "Vector(): "
1412                                 "problem allocating pointer space");
1413                 return NULL;
1414         }
1415
1416         sub_vn_vnvn(vec, vec1->vec, vec2->vec, vec1->size);
1417
1418         return Vector_CreatePyObject_alloc(vec, vec1->size, Py_TYPE(v1));
1419 }
1420
1421 /* subtraction in-place: obj -= obj */
1422 static PyObject *Vector_isub(PyObject *v1, PyObject *v2)
1423 {
1424         VectorObject *vec1= NULL, *vec2= NULL;
1425
1426         if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
1427                 PyErr_Format(PyExc_AttributeError,
1428                              "Vector subtraction: (%s -= %s) "
1429                              "invalid type for this operation",
1430                              Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1431                 return NULL;
1432         }
1433         vec1 = (VectorObject*)v1;
1434         vec2 = (VectorObject*)v2;
1435
1436         if (vec1->size != vec2->size) {
1437                 PyErr_SetString(PyExc_AttributeError,
1438                                 "Vector subtraction: "
1439                                 "vectors must have the same dimensions for this operation");
1440                 return NULL;
1441         }
1442
1443         if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
1444                 return NULL;
1445
1446         sub_vn_vn(vec1->vec, vec2->vec, vec1->size);
1447
1448         (void)BaseMath_WriteCallback(vec1);
1449         Py_INCREF(v1);
1450         return v1;
1451 }
1452
1453 /*------------------------obj * obj------------------------------
1454   mulplication*/
1455
1456
1457 /* COLUMN VECTOR Multiplication (Vector X Matrix)
1458  * [a] * [1][4][7]
1459  * [b] * [2][5][8]
1460  * [c] * [3][6][9]
1461  *
1462  * note: vector/matrix multiplication IS NOT COMMUTATIVE!!!!
1463  * note: assume read callbacks have been done first.
1464  */
1465 int column_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject* vec, MatrixObject * mat)
1466 {
1467         float vec_cpy[MAX_DIMENSIONS];
1468         double dot = 0.0f;
1469         int x, y, z = 0;
1470
1471         if (mat->row_size != vec->size) {
1472                 if (mat->row_size == 4 && vec->size == 3) {
1473                         vec_cpy[3] = 1.0f;
1474                 }
1475                 else {
1476                         PyErr_SetString(PyExc_TypeError,
1477                                         "matrix * vector: "
1478                                         "matrix.row_size and len(vector) must be the same, "
1479                                         "except for 3D vector * 4x4 matrix.");
1480                         return -1;
1481                 }
1482         }
1483
1484         memcpy(vec_cpy, vec->vec, vec->size * sizeof(float));
1485
1486         rvec[3] = 1.0f;
1487
1488         for (x = 0; x < mat->col_size; x++) {
1489                 for (y = 0; y < mat->row_size; y++) {
1490                         dot += (double)(mat->matrix[y][x] * vec_cpy[y]);
1491                 }
1492                 rvec[z++] = (float)dot;
1493                 dot = 0.0f;
1494         }
1495
1496         return 0;
1497 }
1498
1499 static PyObject *vector_mul_float(VectorObject *vec, const float scalar)
1500 {
1501         float *tvec= NULL;
1502         tvec= PyMem_Malloc(vec->size * sizeof(float));
1503
1504         if (tvec == NULL) { /*allocation failure*/
1505                 PyErr_SetString(PyExc_MemoryError,
1506                                 "vec * float: "
1507                                 "problem allocating pointer space");
1508                 return NULL;
1509         }
1510
1511         mul_vn_vn_fl(tvec, vec->vec, vec->size, scalar);
1512         return Vector_CreatePyObject_alloc(tvec, vec->size, Py_TYPE(vec));
1513 }
1514
1515 static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
1516 {
1517         VectorObject *vec1 = NULL, *vec2 = NULL;
1518         float scalar;
1519
1520         if VectorObject_Check(v1) {
1521                 vec1= (VectorObject *)v1;
1522                 if (BaseMath_ReadCallback(vec1) == -1)
1523                         return NULL;
1524         }
1525         if VectorObject_Check(v2) {
1526                 vec2= (VectorObject *)v2;
1527                 if (BaseMath_ReadCallback(vec2) == -1)
1528                         return NULL;
1529         }
1530
1531
1532         /* make sure v1 is always the vector */
1533         if (vec1 && vec2) {
1534                 if (vec1->size != vec2->size) {
1535                         PyErr_SetString(PyExc_ValueError,
1536                                         "Vector multiplication: "
1537                                         "vectors must have the same dimensions for this operation");
1538                         return NULL;
1539                 }
1540
1541                 /*dot product*/
1542                 return PyFloat_FromDouble(dot_vn_vn(vec1->vec, vec2->vec, vec1->size));
1543         }
1544         else if (vec1) {
1545                 if (MatrixObject_Check(v2)) {
1546                         /* VEC * MATRIX */
1547                         float tvec[MAX_DIMENSIONS];
1548
1549                         if (BaseMath_ReadCallback((MatrixObject *)v2) == -1)
1550                                 return NULL;
1551                         if (row_vector_multiplication(tvec, vec1, (MatrixObject*)v2) == -1) {
1552                                 return NULL;
1553                         }
1554
1555                         return Vector_CreatePyObject(tvec, vec1->size, Py_NEW, Py_TYPE(vec1));
1556                 }
1557                 else if (QuaternionObject_Check(v2)) {
1558                         /* VEC * QUAT */
1559 /* ------ to be removed ------*/
1560 #if 1
1561                         PyErr_SetString(PyExc_ValueError,
1562                                         "(Vector * Quat) is now removed, reverse the "
1563                                         "order (promoted to an Error for Debug builds)");
1564                         return NULL;
1565 #else
1566                         QuaternionObject *quat2 = (QuaternionObject*)v2;
1567                         float tvec[3];
1568
1569                         if (vec1->size != 3) {
1570                                 PyErr_SetString(PyExc_ValueError,
1571                                                 "Vector multiplication: "
1572                                                 "only 3D vector rotations (with quats) currently supported");
1573                                 return NULL;
1574                         }
1575                         if (BaseMath_ReadCallback(quat2) == -1) {
1576                                 return NULL;
1577                         }
1578
1579                         copy_v3_v3(tvec, vec1->vec);
1580                         mul_qt_v3(quat2->quat, tvec);
1581                         return Vector_CreatePyObject(tvec, 3, Py_NEW, Py_TYPE(vec1));
1582 #endif
1583 /* ------ to be removed ------*/
1584                 }
1585                 else if (((scalar= PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred())==0) { /* VEC * FLOAT */
1586                         return vector_mul_float(vec1, scalar);
1587                 }
1588         }
1589         else if (vec2) {
1590                 if (((scalar= PyFloat_AsDouble(v1)) == -1.0f && PyErr_Occurred())==0) { /* FLOAT * VEC */
1591                         return vector_mul_float(vec2, scalar);
1592                 }
1593         }
1594         else {
1595                 BLI_assert(!"internal error");
1596         }
1597
1598         PyErr_Format(PyExc_TypeError,
1599                      "Vector multiplication: "
1600                      "not supported between '%.200s' and '%.200s' types",
1601                      Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1602         return NULL;
1603 }
1604
1605 /* mulplication in-place: obj *= obj */
1606 static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
1607 {
1608         VectorObject *vec = (VectorObject *)v1;
1609         float scalar;
1610
1611         if (BaseMath_ReadCallback(vec) == -1)
1612                 return NULL;
1613
1614         /* only support vec*=float and vec*=mat
1615            vec*=vec result is a float so that wont work */
1616         if (MatrixObject_Check(v2)) {
1617 /* ------ to be removed ------*/
1618 #if 1
1619                 PyErr_SetString(PyExc_ValueError,
1620                                                 "(Vector *= Matrix) is now removed, reverse the "
1621                                                 "order (promoted to an Error for Debug builds) "
1622                                                 "and uses the non in-place multiplication.");
1623                 return NULL;
1624 #else
1625                 float rvec[MAX_DIMENSIONS];
1626                 if (BaseMath_ReadCallback((MatrixObject *)v2) == -1)
1627                         return NULL;
1628
1629                 if (column_vector_multiplication(rvec, vec, (MatrixObject*)v2) == -1)
1630                         return NULL;
1631
1632                 memcpy(vec->vec, rvec, sizeof(float) * vec->size);
1633 #endif
1634 /* ------ to be removed ------*/
1635         }
1636         else if (QuaternionObject_Check(v2)) {
1637                 /* VEC *= QUAT */
1638
1639 /* ------ to be removed ------*/
1640 #if 1
1641                 PyErr_SetString(PyExc_ValueError,
1642                                                 "(Vector *= Quat) is now removed, reverse the "
1643                                                 "order (promoted to an Error for Debug builds) "
1644                                                 "and uses the non in-place multiplication.");
1645                 return NULL;
1646 #else
1647                 QuaternionObject *quat2 = (QuaternionObject*)v2;
1648
1649                 if (vec->size != 3) {
1650                         PyErr_SetString(PyExc_ValueError,
1651                                         "Vector multiplication: "
1652                                         "only 3D vector rotations (with quats) currently supported");
1653                         return NULL;
1654                 }
1655
1656                 if (BaseMath_ReadCallback(quat2) == -1) {
1657                         return NULL;
1658                 }
1659
1660                 mul_qt_v3(quat2->quat, vec->vec);
1661 #endif
1662 /* ------ to be removed ------*/
1663         }
1664         else if (((scalar= PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred())==0) { /* VEC *= FLOAT */
1665                 mul_vn_fl(vec->vec, vec->size, scalar);
1666         }
1667         else {
1668                 PyErr_Format(PyExc_TypeError,
1669                              "Vector multiplication: (%s *= %s) "
1670                              "invalid type for this operation",
1671                              Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1672                 return NULL;
1673         }
1674
1675         (void)BaseMath_WriteCallback(vec);
1676         Py_INCREF(v1);
1677         return v1;
1678 }
1679
1680 /* divid: obj / obj */
1681 static PyObject *Vector_div(PyObject *v1, PyObject *v2)
1682 {
1683         float *vec= NULL, scalar;
1684         VectorObject *vec1 = NULL;
1685
1686         if (!VectorObject_Check(v1)) { /* not a vector */
1687                 PyErr_SetString(PyExc_TypeError,
1688                                 "Vector division: "
1689                                 "Vector must be divided by a float");
1690                 return NULL;
1691         }
1692         vec1 = (VectorObject *)v1; /* vector */
1693
1694         if (BaseMath_ReadCallback(vec1) == -1)
1695                 return NULL;
1696
1697         if ((scalar=PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
1698                 PyErr_SetString(PyExc_TypeError,
1699                                 "Vector division: "
1700                                 "Vector must be divided by a float");
1701                 return NULL;
1702         }
1703
1704         if (scalar==0.0f) {
1705                 PyErr_SetString(PyExc_ZeroDivisionError,
1706                                 "Vector division: "
1707                                 "divide by zero error");
1708                 return NULL;
1709         }
1710
1711         vec= PyMem_Malloc(vec1->size * sizeof(float));
1712
1713         if (vec == NULL) { /*allocation failure*/
1714                 PyErr_SetString(PyExc_MemoryError,
1715                                 "vec / value: "
1716                                 "problem allocating pointer space");
1717                 return NULL;
1718         }
1719
1720         mul_vn_vn_fl(vec, vec1->vec, vec1->size, 1.0f/scalar);
1721
1722         return Vector_CreatePyObject_alloc(vec, vec1->size, Py_TYPE(v1));
1723 }
1724
1725 /* divide in-place: obj /= obj */
1726 static PyObject *Vector_idiv(PyObject *v1, PyObject *v2)
1727 {
1728         float scalar;
1729         VectorObject *vec1 = (VectorObject*)v1;
1730
1731         if (BaseMath_ReadCallback(vec1) == -1)
1732                 return NULL;
1733
1734         if ((scalar=PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
1735                 PyErr_SetString(PyExc_TypeError,
1736                                 "Vector division: "
1737                                 "Vector must be divided by a float");
1738                 return NULL;
1739         }
1740
1741         if (scalar==0.0f) {
1742                 PyErr_SetString(PyExc_ZeroDivisionError,
1743                                 "Vector division: "
1744                                 "divide by zero error");
1745                 return NULL;
1746         }
1747
1748         mul_vn_fl(vec1->vec, vec1->size, 1.0f/scalar);
1749
1750         (void)BaseMath_WriteCallback(vec1);
1751
1752         Py_INCREF(v1);
1753         return v1;
1754 }
1755
1756 /* -obj
1757   returns the negative of this object*/
1758 static PyObject *Vector_neg(VectorObject *self)
1759 {
1760         float *tvec;
1761
1762         if (BaseMath_ReadCallback(self) == -1)
1763                 return NULL;
1764
1765         tvec= PyMem_Malloc(self->size * sizeof(float));
1766         negate_vn_vn(tvec, self->vec, self->size);
1767         return Vector_CreatePyObject_alloc(tvec, self->size, Py_TYPE(self));
1768 }
1769
1770 /*------------------------vec_magnitude_nosqrt (internal) - for comparing only */
1771 static double vec_magnitude_nosqrt(float *data, int size)
1772 {
1773         /*return (double)sqrt(dot);*/
1774         /* warning, line above removed because we are not using the length,
1775            rather the comparing the sizes and for this we do not need the sqrt
1776            for the actual length, the dot must be sqrt'd */
1777         return dot_vn_vn(data, data, size);
1778 }
1779
1780
1781 /*------------------------tp_richcmpr
1782   returns -1 execption, 0 false, 1 true */
1783 static PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type)
1784 {
1785         VectorObject *vecA = NULL, *vecB = NULL;
1786         int result = 0;
1787         double epsilon = .000001f;
1788         double lenA, lenB;
1789
1790         if (!VectorObject_Check(objectA) || !VectorObject_Check(objectB)) {
1791                 if (comparison_type == Py_NE) {
1792                         Py_RETURN_TRUE;
1793                 }
1794                 else {
1795                         Py_RETURN_FALSE;
1796                 }
1797         }
1798         vecA = (VectorObject*)objectA;
1799         vecB = (VectorObject*)objectB;
1800
1801         if (BaseMath_ReadCallback(vecA) == -1 || BaseMath_ReadCallback(vecB) == -1)
1802                 return NULL;
1803
1804         if (vecA->size != vecB->size) {
1805                 if (comparison_type == Py_NE) {
1806                         Py_RETURN_TRUE;
1807                 }
1808                 else {
1809                         Py_RETURN_FALSE;
1810                 }
1811         }
1812
1813         switch (comparison_type) {
1814                 case Py_LT:
1815                         lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
1816                         lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
1817                         if (lenA < lenB) {
1818                                 result = 1;
1819                         }
1820                         break;
1821                 case Py_LE:
1822                         lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
1823                         lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
1824                         if (lenA < lenB) {
1825                                 result = 1;
1826                         }
1827                         else {
1828                                 result = (((lenA + epsilon) > lenB) && ((lenA - epsilon) < lenB));
1829                         }
1830                         break;
1831                 case Py_EQ:
1832                         result = EXPP_VectorsAreEqual(vecA->vec, vecB->vec, vecA->size, 1);
1833                         break;
1834                 case Py_NE:
1835                         result = !EXPP_VectorsAreEqual(vecA->vec, vecB->vec, vecA->size, 1);
1836                         break;
1837                 case Py_GT:
1838                         lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
1839                         lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
1840                         if (lenA > lenB) {
1841                                 result = 1;
1842                         }
1843                         break;
1844                 case Py_GE:
1845                         lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
1846                         lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
1847                         if (lenA > lenB) {
1848                                 result = 1;
1849                         }
1850                         else {
1851                                 result = (((lenA + epsilon) > lenB) && ((lenA - epsilon) < lenB));
1852                         }
1853                         break;
1854                 default:
1855                         printf("The result of the comparison could not be evaluated");
1856                         break;
1857         }
1858         if (result == 1) {
1859                 Py_RETURN_TRUE;
1860         }
1861         else {
1862                 Py_RETURN_FALSE;
1863         }
1864 }
1865
1866 /*-----------------PROTCOL DECLARATIONS--------------------------*/
1867 static PySequenceMethods Vector_SeqMethods = {
1868         (lenfunc) Vector_len,                           /* sq_length */
1869         (binaryfunc) NULL,                                      /* sq_concat */
1870         (ssizeargfunc) NULL,                            /* sq_repeat */
1871         (ssizeargfunc) Vector_item,                     /* sq_item */
1872         NULL,                                                           /* py3 deprecated slice func */
1873         (ssizeobjargproc) Vector_ass_item,      /* sq_ass_item */
1874         NULL,                                                           /* py3 deprecated slice assign func */
1875         (objobjproc) NULL,                                      /* sq_contains */
1876         (binaryfunc) NULL,                                      /* sq_inplace_concat */
1877         (ssizeargfunc) NULL,                            /* sq_inplace_repeat */
1878 };
1879
1880 static PyObject *Vector_subscript(VectorObject* self, PyObject* item)
1881 {
1882         if (PyIndex_Check(item)) {
1883                 Py_ssize_t i;
1884                 i = PyNumber_AsSsize_t(item, PyExc_IndexError);
1885                 if (i == -1 && PyErr_Occurred())
1886                         return NULL;
1887                 if (i < 0)
1888                         i += self->size;
1889                 return Vector_item(self, i);
1890         }
1891         else if (PySlice_Check(item)) {
1892                 Py_ssize_t start, stop, step, slicelength;
1893
1894                 if (PySlice_GetIndicesEx((void *)item, self->size, &start, &stop, &step, &slicelength) < 0)
1895                         return NULL;
1896
1897                 if (slicelength <= 0) {
1898                         return PyTuple_New(0);
1899                 }
1900                 else if (step == 1) {
1901                         return Vector_slice(self, start, stop);
1902                 }
1903                 else {
1904                         PyErr_SetString(PyExc_IndexError,
1905                                         "slice steps not supported with vectors");
1906                         return NULL;
1907                 }
1908         }
1909         else {
1910                 PyErr_Format(PyExc_TypeError,
1911                              "vector indices must be integers, not %.200s",
1912                              Py_TYPE(item)->tp_name);
1913                 return NULL;
1914         }
1915 }
1916
1917 static int Vector_ass_subscript(VectorObject* self, PyObject* item, PyObject* value)
1918 {
1919         if (PyIndex_Check(item)) {
1920                 Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
1921                 if (i == -1 && PyErr_Occurred())
1922                         return -1;
1923                 if (i < 0)
1924                         i += self->size;
1925                 return Vector_ass_item(self, i, value);
1926         }
1927         else if (PySlice_Check(item)) {
1928                 Py_ssize_t start, stop, step, slicelength;
1929
1930                 if (PySlice_GetIndicesEx((void *)item, self->size, &start, &stop, &step, &slicelength) < 0)
1931                         return -1;
1932
1933                 if (step == 1)
1934                         return Vector_ass_slice(self, start, stop, value);
1935                 else {
1936                         PyErr_SetString(PyExc_IndexError,
1937                                         "slice steps not supported with vectors");
1938                         return -1;
1939                 }
1940         }
1941         else {
1942                 PyErr_Format(PyExc_TypeError,
1943                              "vector indices must be integers, not %.200s",
1944                              Py_TYPE(item)->tp_name);
1945                 return -1;
1946         }
1947 }
1948
1949 static PyMappingMethods Vector_AsMapping = {
1950         (lenfunc)Vector_len,
1951         (binaryfunc)Vector_subscript,
1952         (objobjargproc)Vector_ass_subscript
1953 };
1954
1955
1956 static PyNumberMethods Vector_NumMethods = {
1957         (binaryfunc)    Vector_add,     /*nb_add*/
1958         (binaryfunc)    Vector_sub,     /*nb_subtract*/
1959         (binaryfunc)    Vector_mul,     /*nb_multiply*/
1960         NULL,                                                   /*nb_remainder*/
1961         NULL,                                                   /*nb_divmod*/
1962         NULL,                                                   /*nb_power*/
1963         (unaryfunc)     Vector_neg,     /*nb_negative*/
1964         (unaryfunc)     NULL,   /*tp_positive*/
1965         (unaryfunc)     NULL,   /*tp_absolute*/
1966         (inquiry)       NULL,   /*tp_bool*/
1967         (unaryfunc)     NULL,   /*nb_invert*/
1968         NULL,                           /*nb_lshift*/
1969         (binaryfunc)NULL,       /*nb_rshift*/
1970         NULL,                           /*nb_and*/
1971         NULL,                           /*nb_xor*/
1972         NULL,                           /*nb_or*/
1973         NULL,                           /*nb_int*/
1974         NULL,                           /*nb_reserved*/
1975         NULL,                           /*nb_float*/
1976         Vector_iadd,    /* nb_inplace_add */
1977         Vector_isub,    /* nb_inplace_subtract */
1978         Vector_imul,    /* nb_inplace_multiply */
1979         NULL,                           /* nb_inplace_remainder */
1980         NULL,                           /* nb_inplace_power */
1981         NULL,                           /* nb_inplace_lshift */
1982         NULL,                           /* nb_inplace_rshift */
1983         NULL,                           /* nb_inplace_and */
1984         NULL,                           /* nb_inplace_xor */
1985         NULL,                           /* nb_inplace_or */
1986         NULL,                           /* nb_floor_divide */
1987         Vector_div,             /* nb_true_divide */
1988         NULL,                           /* nb_inplace_floor_divide */
1989         Vector_idiv,    /* nb_inplace_true_divide */
1990         NULL,                   /* nb_index */
1991 };
1992
1993 /*------------------PY_OBECT DEFINITION--------------------------*/
1994
1995 /*
1996  * vector axis, vector.x/y/z/w
1997  */
1998
1999 static PyObject *Vector_getAxis(VectorObject *self, void *type)
2000 {
2001         return vector_item_internal(self, GET_INT_FROM_POINTER(type), TRUE);
2002 }
2003
2004 static int Vector_setAxis(VectorObject *self, PyObject *value, void *type)
2005 {
2006         return vector_ass_item_internal(self, GET_INT_FROM_POINTER(type), value, TRUE);
2007 }
2008
2009 /* vector.length */
2010 static PyObject *Vector_getLength(VectorObject *self, void *UNUSED(closure))
2011 {
2012         if (BaseMath_ReadCallback(self) == -1)
2013                 return NULL;
2014
2015         return PyFloat_FromDouble(sqrt(dot_vn_vn(self->vec, self->vec, self->size)));
2016 }
2017
2018 static int Vector_setLength(VectorObject *self, PyObject *value)
2019 {
2020         double dot = 0.0f, param;
2021
2022         if (BaseMath_ReadCallback(self) == -1)
2023                 return -1;
2024
2025         if ((param=PyFloat_AsDouble(value)) == -1.0 && PyErr_Occurred()) {
2026                 PyErr_SetString(PyExc_TypeError,
2027                                 "length must be set to a number");
2028                 return -1;
2029         }
2030
2031         if (param < 0.0) {
2032                 PyErr_SetString(PyExc_ValueError,
2033                                 "cannot set a vectors length to a negative value");
2034                 return -1;
2035         }
2036         if (param == 0.0) {
2037                 fill_vn_fl(self->vec, self->size, 0.0f);
2038                 return 0;
2039         }
2040
2041         dot= dot_vn_vn(self->vec, self->vec, self->size);
2042
2043         if (!dot) /* cant sqrt zero */
2044                 return 0;
2045
2046         dot = sqrt(dot);
2047
2048         if (dot==param)
2049                 return 0;
2050
2051         dot= dot/param;
2052
2053         mul_vn_fl(self->vec, self->size, 1.0/dot);
2054
2055         (void)BaseMath_WriteCallback(self); /* checked already */
2056
2057         return 0;
2058 }
2059
2060 /* vector.length_squared */
2061 static PyObject *Vector_getLengthSquared(VectorObject *self, void *UNUSED(closure))
2062 {
2063         if (BaseMath_ReadCallback(self) == -1)
2064                 return NULL;
2065
2066         return PyFloat_FromDouble(dot_vn_vn(self->vec, self->vec, self->size));
2067 }
2068
2069 /* Get a new Vector according to the provided swizzle. This function has little
2070    error checking, as we are in control of the inputs: the closure is set by us
2071    in Vector_createSwizzleGetSeter. */
2072 static PyObject *Vector_getSwizzle(VectorObject *self, void *closure)
2073 {
2074         size_t axis_to;
2075         size_t axis_from;
2076         float vec[MAX_DIMENSIONS];
2077         unsigned int swizzleClosure;
2078
2079         if (BaseMath_ReadCallback(self) == -1)
2080                 return NULL;
2081
2082         /* Unpack the axes from the closure into an array. */
2083         axis_to = 0;
2084         swizzleClosure = GET_INT_FROM_POINTER(closure);
2085         while (swizzleClosure & SWIZZLE_VALID_AXIS)
2086         {
2087                 axis_from = swizzleClosure & SWIZZLE_AXIS;
2088                 if (axis_from >= self->size) {
2089                         PyErr_SetString(PyExc_AttributeError,
2090                                         "Vector swizzle: "
2091                                         "specified axis not present");
2092                         return NULL;
2093                 }
2094
2095                 vec[axis_to] = self->vec[axis_from];
2096                 swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
2097                 axis_to++;
2098         }
2099
2100         return Vector_CreatePyObject(vec, axis_to, Py_NEW, Py_TYPE(self));
2101 }
2102
2103 /* Set the items of this vector using a swizzle.
2104    - If value is a vector or list this operates like an array copy, except that
2105          the destination is effectively re-ordered as defined by the swizzle. At
2106          most min(len(source), len(dest)) values will be copied.
2107    - If the value is scalar, it is copied to all axes listed in the swizzle.
2108    - If an axis appears more than once in the swizzle, the final occurrence is
2109          the one that determines its value.
2110
2111    Returns 0 on success and -1 on failure. On failure, the vector will be
2112    unchanged. */
2113 static int Vector_setSwizzle(VectorObject *self, PyObject *value, void *closure)
2114 {
2115         size_t size_from;
2116         float scalarVal;
2117
2118         size_t axis_from;
2119         size_t axis_to;
2120
2121         unsigned int swizzleClosure;
2122
2123         float tvec[MAX_DIMENSIONS];
2124         float vec_assign[MAX_DIMENSIONS];
2125
2126         if (BaseMath_ReadCallback(self) == -1)
2127                 return -1;
2128
2129         /* Check that the closure can be used with this vector: even 2D vectors have
2130            swizzles defined for axes z and w, but they would be invalid. */
2131         swizzleClosure = GET_INT_FROM_POINTER(closure);
2132         axis_from= 0;
2133         while (swizzleClosure & SWIZZLE_VALID_AXIS) {
2134                 axis_to = swizzleClosure & SWIZZLE_AXIS;
2135                 if (axis_to >= self->size)
2136                 {
2137                         PyErr_SetString(PyExc_AttributeError,
2138                                         "Vector swizzle: "
2139                                         "specified axis not present");
2140                         return -1;
2141                 }
2142                 swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
2143                 axis_from++;
2144         }
2145
2146         if (((scalarVal=PyFloat_AsDouble(value)) == -1 && PyErr_Occurred())==0) {
2147                 int i;
2148                 for (i=0; i < MAX_DIMENSIONS; i++)
2149                         vec_assign[i]= scalarVal;
2150
2151                 size_from= axis_from;
2152         }
2153         else if ( (PyErr_Clear()), /* run but ignore the result */
2154                   (size_from=mathutils_array_parse(vec_assign, 2, 4, value,
2155                                                    "mathutils.Vector.**** = swizzle assignment")) == -1)
2156         {
2157                 return -1;
2158         }
2159
2160         if (axis_from != size_from) {
2161                 PyErr_SetString(PyExc_AttributeError,
2162                                 "Vector swizzle: size does not match swizzle");
2163                 return -1;
2164         }
2165
2166         /* Copy vector contents onto swizzled axes. */
2167         axis_from = 0;
2168         swizzleClosure = GET_INT_FROM_POINTER(closure);
2169         while (swizzleClosure & SWIZZLE_VALID_AXIS)
2170         {
2171                 axis_to = swizzleClosure & SWIZZLE_AXIS;
2172                 tvec[axis_to] = vec_assign[axis_from];
2173                 swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
2174                 axis_from++;
2175         }
2176
2177         memcpy(self->vec, tvec, axis_from * sizeof(float));
2178         /* continue with BaseMathObject_WriteCallback at the end */
2179
2180         if (BaseMath_WriteCallback(self) == -1)
2181                 return -1;
2182         else
2183                 return 0;
2184 }
2185
2186 /*****************************************************************************/
2187 /* Python attributes get/set structure:                                      */
2188 /*****************************************************************************/
2189 static PyGetSetDef Vector_getseters[] = {
2190         {(char *)"x", (getter)Vector_getAxis, (setter)Vector_setAxis, (char *)"Vector X axis.\n\n:type: float", (void *)0},
2191         {(char *)"y", (getter)Vector_getAxis, (setter)Vector_setAxis, (char *)"Vector Y axis.\n\n:type: float", (void *)1},
2192         {(char *)"z", (getter)Vector_getAxis, (setter)Vector_setAxis, (char *)"Vector Z axis (3D Vectors only).\n\n:type: float", (void *)2},
2193         {(char *)"w", (getter)Vector_getAxis, (setter)Vector_setAxis, (char *)"Vector W axis (4D Vectors only).\n\n:type: float", (void *)3},
2194         {(char *)"length", (getter)Vector_getLength, (setter)Vector_setLength, (char *)"Vector Length.\n\n:type: float", NULL},
2195         {(char *)"length_squared", (getter)Vector_getLengthSquared, (setter)NULL, (char *)"Vector length squared (v.dot(v)).\n\n:type: float", NULL},
2196         {(char *)"magnitude", (getter)Vector_getLength, (setter)Vector_setLength, (char *)"Vector Length.\n\n:type: float", NULL},
2197         {(char *)"is_wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, (char *)BaseMathObject_Wrapped_doc, NULL},
2198         {(char *)"owner", (getter)BaseMathObject_getOwner, (setter)NULL, (char *)BaseMathObject_Owner_doc, NULL},
2199
2200         /* autogenerated swizzle attrs, see python script below */
2201         {(char *)"xx",   (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 36
2202         {(char *)"xxx",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 292
2203         {(char *)"xxxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2340
2204         {(char *)"xxxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2852
2205         {(char *)"xxxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3364
2206         {(char *)"xxxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3876
2207         {(char *)"xxy",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 356
2208         {(char *)"xxyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2404
2209         {(char *)"xxyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2916
2210         {(char *)"xxyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3428
2211         {(char *)"xxyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3940
2212         {(char *)"xxz",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 420
2213         {(char *)"xxzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2468
2214         {(char *)"xxzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2980
2215         {(char *)"xxzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3492
2216         {(char *)"xxzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4004
2217         {(char *)"xxw",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 484
2218         {(char *)"xxwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2532
2219         {(char *)"xxwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3044
2220         {(char *)"xxwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3556
2221         {(char *)"xxww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4068
2222         {(char *)"xy",   (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 44
2223         {(char *)"xyx",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 300
2224         {(char *)"xyxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2348
2225         {(char *)"xyxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2860
2226         {(char *)"xyxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3372
2227         {(char *)"xyxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3884
2228         {(char *)"xyy",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 364
2229         {(char *)"xyyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2412
2230         {(char *)"xyyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2924
2231         {(char *)"xyyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3436
2232         {(char *)"xyyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3948
2233         {(char *)"xyz",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 428
2234         {(char *)"xyzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2476
2235         {(char *)"xyzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2988
2236         {(char *)"xyzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3500
2237         {(char *)"xyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4012
2238         {(char *)"xyw",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 492
2239         {(char *)"xywx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2540
2240         {(char *)"xywy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3052
2241         {(char *)"xywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3564
2242         {(char *)"xyww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4076
2243         {(char *)"xz",   (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 52
2244         {(char *)"xzx",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 308
2245         {(char *)"xzxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2356
2246         {(char *)"xzxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2868
2247         {(char *)"xzxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3380
2248         {(char *)"xzxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3892
2249         {(char *)"xzy",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 372
2250         {(char *)"xzyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2420
2251         {(char *)"xzyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2932
2252         {(char *)"xzyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3444
2253         {(char *)"xzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3956
2254         {(char *)"xzz",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 436
2255         {(char *)"xzzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2484
2256         {(char *)"xzzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2996
2257         {(char *)"xzzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3508
2258         {(char *)"xzzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4020
2259         {(char *)"xzw",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 500
2260         {(char *)"xzwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2548
2261         {(char *)"xzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3060
2262         {(char *)"xzwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3572
2263         {(char *)"xzww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4084
2264         {(char *)"xw",   (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 60
2265         {(char *)"xwx",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 316
2266         {(char *)"xwxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2364
2267         {(char *)"xwxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2876
2268         {(char *)"xwxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3388
2269         {(char *)"xwxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3900
2270         {(char *)"xwy",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 380
2271         {(char *)"xwyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2428
2272         {(char *)"xwyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2940
2273         {(char *)"xwyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3452
2274         {(char *)"xwyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3964
2275         {(char *)"xwz",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 444
2276         {(char *)"xwzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2492
2277         {(char *)"xwzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3004
2278         {(char *)"xwzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3516
2279         {(char *)"xwzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4028
2280         {(char *)"xww",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 508
2281         {(char *)"xwwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2556
2282         {(char *)"xwwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3068
2283         {(char *)"xwwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3580
2284         {(char *)"xwww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4092
2285         {(char *)"yx",   (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 37
2286         {(char *)"yxx",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 293
2287         {(char *)"yxxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2341
2288         {(char *)"yxxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2853
2289         {(char *)"yxxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3365
2290         {(char *)"yxxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3877
2291         {(char *)"yxy",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 357
2292         {(char *)"yxyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2405
2293         {(char *)"yxyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2917
2294         {(char *)"yxyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3429
2295         {(char *)"yxyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3941
2296         {(char *)"yxz",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 421
2297         {(char *)"yxzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2469
2298         {(char *)"yxzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2981
2299         {(char *)"yxzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3493
2300         {(char *)"yxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4005
2301         {(char *)"yxw",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 485
2302         {(char *)"yxwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2533
2303         {(char *)"yxwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3045
2304         {(char *)"yxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3557
2305         {(char *)"yxww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4069
2306         {(char *)"yy",   (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 45
2307         {(char *)"yyx",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 301
2308         {(char *)"yyxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2349
2309         {(char *)"yyxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2861
2310         {(char *)"yyxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3373
2311         {(char *)"yyxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3885
2312         {(char *)"yyy",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 365
2313         {(char *)"yyyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2413
2314         {(char *)"yyyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2925
2315         {(char *)"yyyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3437
2316         {(char *)"yyyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3949
2317         {(char *)"yyz",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 429
2318         {(char *)"yyzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2477
2319         {(char *)"yyzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2989
2320         {(char *)"yyzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3501
2321         {(char *)"yyzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4013
2322         {(char *)"yyw",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 493
2323         {(char *)"yywx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2541
2324         {(char *)"yywy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3053
2325         {(char *)"yywz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3565
2326         {(char *)"yyww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4077
2327         {(char *)"yz",   (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 53
2328         {(char *)"yzx",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 309
2329         {(char *)"yzxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2357
2330         {(char *)"yzxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2869
2331         {(char *)"yzxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3381
2332         {(char *)"yzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3893
2333         {(char *)"yzy",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 373
2334         {(char *)"yzyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2421
2335         {(char *)"yzyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2933
2336         {(char *)"yzyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3445
2337         {(char *)"yzyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3957
2338         {(char *)"yzz",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 437
2339         {(char *)"yzzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2485
2340         {(char *)"yzzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2997
2341         {(char *)"yzzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3509
2342         {(char *)"yzzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4021
2343         {(char *)"yzw",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 501
2344         {(char *)"yzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2549
2345         {(char *)"yzwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3061
2346         {(char *)"yzwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3573
2347         {(char *)"yzww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4085
2348         {(char *)"yw",   (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 61
2349         {(char *)"ywx",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 317
2350         {(char *)"ywxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2365
2351         {(char *)"ywxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2877
2352         {(char *)"ywxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3389
2353         {(char *)"ywxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3901
2354         {(char *)"ywy",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 381
2355         {(char *)"ywyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2429
2356         {(char *)"ywyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2941
2357         {(char *)"ywyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3453
2358         {(char *)"ywyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3965
2359         {(char *)"ywz",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 445
2360         {(char *)"ywzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2493
2361         {(char *)"ywzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3005
2362         {(char *)"ywzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3517
2363         {(char *)"ywzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4029
2364         {(char *)"yww",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 509
2365         {(char *)"ywwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2557
2366         {(char *)"ywwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3069
2367         {(char *)"ywwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3581
2368         {(char *)"ywww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4093
2369         {(char *)"zx",   (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 38
2370         {(char *)"zxx",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 294
2371         {(char *)"zxxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2342
2372         {(char *)"zxxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2854
2373         {(char *)"zxxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3366
2374         {(char *)"zxxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3878
2375         {(char *)"zxy",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 358
2376         {(char *)"zxyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2406
2377         {(char *)"zxyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2918
2378         {(char *)"zxyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3430
2379         {(char *)"zxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3942
2380         {(char *)"zxz",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 422
2381         {(char *)"zxzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2470
2382         {(char *)"zxzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2982
2383         {(char *)"zxzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3494
2384         {(char *)"zxzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4006
2385         {(char *)"zxw",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 486
2386         {(char *)"zxwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2534
2387         {(char *)"zxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3046
2388         {(char *)"zxwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3558
2389         {(char *)"zxww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4070
2390         {(char *)"zy",   (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 46
2391         {(char *)"zyx",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 302
2392         {(char *)"zyxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2350
2393         {(char *)"zyxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2862
2394         {(char *)"zyxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3374
2395         {(char *)"zyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3886
2396         {(char *)"zyy",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 366
2397         {(char *)"zyyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2414
2398         {(char *)"zyyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2926
2399         {(char *)"zyyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3438
2400         {(char *)"zyyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3950
2401         {(char *)"zyz",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 430
2402         {(char *)"zyzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2478
2403         {(char *)"zyzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2990
2404         {(char *)"zyzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3502
2405         {(char *)"zyzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4014
2406         {(char *)"zyw",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 494
2407         {(char *)"zywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2542
2408         {(char *)"zywy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3054
2409         {(char *)"zywz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3566
2410         {(char *)"zyww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4078
2411         {(char *)"zz",   (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 54
2412         {(char *)"zzx",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 310
2413         {(char *)"zzxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2358
2414         {(char *)"zzxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2870
2415         {(char *)"zzxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3382
2416         {(char *)"zzxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3894
2417         {(char *)"zzy",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 374
2418         {(char *)"zzyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2422
2419         {(char *)"zzyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2934
2420         {(char *)"zzyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3446
2421         {(char *)"zzyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3958
2422         {(char *)"zzz",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 438
2423         {(char *)"zzzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2486
2424         {(char *)"zzzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2998
2425         {(char *)"zzzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3510
2426         {(char *)"zzzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4022
2427         {(char *)"zzw",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 502
2428         {(char *)"zzwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2550
2429         {(char *)"zzwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3062
2430         {(char *)"zzwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3574
2431         {(char *)"zzww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4086
2432         {(char *)"zw",   (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 62
2433         {(char *)"zwx",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 318
2434         {(char *)"zwxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2366
2435         {(char *)"zwxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2878
2436         {(char *)"zwxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3390
2437         {(char *)"zwxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3902
2438         {(char *)"zwy",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 382
2439         {(char *)"zwyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2430
2440         {(char *)"zwyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2942
2441         {(char *)"zwyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3454
2442         {(char *)"zwyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3966
2443         {(char *)"zwz",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 446
2444         {(char *)"zwzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2494
2445         {(char *)"zwzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3006
2446         {(char *)"zwzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3518
2447         {(char *)"zwzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4030
2448         {(char *)"zww",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 510
2449         {(char *)"zwwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2558
2450         {(char *)"zwwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3070
2451         {(char *)"zwwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3582
2452         {(char *)"zwww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4094
2453         {(char *)"wx",   (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 39
2454         {(char *)"wxx",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 295
2455         {(char *)"wxxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2343
2456         {(char *)"wxxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2855
2457         {(char *)"wxxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3367
2458         {(char *)"wxxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3879
2459         {(char *)"wxy",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 359
2460         {(char *)"wxyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2407
2461         {(char *)"wxyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2919
2462         {(char *)"wxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3431
2463         {(char *)"wxyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3943
2464         {(char *)"wxz",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 423
2465         {(char *)"wxzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2471
2466         {(char *)"wxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2983
2467         {(char *)"wxzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3495
2468         {(char *)"wxzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4007
2469         {(char *)"wxw",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 487
2470         {(char *)"wxwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2535
2471         {(char *)"wxwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3047
2472         {(char *)"wxwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3559
2473         {(char *)"wxww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4071
2474         {(char *)"wy",   (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 47
2475         {(char *)"wyx",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 303
2476         {(char *)"wyxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2351
2477         {(char *)"wyxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2863
2478         {(char *)"wyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3375
2479         {(char *)"wyxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3887
2480         {(char *)"wyy",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 367
2481         {(char *)"wyyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2415
2482         {(char *)"wyyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2927
2483         {(char *)"wyyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3439
2484         {(char *)"wyyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3951
2485         {(char *)"wyz",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 431
2486         {(char *)"wyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2479
2487         {(char *)"wyzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2991
2488         {(char *)"wyzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3503
2489         {(char *)"wyzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4015
2490         {(char *)"wyw",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 495
2491         {(char *)"wywx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2543
2492         {(char *)"wywy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3055
2493         {(char *)"wywz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3567
2494         {(char *)"wyww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4079
2495         {(char *)"wz",   (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 55
2496         {(char *)"wzx",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 311
2497         {(char *)"wzxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2359
2498         {(char *)"wzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2871
2499         {(char *)"wzxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3383
2500         {(char *)"wzxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3895
2501         {(char *)"wzy",  (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 375
2502         {(char *)"wzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2423
2503         {(char *)"wzyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2935
2504         {(char *)"wzyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3447
2505         {(char *)"wzyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3959
2506         {(char *)"wzz",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 439
2507         {(char *)"wzzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2487
2508         {(char *)"wzzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2999
2509         {(char *)"wzzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3511
2510         {(char *)"wzzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4023
2511         {(char *)"wzw",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 503
2512         {(char *)"wzwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2551
2513         {(char *)"wzwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3063
2514         {(char *)"wzwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3575
2515         {(char *)"wzww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4087
2516         {(char *)"ww",   (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 63
2517         {(char *)"wwx",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 319
2518         {(char *)"wwxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2367
2519         {(char *)"wwxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2879
2520         {(char *)"wwxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3391
2521         {(char *)"wwxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3903
2522         {(char *)"wwy",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 383
2523         {(char *)"wwyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2431
2524         {(char *)"wwyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2943
2525         {(char *)"wwyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3455
2526         {(char *)"wwyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3967
2527         {(char *)"wwz",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 447
2528         {(char *)"wwzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2495
2529         {(char *)"wwzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3007
2530         {(char *)"wwzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3519
2531         {(char *)"wwzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4031
2532         {(char *)"www",  (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 511
2533         {(char *)"wwwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 2559
2534         {(char *)"wwwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3071
2535         {(char *)"wwwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 3583
2536         {(char *)"wwww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  )}, // 4095
2537         {NULL, NULL, NULL, NULL, NULL}  /* Sentinel */
2538 };
2539
2540 /* Python script used to make swizzle array */
2541 /*
2542 SWIZZLE_BITS_PER_AXIS = 3
2543 SWIZZLE_VALID_AXIS = 0x4
2544
2545 axis_dict = {}
2546 axis_pos = {'x':0, 'y':1, 'z':2, 'w':3}
2547 axises = 'xyzw'
2548 while len(axises) >= 2:
2549
2550         for axis_0 in axises:
2551                 axis_0_pos = axis_pos[axis_0]
2552                 for axis_1 in axises:
2553                         axis_1_pos = axis_pos[axis_1]
2554                         axis_dict[axis_0+axis_1] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS))' % (axis_0_pos, axis_1_pos)
2555                         if len(axises)>2:
2556                                 for axis_2 in axises:
2557                                         axis_2_pos = axis_pos[axis_2]
2558                                         axis_dict[axis_0+axis_1+axis_2] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)))' % (axis_0_pos, axis_1_pos, axis_2_pos)
2559                                         if len(axises)>3:
2560                                                 for axis_3 in axises:
2561                                                         axis_3_pos = axis_pos[axis_3]
2562                                                         axis_dict[axis_0+axis_1+axis_2+axis_3] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((%s|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3)))  ' % (axis_0_pos, axis_1_pos, axis_2_pos, axis_3_pos)
2563
2564         axises = axises[:-1]
2565
2566
2567 items = axis_dict.items()
2568 items.sort(key = lambda a: a[0].replace('x', '0').replace('y', '1').replace('z', '2').replace('w', '3'))
2569
2570 unique = set()
2571 for key, val in items:
2572         num = eval(val)
2573         set_str = 'Vector_setSwizzle' if (len(set(key)) == len(key)) else 'NULL'
2574         print '\t{"%s", %s(getter)Vector_getSwizzle, (setter)%s, NULL, SET_INT_IN_POINTER(%s)}, // %s' % (key, (' '*(4-len(key))), set_str, axis_dict[key], num)
2575         unique.add(num)
2576
2577 if len(unique) != len(items):
2578         print "ERROR"
2579 */
2580
2581 /* ROW VECTOR Multiplication - Vector X Matrix
2582  * [x][y][z] *  [1][4][7]
2583  *             [2][5][8]
2584  *             [3][6][9]
2585  * vector/matrix multiplication IS NOT COMMUTATIVE!!!! */
2586 static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat)
2587 {
2588         float vec_cpy[MAX_DIMENSIONS];
2589         double dot = 0.0f;
2590         int x, y, z= 0, vec_size= vec->size;
2591
2592         if (mat->col_size != vec_size) {
2593                 if (mat->col_size == 4 && vec_size != 3) {
2594                         PyErr_SetString(PyExc_ValueError,
2595                                         "vector * matrix: matrix column size "
2596                                         "and the vector size must be the same");
2597                         return -1;
2598                 }
2599                 else {
2600                         vec_cpy[3] = 1.0f;
2601                 }
2602         }
2603
2604         if (BaseMath_ReadCallback(vec) == -1 || BaseMath_ReadCallback(mat) == -1)
2605                 return -1;
2606
2607         memcpy(vec_cpy, vec->vec, vec_size * sizeof(float));
2608
2609         rvec[3] = 1.0f;
2610         //muliplication
2611         for (x = 0; x < mat->row_size; x++) {
2612                 for (y = 0; y < mat->col_size; y++) {
2613                         dot += mat->matrix[x][y] * vec_cpy[y];
2614                 }
2615                 rvec[z++] = (float)dot;
2616                 dot = 0.0f;
2617         }
2618         return 0;
2619 }
2620
2621 /*----------------------------Vector.negate() -------------------- */
2622 PyDoc_STRVAR(Vector_negate_doc,
2623 ".. method:: negate()\n"
2624 "\n"
2625 "   Set all values to their negative.\n"
2626 "\n"
2627 "   :return: an instance of itself\n"
2628 "   :rtype: :class:`Vector`\n"
2629 );
2630 static PyObject *Vector_negate(VectorObject *self)
2631 {
2632         if (BaseMath_ReadCallback(self) == -1)
2633                 return NULL;
2634
2635         negate_vn(self->vec, self->size);
2636
2637         (void)BaseMath_WriteCallback(self); // already checked for error
2638         Py_RETURN_NONE;
2639 }
2640
2641 static struct PyMethodDef Vector_methods[] = {
2642         /* Class Methods */
2643         {"Fill", (PyCFunction) C_Vector_Fill, METH_VARARGS | METH_CLASS, C_Vector_Fill_doc},
2644         {"Range", (PyCFunction) C_Vector_Range, METH_VARARGS | METH_CLASS, C_Vector_Range_doc},
2645         {"Linspace", (PyCFunction) C_Vector_Linspace, METH_VARARGS | METH_CLASS, C_Vector_Linspace_doc},
2646         {"Repeat", (PyCFunction) C_Vector_Repeat, METH_VARARGS | METH_CLASS, C_Vector_Repeat_doc},
2647
2648         /* in place only */
2649         {"zero", (PyCFunction) Vector_zero, METH_NOARGS, Vector_zero_doc},
2650         {"negate", (PyCFunction) Vector_negate, METH_NOARGS, Vector_negate_doc},
2651
2652         /* operate on original or copy */
2653         {"normalize", (PyCFunction) Vector_normalize, METH_NOARGS, Vector_normalize_doc},
2654         {"normalized", (PyCFunction) Vector_normalized, METH_NOARGS, Vector_normalized_doc},
2655
2656         {"resize", (PyCFunction) Vector_resize, METH_O, Vector_resize_doc},
2657         {"resized", (PyCFunction) Vector_resized, METH_O, Vector_resized_doc},
2658         {"to_2d", (PyCFunction) Vector_to_2d, METH_NOARGS, Vector_to_2d_doc},
2659         {"resize_2d", (PyCFunction) Vector_resize_2d, METH_NOARGS, Vector_resize_2d_doc},
2660         {"to_3d", (PyCFunction) Vector_to_3d, METH_NOARGS, Vector_to_3d_doc},
2661         {"resize_3d", (PyCFunction) Vector_resize_3d, METH_NOARGS, Vector_resize_3d_doc},
2662         {"to_4d", (PyCFunction) Vector_to_4d, METH_NOARGS, Vector_to_4d_doc},
2663         {"resize_4d", (PyCFunction) Vector_resize_4d, METH_NOARGS, Vector_resize_4d_doc},
2664         {"to_tuple", (PyCFunction) Vector_to_tuple, METH_VARARGS, Vector_to_tuple_doc},
2665         {"to_track_quat", (PyCFunction) Vector_to_track_quat, METH_VARARGS, Vector_to_track_quat_doc},
2666
2667         /* operation between 2 or more types  */
2668         {"reflect", (PyCFunction) Vector_reflect, METH_O, Vector_reflect_doc},
2669         {"cross", (PyCFunction) Vector_cross, METH_O, Vector_cross_doc},
2670         {"dot", (PyCFunction) Vector_dot, METH_O, Vector_dot_doc},
2671         {"angle", (PyCFunction) Vector_angle, METH_VARARGS, Vector_angle_doc},
2672         {"rotation_difference", (PyCFunction) Vector_rotation_difference, METH_O, Vector_rotation_difference_doc},
2673         {"project", (PyCFunction) Vector_project, METH_O, Vector_project_doc},
2674         {"lerp", (PyCFunction) Vector_lerp, METH_VARARGS, Vector_lerp_doc},
2675         {"rotate", (PyCFunction) Vector_rotate, METH_O, Vector_rotate_doc},
2676
2677         {"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc},
2678         {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, NULL},
2679         {NULL, NULL, 0, NULL}
2680 };
2681
2682
2683 /* Note
2684  Py_TPFLAGS_CHECKTYPES allows us to avoid casting all types to Vector when coercing
2685  but this means for eg that
2686  vec*mat and mat*vec both get sent to Vector_mul and it neesd to sort out the order
2687 */
2688
2689 PyDoc_STRVAR(vector_doc,
2690 "This object gives access to Vectors in Blender."
2691 );
2692 PyTypeObject vector_Type = {
2693         PyVarObject_HEAD_INIT(NULL, 0)
2694         /*  For printing, in format "<module>.<name>" */
2695         "mathutils.Vector",             /* char *tp_name; */
2696         sizeof(VectorObject),         /* int tp_basicsize; */
2697         0,                          /* tp_itemsize;  For allocation */
2698
2699         /* Methods to implement standard operations */
2700
2701         (destructor) BaseMathObject_dealloc,/* destructor tp_dealloc; */
2702         NULL,                       /* printfunc tp_print; */
2703         NULL,                       /* getattrfunc tp_getattr; */
2704         NULL,                       /* setattrfunc tp_setattr; */
2705         NULL,   /* cmpfunc tp_compare; */
2706         (reprfunc)Vector_repr,     /* reprfunc tp_repr; */
2707
2708         /* Method suites for standard classes */
2709
2710         &Vector_NumMethods,                       /* PyNumberMethods *tp_as_number; */
2711         &Vector_SeqMethods,                       /* PySequenceMethods *tp_as_sequence; */
2712         &Vector_AsMapping,                       /* PyMappingMethods *tp_as_mapping; */
2713
2714         /* More standard operations (here for binary compatibility) */
2715
2716         NULL,                       /* hashfunc tp_hash; */
2717         NULL,                       /* ternaryfunc tp_call; */
2718         NULL,                       /* reprfunc tp_str; */
2719         NULL,                       /* getattrofunc tp_getattro; */
2720         NULL,                       /* setattrofunc tp_setattro; */
2721
2722         /* Functions to access object as input/output buffer */
2723         NULL,                       /* PyBufferProcs *tp_as_buffer; */
2724
2725   /*** Flags to define presence of optional/expanded features ***/
2726         Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
2727         vector_doc,                       /*  char *tp_doc;  Documentation string */
2728   /*** Assigned meaning in release 2.0 ***/
2729
2730         /* call function for all accessible objects */
2731         (traverseproc)BaseMathObject_traverse,  //tp_traverse
2732
2733         /* delete references to contained objects */
2734         (inquiry)BaseMathObject_clear,  //tp_clear
2735
2736   /***  Assigned meaning in release 2.1 ***/
2737   /*** rich comparisons ***/
2738         (richcmpfunc)Vector_richcmpr,                       /* richcmpfunc tp_richcompare; */
2739
2740   /***  weak reference enabler ***/
2741         0,                          /* long tp_weaklistoffset; */
2742
2743   /*** Added in release 2.2 ***/
2744         /*   Iterators */
2745         NULL,                       /* getiterfunc tp_iter; */
2746         NULL,                       /* iternextfunc tp_iternext; */
2747
2748   /*** Attribute descriptor and subclassing stuff ***/
2749         Vector_methods,           /* struct PyMethodDef *tp_methods; */
2750         NULL,                       /* struct PyMemberDef *tp_members; */
2751         Vector_getseters,           /* struct PyGetSetDef *tp_getset; */
2752         NULL,                       /* struct _typeobject *tp_base; */
2753         NULL,                       /* PyObject *tp_dict; */
2754         NULL,                       /* descrgetfunc tp_descr_get; */
2755         NULL,                       /* descrsetfunc tp_descr_set; */
2756         0,                          /* long tp_dictoffset; */
2757         NULL,                       /* initproc tp_init; */
2758         NULL,                       /* allocfunc tp_alloc; */
2759         Vector_new,                 /* newfunc tp_new; */
2760         /*  Low-level free-memory routine */
2761         NULL,                       /* freefunc tp_free;  */
2762         /* For PyObject_IS_GC */
2763         NULL,                       /* inquiry tp_is_gc;  */
2764         NULL,                       /* PyObject *tp_bases; */
2765         /* method resolution order */
2766         NULL,                       /* PyObject *tp_mro;  */
2767         NULL,                       /* PyObject *tp_cache; */
2768         NULL,                       /* PyObject *tp_subclasses; */
2769         NULL,                       /* PyObject *tp_weaklist; */
2770         NULL
2771 };
2772
2773 /*------------------------Vector_CreatePyObject (internal)-------------
2774   creates a new vector object
2775   pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
2776  (i.e. it was allocated elsewhere by MEM_mallocN())
2777   pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
2778  (i.e. it must be created here with PyMEM_malloc())*/
2779 PyObject *Vector_CreatePyObject(float *vec, const int size, const int type, PyTypeObject *base_type)
2780 {
2781         VectorObject *self;
2782
2783         if (size < 2) {
2784                 PyErr_SetString(PyExc_RuntimeError,
2785                                 "Vector(): invalid size");
2786                 return NULL;
2787         }
2788
2789         self= base_type ?       (VectorObject *)base_type->tp_alloc(base_type, 0) :
2790                                                 (VectorObject *)PyObject_GC_New(VectorObject, &vector_Type);
2791
2792         if (self) {
2793                 self->size = size;
2794
2795                 /* init callbacks as NULL */
2796                 self->cb_user= NULL;
2797                 self->cb_type= self->cb_subtype= 0;
2798
2799                 if (type == Py_WRAP) {
2800                         self->vec = vec;
2801                         self->wrapped = Py_WRAP;
2802                 }
2803                 else if (type == Py_NEW) {
2804                         self->vec= PyMem_Malloc(size * sizeof(float));
2805                         if (vec) {
2806                                 memcpy(self->vec, vec, size * sizeof(float));
2807                         }
2808                         else { /* new empty */
2809                                 fill_vn_fl(self->vec, size, 0.0f);
2810                                 if (size == 4) { /* do the homogenous thing */
2811                                         self->vec[3] = 1.0f;
2812                                 }
2813                         }
2814                         self->wrapped = Py_NEW;
2815                 }
2816                 else {
2817                         Py_FatalError("Vector(): invalid type!");
2818                 }
2819         }
2820         return (PyObject *) self;
2821 }
2822
2823 PyObject *Vector_CreatePyObject_cb(PyObject *cb_user, int size, int cb_type, int cb_subtype)
2824 {
2825         float dummy[4] = {0.0, 0.0, 0.0, 0.0}; /* dummy init vector, callbacks will be used on access */
2826         VectorObject *self= (VectorObject *)Vector_CreatePyObject(dummy, size, Py_NEW, NULL);
2827         if (self) {
2828                 Py_INCREF(cb_user);
2829                 self->cb_user=                  cb_user;
2830                 self->cb_type=                  (unsigned char)cb_type;
2831                 self->cb_subtype=               (unsigned char)cb_subtype;
2832                 PyObject_GC_Track(self);
2833         }
2834
2835         return (PyObject *)self;
2836 }
2837
2838 PyObject *Vector_CreatePyObject_alloc(float *vec, const int size, PyTypeObject *base_type)
2839 {
2840         VectorObject *vect_ob;
2841         vect_ob= (VectorObject *)Vector_CreatePyObject(vec, size, Py_WRAP, base_type);
2842         vect_ob->wrapped= Py_NEW;
2843
2844         return (PyObject *)vect_ob;
2845 }