edits to argument parsing for Euler.rotate_axis, also corrected some exception messag...
[blender.git] / source / blender / python / mathutils / mathutils_Vector.c
1 /*
2  * $Id$
3  * ***** BEGIN GPL LICENSE BLOCK *****
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
20  * All rights reserved.
21  *
22  *
23  * Contributor(s): Willian P. Germano, Joseph Gilbert, Ken Hughes, Alex Fraser, Campbell Barton
24  *
25  * ***** END GPL LICENSE BLOCK *****
26  */
27
28 /** \file blender/python/generic/mathutils_Vector.c
29  *  \ingroup pygen
30  */
31
32
33 #include <Python.h>
34
35 #include "mathutils.h"
36
37 #include "BLI_math.h"
38 #include "BLI_utildefines.h"
39
40 #define MAX_DIMENSIONS 4
41
42 /* Swizzle axes get packed into a single value that is used as a closure. Each
43    axis uses SWIZZLE_BITS_PER_AXIS bits. The first bit (SWIZZLE_VALID_AXIS) is
44    used as a sentinel: if it is unset, the axis is not valid. */
45 #define SWIZZLE_BITS_PER_AXIS 3
46 #define SWIZZLE_VALID_AXIS 0x4
47 #define SWIZZLE_AXIS       0x3
48
49 static PyObject *Vector_copy(VectorObject *self);
50 static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits);
51 static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat);
52
53 /* Supports 2D, 3D, and 4D vector objects both int and float values
54  * accepted. Mixed float and int values accepted. Ints are parsed to float
55  */
56 static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds))
57 {
58         float vec[4]= {0.0f, 0.0f, 0.0f, 0.0f};
59         int size= 3; /* default to a 3D vector */
60
61         switch(PyTuple_GET_SIZE(args)) {
62         case 0:
63                 break;
64         case 1:
65                 if((size=mathutils_array_parse(vec, 2, 4, PyTuple_GET_ITEM(args, 0), "mathutils.Vector()")) == -1)
66                         return NULL;
67                 break;
68         default:
69                 PyErr_SetString(PyExc_TypeError,
70                                 "mathutils.Vector(): "
71                                 "more then a single arg given");
72                 return NULL;
73         }
74         return newVectorObject(vec, size, Py_NEW, type);
75 }
76
77 static PyObject *vec__apply_to_copy(PyNoArgsFunction vec_func, VectorObject *self)
78 {
79         PyObject *ret= Vector_copy(self);
80         PyObject *ret_dummy= vec_func(ret);
81         if(ret_dummy) {
82                 Py_DECREF(ret_dummy);
83                 return (PyObject *)ret;
84         }
85         else { /* error */
86                 Py_DECREF(ret);
87                 return NULL;
88         }
89 }
90
91 /*-----------------------------METHODS---------------------------- */
92 PyDoc_STRVAR(Vector_zero_doc,
93 ".. method:: zero()\n"
94 "\n"
95 "   Set all values to zero.\n"
96 );
97 static PyObject *Vector_zero(VectorObject *self)
98 {
99         fill_vn(self->vec, self->size, 0.0f);
100
101         if(BaseMath_WriteCallback(self) == -1)
102                 return NULL;
103
104         Py_RETURN_NONE;
105 }
106
107 PyDoc_STRVAR(Vector_normalize_doc,
108 ".. method:: normalize()\n"
109 "\n"
110 "   Normalize the vector, making the length of the vector always 1.0.\n"
111 "\n"
112 "   .. warning:: Normalizing a vector where all values are zero results\n"
113 "      in all axis having a nan value (not a number).\n"
114 "\n"
115 "   .. note:: Normalize works for vectors of all sizes,\n"
116 "      however 4D Vectors w axis is left untouched.\n"
117 );
118 static PyObject *Vector_normalize(VectorObject *self)
119 {
120         int i;
121         float norm = 0.0f;
122
123         if(BaseMath_ReadCallback(self) == -1)
124                 return NULL;
125
126         for(i = 0; i < self->size; i++) {
127                 norm += self->vec[i] * self->vec[i];
128         }
129         norm = (float) sqrt(norm);
130         for(i = 0; i < self->size; i++) {
131                 self->vec[i] /= norm;
132         }
133
134         (void)BaseMath_WriteCallback(self);
135         Py_RETURN_NONE;
136 }
137 PyDoc_STRVAR(Vector_normalized_doc,
138 ".. method:: normalized()\n"
139 "\n"
140 "   Return a new, normalized vector.\n"
141 "\n"
142 "   :return: a normalized copy of the vector\n"
143 "   :rtype: :class:`Vector`\n"
144 );
145 static PyObject *Vector_normalized(VectorObject *self)
146 {
147         return vec__apply_to_copy((PyNoArgsFunction)Vector_normalize, self);
148 }
149
150 PyDoc_STRVAR(Vector_resize_2d_doc,
151 ".. method:: resize_2d()\n"
152 "\n"
153 "   Resize the vector to 2D  (x, y).\n"
154 "\n"
155 "   :return: an instance of itself\n"
156 "   :rtype: :class:`Vector`\n"
157 );
158 static PyObject *Vector_resize_2d(VectorObject *self)
159 {
160         if(self->wrapped==Py_WRAP) {
161                 PyErr_SetString(PyExc_TypeError,
162                                 "Vector.resize_2d(): "
163                                 "cannot resize wrapped data - only python vectors");
164                 return NULL;
165         }
166         if(self->cb_user) {
167                 PyErr_SetString(PyExc_TypeError,
168                                 "Vector.resize_2d(): "
169                                 "cannot resize a vector that has an owner");
170                 return NULL;
171         }
172
173         self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 2));
174         if(self->vec == NULL) {
175                 PyErr_SetString(PyExc_MemoryError,
176                                 "Vector.resize_2d(): "
177                                 "problem allocating pointer space");
178                 return NULL;
179         }
180
181         self->size = 2;
182         Py_RETURN_NONE;
183 }
184
185 PyDoc_STRVAR(Vector_resize_3d_doc,
186 ".. method:: resize_3d()\n"
187 "\n"
188 "   Resize the vector to 3D  (x, y, z).\n"
189 "\n"
190 "   :return: an instance of itself\n"
191 "   :rtype: :class:`Vector`\n"
192 );
193 static PyObject *Vector_resize_3d(VectorObject *self)
194 {
195         if (self->wrapped==Py_WRAP) {
196                 PyErr_SetString(PyExc_TypeError,
197                                 "Vector.resize_3d(): "
198                                 "cannot resize wrapped data - only python vectors");
199                 return NULL;
200         }
201         if(self->cb_user) {
202                 PyErr_SetString(PyExc_TypeError,
203                                 "Vector.resize_3d(): "
204                                 "cannot resize a vector that has an owner");
205                 return NULL;
206         }
207
208         self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 3));
209         if(self->vec == NULL) {
210                 PyErr_SetString(PyExc_MemoryError,
211                                 "Vector.resize_3d(): "
212                                 "problem allocating pointer space");
213                 return NULL;
214         }
215
216         if(self->size == 2)
217                 self->vec[2] = 0.0f;
218
219         self->size = 3;
220         Py_RETURN_NONE;
221 }
222
223 PyDoc_STRVAR(Vector_resize_4d_doc,
224 ".. method:: resize_4d()\n"
225 "\n"
226 "   Resize the vector to 4D (x, y, z, w).\n"
227 "\n"
228 "   :return: an instance of itself\n"
229 "   :rtype: :class:`Vector`\n"
230 );
231 static PyObject *Vector_resize_4d(VectorObject *self)
232 {
233         if(self->wrapped==Py_WRAP) {
234                 PyErr_SetString(PyExc_TypeError,
235                                 "Vector.resize_4d(): "
236                                 "cannot resize wrapped data - only python vectors");
237                 return NULL;
238         }
239         if(self->cb_user) {
240                 PyErr_SetString(PyExc_TypeError,
241                                 "Vector.resize_4d(): "
242                                 "cannot resize a vector that has an owner");
243                 return NULL;
244         }
245
246         self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 4));
247         if(self->vec == NULL) {
248                 PyErr_SetString(PyExc_MemoryError,
249                                 "Vector.resize_4d(): "
250                                 "problem allocating pointer space");
251                 return NULL;
252         }
253
254         if(self->size == 2){
255                 self->vec[2] = 0.0f;
256                 self->vec[3] = 1.0f;
257         }
258         else if(self->size == 3){
259                 self->vec[3] = 1.0f;
260         }
261         self->size = 4;
262         Py_RETURN_NONE;
263 }
264 PyDoc_STRVAR(Vector_to_2d_doc,
265 ".. method:: to_2d()\n"
266 "\n"
267 "   Return a 2d copy of the vector.\n"
268 "\n"
269 "   :return: a new vector\n"
270 "   :rtype: :class:`Vector`\n"
271 );
272 static PyObject *Vector_to_2d(VectorObject *self)
273 {
274         if(BaseMath_ReadCallback(self) == -1)
275                 return NULL;
276
277         return newVectorObject(self->vec, 2, Py_NEW, Py_TYPE(self));
278 }
279 PyDoc_STRVAR(Vector_to_3d_doc,
280 ".. method:: to_3d()\n"
281 "\n"
282 "   Return a 3d copy of the vector.\n"
283 "\n"
284 "   :return: a new vector\n"
285 "   :rtype: :class:`Vector`\n"
286 );
287 static PyObject *Vector_to_3d(VectorObject *self)
288 {
289         float tvec[3]= {0.0f};
290
291         if(BaseMath_ReadCallback(self) == -1)
292                 return NULL;
293
294         memcpy(tvec, self->vec, sizeof(float) * MIN2(self->size, 3));
295         return newVectorObject(tvec, 3, Py_NEW, Py_TYPE(self));
296 }
297 PyDoc_STRVAR(Vector_to_4d_doc,
298 ".. method:: to_4d()\n"
299 "\n"
300 "   Return a 4d copy of the vector.\n"
301 "\n"
302 "   :return: a new vector\n"
303 "   :rtype: :class:`Vector`\n"
304 );
305 static PyObject *Vector_to_4d(VectorObject *self)
306 {
307         float tvec[4]= {0.0f, 0.0f, 0.0f, 1.0f};
308
309         if(BaseMath_ReadCallback(self) == -1)
310                 return NULL;
311
312         memcpy(tvec, self->vec, sizeof(float) * MIN2(self->size, 4));
313         return newVectorObject(tvec, 4, Py_NEW, Py_TYPE(self));
314 }
315
316 PyDoc_STRVAR(Vector_to_tuple_doc,
317 ".. method:: to_tuple(precision=-1)\n"
318 "\n"
319 "   Return this vector as a tuple with.\n"
320 "\n"
321 "   :arg precision: The number to round the value to in [-1, 21].\n"
322 "   :type precision: int\n"
323 "   :return: the values of the vector rounded by *precision*\n"
324 "   :rtype: tuple\n"
325 );
326 /* note: BaseMath_ReadCallback must be called beforehand */
327 static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits)
328 {
329         PyObject *ret;
330         int i;
331
332         ret= PyTuple_New(self->size);
333
334         if(ndigits >= 0) {
335                 for(i = 0; i < self->size; i++) {
336                         PyTuple_SET_ITEM(ret, i, PyFloat_FromDouble(double_round((double)self->vec[i], ndigits)));
337                 }
338         }
339         else {
340                 for(i = 0; i < self->size; i++) {
341                         PyTuple_SET_ITEM(ret, i, PyFloat_FromDouble(self->vec[i]));
342                 }
343         }
344
345         return ret;
346 }
347
348 static PyObject *Vector_to_tuple(VectorObject *self, PyObject *args)
349 {
350         int ndigits= 0;
351
352         if(!PyArg_ParseTuple(args, "|i:to_tuple", &ndigits))
353                 return NULL;
354
355         if(ndigits > 22 || ndigits < 0) {
356                 PyErr_SetString(PyExc_ValueError,
357                                 "Vector.to_tuple(ndigits): "
358                                 "ndigits must be between 0 and 21");
359                 return NULL;
360         }
361
362         if(PyTuple_GET_SIZE(args)==0)
363                 ndigits= -1;
364
365         if(BaseMath_ReadCallback(self) == -1)
366                 return NULL;
367
368         return Vector_to_tuple_ext(self, ndigits);
369 }
370
371 PyDoc_STRVAR(Vector_to_track_quat_doc,
372 ".. method:: to_track_quat(track, up)\n"
373 "\n"
374 "   Return a quaternion rotation from the vector and the track and up axis.\n"
375 "\n"
376 "   :arg track: Track axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z'].\n"
377 "   :type track: string\n"
378 "   :arg up: Up axis in ['X', 'Y', 'Z'].\n"
379 "   :type up: string\n"
380 "   :return: rotation from the vector and the track and up axis.\n"
381 "   :rtype: :class:`Quaternion`\n"
382 );
383 static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
384 {
385         float vec[3], quat[4];
386         const char *strack, *sup;
387         short track = 2, up = 1;
388
389         if(!PyArg_ParseTuple(args, "|ss:to_track_quat", &strack, &sup))
390                 return NULL;
391
392         if (self->size != 3) {
393                 PyErr_SetString(PyExc_TypeError,
394                                 "Vector.to_track_quat(): "
395                                 "only for 3D vectors");
396                 return NULL;
397         }
398
399         if(BaseMath_ReadCallback(self) == -1)
400                 return NULL;
401
402         if (strack) {
403                 const char *axis_err_msg= "only X, -X, Y, -Y, Z or -Z for track axis";
404
405                 if (strlen(strack) == 2) {
406                         if (strack[0] == '-') {
407                                 switch(strack[1]) {
408                                         case 'X':
409                                                 track = 3;
410                                                 break;
411                                         case 'Y':
412                                                 track = 4;
413                                                 break;
414                                         case 'Z':
415                                                 track = 5;
416                                                 break;
417                                         default:
418                                                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
419                                                 return NULL;
420                                 }
421                         }
422                         else {
423                                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
424                                 return NULL;
425                         }
426                 }
427                 else if (strlen(strack) == 1) {
428                         switch(strack[0]) {
429                         case '-':
430                         case 'X':
431                                 track = 0;
432                                 break;
433                         case 'Y':
434                                 track = 1;
435                                 break;
436                         case 'Z':
437                                 track = 2;
438                                 break;
439                         default:
440                                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
441                                 return NULL;
442                         }
443                 }
444                 else {
445                         PyErr_SetString(PyExc_ValueError, axis_err_msg);
446                         return NULL;
447                 }
448         }
449
450         if (sup) {
451                 const char *axis_err_msg= "only X, Y or Z for up axis";
452                 if (strlen(sup) == 1) {
453                         switch(*sup) {
454                         case 'X':
455                                 up = 0;
456                                 break;
457                         case 'Y':
458                                 up = 1;
459                                 break;
460                         case 'Z':
461                                 up = 2;
462                                 break;
463                         default:
464                                 PyErr_SetString(PyExc_ValueError, axis_err_msg);
465                                 return NULL;
466                         }
467                 }
468                 else {
469                         PyErr_SetString(PyExc_ValueError, axis_err_msg);
470                         return NULL;
471                 }
472         }
473
474         if (track == up) {
475                 PyErr_SetString(PyExc_ValueError,
476                                 "Can't have the same axis for track and up");
477                 return NULL;
478         }
479
480         /*
481                 flip vector around, since vectoquat expect a vector from target to tracking object
482                 and the python function expects the inverse (a vector to the target).
483         */
484         negate_v3_v3(vec, self->vec);
485
486         vec_to_quat(quat, vec, track, up);
487
488         return newQuaternionObject(quat, Py_NEW, NULL);
489 }
490
491 /*
492  * Vector.reflect(mirror): return a reflected vector on the mirror normal
493  *  vec - ((2 * DotVecs(vec, mirror)) * mirror)
494  */
495 PyDoc_STRVAR(Vector_reflect_doc,
496 ".. method:: reflect(mirror)\n"
497 "\n"
498 "   Return the reflection vector from the *mirror* argument.\n"
499 "\n"
500 "   :arg mirror: This vector could be a normal from the reflecting surface.\n"
501 "   :type mirror: :class:`Vector`\n"
502 "   :return: The reflected vector matching the size of this vector.\n"
503 "   :rtype: :class:`Vector`\n"
504 );
505 static PyObject *Vector_reflect(VectorObject *self, PyObject *value)
506 {
507         int value_size;
508         float mirror[3], vec[3];
509         float reflect[3] = {0.0f};
510         float tvec[MAX_DIMENSIONS];
511
512         if(BaseMath_ReadCallback(self) == -1)
513                 return NULL;
514
515         if((value_size= mathutils_array_parse(tvec, 2, 4, value, "Vector.reflect(other), invalid 'other' arg")) == -1)
516                 return NULL;
517
518         mirror[0] = tvec[0];
519         mirror[1] = tvec[1];
520         if (value_size > 2)             mirror[2] = tvec[2];
521         else                                    mirror[2] = 0.0;
522
523         vec[0] = self->vec[0];
524         vec[1] = self->vec[1];
525         if (self->size > 2)             vec[2] = self->vec[2];
526         else                                    vec[2] = 0.0;
527
528         normalize_v3(mirror);
529         reflect_v3_v3v3(reflect, vec, mirror);
530
531         return newVectorObject(reflect, self->size, Py_NEW, Py_TYPE(self));
532 }
533
534 PyDoc_STRVAR(Vector_cross_doc,
535 ".. method:: cross(other)\n"
536 "\n"
537 "   Return the cross product of this vector and another.\n"
538 "\n"
539 "   :arg other: The other vector to perform the cross product with.\n"
540 "   :type other: :class:`Vector`\n"
541 "   :return: The cross product.\n"
542 "   :rtype: :class:`Vector`\n"
543 "\n"
544 "   .. note:: both vectors must be 3D\n"
545 );
546 static PyObject *Vector_cross(VectorObject *self, PyObject *value)
547 {
548         VectorObject *ret;
549         float tvec[MAX_DIMENSIONS];
550
551         if(BaseMath_ReadCallback(self) == -1)
552                 return NULL;
553
554         if(mathutils_array_parse(tvec, self->size, self->size, value, "Vector.cross(other), invalid 'other' arg") == -1)
555                 return NULL;
556
557         ret= (VectorObject *)newVectorObject(NULL, 3, Py_NEW, Py_TYPE(self));
558         cross_v3_v3v3(ret->vec, self->vec, tvec);
559         return (PyObject *)ret;
560 }
561
562 PyDoc_STRVAR(Vector_dot_doc,
563 ".. method:: dot(other)\n"
564 "\n"
565 "   Return the dot product of this vector and another.\n"
566 "\n"
567 "   :arg other: The other vector to perform the dot product with.\n"
568 "   :type other: :class:`Vector`\n"
569 "   :return: The dot product.\n"
570 "   :rtype: :class:`Vector`\n"
571 );
572 static PyObject *Vector_dot(VectorObject *self, PyObject *value)
573 {
574         float tvec[MAX_DIMENSIONS];
575         double dot = 0.0;
576         int x;
577
578         if(BaseMath_ReadCallback(self) == -1)
579                 return NULL;
580
581         if(mathutils_array_parse(tvec, self->size, self->size, value, "Vector.dot(other), invalid 'other' arg") == -1)
582                 return NULL;
583
584         for(x = 0; x < self->size; x++) {
585                 dot += (double)(self->vec[x] * tvec[x]);
586         }
587
588         return PyFloat_FromDouble(dot);
589 }
590
591 PyDoc_STRVAR(Vector_angle_doc,
592 ".. function:: angle(other, fallback)\n"
593 "\n"
594 "   Return the angle between two vectors.\n"
595 "\n"
596 "   :arg other: another vector to compare the angle with\n"
597 "   :type other: :class:`Vector`\n"
598 "   :arg fallback: return this value when the angle cant be calculated\n"
599 "      (zero length vector)\n"
600 "   :type fallback: any\n"
601 "   :return: angle in radians or fallback when given\n"
602 "   :rtype: float\n"
603 "\n"
604 "   .. note:: Zero length vectors raise an :exc:`AttributeError`.\n"
605 );
606 static PyObject *Vector_angle(VectorObject *self, PyObject *args)
607 {
608         const int size= self->size;
609         float tvec[MAX_DIMENSIONS];
610         PyObject *value;
611         double dot = 0.0f, test_v1 = 0.0f, test_v2 = 0.0f;
612         int x;
613         PyObject *fallback= NULL;
614
615         if(!PyArg_ParseTuple(args, "O|O:angle", &value, &fallback))
616                 return NULL;
617
618         if(BaseMath_ReadCallback(self) == -1)
619                 return NULL;
620
621         if(mathutils_array_parse(tvec, size, size, value, "Vector.angle(other), invalid 'other' arg") == -1)
622                 return NULL;
623
624         for(x = 0; x < size; x++) {
625                 test_v1 += (double)(self->vec[x] * self->vec[x]);
626                 test_v2 += (double)(tvec[x] * tvec[x]);
627         }
628         if (!test_v1 || !test_v2){
629                 /* avoid exception */
630                 if(fallback) {
631                         Py_INCREF(fallback);
632                         return fallback;
633                 }
634                 else {
635                         PyErr_SetString(PyExc_ValueError,
636                                         "Vector.angle(other): "
637                                         "zero length vectors have no valid angle");
638                         return NULL;
639                 }
640         }
641
642         //dot product
643         for(x = 0; x < self->size; x++) {
644                 dot += (double)(self->vec[x] * tvec[x]);
645         }
646         dot /= (sqrt(test_v1) * sqrt(test_v2));
647
648         return PyFloat_FromDouble(saacos(dot));
649 }
650
651 PyDoc_STRVAR(Vector_rotation_difference_doc,
652 ".. function:: difference(other)\n"
653 "\n"
654 "   Returns a quaternion representing the rotational difference between this\n"
655 "   vector and another.\n"
656 "\n"
657 "   :arg other: second vector.\n"
658 "   :type other: :class:`Vector`\n"
659 "   :return: the rotational difference between the two vectors.\n"
660 "   :rtype: :class:`Quaternion`\n"
661 "\n"
662 "   .. note:: 2D vectors raise an :exc:`AttributeError`.\n"
663 );
664 static PyObject *Vector_rotation_difference(VectorObject *self, PyObject *value)
665 {
666         float quat[4], vec_a[3], vec_b[3];
667
668         if(self->size < 3) {
669                 PyErr_SetString(PyExc_ValueError,
670                                 "vec.difference(value): "
671                                 "expects both vectors to be size 3 or 4");
672                 return NULL;
673         }
674
675         if(BaseMath_ReadCallback(self) == -1)
676                 return NULL;
677
678         if(mathutils_array_parse(vec_b, 3, MAX_DIMENSIONS, value, "Vector.difference(other), invalid 'other' arg") == -1)
679                 return NULL;
680
681         normalize_v3_v3(vec_a, self->vec);
682         normalize_v3(vec_b);
683
684         rotation_between_vecs_to_quat(quat, vec_a, vec_b);
685
686         return newQuaternionObject(quat, Py_NEW, NULL);
687 }
688
689 PyDoc_STRVAR(Vector_project_doc,
690 ".. function:: project(other)\n"
691 "\n"
692 "   Return the projection of this vector onto the *other*.\n"
693 "\n"
694 "   :arg other: second vector.\n"
695 "   :type other: :class:`Vector`\n"
696 "   :return: the parallel projection vector\n"
697 "   :rtype: :class:`Vector`\n"
698 );
699 static PyObject *Vector_project(VectorObject *self, PyObject *value)
700 {
701         const int size= self->size;
702         float tvec[MAX_DIMENSIONS];
703         float vec[MAX_DIMENSIONS];
704         double dot = 0.0f, dot2 = 0.0f;
705         int x;
706
707         if(BaseMath_ReadCallback(self) == -1)
708                 return NULL;
709
710         if(mathutils_array_parse(tvec, size, size, value, "Vector.project(other), invalid 'other' arg") == -1)
711                 return NULL;
712
713         if(BaseMath_ReadCallback(self) == -1)
714                 return NULL;
715
716         //get dot products
717         for(x = 0; x < size; x++) {
718                 dot += (double)(self->vec[x] * tvec[x]);
719                 dot2 += (double)(tvec[x] * tvec[x]);
720         }
721         //projection
722         dot /= dot2;
723         for(x = 0; x < size; x++) {
724                 vec[x] = (float)dot * tvec[x];
725         }
726         return newVectorObject(vec, size, Py_NEW, Py_TYPE(self));
727 }
728
729 PyDoc_STRVAR(Vector_lerp_doc,
730 ".. function:: lerp(other, factor)\n"
731 "\n"
732 "   Returns the interpolation of two vectors.\n"
733 "\n"
734 "   :arg other: value to interpolate with.\n"
735 "   :type other: :class:`Vector`\n"
736 "   :arg factor: The interpolation value in [0.0, 1.0].\n"
737 "   :type factor: float\n"
738 "   :return: The interpolated rotation.\n"
739 "   :rtype: :class:`Vector`\n"
740 );
741 static PyObject *Vector_lerp(VectorObject *self, PyObject *args)
742 {
743         const int size= self->size;
744         PyObject *value= NULL;
745         float fac, ifac;
746         float tvec[MAX_DIMENSIONS], vec[MAX_DIMENSIONS];
747         int x;
748
749         if(!PyArg_ParseTuple(args, "Of:lerp", &value, &fac))
750                 return NULL;
751
752         if(mathutils_array_parse(tvec, size, size, value, "Vector.lerp(other), invalid 'other' arg") == -1)
753                 return NULL;
754
755         if(BaseMath_ReadCallback(self) == -1)
756                 return NULL;
757
758         ifac= 1.0f - fac;
759
760         for(x = 0; x < size; x++) {
761                 vec[x] = (ifac * self->vec[x]) + (fac * tvec[x]);
762         }
763         return newVectorObject(vec, size, Py_NEW, Py_TYPE(self));
764 }
765
766 PyDoc_STRVAR(Vector_rotate_doc,
767 ".. function:: rotate(other)\n"
768 "\n"
769 "   Return vector by a rotation value.\n"
770 "\n"
771 "   :arg other: rotation component of mathutils value\n"
772 "   :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n"
773 );
774 static PyObject *Vector_rotate(VectorObject *self, PyObject *value)
775 {
776         float other_rmat[3][3];
777
778         if(BaseMath_ReadCallback(self) == -1)
779                 return NULL;
780
781         if(mathutils_any_to_rotmat(other_rmat, value, "Vector.rotate(value)") == -1)
782                 return NULL;
783
784         if(self->size < 3) {
785                 PyErr_SetString(PyExc_ValueError,
786                                 "Vector must be 3D or 4D");
787                 return NULL;
788         }
789
790         mul_m3_v3(other_rmat, self->vec);
791
792         (void)BaseMath_WriteCallback(self);
793         Py_RETURN_NONE;
794 }
795
796 PyDoc_STRVAR(Vector_copy_doc,
797 ".. function:: copy()\n"
798 "\n"
799 "   Returns a copy of this vector.\n"
800 "\n"
801 "   :return: A copy of the vector.\n"
802 "   :rtype: :class:`Vector`\n"
803 "\n"
804 "   .. note:: use this to get a copy of a wrapped vector with\n"
805 "      no reference to the original data.\n"
806 );
807 static PyObject *Vector_copy(VectorObject *self)
808 {
809         if(BaseMath_ReadCallback(self) == -1)
810                 return NULL;
811
812         return newVectorObject(self->vec, self->size, Py_NEW, Py_TYPE(self));
813 }
814
815 static PyObject *Vector_repr(VectorObject *self)
816 {
817         PyObject *ret, *tuple;
818
819         if(BaseMath_ReadCallback(self) == -1)
820                 return NULL;
821
822         tuple= Vector_to_tuple_ext(self, -1);
823         ret= PyUnicode_FromFormat("Vector(%R)", tuple);
824         Py_DECREF(tuple);
825         return ret;
826 }
827
828 /* Sequence Protocol */
829 /* sequence length len(vector) */
830 static int Vector_len(VectorObject *self)
831 {
832         return self->size;
833 }
834 /* sequence accessor (get): vector[index] */
835 static PyObject *vector_item_internal(VectorObject *self, int i, const int is_attr)
836 {
837         if(i<0) i= self->size-i;
838
839         if(i < 0 || i >= self->size) {
840                 if(is_attr)     {
841                         PyErr_Format(PyExc_AttributeError,
842                                      "Vector.%c: unavailable on %dd vector",
843                                      *(((char *)"xyzw") + i), self->size);
844                 }
845                 else {
846                         PyErr_SetString(PyExc_IndexError,
847                                         "vector[index]: out of range");
848                 }
849                 return NULL;
850         }
851
852         if(BaseMath_ReadIndexCallback(self, i) == -1)
853                 return NULL;
854
855         return PyFloat_FromDouble(self->vec[i]);
856 }
857
858 static PyObject *Vector_item(VectorObject *self, int i)
859 {
860         return vector_item_internal(self, i, FALSE);
861 }
862 /* sequence accessor (set): vector[index] = value */
863 static int vector_ass_item_internal(VectorObject *self, int i, PyObject *value, const int is_attr)
864 {
865         float scalar;
866         if((scalar=PyFloat_AsDouble(value))==-1.0f && PyErr_Occurred()) { /* parsed item not a number */
867                 PyErr_SetString(PyExc_TypeError,
868                                 "vector[index] = x: "
869                                 "index argument not a number");
870                 return -1;
871         }
872
873         if(i<0) i= self->size-i;
874
875         if(i < 0 || i >= self->size){
876                 if(is_attr) {
877                         PyErr_Format(PyExc_AttributeError,
878                                      "Vector.%c = x: unavailable on %dd vector",
879                                      *(((char *)"xyzw") + i), self->size);
880                 }
881                 else {
882                         PyErr_SetString(PyExc_IndexError,
883                                         "vector[index] = x: "
884                                         "assignment index out of range");
885                 }
886                 return -1;
887         }
888         self->vec[i] = scalar;
889
890         if(BaseMath_WriteIndexCallback(self, i) == -1)
891                 return -1;
892         return 0;
893 }
894
895 static int Vector_ass_item(VectorObject *self, int i, PyObject *value)
896 {
897         return vector_ass_item_internal(self, i, value, FALSE);
898 }
899
900 /* sequence slice (get): vector[a:b] */
901 static PyObject *Vector_slice(VectorObject *self, int begin, int end)
902 {
903         PyObject *tuple;
904         int count;
905
906         if(BaseMath_ReadCallback(self) == -1)
907                 return NULL;
908
909         CLAMP(begin, 0, self->size);
910         if (end<0) end= self->size+end+1;
911         CLAMP(end, 0, self->size);
912         begin= MIN2(begin, end);
913
914         tuple= PyTuple_New(end - begin);
915         for(count = begin; count < end; count++) {
916                 PyTuple_SET_ITEM(tuple, count - begin, PyFloat_FromDouble(self->vec[count]));
917         }
918
919         return tuple;
920 }
921 /* sequence slice (set): vector[a:b] = value */
922 static int Vector_ass_slice(VectorObject *self, int begin, int end, PyObject *seq)
923 {
924         int y, size = 0;
925         float vec[MAX_DIMENSIONS];
926
927         if(BaseMath_ReadCallback(self) == -1)
928                 return -1;
929
930         CLAMP(begin, 0, self->size);
931         CLAMP(end, 0, self->size);
932         begin = MIN2(begin, end);
933
934         size = (end - begin);
935         if(mathutils_array_parse(vec, size, size, seq, "vector[begin:end] = [...]") == -1)
936                 return -1;
937
938         /*parsed well - now set in vector*/
939         for(y = 0; y < size; y++){
940                 self->vec[begin + y] = vec[y];
941         }
942
943         if(BaseMath_WriteCallback(self) == -1)
944                 return -1;
945
946         return 0;
947 }
948
949 /* Numeric Protocols */
950 /* addition: obj + obj */
951 static PyObject *Vector_add(PyObject *v1, PyObject *v2)
952 {
953         VectorObject *vec1 = NULL, *vec2 = NULL;
954         float vec[MAX_DIMENSIONS];
955
956         if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
957                 PyErr_SetString(PyExc_AttributeError,
958                                 "Vector addition: "
959                                 "arguments not valid for this operation");
960                 return NULL;
961         }
962         vec1 = (VectorObject*)v1;
963         vec2 = (VectorObject*)v2;
964
965         if(BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
966                 return NULL;
967
968         /*VECTOR + VECTOR*/
969         if(vec1->size != vec2->size) {
970                 PyErr_SetString(PyExc_AttributeError,
971                                 "Vector addition: "
972                                 "vectors must have the same dimensions for this operation");
973                 return NULL;
974         }
975
976         add_vn_vnvn(vec, vec1->vec, vec2->vec, vec1->size);
977
978         return newVectorObject(vec, vec1->size, Py_NEW, Py_TYPE(v1));
979 }
980
981 /* addition in-place: obj += obj */
982 static PyObject *Vector_iadd(PyObject *v1, PyObject *v2)
983 {
984         VectorObject *vec1 = NULL, *vec2 = NULL;
985
986         if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
987                 PyErr_SetString(PyExc_AttributeError,
988                                 "Vector addition: "
989                                 "arguments not valid for this operation");
990                 return NULL;
991         }
992         vec1 = (VectorObject*)v1;
993         vec2 = (VectorObject*)v2;
994
995         if(vec1->size != vec2->size) {
996                 PyErr_SetString(PyExc_AttributeError,
997                                 "Vector addition: "
998                                 "vectors must have the same dimensions for this operation");
999                 return NULL;
1000         }
1001
1002         if(BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
1003                 return NULL;
1004
1005         add_vn_vn(vec1->vec, vec2->vec, vec1->size);
1006
1007         (void)BaseMath_WriteCallback(vec1);
1008         Py_INCREF(v1);
1009         return v1;
1010 }
1011
1012 /* subtraction: obj - obj */
1013 static PyObject *Vector_sub(PyObject *v1, PyObject *v2)
1014 {
1015         VectorObject *vec1 = NULL, *vec2 = NULL;
1016         float vec[MAX_DIMENSIONS];
1017
1018         if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
1019                 PyErr_SetString(PyExc_AttributeError,
1020                                 "Vector subtraction: "
1021                                 "arguments not valid for this operation");
1022                 return NULL;
1023         }
1024         vec1 = (VectorObject*)v1;
1025         vec2 = (VectorObject*)v2;
1026
1027         if(BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
1028                 return NULL;
1029
1030         if(vec1->size != vec2->size) {
1031                 PyErr_SetString(PyExc_AttributeError,
1032                                 "Vector subtraction: "
1033                                 "vectors must have the same dimensions for this operation");
1034                 return NULL;
1035         }
1036
1037         sub_vn_vnvn(vec, vec1->vec, vec2->vec, vec1->size);
1038
1039         return newVectorObject(vec, vec1->size, Py_NEW, Py_TYPE(v1));
1040 }
1041
1042 /* subtraction in-place: obj -= obj */
1043 static PyObject *Vector_isub(PyObject *v1, PyObject *v2)
1044 {
1045         VectorObject *vec1= NULL, *vec2= NULL;
1046
1047         if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
1048                 PyErr_SetString(PyExc_AttributeError,
1049                                 "Vector subtraction: "
1050                                 "arguments not valid for this operation");
1051                 return NULL;
1052         }
1053         vec1 = (VectorObject*)v1;
1054         vec2 = (VectorObject*)v2;
1055
1056         if(vec1->size != vec2->size) {
1057                 PyErr_SetString(PyExc_AttributeError,
1058                                 "Vector subtraction: "
1059                                 "vectors must have the same dimensions for this operation");
1060                 return NULL;
1061         }
1062
1063         if(BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
1064                 return NULL;
1065
1066         sub_vn_vn(vec1->vec, vec2->vec, vec1->size);
1067
1068         (void)BaseMath_WriteCallback(vec1);
1069         Py_INCREF(v1);
1070         return v1;
1071 }
1072
1073 /*------------------------obj * obj------------------------------
1074   mulplication*/
1075
1076
1077 /* COLUMN VECTOR Multiplication (Vector X Matrix)
1078  * [a] * [1][4][7]
1079  * [b] * [2][5][8]
1080  * [c] * [3][6][9]
1081  *
1082  * note: vector/matrix multiplication IS NOT COMMUTATIVE!!!!
1083  * note: assume read callbacks have been done first.
1084  */
1085 int column_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject* vec, MatrixObject * mat)
1086 {
1087         float vec_cpy[MAX_DIMENSIONS];
1088         double dot = 0.0f;
1089         int x, y, z = 0;
1090
1091         if(mat->row_size != vec->size){
1092                 if(mat->row_size == 4 && vec->size == 3) {
1093                         vec_cpy[3] = 1.0f;
1094                 }
1095                 else {
1096                         PyErr_SetString(PyExc_TypeError,
1097                                         "matrix * vector: "
1098                                         "matrix.row_size and len(vector) must be the same, "
1099                                         "except for 3D vector * 4x4 matrix.");
1100                         return -1;
1101                 }
1102         }
1103
1104         memcpy(vec_cpy, vec->vec, vec->size * sizeof(float));
1105
1106         rvec[3] = 1.0f;
1107
1108         for(x = 0; x < mat->col_size; x++) {
1109                 for(y = 0; y < mat->row_size; y++) {
1110                         dot += (double)(mat->matrix[y][x] * vec_cpy[y]);
1111                 }
1112                 rvec[z++] = (float)dot;
1113                 dot = 0.0f;
1114         }
1115
1116         return 0;
1117 }
1118
1119 static PyObject *vector_mul_float(VectorObject *vec, const float scalar)
1120 {
1121         float tvec[MAX_DIMENSIONS];
1122         mul_vn_vn_fl(tvec, vec->vec, vec->size, scalar);
1123         return newVectorObject(tvec, vec->size, Py_NEW, Py_TYPE(vec));
1124 }
1125
1126 static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
1127 {
1128         VectorObject *vec1 = NULL, *vec2 = NULL;
1129         float scalar;
1130
1131         if VectorObject_Check(v1) {
1132                 vec1= (VectorObject *)v1;
1133                 if(BaseMath_ReadCallback(vec1) == -1)
1134                         return NULL;
1135         }
1136         if VectorObject_Check(v2) {
1137                 vec2= (VectorObject *)v2;
1138                 if(BaseMath_ReadCallback(vec2) == -1)
1139                         return NULL;
1140         }
1141
1142
1143         /* make sure v1 is always the vector */
1144         if (vec1 && vec2) {
1145                 int i;
1146                 double dot = 0.0f;
1147
1148                 if(vec1->size != vec2->size) {
1149                         PyErr_SetString(PyExc_ValueError,
1150                                         "Vector multiplication: "
1151                                         "vectors must have the same dimensions for this operation");
1152                         return NULL;
1153                 }
1154
1155                 /*dot product*/
1156                 for(i = 0; i < vec1->size; i++) {
1157                         dot += (double)(vec1->vec[i] * vec2->vec[i]);
1158                 }
1159                 return PyFloat_FromDouble(dot);
1160         }
1161         else if (vec1) {
1162                 if (MatrixObject_Check(v2)) {
1163                         /* VEC * MATRIX */
1164                         float tvec[MAX_DIMENSIONS];
1165
1166                         if(BaseMath_ReadCallback((MatrixObject *)v2) == -1)
1167                                 return NULL;
1168                         if(row_vector_multiplication(tvec, vec1, (MatrixObject*)v2) == -1) {
1169                                 return NULL;
1170                         }
1171
1172                         return newVectorObject(tvec, vec1->size, Py_NEW, Py_TYPE(vec1));
1173                 }
1174                 else if (QuaternionObject_Check(v2)) {
1175                         /* VEC * QUAT */
1176 /* ------ to be removed ------*/
1177 #if 1
1178                         PyErr_SetString(PyExc_ValueError,
1179                                         "(Vector * Quat) is now removed, reverse the "
1180                                         "order (promoted to an Error for Debug builds)");
1181                         return NULL;
1182 #else
1183                         QuaternionObject *quat2 = (QuaternionObject*)v2;
1184                         float tvec[3];
1185
1186                         if(vec1->size != 3) {
1187                                 PyErr_SetString(PyExc_ValueError,
1188                                                 "Vector multiplication: "
1189                                                 "only 3D vector rotations (with quats) currently supported");
1190                                 return NULL;
1191                         }
1192                         if(BaseMath_ReadCallback(quat2) == -1) {
1193                                 return NULL;
1194                         }
1195
1196                         copy_v3_v3(tvec, vec1->vec);
1197                         mul_qt_v3(quat2->quat, tvec);
1198                         return newVectorObject(tvec, 3, Py_NEW, Py_TYPE(vec1));
1199 #endif
1200 /* ------ to be removed ------*/
1201                 }
1202                 else if (((scalar= PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred())==0) { /* VEC * FLOAT */
1203                         return vector_mul_float(vec1, scalar);
1204                 }
1205         }
1206         else if (vec2) {
1207                 if (((scalar= PyFloat_AsDouble(v1)) == -1.0f && PyErr_Occurred())==0) { /* FLOAT * VEC */
1208                         return vector_mul_float(vec2, scalar);
1209                 }
1210         }
1211         else {
1212                 BLI_assert(!"internal error");
1213         }
1214
1215         PyErr_Format(PyExc_TypeError,
1216                      "Vector multiplication: "
1217                      "not supported between '%.200s' and '%.200s' types",
1218                      Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
1219         return NULL;
1220 }
1221
1222 /* mulplication in-place: obj *= obj */
1223 static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
1224 {
1225         VectorObject *vec = (VectorObject *)v1;
1226         float scalar;
1227
1228         if(BaseMath_ReadCallback(vec) == -1)
1229                 return NULL;
1230
1231         /* only support vec*=float and vec*=mat
1232            vec*=vec result is a float so that wont work */
1233         if (MatrixObject_Check(v2)) {
1234 /* ------ to be removed ------*/
1235 #if 1
1236                 PyErr_SetString(PyExc_ValueError,
1237                                                 "(Vector *= Matrix) is now removed, reverse the "
1238                                                 "order (promoted to an Error for Debug builds) "
1239                                                 "and uses the non in-place multiplication.");
1240                 return NULL;
1241 #else
1242                 float rvec[MAX_DIMENSIONS];
1243                 if(BaseMath_ReadCallback((MatrixObject *)v2) == -1)
1244                         return NULL;
1245
1246                 if(column_vector_multiplication(rvec, vec, (MatrixObject*)v2) == -1)
1247                         return NULL;
1248
1249                 memcpy(vec->vec, rvec, sizeof(float) * vec->size);
1250 #endif
1251 /* ------ to be removed ------*/
1252         }
1253         else if (QuaternionObject_Check(v2)) {
1254                 /* VEC *= QUAT */
1255
1256 /* ------ to be removed ------*/
1257 #if 1
1258                 PyErr_SetString(PyExc_ValueError,
1259                                                 "(Vector *= Quat) is now removed, reverse the "
1260                                                 "order (promoted to an Error for Debug builds) "
1261                                                 "and uses the non in-place multiplication.");
1262                 return NULL;
1263 #else
1264                 QuaternionObject *quat2 = (QuaternionObject*)v2;
1265
1266                 if(vec->size != 3) {
1267                         PyErr_SetString(PyExc_ValueError,
1268                                         "Vector multiplication: "
1269                                         "only 3D vector rotations (with quats) currently supported");
1270                         return NULL;
1271                 }
1272
1273                 if(BaseMath_ReadCallback(quat2) == -1) {
1274                         return NULL;
1275                 }
1276
1277                 mul_qt_v3(quat2->quat, vec->vec);
1278 #endif
1279 /* ------ to be removed ------*/
1280         }
1281         else if (((scalar= PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred())==0) { /* VEC *= FLOAT */
1282                 mul_vn_fl(vec->vec, vec->size, scalar);
1283         }
1284         else {
1285                 PyErr_SetString(PyExc_TypeError,
1286                                 "Vector multiplication: "
1287                                 "arguments not acceptable for this operation");
1288                 return NULL;
1289         }
1290
1291         (void)BaseMath_WriteCallback(vec);
1292         Py_INCREF(v1);
1293         return v1;
1294 }
1295
1296 /* divid: obj / obj */
1297 static PyObject *Vector_div(PyObject *v1, PyObject *v2)
1298 {
1299         int i;
1300         float vec[4], scalar;
1301         VectorObject *vec1 = NULL;
1302
1303         if(!VectorObject_Check(v1)) { /* not a vector */
1304                 PyErr_SetString(PyExc_TypeError,
1305                                 "Vector division: "
1306                                 "Vector must be divided by a float");
1307                 return NULL;
1308         }
1309         vec1 = (VectorObject*)v1; /* vector */
1310
1311         if(BaseMath_ReadCallback(vec1) == -1)
1312                 return NULL;
1313
1314         if((scalar=PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
1315                 PyErr_SetString(PyExc_TypeError,
1316                                 "Vector division: "
1317                                 "Vector must be divided by a float");
1318                 return NULL;
1319         }
1320
1321         if(scalar==0.0f) {
1322                 PyErr_SetString(PyExc_ZeroDivisionError,
1323                                 "Vector division: "
1324                                 "divide by zero error");
1325                 return NULL;
1326         }
1327
1328         for(i = 0; i < vec1->size; i++) {
1329                 vec[i] = vec1->vec[i] / scalar;
1330         }
1331         return newVectorObject(vec, vec1->size, Py_NEW, Py_TYPE(v1));
1332 }
1333
1334 /* divide in-place: obj /= obj */
1335 static PyObject *Vector_idiv(PyObject *v1, PyObject *v2)
1336 {
1337         int i;
1338         float scalar;
1339         VectorObject *vec1 = (VectorObject*)v1;
1340
1341         if(BaseMath_ReadCallback(vec1) == -1)
1342                 return NULL;
1343
1344         if((scalar=PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
1345                 PyErr_SetString(PyExc_TypeError,
1346                                 "Vector division: "
1347                                 "Vector must be divided by a float");
1348                 return NULL;
1349         }
1350
1351         if(scalar==0.0f) {
1352                 PyErr_SetString(PyExc_ZeroDivisionError,
1353                                 "Vector division: "
1354                                 "divide by zero error");
1355                 return NULL;
1356         }
1357         for(i = 0; i < vec1->size; i++) {
1358                 vec1->vec[i] /= scalar;
1359         }
1360
1361         (void)BaseMath_WriteCallback(vec1);
1362
1363         Py_INCREF(v1);
1364         return v1;
1365 }
1366
1367 /* -obj
1368   returns the negative of this object*/
1369 static PyObject *Vector_neg(VectorObject *self)
1370 {
1371         float tvec[MAX_DIMENSIONS];
1372
1373         if(BaseMath_ReadCallback(self) == -1)
1374                 return NULL;
1375
1376         negate_vn_vn(tvec, self->vec, self->size);
1377         return newVectorObject(tvec, self->size, Py_NEW, Py_TYPE(self));
1378 }
1379
1380 /*------------------------vec_magnitude_nosqrt (internal) - for comparing only */
1381 static double vec_magnitude_nosqrt(float *data, int size)
1382 {
1383         double dot = 0.0f;
1384         int i;
1385
1386         for(i=0; i<size; i++){
1387                 dot += (double)data[i];
1388         }
1389         /*return (double)sqrt(dot);*/
1390         /* warning, line above removed because we are not using the length,
1391            rather the comparing the sizes and for this we do not need the sqrt
1392            for the actual length, the dot must be sqrt'd */
1393         return dot;
1394 }
1395
1396
1397 /*------------------------tp_richcmpr
1398   returns -1 execption, 0 false, 1 true */
1399 static PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type)
1400 {
1401         VectorObject *vecA = NULL, *vecB = NULL;
1402         int result = 0;
1403         double epsilon = .000001f;
1404         double lenA, lenB;
1405
1406         if (!VectorObject_Check(objectA) || !VectorObject_Check(objectB)){
1407                 if (comparison_type == Py_NE){
1408                         Py_RETURN_TRUE;
1409                 }
1410                 else {
1411                         Py_RETURN_FALSE;
1412                 }
1413         }
1414         vecA = (VectorObject*)objectA;
1415         vecB = (VectorObject*)objectB;
1416
1417         if(BaseMath_ReadCallback(vecA) == -1 || BaseMath_ReadCallback(vecB) == -1)
1418                 return NULL;
1419
1420         if (vecA->size != vecB->size){
1421                 if (comparison_type == Py_NE){
1422                         Py_RETURN_TRUE;
1423                 }
1424                 else {
1425                         Py_RETURN_FALSE;
1426                 }
1427         }
1428
1429         switch (comparison_type){
1430                 case Py_LT:
1431                         lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
1432                         lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
1433                         if(lenA < lenB){
1434                                 result = 1;
1435                         }
1436                         break;
1437                 case Py_LE:
1438                         lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
1439                         lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
1440                         if(lenA < lenB){
1441                                 result = 1;
1442                         }
1443                         else {
1444                                 result = (((lenA + epsilon) > lenB) && ((lenA - epsilon) < lenB));
1445                         }
1446                         break;
1447                 case Py_EQ:
1448                         result = EXPP_VectorsAreEqual(vecA->vec, vecB->vec, vecA->size, 1);
1449                         break;
1450                 case Py_NE:
1451                         result = !EXPP_VectorsAreEqual(vecA->vec, vecB->vec, vecA->size, 1);
1452                         break;
1453                 case Py_GT:
1454                         lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
1455                         lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
1456                         if(lenA > lenB){
1457                                 result = 1;
1458                         }
1459                         break;
1460                 case Py_GE:
1461                         lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
1462                         lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
1463                         if(lenA > lenB){
1464                                 result = 1;
1465                         }
1466                         else {
1467                                 result = (((lenA + epsilon) > lenB) && ((lenA - epsilon) < lenB));
1468                         }
1469                         break;
1470                 default:
1471                         printf("The result of the comparison could not be evaluated");
1472                         break;
1473         }
1474         if (result == 1){
1475                 Py_RETURN_TRUE;
1476         }
1477         else {
1478                 Py_RETURN_FALSE;
1479         }
1480 }
1481
1482 /*-----------------PROTCOL DECLARATIONS--------------------------*/
1483 static PySequenceMethods Vector_SeqMethods = {
1484         (lenfunc) Vector_len,                           /* sq_length */
1485         (binaryfunc) NULL,                                      /* sq_concat */
1486         (ssizeargfunc) NULL,                            /* sq_repeat */
1487         (ssizeargfunc) Vector_item,                     /* sq_item */
1488         NULL,                                                           /* py3 deprecated slice func */
1489         (ssizeobjargproc) Vector_ass_item,      /* sq_ass_item */
1490         NULL,                                                           /* py3 deprecated slice assign func */
1491         (objobjproc) NULL,                                      /* sq_contains */
1492         (binaryfunc) NULL,                                      /* sq_inplace_concat */
1493         (ssizeargfunc) NULL,                            /* sq_inplace_repeat */
1494 };
1495
1496 static PyObject *Vector_subscript(VectorObject* self, PyObject* item)
1497 {
1498         if (PyIndex_Check(item)) {
1499                 Py_ssize_t i;
1500                 i = PyNumber_AsSsize_t(item, PyExc_IndexError);
1501                 if (i == -1 && PyErr_Occurred())
1502                         return NULL;
1503                 if (i < 0)
1504                         i += self->size;
1505                 return Vector_item(self, i);
1506         }
1507         else if (PySlice_Check(item)) {
1508                 Py_ssize_t start, stop, step, slicelength;
1509
1510                 if (PySlice_GetIndicesEx((void *)item, self->size, &start, &stop, &step, &slicelength) < 0)
1511                         return NULL;
1512
1513                 if (slicelength <= 0) {
1514                         return PyTuple_New(0);
1515                 }
1516                 else if (step == 1) {
1517                         return Vector_slice(self, start, stop);
1518                 }
1519                 else {
1520                         PyErr_SetString(PyExc_IndexError,
1521                                         "slice steps not supported with vectors");
1522                         return NULL;
1523                 }
1524         }
1525         else {
1526                 PyErr_Format(PyExc_TypeError,
1527                              "vector indices must be integers, not %.200s",
1528                              Py_TYPE(item)->tp_name);
1529                 return NULL;
1530         }
1531 }
1532
1533 static int Vector_ass_subscript(VectorObject* self, PyObject* item, PyObject* value)
1534 {
1535         if (PyIndex_Check(item)) {
1536                 Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
1537                 if (i == -1 && PyErr_Occurred())
1538                         return -1;
1539                 if (i < 0)
1540                         i += self->size;
1541                 return Vector_ass_item(self, i, value);
1542         }
1543         else if (PySlice_Check(item)) {
1544                 Py_ssize_t start, stop, step, slicelength;
1545
1546                 if (PySlice_GetIndicesEx((void *)item, self->size, &start, &stop, &step, &slicelength) < 0)
1547                         return -1;
1548
1549                 if (step == 1)
1550                         return Vector_ass_slice(self, start, stop, value);
1551                 else {
1552                         PyErr_SetString(PyExc_IndexError,
1553                                         "slice steps not supported with vectors");
1554                         return -1;
1555                 }
1556         }
1557         else {
1558                 PyErr_Format(PyExc_TypeError,
1559                              "vector indices must be integers, not %.200s",
1560                              Py_TYPE(item)->tp_name);
1561                 return -1;
1562         }
1563 }
1564
1565 static PyMappingMethods Vector_AsMapping = {
1566         (lenfunc)Vector_len,
1567         (binaryfunc)Vector_subscript,
1568         (objobjargproc)Vector_ass_subscript
1569 };
1570
1571
1572 static PyNumberMethods Vector_NumMethods = {
1573         (binaryfunc)    Vector_add,     /*nb_add*/
1574         (binaryfunc)    Vector_sub,     /*nb_subtract*/
1575         (binaryfunc)    Vector_mul,     /*nb_multiply*/
1576         NULL,                                                   /*nb_remainder*/
1577         NULL,                                                   /*nb_divmod*/
1578         NULL,                                                   /*nb_power*/
1579         (unaryfunc)     Vector_neg,     /*nb_negative*/
1580         (unaryfunc)     NULL,   /*tp_positive*/
1581         (unaryfunc)     NULL,   /*tp_absolute*/
1582         (inquiry)       NULL,   /*tp_bool*/
1583         (unaryfunc)     NULL,   /*nb_invert*/
1584         NULL,                           /*nb_lshift*/
1585         (binaryfunc)NULL,       /*nb_rshift*/
1586         NULL,                           /*nb_and*/
1587         NULL,                           /*nb_xor*/
1588         NULL,                           /*nb_or*/
1589         NULL,                           /*nb_int*/
1590         NULL,                           /*nb_reserved*/
1591         NULL,                           /*nb_float*/
1592         Vector_iadd,    /* nb_inplace_add */
1593         Vector_isub,    /* nb_inplace_subtract */
1594         Vector_imul,    /* nb_inplace_multiply */
1595         NULL,                           /* nb_inplace_remainder */
1596         NULL,                           /* nb_inplace_power */
1597         NULL,                           /* nb_inplace_lshift */
1598         NULL,                           /* nb_inplace_rshift */
1599         NULL,                           /* nb_inplace_and */
1600         NULL,                           /* nb_inplace_xor */
1601         NULL,                           /* nb_inplace_or */
1602         NULL,                           /* nb_floor_divide */
1603         Vector_div,             /* nb_true_divide */
1604         NULL,                           /* nb_inplace_floor_divide */
1605         Vector_idiv,    /* nb_inplace_true_divide */
1606         NULL,                   /* nb_index */
1607 };
1608
1609 /*------------------PY_OBECT DEFINITION--------------------------*/
1610
1611 /*
1612  * vector axis, vector.x/y/z/w
1613  */
1614
1615 static PyObject *Vector_getAxis(VectorObject *self, void *type)
1616 {
1617         return vector_item_internal(self, GET_INT_FROM_POINTER(type), TRUE);
1618 }
1619
1620 static int Vector_setAxis(VectorObject *self, PyObject *value, void *type)
1621 {
1622         return vector_ass_item_internal(self, GET_INT_FROM_POINTER(type), value, TRUE);
1623 }
1624
1625 /* vector.length */
1626 static PyObject *Vector_getLength(VectorObject *self, void *UNUSED(closure))
1627 {
1628         double dot = 0.0f;
1629         int i;
1630
1631         if(BaseMath_ReadCallback(self) == -1)
1632                 return NULL;
1633
1634         for(i = 0; i < self->size; i++){
1635                 dot += (double)(self->vec[i] * self->vec[i]);
1636         }
1637         return PyFloat_FromDouble(sqrt(dot));
1638 }
1639
1640 static int Vector_setLength(VectorObject *self, PyObject *value)
1641 {
1642         double dot = 0.0f, param;
1643         int i;
1644
1645         if(BaseMath_ReadCallback(self) == -1)
1646                 return -1;
1647
1648         if((param=PyFloat_AsDouble(value)) == -1.0 && PyErr_Occurred()) {
1649                 PyErr_SetString(PyExc_TypeError,
1650                                 "length must be set to a number");
1651                 return -1;
1652         }
1653
1654         if (param < 0.0) {
1655                 PyErr_SetString(PyExc_ValueError,
1656                                 "cannot set a vectors length to a negative value");
1657                 return -1;
1658         }
1659         if (param == 0.0) {
1660                 fill_vn(self->vec, self->size, 0.0f);
1661                 return 0;
1662         }
1663
1664         for(i = 0; i < self->size; i++){
1665                 dot += (double)(self->vec[i] * self->vec[i]);
1666         }
1667
1668         if (!dot) /* cant sqrt zero */
1669                 return 0;
1670
1671         dot = sqrt(dot);
1672
1673         if (dot==param)
1674                 return 0;
1675
1676         dot= dot/param;
1677
1678         for(i = 0; i < self->size; i++){
1679                 self->vec[i]= self->vec[i] / (float)dot;
1680         }
1681
1682         (void)BaseMath_WriteCallback(self); /* checked already */
1683
1684         return 0;
1685 }
1686
1687 /* vector.length_squared */
1688 static PyObject *Vector_getLengthSquared(VectorObject *self, void *UNUSED(closure))
1689 {
1690         double dot = 0.0f;
1691         int i;
1692
1693         if(BaseMath_ReadCallback(self) == -1)
1694                 return NULL;
1695
1696         for(i = 0; i < self->size; i++){
1697                 dot += (double)(self->vec[i] * self->vec[i]);
1698         }
1699         return PyFloat_FromDouble(dot);
1700 }
1701
1702 /* Get a new Vector according to the provided swizzle. This function has little
1703    error checking, as we are in control of the inputs: the closure is set by us
1704    in Vector_createSwizzleGetSeter. */
1705 static PyObject *Vector_getSwizzle(VectorObject *self, void *closure)
1706 {
1707         size_t axis_to;
1708         size_t axis_from;
1709         float vec[MAX_DIMENSIONS];
1710         unsigned int swizzleClosure;
1711
1712         if(BaseMath_ReadCallback(self) == -1)
1713                 return NULL;
1714
1715         /* Unpack the axes from the closure into an array. */
1716         axis_to = 0;
1717         swizzleClosure = GET_INT_FROM_POINTER(closure);
1718         while (swizzleClosure & SWIZZLE_VALID_AXIS)
1719         {
1720                 axis_from = swizzleClosure & SWIZZLE_AXIS;
1721                 if(axis_from >= self->size) {
1722                         PyErr_SetString(PyExc_AttributeError,
1723                                         "Vector swizzle: "
1724                                         "specified axis not present");
1725                         return NULL;
1726                 }
1727
1728                 vec[axis_to] = self->vec[axis_from];
1729                 swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
1730                 axis_to++;
1731         }
1732
1733         return newVectorObject(vec, axis_to, Py_NEW, Py_TYPE(self));
1734 }
1735
1736 /* Set the items of this vector using a swizzle.
1737    - If value is a vector or list this operates like an array copy, except that
1738          the destination is effectively re-ordered as defined by the swizzle. At
1739          most min(len(source), len(dest)) values will be copied.
1740    - If the value is scalar, it is copied to all axes listed in the swizzle.
1741    - If an axis appears more than once in the swizzle, the final occurrence is
1742          the one that determines its value.
1743
1744    Returns 0 on success and -1 on failure. On failure, the vector will be
1745    unchanged. */
1746 static int Vector_setSwizzle(VectorObject *self, PyObject *value, void *closure)
1747 {
1748         size_t size_from;
1749         float scalarVal;
1750
1751         size_t axis_from;
1752         size_t axis_to;
1753
1754         unsigned int swizzleClosure;
1755
1756         float tvec[MAX_DIMENSIONS];
1757         float vec_assign[MAX_DIMENSIONS];
1758
1759         if(BaseMath_ReadCallback(self) == -1)
1760                 return -1;
1761
1762         /* Check that the closure can be used with this vector: even 2D vectors have
1763            swizzles defined for axes z and w, but they would be invalid. */
1764         swizzleClosure = GET_INT_FROM_POINTER(closure);
1765         axis_from= 0;
1766         while (swizzleClosure & SWIZZLE_VALID_AXIS) {
1767                 axis_to = swizzleClosure & SWIZZLE_AXIS;
1768                 if (axis_to >= self->size)
1769                 {
1770                         PyErr_SetString(PyExc_AttributeError,
1771                                         "Vector swizzle: "
1772                                         "specified axis not present");
1773                         return -1;
1774                 }
1775                 swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
1776                 axis_from++;
1777         }
1778
1779         if (((scalarVal=PyFloat_AsDouble(value)) == -1 && PyErr_Occurred())==0) {
1780                 int i;
1781                 for(i=0; i < MAX_DIMENSIONS; i++)
1782                         vec_assign[i]= scalarVal;
1783
1784                 size_from= axis_from;
1785         }
1786         else if(PyErr_Clear(), (size_from=mathutils_array_parse(vec_assign, 2, 4, value, "mathutils.Vector.**** = swizzle assignment")) == -1) {
1787                 return -1;
1788         }
1789
1790         if(axis_from != size_from) {
1791                 PyErr_SetString(PyExc_AttributeError,
1792                                 "Vector swizzle: size does not match swizzle");
1793                 return -1;
1794         }
1795
1796         /* Copy vector contents onto swizzled axes. */
1797         axis_from = 0;
1798         swizzleClosure = GET_INT_FROM_POINTER(closure);
1799         while (swizzleClosure & SWIZZLE_VALID_AXIS)
1800         {
1801                 axis_to = swizzleClosure & SWIZZLE_AXIS;
1802                 tvec[axis_to] = vec_assign[axis_from];
1803                 swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
1804                 axis_from++;
1805         }
1806
1807         memcpy(self->vec, tvec, axis_from * sizeof(float));
1808         /* continue with BaseMathObject_WriteCallback at the end */
1809
1810         if(BaseMath_WriteCallback(self) == -1)
1811                 return -1;
1812         else
1813                 return 0;
1814 }
1815
1816 /*****************************************************************************/
1817 /* Python attributes get/set structure:                                      */
1818 /*****************************************************************************/
1819 static PyGetSetDef Vector_getseters[] = {
1820         {(char *)"x", (getter)Vector_getAxis, (setter)Vector_setAxis, (char *)"Vector X axis.\n\n:type: float", (void *)0},
1821         {(char *)"y", (getter)Vector_getAxis, (setter)Vector_setAxis, (char *)"Vector Y axis.\n\n:type: float", (void *)1},
1822         {(char *)"z", (getter)Vector_getAxis, (setter)Vector_setAxis, (char *)"Vector Z axis (3D Vectors only).\n\n:type: float", (void *)2},
1823         {(char *)"w", (getter)Vector_getAxis, (setter)Vector_setAxis, (char *)"Vector W axis (4D Vectors only).\n\n:type: float", (void *)3},
1824         {(char *)"length", (getter)Vector_getLength, (setter)Vector_setLength, (char *)"Vector Length.\n\n:type: float", NULL},
1825         {(char *)"length_squared", (getter)Vector_getLengthSquared, (setter)NULL, (char *)"Vector length squared (v.dot(v)).\n\n:type: float", NULL},
1826         {(char *)"magnitude", (getter)Vector_getLength, (setter)Vector_setLength, (char *)"Vector Length.\n\n:type: float", NULL},
1827         {(char *)"is_wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, (char *)BaseMathObject_Wrapped_doc, NULL},
1828         {(char *)"owner", (getter)BaseMathObject_getOwner, (setter)NULL, (char *)BaseMathObject_Owner_doc, NULL},
1829
1830         /* autogenerated swizzle attrs, see python script below */
1831         {(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
1832         {(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
1833         {(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
1834         {(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
1835         {(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
1836         {(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
1837         {(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
1838         {(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
1839         {(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
1840         {(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
1841         {(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
1842         {(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
1843         {(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
1844         {(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
1845         {(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
1846         {(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
1847         {(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
1848         {(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
1849         {(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
1850         {(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
1851         {(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
1852         {(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
1853         {(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
1854         {(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
1855         {(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
1856         {(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
1857         {(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
1858         {(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
1859         {(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
1860         {(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
1861         {(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
1862         {(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
1863         {(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
1864         {(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
1865         {(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
1866         {(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
1867         {(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
1868         {(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
1869         {(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
1870         {(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
1871         {(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
1872         {(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
1873         {(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
1874         {(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
1875         {(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
1876         {(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
1877         {(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
1878         {(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
1879         {(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
1880         {(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
1881         {(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
1882         {(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
1883         {(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
1884         {(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
1885         {(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
1886         {(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
1887         {(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
1888         {(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
1889         {(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
1890         {(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
1891         {(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
1892         {(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
1893         {(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
1894         {(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
1895         {(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
1896         {(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
1897         {(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
1898         {(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
1899         {(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
1900         {(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
1901         {(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
1902         {(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
1903         {(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
1904         {(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
1905         {(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
1906         {(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
1907         {(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
1908         {(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
1909         {(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
1910         {(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
1911         {(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
1912         {(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
1913         {(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
1914         {(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
1915         {(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
1916         {(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
1917         {(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
1918         {(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
1919         {(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
1920         {(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
1921         {(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
1922         {(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
1923         {(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
1924         {(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
1925         {(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
1926         {(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
1927         {(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
1928         {(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
1929         {(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
1930         {(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
1931         {(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
1932         {(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
1933         {(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
1934         {(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
1935         {(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
1936         {(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
1937         {(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
1938         {(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
1939         {(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
1940         {(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
1941         {(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
1942         {(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
1943         {(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
1944         {(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
1945         {(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
1946         {(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
1947         {(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
1948         {(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
1949         {(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
1950         {(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
1951         {(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
1952         {(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
1953         {(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
1954         {(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
1955         {(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
1956         {(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
1957         {(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
1958         {(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
1959         {(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
1960         {(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
1961         {(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
1962         {(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
1963         {(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
1964         {(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
1965         {(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
1966         {(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
1967         {(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
1968         {(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
1969         {(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
1970         {(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
1971         {(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
1972         {(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
1973         {(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
1974         {(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
1975         {(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
1976         {(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
1977         {(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
1978         {(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
1979         {(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
1980         {(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
1981         {(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
1982         {(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
1983         {(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
1984         {(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
1985         {(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
1986         {(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
1987         {(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
1988         {(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
1989         {(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
1990         {(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
1991         {(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
1992         {(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
1993         {(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
1994         {(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
1995         {(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
1996         {(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
1997         {(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
1998         {(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
1999         {(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
2000         {(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
2001         {(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
2002         {(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
2003         {(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
2004         {(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
2005         {(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
2006         {(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
2007         {(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
2008         {(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
2009         {(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
2010         {(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
2011         {(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
2012         {(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
2013         {(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
2014         {(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
2015         {(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
2016         {(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
2017         {(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
2018         {(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
2019         {(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
2020         {(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
2021         {(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
2022         {(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
2023         {(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
2024         {(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
2025         {(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
2026         {(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
2027         {(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
2028         {(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
2029         {(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
2030         {(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
2031         {(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
2032         {(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
2033         {(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
2034         {(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
2035         {(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
2036         {(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
2037         {(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
2038         {(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
2039         {(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
2040         {(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
2041         {(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
2042         {(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
2043         {(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
2044         {(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
2045         {(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
2046         {(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
2047         {(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
2048         {(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
2049         {(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
2050         {(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
2051         {(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
2052         {(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
2053         {(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
2054         {(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
2055         {(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
2056         {(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
2057         {(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
2058         {(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
2059         {(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
2060         {(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
2061         {(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
2062         {(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
2063         {(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
2064         {(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
2065         {(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
2066         {(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
2067         {(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
2068         {(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
2069         {(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
2070         {(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
2071         {(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
2072         {(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
2073         {(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
2074         {(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
2075         {(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
2076         {(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
2077         {(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
2078         {(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
2079         {(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
2080         {(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
2081         {(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
2082         {(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
2083         {(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
2084         {(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
2085         {(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
2086         {(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
2087         {(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
2088         {(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
2089         {(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
2090         {(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
2091         {(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
2092         {(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
2093         {(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
2094         {(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
2095         {(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
2096         {(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
2097         {(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
2098         {(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
2099         {(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
2100         {(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
2101         {(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
2102         {(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
2103         {(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
2104         {(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
2105         {(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
2106         {(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
2107         {(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
2108         {(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
2109         {(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
2110         {(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
2111         {(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
2112         {(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
2113         {(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
2114         {(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
2115         {(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
2116         {(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
2117         {(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
2118         {(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
2119         {(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
2120         {(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
2121         {(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
2122         {(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
2123         {(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
2124         {(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
2125         {(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
2126         {(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
2127         {(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
2128         {(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
2129         {(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
2130         {(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
2131         {(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
2132         {(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
2133         {(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
2134         {(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
2135         {(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
2136         {(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
2137         {(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
2138         {(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
2139         {(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
2140         {(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
2141         {(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
2142         {(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
2143         {(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
2144         {(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
2145         {(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
2146         {(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
2147         {(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
2148         {(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
2149         {(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
2150         {(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
2151         {(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
2152         {(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
2153         {(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
2154         {(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
2155         {(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
2156         {(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
2157         {(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
2158         {(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
2159         {(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
2160         {(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
2161         {(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
2162         {(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
2163         {(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
2164         {(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
2165         {(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
2166         {(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
2167         {NULL, NULL, NULL, NULL, NULL}  /* Sentinel */
2168 };
2169
2170 /* Python script used to make swizzle array */
2171 /*
2172 SWIZZLE_BITS_PER_AXIS = 3
2173 SWIZZLE_VALID_AXIS = 0x4
2174
2175 axis_dict = {}
2176 axis_pos = {'x':0, 'y':1, 'z':2, 'w':3}
2177 axises = 'xyzw'
2178 while len(axises) >= 2:
2179
2180         for axis_0 in axises:
2181                 axis_0_pos = axis_pos[axis_0]
2182                 for axis_1 in axises:
2183                         axis_1_pos = axis_pos[axis_1]
2184                         axis_dict[axis_0+axis_1] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS))' % (axis_0_pos, axis_1_pos)
2185                         if len(axises)>2:
2186                                 for axis_2 in axises:
2187                                         axis_2_pos = axis_pos[axis_2]
2188                                         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)
2189                                         if len(axises)>3:
2190                                                 for axis_3 in axises:
2191                                                         axis_3_pos = axis_pos[axis_3]
2192                                                         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)
2193
2194         axises = axises[:-1]
2195
2196
2197 items = axis_dict.items()
2198 items.sort(key = lambda a: a[0].replace('x', '0').replace('y', '1').replace('z', '2').replace('w', '3'))
2199
2200 unique = set()
2201 for key, val in items:
2202         num = eval(val)
2203         set_str = 'Vector_setSwizzle' if (len(set(key)) == len(key)) else 'NULL'
2204         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)
2205         unique.add(num)
2206
2207 if len(unique) != len(items):
2208         print "ERROR"
2209 */
2210
2211 /* ROW VECTOR Multiplication - Vector X Matrix
2212  * [x][y][z] *  [1][4][7]
2213  *             [2][5][8]
2214  *             [3][6][9]
2215  * vector/matrix multiplication IS NOT COMMUTATIVE!!!! */
2216 static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat)
2217 {
2218         float vec_cpy[MAX_DIMENSIONS];
2219         double dot = 0.0f;
2220         int x, y, z= 0, vec_size= vec->size;
2221
2222         if(mat->col_size != vec_size){
2223                 if(mat->col_size == 4 && vec_size != 3){
2224                         PyErr_SetString(PyExc_ValueError,
2225                                         "vector * matrix: matrix column size "
2226                                         "and the vector size must be the same");
2227                         return -1;
2228                 }
2229                 else {
2230                         vec_cpy[3] = 1.0f;
2231                 }
2232         }
2233
2234         if(BaseMath_ReadCallback(vec) == -1 || BaseMath_ReadCallback(mat) == -1)
2235                 return -1;
2236
2237         memcpy(vec_cpy, vec->vec, vec_size * sizeof(float));
2238 printf("asasas\n");
2239         rvec[3] = 1.0f;
2240         //muliplication
2241         for(x = 0; x < mat->row_size; x++) {
2242                 for(y = 0; y < mat->col_size; y++) {
2243                         dot += mat->matrix[x][y] * vec_cpy[y];
2244                 }
2245                 rvec[z++] = (float)dot;
2246                 dot = 0.0f;
2247         }
2248         return 0;
2249 }
2250
2251 /*----------------------------Vector.negate() -------------------- */
2252 PyDoc_STRVAR(Vector_negate_doc,
2253 ".. method:: negate()\n"
2254 "\n"
2255 "   Set all values to their negative.\n"
2256 "\n"
2257 "   :return: an instance of itself\n"
2258 "   :rtype: :class:`Vector`\n"
2259 );
2260 static PyObject *Vector_negate(VectorObject *self)
2261 {
2262         if(BaseMath_ReadCallback(self) == -1)
2263                 return NULL;
2264
2265         negate_vn(self->vec, self->size);
2266
2267         (void)BaseMath_WriteCallback(self); // already checked for error
2268         Py_RETURN_NONE;
2269 }
2270
2271 static struct PyMethodDef Vector_methods[] = {
2272         /* in place only */
2273         {"zero", (PyCFunction) Vector_zero, METH_NOARGS, Vector_zero_doc},
2274         {"negate", (PyCFunction) Vector_negate, METH_NOARGS, Vector_negate_doc},
2275
2276         /* operate on original or copy */
2277         {"normalize", (PyCFunction) Vector_normalize, METH_NOARGS, Vector_normalize_doc},
2278         {"normalized", (PyCFunction) Vector_normalized, METH_NOARGS, Vector_normalized_doc},
2279
2280         {"to_2d", (PyCFunction) Vector_to_2d, METH_NOARGS, Vector_to_2d_doc},
2281         {"resize_2d", (PyCFunction) Vector_resize_2d, METH_NOARGS, Vector_resize_2d_doc},
2282         {"to_3d", (PyCFunction) Vector_to_3d, METH_NOARGS, Vector_to_3d_doc},
2283         {"resize_3d", (PyCFunction) Vector_resize_3d, METH_NOARGS, Vector_resize_3d_doc},
2284         {"to_4d", (PyCFunction) Vector_to_4d, METH_NOARGS, Vector_to_4d_doc},
2285         {"resize_4d", (PyCFunction) Vector_resize_4d, METH_NOARGS, Vector_resize_4d_doc},
2286         {"to_tuple", (PyCFunction) Vector_to_tuple, METH_VARARGS, Vector_to_tuple_doc},
2287         {"to_track_quat", (PyCFunction) Vector_to_track_quat, METH_VARARGS, Vector_to_track_quat_doc},
2288
2289         /* operation between 2 or more types  */
2290         {"reflect", (PyCFunction) Vector_reflect, METH_O, Vector_reflect_doc},
2291         {"cross", (PyCFunction) Vector_cross, METH_O, Vector_cross_doc},
2292         {"dot", (PyCFunction) Vector_dot, METH_O, Vector_dot_doc},
2293         {"angle", (PyCFunction) Vector_angle, METH_VARARGS, Vector_angle_doc},
2294         {"rotation_difference", (PyCFunction) Vector_rotation_difference, METH_O, Vector_rotation_difference_doc},
2295         {"project", (PyCFunction) Vector_project, METH_O, Vector_project_doc},
2296         {"lerp", (PyCFunction) Vector_lerp, METH_VARARGS, Vector_lerp_doc},
2297         {"rotate", (PyCFunction) Vector_rotate, METH_O, Vector_rotate_doc},
2298
2299         {"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc},
2300         {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, NULL},
2301         {NULL, NULL, 0, NULL}
2302 };
2303
2304
2305 /* Note
2306  Py_TPFLAGS_CHECKTYPES allows us to avoid casting all types to Vector when coercing
2307  but this means for eg that
2308  vec*mat and mat*vec both get sent to Vector_mul and it neesd to sort out the order
2309 */
2310
2311 PyDoc_STRVAR(vector_doc,
2312 "This object gives access to Vectors in Blender."
2313 );
2314 PyTypeObject vector_Type = {
2315         PyVarObject_HEAD_INIT(NULL, 0)
2316         /*  For printing, in format "<module>.<name>" */
2317         "mathutils.Vector",             /* char *tp_name; */
2318         sizeof(VectorObject),         /* int tp_basicsize; */
2319         0,                          /* tp_itemsize;  For allocation */
2320
2321         /* Methods to implement standard operations */
2322
2323         (destructor) BaseMathObject_dealloc,/* destructor tp_dealloc; */
2324         NULL,                       /* printfunc tp_print; */
2325         NULL,                       /* getattrfunc tp_getattr; */
2326         NULL,                       /* setattrfunc tp_setattr; */
2327         NULL,   /* cmpfunc tp_compare; */
2328         (reprfunc)Vector_repr,     /* reprfunc tp_repr; */
2329
2330         /* Method suites for standard classes */
2331
2332         &Vector_NumMethods,                       /* PyNumberMethods *tp_as_number; */
2333         &Vector_SeqMethods,                       /* PySequenceMethods *tp_as_sequence; */
2334         &Vector_AsMapping,                       /* PyMappingMethods *tp_as_mapping; */
2335
2336         /* More standard operations (here for binary compatibility) */
2337
2338         NULL,                       /* hashfunc tp_hash; */
2339         NULL,                       /* ternaryfunc tp_call; */
2340         NULL,                       /* reprfunc tp_str; */
2341         NULL,                       /* getattrofunc tp_getattro; */
2342         NULL,                       /* setattrofunc tp_setattro; */
2343
2344         /* Functions to access object as input/output buffer */
2345         NULL,                       /* PyBufferProcs *tp_as_buffer; */
2346
2347   /*** Flags to define presence of optional/expanded features ***/
2348         Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
2349         vector_doc,                       /*  char *tp_doc;  Documentation string */
2350   /*** Assigned meaning in release 2.0 ***/
2351
2352         /* call function for all accessible objects */
2353         (traverseproc)BaseMathObject_traverse,  //tp_traverse
2354
2355         /* delete references to contained objects */
2356         (inquiry)BaseMathObject_clear,  //tp_clear
2357
2358   /***  Assigned meaning in release 2.1 ***/
2359   /*** rich comparisons ***/
2360         (richcmpfunc)Vector_richcmpr,                       /* richcmpfunc tp_richcompare; */
2361
2362   /***  weak reference enabler ***/
2363         0,                          /* long tp_weaklistoffset; */
2364
2365   /*** Added in release 2.2 ***/
2366         /*   Iterators */
2367         NULL,                       /* getiterfunc tp_iter; */
2368         NULL,                       /* iternextfunc tp_iternext; */
2369
2370   /*** Attribute descriptor and subclassing stuff ***/
2371         Vector_methods,           /* struct PyMethodDef *tp_methods; */
2372         NULL,                       /* struct PyMemberDef *tp_members; */
2373         Vector_getseters,           /* struct PyGetSetDef *tp_getset; */
2374         NULL,                       /* struct _typeobject *tp_base; */
2375         NULL,                       /* PyObject *tp_dict; */
2376         NULL,                       /* descrgetfunc tp_descr_get; */
2377         NULL,                       /* descrsetfunc tp_descr_set; */
2378         0,                          /* long tp_dictoffset; */
2379         NULL,                       /* initproc tp_init; */
2380         NULL,                       /* allocfunc tp_alloc; */
2381         Vector_new,                 /* newfunc tp_new; */
2382         /*  Low-level free-memory routine */
2383         NULL,                       /* freefunc tp_free;  */
2384         /* For PyObject_IS_GC */
2385         NULL,                       /* inquiry tp_is_gc;  */
2386         NULL,                       /* PyObject *tp_bases; */
2387         /* method resolution order */
2388         NULL,                       /* PyObject *tp_mro;  */
2389         NULL,                       /* PyObject *tp_cache; */
2390         NULL,                       /* PyObject *tp_subclasses; */
2391         NULL,                       /* PyObject *tp_weaklist; */
2392         NULL
2393 };
2394
2395 /*------------------------newVectorObject (internal)-------------
2396   creates a new vector object
2397   pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
2398  (i.e. it was allocated elsewhere by MEM_mallocN())
2399   pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
2400  (i.e. it must be created here with PyMEM_malloc())*/
2401 PyObject *newVectorObject(float *vec, const int size, const int type, PyTypeObject *base_type)
2402 {
2403         VectorObject *self;
2404
2405         if(size > 4 || size < 2) {
2406                 PyErr_SetString(PyExc_RuntimeError,
2407                                 "Vector(): invalid size");
2408                 return NULL;
2409         }
2410
2411         self= base_type ?       (VectorObject *)base_type->tp_alloc(base_type, 0) :
2412                                                 (VectorObject *)PyObject_GC_New(VectorObject, &vector_Type);
2413
2414         if(self) {
2415                 self->size = size;
2416
2417                 /* init callbacks as NULL */
2418                 self->cb_user= NULL;
2419                 self->cb_type= self->cb_subtype= 0;
2420
2421                 if(type == Py_WRAP) {
2422                         self->vec = vec;
2423                         self->wrapped = Py_WRAP;
2424                 }
2425                 else if (type == Py_NEW) {
2426                         self->vec= PyMem_Malloc(size * sizeof(float));
2427                         if(vec) {
2428                                 memcpy(self->vec, vec, size * sizeof(float));
2429                         }
2430                         else { /* new empty */
2431                                 fill_vn(self->vec, size, 0.0f);
2432                                 if(size == 4) { /* do the homogenous thing */
2433                                         self->vec[3] = 1.0f;
2434                                 }
2435                         }
2436                         self->wrapped = Py_NEW;
2437                 }
2438                 else {
2439                         Py_FatalError("Vector(): invalid type!");
2440                 }
2441         }
2442         return (PyObject *) self;
2443 }
2444
2445 PyObject *newVectorObject_cb(PyObject *cb_user, int size, int cb_type, int cb_subtype)
2446 {
2447         float dummy[4] = {0.0, 0.0, 0.0, 0.0}; /* dummy init vector, callbacks will be used on access */
2448         VectorObject *self= (VectorObject *)newVectorObject(dummy, size, Py_NEW, NULL);
2449         if(self) {
2450                 Py_INCREF(cb_user);
2451                 self->cb_user=                  cb_user;
2452                 self->cb_type=                  (unsigned char)cb_type;
2453                 self->cb_subtype=               (unsigned char)cb_subtype;
2454                 PyObject_GC_Track(self);
2455         }
2456
2457         return (PyObject *)self;
2458 }