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