Initialize libbullet git in 2.0_beta.
[platform/upstream/libbullet.git] / Extras / PhysicsEffects / include / vecmath / neon / vectormath_aos.h
1 /*\r
2    Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.\r
3    All rights reserved.\r
4 \r
5    Redistribution and use in source and binary forms,\r
6    with or without modification, are permitted provided that the\r
7    following conditions are met:\r
8     * Redistributions of source code must retain the above copyright\r
9       notice, this list of conditions and the following disclaimer.\r
10     * Redistributions in binary form must reproduce the above copyright\r
11       notice, this list of conditions and the following disclaimer in the\r
12       documentation and/or other materials provided with the distribution.\r
13     * Neither the name of the Sony Computer Entertainment Inc nor the names\r
14       of its contributors may be used to endorse or promote products derived\r
15       from this software without specific prior written permission.\r
16 \r
17    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
18    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
19    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
20    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r
21    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
22    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
23    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
24    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
25    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
26    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
27    POSSIBILITY OF SUCH DAMAGE.\r
28 */\r
29 \r
30 #ifndef _VECTORMATH_AOS_CPP_SCALAR_H\r
31 #define _VECTORMATH_AOS_CPP_SCALAR_H\r
32 \r
33 #include <math.h>\r
34 \r
35 #ifdef _VECTORMATH_DEBUG\r
36 #include <stdio.h>\r
37 #endif\r
38 \r
39 namespace Vectormath {\r
40 \r
41 namespace Aos {\r
42 \r
43 //-----------------------------------------------------------------------------\r
44 // Forward Declarations\r
45 //\r
46 \r
47 class Vector3;\r
48 class Vector4;\r
49 class Point3;\r
50 class Quat;\r
51 class Matrix3;\r
52 class Matrix4;\r
53 class Transform3;\r
54 \r
55 // A 3-D vector in array-of-structures format\r
56 //\r
57 class Vector3\r
58 {\r
59     float mX;\r
60     float mY;\r
61     float mZ;\r
62 // ARA begin code change\r
63 // Removed #ifndef __GNUC__ condition\r
64     float d;\r
65 // ARA end\r
66 \r
67 public:\r
68     // Default constructor; does no initialization\r
69     //\r
70         // ARA begin insert new code\r
71         // Added explicit initialization of d = 0.0f;\r
72     inline Vector3( ) { d = 0.0f; };\r
73         // ARA end\r
74 \r
75     // Copy a 3-D vector\r
76     // \r
77     inline Vector3( const Vector3 & vec );\r
78 \r
79     // Construct a 3-D vector from x, y, and z elements\r
80     // \r
81     inline Vector3( float x, float y, float z );\r
82 \r
83     // Copy elements from a 3-D point into a 3-D vector\r
84     // \r
85     explicit inline Vector3( const Point3 & pnt );\r
86 \r
87     // Set all elements of a 3-D vector to the same scalar value\r
88     // \r
89     explicit inline Vector3( float scalar );\r
90 \r
91     // Assign one 3-D vector to another\r
92     // \r
93     inline Vector3 & operator =( const Vector3 & vec );\r
94 \r
95     // Set the x element of a 3-D vector\r
96     // \r
97     inline Vector3 & setX( float x );\r
98 \r
99     // Set the y element of a 3-D vector\r
100     // \r
101     inline Vector3 & setY( float y );\r
102 \r
103     // Set the z element of a 3-D vector\r
104     // \r
105     inline Vector3 & setZ( float z );\r
106 \r
107     // Get the x element of a 3-D vector\r
108     // \r
109     inline float getX( ) const;\r
110 \r
111     // Get the y element of a 3-D vector\r
112     // \r
113     inline float getY( ) const;\r
114 \r
115     // Get the z element of a 3-D vector\r
116     // \r
117     inline float getZ( ) const;\r
118 \r
119     // Set an x, y, or z element of a 3-D vector by index\r
120     // \r
121     inline Vector3 & setElem( int idx, float value );\r
122 \r
123     // Get an x, y, or z element of a 3-D vector by index\r
124     // \r
125     inline float getElem( int idx ) const;\r
126 \r
127     // Subscripting operator to set or get an element\r
128     // \r
129     inline float & operator []( int idx );\r
130 \r
131     // Subscripting operator to get an element\r
132     // \r
133     inline float operator []( int idx ) const;\r
134 \r
135     // Add two 3-D vectors\r
136     // \r
137     inline const Vector3 operator +( const Vector3 & vec ) const;\r
138 \r
139     // Subtract a 3-D vector from another 3-D vector\r
140     // \r
141     inline const Vector3 operator -( const Vector3 & vec ) const;\r
142 \r
143     // Add a 3-D vector to a 3-D point\r
144     // \r
145     inline const Point3 operator +( const Point3 & pnt ) const;\r
146 \r
147     // Multiply a 3-D vector by a scalar\r
148     // \r
149     inline const Vector3 operator *( float scalar ) const;\r
150 \r
151     // Divide a 3-D vector by a scalar\r
152     // \r
153     inline const Vector3 operator /( float scalar ) const;\r
154 \r
155     // Perform compound assignment and addition with a 3-D vector\r
156     // \r
157     inline Vector3 & operator +=( const Vector3 & vec );\r
158 \r
159     // Perform compound assignment and subtraction by a 3-D vector\r
160     // \r
161     inline Vector3 & operator -=( const Vector3 & vec );\r
162 \r
163     // Perform compound assignment and multiplication by a scalar\r
164     // \r
165     inline Vector3 & operator *=( float scalar );\r
166 \r
167     // Perform compound assignment and division by a scalar\r
168     // \r
169     inline Vector3 & operator /=( float scalar );\r
170 \r
171     // Negate all elements of a 3-D vector\r
172     // \r
173     inline const Vector3 operator -( ) const;\r
174 \r
175     // Construct x axis\r
176     // \r
177     static inline const Vector3 xAxis( );\r
178 \r
179     // Construct y axis\r
180     // \r
181     static inline const Vector3 yAxis( );\r
182 \r
183     // Construct z axis\r
184     // \r
185     static inline const Vector3 zAxis( );\r
186 \r
187 }\r
188 #ifdef __GNUC__\r
189 __attribute__ ((aligned(16)))\r
190 #endif\r
191 ;\r
192 \r
193 // Multiply a 3-D vector by a scalar\r
194 // \r
195 inline const Vector3 operator *( float scalar, const Vector3 & vec );\r
196 \r
197 // Multiply two 3-D vectors per element\r
198 // \r
199 inline const Vector3 mulPerElem( const Vector3 & vec0, const Vector3 & vec1 );\r
200 \r
201 // Divide two 3-D vectors per element\r
202 // NOTE: \r
203 // Floating-point behavior matches standard library function divf4.\r
204 // \r
205 inline const Vector3 divPerElem( const Vector3 & vec0, const Vector3 & vec1 );\r
206 \r
207 // Compute the reciprocal of a 3-D vector per element\r
208 // NOTE: \r
209 // Floating-point behavior matches standard library function recipf4.\r
210 // \r
211 inline const Vector3 recipPerElem( const Vector3 & vec );\r
212 \r
213 // Compute the square root of a 3-D vector per element\r
214 // NOTE: \r
215 // Floating-point behavior matches standard library function sqrtf4.\r
216 // \r
217 inline const Vector3 sqrtPerElem( const Vector3 & vec );\r
218 \r
219 // Compute the reciprocal square root of a 3-D vector per element\r
220 // NOTE: \r
221 // Floating-point behavior matches standard library function rsqrtf4.\r
222 // \r
223 inline const Vector3 rsqrtPerElem( const Vector3 & vec );\r
224 \r
225 // Compute the absolute value of a 3-D vector per element\r
226 // \r
227 inline const Vector3 absPerElem( const Vector3 & vec );\r
228 \r
229 // Copy sign from one 3-D vector to another, per element\r
230 // \r
231 inline const Vector3 copySignPerElem( const Vector3 & vec0, const Vector3 & vec1 );\r
232 \r
233 // Maximum of two 3-D vectors per element\r
234 // \r
235 inline const Vector3 maxPerElem( const Vector3 & vec0, const Vector3 & vec1 );\r
236 \r
237 // Minimum of two 3-D vectors per element\r
238 // \r
239 inline const Vector3 minPerElem( const Vector3 & vec0, const Vector3 & vec1 );\r
240 \r
241 // Maximum element of a 3-D vector\r
242 // \r
243 inline float maxElem( const Vector3 & vec );\r
244 \r
245 // Minimum element of a 3-D vector\r
246 // \r
247 inline float minElem( const Vector3 & vec );\r
248 \r
249 // Compute the sum of all elements of a 3-D vector\r
250 // \r
251 inline float sum( const Vector3 & vec );\r
252 \r
253 // Compute the dot product of two 3-D vectors\r
254 // \r
255 inline float dot( const Vector3 & vec0, const Vector3 & vec1 );\r
256 \r
257 // Compute the square of the length of a 3-D vector\r
258 // \r
259 inline float lengthSqr( const Vector3 & vec );\r
260 \r
261 // Compute the length of a 3-D vector\r
262 // \r
263 inline float length( const Vector3 & vec );\r
264 \r
265 // Normalize a 3-D vector\r
266 // NOTE: \r
267 // The result is unpredictable when all elements of vec are at or near zero.\r
268 // \r
269 inline const Vector3 normalize( const Vector3 & vec );\r
270 \r
271 // Compute cross product of two 3-D vectors\r
272 // \r
273 inline const Vector3 cross( const Vector3 & vec0, const Vector3 & vec1 );\r
274 \r
275 // Outer product of two 3-D vectors\r
276 // \r
277 inline const Matrix3 outer( const Vector3 & vec0, const Vector3 & vec1 );\r
278 \r
279 // Pre-multiply a row vector by a 3x3 matrix\r
280 // \r
281 inline const Vector3 rowMul( const Vector3 & vec, const Matrix3 & mat );\r
282 \r
283 // Cross-product matrix of a 3-D vector\r
284 // \r
285 inline const Matrix3 crossMatrix( const Vector3 & vec );\r
286 \r
287 // Create cross-product matrix and multiply\r
288 // NOTE: \r
289 // Faster than separately creating a cross-product matrix and multiplying.\r
290 // \r
291 inline const Matrix3 crossMatrixMul( const Vector3 & vec, const Matrix3 & mat );\r
292 \r
293 // Linear interpolation between two 3-D vectors\r
294 // NOTE: \r
295 // Does not clamp t between 0 and 1.\r
296 // \r
297 inline const Vector3 lerp( float t, const Vector3 & vec0, const Vector3 & vec1 );\r
298 \r
299 // Spherical linear interpolation between two 3-D vectors\r
300 // NOTE: \r
301 // The result is unpredictable if the vectors point in opposite directions.\r
302 // Does not clamp t between 0 and 1.\r
303 // \r
304 inline const Vector3 slerp( float t, const Vector3 & unitVec0, const Vector3 & unitVec1 );\r
305 \r
306 // Conditionally select between two 3-D vectors\r
307 // \r
308 inline const Vector3 select( const Vector3 & vec0, const Vector3 & vec1, bool select1 );\r
309 \r
310 // Load x, y, and z elements from the first three words of a float array.\r
311 // \r
312 // \r
313 inline void loadXYZ( Vector3 & vec, const float * fptr );\r
314 \r
315 // Store x, y, and z elements of a 3-D vector in the first three words of a float array.\r
316 // Memory area of previous 16 bytes and next 32 bytes from fptr might be accessed\r
317 // \r
318 inline void storeXYZ( const Vector3 & vec, float * fptr );\r
319 \r
320 // Load three-half-floats as a 3-D vector\r
321 // NOTE: \r
322 // This transformation does not support either denormalized numbers or NaNs.\r
323 // \r
324 inline void loadHalfFloats( Vector3 & vec, const unsigned short * hfptr );\r
325 \r
326 // Store a 3-D vector as half-floats. Memory area of previous 16 bytes and next 32 bytes from <code><i>hfptr</i></code> might be accessed.\r
327 // NOTE: \r
328 // This transformation does not support either denormalized numbers or NaNs. Memory area of previous 16 bytes and next 32 bytes from hfptr might be accessed.\r
329 // \r
330 inline void storeHalfFloats( const Vector3 & vec, unsigned short * hfptr );\r
331 \r
332 #ifdef _VECTORMATH_DEBUG\r
333 \r
334 // Print a 3-D vector\r
335 // NOTE: \r
336 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
337 // \r
338 inline void print( const Vector3 & vec );\r
339 \r
340 // Print a 3-D vector and an associated string identifier\r
341 // NOTE: \r
342 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
343 // \r
344 inline void print( const Vector3 & vec, const char * name );\r
345 \r
346 #endif\r
347 \r
348 // A 4-D vector in array-of-structures format\r
349 //\r
350 class Vector4\r
351 {\r
352     float mX;\r
353     float mY;\r
354     float mZ;\r
355     float mW;\r
356 \r
357 public:\r
358     // Default constructor; does no initialization\r
359     // \r
360     inline Vector4( ) { };\r
361 \r
362     // Copy a 4-D vector\r
363     // \r
364     inline Vector4( const Vector4 & vec );\r
365 \r
366     // Construct a 4-D vector from x, y, z, and w elements\r
367     // \r
368     inline Vector4( float x, float y, float z, float w );\r
369 \r
370     // Construct a 4-D vector from a 3-D vector and a scalar\r
371     // \r
372     inline Vector4( const Vector3 & xyz, float w );\r
373 \r
374     // Copy x, y, and z from a 3-D vector into a 4-D vector, and set w to 0\r
375     // \r
376     explicit inline Vector4( const Vector3 & vec );\r
377 \r
378     // Copy x, y, and z from a 3-D point into a 4-D vector, and set w to 1\r
379     // \r
380     explicit inline Vector4( const Point3 & pnt );\r
381 \r
382     // Copy elements from a quaternion into a 4-D vector\r
383     // \r
384     explicit inline Vector4( const Quat & quat );\r
385 \r
386     // Set all elements of a 4-D vector to the same scalar value\r
387     // \r
388     explicit inline Vector4( float scalar );\r
389 \r
390     // Assign one 4-D vector to another\r
391     // \r
392     inline Vector4 & operator =( const Vector4 & vec );\r
393 \r
394     // Set the x, y, and z elements of a 4-D vector\r
395     // NOTE: \r
396     // This function does not change the w element.\r
397     // \r
398     inline Vector4 & setXYZ( const Vector3 & vec );\r
399 \r
400     // Get the x, y, and z elements of a 4-D vector\r
401     // \r
402     inline const Vector3 getXYZ( ) const;\r
403 \r
404     // Set the x element of a 4-D vector\r
405     // \r
406     inline Vector4 & setX( float x );\r
407 \r
408     // Set the y element of a 4-D vector\r
409     // \r
410     inline Vector4 & setY( float y );\r
411 \r
412     // Set the z element of a 4-D vector\r
413     // \r
414     inline Vector4 & setZ( float z );\r
415 \r
416     // Set the w element of a 4-D vector\r
417     // \r
418     inline Vector4 & setW( float w );\r
419 \r
420     // Get the x element of a 4-D vector\r
421     // \r
422     inline float getX( ) const;\r
423 \r
424     // Get the y element of a 4-D vector\r
425     // \r
426     inline float getY( ) const;\r
427 \r
428     // Get the z element of a 4-D vector\r
429     // \r
430     inline float getZ( ) const;\r
431 \r
432     // Get the w element of a 4-D vector\r
433     // \r
434     inline float getW( ) const;\r
435 \r
436     // Set an x, y, z, or w element of a 4-D vector by index\r
437     // \r
438     inline Vector4 & setElem( int idx, float value );\r
439 \r
440     // Get an x, y, z, or w element of a 4-D vector by index\r
441     // \r
442     inline float getElem( int idx ) const;\r
443 \r
444     // Subscripting operator to set or get an element\r
445     // \r
446     inline float & operator []( int idx );\r
447 \r
448     // Subscripting operator to get an element\r
449     // \r
450     inline float operator []( int idx ) const;\r
451 \r
452     // Add two 4-D vectors\r
453     // \r
454     inline const Vector4 operator +( const Vector4 & vec ) const;\r
455 \r
456     // Subtract a 4-D vector from another 4-D vector\r
457     // \r
458     inline const Vector4 operator -( const Vector4 & vec ) const;\r
459 \r
460     // Multiply a 4-D vector by a scalar\r
461     // \r
462     inline const Vector4 operator *( float scalar ) const;\r
463 \r
464     // Divide a 4-D vector by a scalar\r
465     // \r
466     inline const Vector4 operator /( float scalar ) const;\r
467 \r
468     // Perform compound assignment and addition with a 4-D vector\r
469     // \r
470     inline Vector4 & operator +=( const Vector4 & vec );\r
471 \r
472     // Perform compound assignment and subtraction by a 4-D vector\r
473     // \r
474     inline Vector4 & operator -=( const Vector4 & vec );\r
475 \r
476     // Perform compound assignment and multiplication by a scalar\r
477     // \r
478     inline Vector4 & operator *=( float scalar );\r
479 \r
480     // Perform compound assignment and division by a scalar\r
481     // \r
482     inline Vector4 & operator /=( float scalar );\r
483 \r
484     // Negate all elements of a 4-D vector\r
485     // \r
486     inline const Vector4 operator -( ) const;\r
487 \r
488     // Construct x axis\r
489     // \r
490     static inline const Vector4 xAxis( );\r
491 \r
492     // Construct y axis\r
493     // \r
494     static inline const Vector4 yAxis( );\r
495 \r
496     // Construct z axis\r
497     // \r
498     static inline const Vector4 zAxis( );\r
499 \r
500     // Construct w axis\r
501     // \r
502     static inline const Vector4 wAxis( );\r
503 \r
504 }\r
505 #ifdef __GNUC__\r
506 __attribute__ ((aligned(16)))\r
507 #endif\r
508 ;\r
509 \r
510 // Multiply a 4-D vector by a scalar\r
511 // \r
512 inline const Vector4 operator *( float scalar, const Vector4 & vec );\r
513 \r
514 // Multiply two 4-D vectors per element\r
515 // \r
516 inline const Vector4 mulPerElem( const Vector4 & vec0, const Vector4 & vec1 );\r
517 \r
518 // Divide two 4-D vectors per element\r
519 // NOTE: \r
520 // Floating-point behavior matches standard library function divf4.\r
521 // \r
522 inline const Vector4 divPerElem( const Vector4 & vec0, const Vector4 & vec1 );\r
523 \r
524 // Compute the reciprocal of a 4-D vector per element\r
525 // NOTE: \r
526 // Floating-point behavior matches standard library function recipf4.\r
527 // \r
528 inline const Vector4 recipPerElem( const Vector4 & vec );\r
529 \r
530 // Compute the square root of a 4-D vector per element\r
531 // NOTE: \r
532 // Floating-point behavior matches standard library function sqrtf4.\r
533 // \r
534 inline const Vector4 sqrtPerElem( const Vector4 & vec );\r
535 \r
536 // Compute the reciprocal square root of a 4-D vector per element\r
537 // NOTE: \r
538 // Floating-point behavior matches standard library function rsqrtf4.\r
539 // \r
540 inline const Vector4 rsqrtPerElem( const Vector4 & vec );\r
541 \r
542 // Compute the absolute value of a 4-D vector per element\r
543 // \r
544 inline const Vector4 absPerElem( const Vector4 & vec );\r
545 \r
546 // Copy sign from one 4-D vector to another, per element\r
547 // \r
548 inline const Vector4 copySignPerElem( const Vector4 & vec0, const Vector4 & vec1 );\r
549 \r
550 // Maximum of two 4-D vectors per element\r
551 // \r
552 inline const Vector4 maxPerElem( const Vector4 & vec0, const Vector4 & vec1 );\r
553 \r
554 // Minimum of two 4-D vectors per element\r
555 // \r
556 inline const Vector4 minPerElem( const Vector4 & vec0, const Vector4 & vec1 );\r
557 \r
558 // Maximum element of a 4-D vector\r
559 // \r
560 inline float maxElem( const Vector4 & vec );\r
561 \r
562 // Minimum element of a 4-D vector\r
563 // \r
564 inline float minElem( const Vector4 & vec );\r
565 \r
566 // Compute the sum of all elements of a 4-D vector\r
567 // \r
568 inline float sum( const Vector4 & vec );\r
569 \r
570 // Compute the dot product of two 4-D vectors\r
571 // \r
572 inline float dot( const Vector4 & vec0, const Vector4 & vec1 );\r
573 \r
574 // Compute the square of the length of a 4-D vector\r
575 // \r
576 inline float lengthSqr( const Vector4 & vec );\r
577 \r
578 // Compute the length of a 4-D vector\r
579 // \r
580 inline float length( const Vector4 & vec );\r
581 \r
582 // Normalize a 4-D vector\r
583 // NOTE: \r
584 // The result is unpredictable when all elements of vec are at or near zero.\r
585 // \r
586 inline const Vector4 normalize( const Vector4 & vec );\r
587 \r
588 // Outer product of two 4-D vectors\r
589 // \r
590 inline const Matrix4 outer( const Vector4 & vec0, const Vector4 & vec1 );\r
591 \r
592 // Linear interpolation between two 4-D vectors\r
593 // NOTE: \r
594 // Does not clamp t between 0 and 1.\r
595 // \r
596 inline const Vector4 lerp( float t, const Vector4 & vec0, const Vector4 & vec1 );\r
597 \r
598 // Spherical linear interpolation between two 4-D vectors\r
599 // NOTE: \r
600 // The result is unpredictable if the vectors point in opposite directions.\r
601 // Does not clamp t between 0 and 1.\r
602 // \r
603 inline const Vector4 slerp( float t, const Vector4 & unitVec0, const Vector4 & unitVec1 );\r
604 \r
605 // Conditionally select between two 4-D vectors\r
606 // \r
607 inline const Vector4 select( const Vector4 & vec0, const Vector4 & vec1, bool select1 );\r
608 \r
609 // Load x, y, z, and w elements from the first four words of a float array.\r
610 // \r
611 // \r
612 inline void loadXYZW( Vector4 & vec, const float * fptr );\r
613 \r
614 // Store x, y, z, and w elements of a 4-D vector in the first four words of a float array.\r
615 // Memory area of previous 16 bytes and next 32 bytes from fptr might be accessed\r
616 // \r
617 inline void storeXYZW( const Vector4 & vec, float * fptr );\r
618 \r
619 // Load four-half-floats as a 4-D vector\r
620 // NOTE: \r
621 // This transformation does not support either denormalized numbers or NaNs.\r
622 // \r
623 inline void loadHalfFloats( Vector4 & vec, const unsigned short * hfptr );\r
624 \r
625 // Store a 4-D vector as half-floats. Memory area of previous 16 bytes and next 32 bytes from <code><i>hfptr</i></code> might be accessed.\r
626 // NOTE: \r
627 // This transformation does not support either denormalized numbers or NaNs. Memory area of previous 16 bytes and next 32 bytes from hfptr might be accessed.\r
628 // \r
629 inline void storeHalfFloats( const Vector4 & vec, unsigned short * hfptr );\r
630 \r
631 #ifdef _VECTORMATH_DEBUG\r
632 \r
633 // Print a 4-D vector\r
634 // NOTE: \r
635 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
636 // \r
637 inline void print( const Vector4 & vec );\r
638 \r
639 // Print a 4-D vector and an associated string identifier\r
640 // NOTE: \r
641 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
642 // \r
643 inline void print( const Vector4 & vec, const char * name );\r
644 \r
645 #endif\r
646 \r
647 // A 3-D point in array-of-structures format\r
648 //\r
649 class Point3\r
650 {\r
651     float mX;\r
652     float mY;\r
653     float mZ;\r
654 // ARA begin code change\r
655 // Removed #ifndef __GNUC__ condition\r
656     float d;\r
657 // ARA end\r
658 \r
659 public:\r
660     // Default constructor; does no initialization\r
661     // \r
662         // ARA begin insert new code\r
663         // Added explicit initialization of d = 0.0f;\r
664     inline Point3( ) { d = 0.0f; };\r
665         // ARA end\r
666 \r
667     // Copy a 3-D point\r
668     // \r
669     inline Point3( const Point3 & pnt );\r
670 \r
671     // Construct a 3-D point from x, y, and z elements\r
672     // \r
673     inline Point3( float x, float y, float z );\r
674 \r
675     // Copy elements from a 3-D vector into a 3-D point\r
676     // \r
677     explicit inline Point3( const Vector3 & vec );\r
678 \r
679     // Set all elements of a 3-D point to the same scalar value\r
680     // \r
681     explicit inline Point3( float scalar );\r
682 \r
683     // Assign one 3-D point to another\r
684     // \r
685     inline Point3 & operator =( const Point3 & pnt );\r
686 \r
687     // Set the x element of a 3-D point\r
688     // \r
689     inline Point3 & setX( float x );\r
690 \r
691     // Set the y element of a 3-D point\r
692     // \r
693     inline Point3 & setY( float y );\r
694 \r
695     // Set the z element of a 3-D point\r
696     // \r
697     inline Point3 & setZ( float z );\r
698 \r
699     // Get the x element of a 3-D point\r
700     // \r
701     inline float getX( ) const;\r
702 \r
703     // Get the y element of a 3-D point\r
704     // \r
705     inline float getY( ) const;\r
706 \r
707     // Get the z element of a 3-D point\r
708     // \r
709     inline float getZ( ) const;\r
710 \r
711     // Set an x, y, or z element of a 3-D point by index\r
712     // \r
713     inline Point3 & setElem( int idx, float value );\r
714 \r
715     // Get an x, y, or z element of a 3-D point by index\r
716     // \r
717     inline float getElem( int idx ) const;\r
718 \r
719     // Subscripting operator to set or get an element\r
720     // \r
721     inline float & operator []( int idx );\r
722 \r
723     // Subscripting operator to get an element\r
724     // \r
725     inline float operator []( int idx ) const;\r
726 \r
727     // Subtract a 3-D point from another 3-D point\r
728     // \r
729     inline const Vector3 operator -( const Point3 & pnt ) const;\r
730 \r
731     // Add a 3-D point to a 3-D vector\r
732     // \r
733     inline const Point3 operator +( const Vector3 & vec ) const;\r
734 \r
735     // Subtract a 3-D vector from a 3-D point\r
736     // \r
737     inline const Point3 operator -( const Vector3 & vec ) const;\r
738 \r
739     // Perform compound assignment and addition with a 3-D vector\r
740     // \r
741     inline Point3 & operator +=( const Vector3 & vec );\r
742 \r
743     // Perform compound assignment and subtraction by a 3-D vector\r
744     // \r
745     inline Point3 & operator -=( const Vector3 & vec );\r
746 \r
747 }\r
748 #ifdef __GNUC__\r
749 __attribute__ ((aligned(16)))\r
750 #endif\r
751 ;\r
752 \r
753 // Multiply two 3-D points per element\r
754 // \r
755 inline const Point3 mulPerElem( const Point3 & pnt0, const Point3 & pnt1 );\r
756 \r
757 // Divide two 3-D points per element\r
758 // NOTE: \r
759 // Floating-point behavior matches standard library function divf4.\r
760 // \r
761 inline const Point3 divPerElem( const Point3 & pnt0, const Point3 & pnt1 );\r
762 \r
763 // Compute the reciprocal of a 3-D point per element\r
764 // NOTE: \r
765 // Floating-point behavior matches standard library function recipf4.\r
766 // \r
767 inline const Point3 recipPerElem( const Point3 & pnt );\r
768 \r
769 // Compute the square root of a 3-D point per element\r
770 // NOTE: \r
771 // Floating-point behavior matches standard library function sqrtf4.\r
772 // \r
773 inline const Point3 sqrtPerElem( const Point3 & pnt );\r
774 \r
775 // Compute the reciprocal square root of a 3-D point per element\r
776 // NOTE: \r
777 // Floating-point behavior matches standard library function rsqrtf4.\r
778 // \r
779 inline const Point3 rsqrtPerElem( const Point3 & pnt );\r
780 \r
781 // Compute the absolute value of a 3-D point per element\r
782 // \r
783 inline const Point3 absPerElem( const Point3 & pnt );\r
784 \r
785 // Copy sign from one 3-D point to another, per element\r
786 // \r
787 inline const Point3 copySignPerElem( const Point3 & pnt0, const Point3 & pnt1 );\r
788 \r
789 // Maximum of two 3-D points per element\r
790 // \r
791 inline const Point3 maxPerElem( const Point3 & pnt0, const Point3 & pnt1 );\r
792 \r
793 // Minimum of two 3-D points per element\r
794 // \r
795 inline const Point3 minPerElem( const Point3 & pnt0, const Point3 & pnt1 );\r
796 \r
797 // Maximum element of a 3-D point\r
798 // \r
799 inline float maxElem( const Point3 & pnt );\r
800 \r
801 // Minimum element of a 3-D point\r
802 // \r
803 inline float minElem( const Point3 & pnt );\r
804 \r
805 // Compute the sum of all elements of a 3-D point\r
806 // \r
807 inline float sum( const Point3 & pnt );\r
808 \r
809 // Apply uniform scale to a 3-D point\r
810 // \r
811 inline const Point3 scale( const Point3 & pnt, float scaleVal );\r
812 \r
813 // Apply non-uniform scale to a 3-D point\r
814 // \r
815 inline const Point3 scale( const Point3 & pnt, const Vector3 & scaleVec );\r
816 \r
817 // Scalar projection of a 3-D point on a unit-length 3-D vector\r
818 // \r
819 inline float projection( const Point3 & pnt, const Vector3 & unitVec );\r
820 \r
821 // Compute the square of the distance of a 3-D point from the coordinate-system origin\r
822 // \r
823 inline float distSqrFromOrigin( const Point3 & pnt );\r
824 \r
825 // Compute the distance of a 3-D point from the coordinate-system origin\r
826 // \r
827 inline float distFromOrigin( const Point3 & pnt );\r
828 \r
829 // Compute the square of the distance between two 3-D points\r
830 // \r
831 inline float distSqr( const Point3 & pnt0, const Point3 & pnt1 );\r
832 \r
833 // Compute the distance between two 3-D points\r
834 // \r
835 inline float dist( const Point3 & pnt0, const Point3 & pnt1 );\r
836 \r
837 // Linear interpolation between two 3-D points\r
838 // NOTE: \r
839 // Does not clamp t between 0 and 1.\r
840 // \r
841 inline const Point3 lerp( float t, const Point3 & pnt0, const Point3 & pnt1 );\r
842 \r
843 // Conditionally select between two 3-D points\r
844 // \r
845 inline const Point3 select( const Point3 & pnt0, const Point3 & pnt1, bool select1 );\r
846 \r
847 // Load x, y, and z elements from the first three words of a float array.\r
848 // \r
849 // \r
850 inline void loadXYZ( Point3 & pnt, const float * fptr );\r
851 \r
852 // Store x, y, and z elements of a 3-D point in the first three words of a float array.\r
853 // Memory area of previous 16 bytes and next 32 bytes from fptr might be accessed\r
854 // \r
855 inline void storeXYZ( const Point3 & pnt, float * fptr );\r
856 \r
857 // Load three-half-floats as a 3-D point\r
858 // NOTE: \r
859 // This transformation does not support either denormalized numbers or NaNs.\r
860 // \r
861 inline void loadHalfFloats( Point3 & pnt, const unsigned short * hfptr );\r
862 \r
863 // Store a 3-D point as half-floats. Memory area of previous 16 bytes and next 32 bytes from <code><i>hfptr</i></code> might be accessed.\r
864 // NOTE: \r
865 // This transformation does not support either denormalized numbers or NaNs. Memory area of previous 16 bytes and next 32 bytes from hfptr might be accessed.\r
866 // \r
867 inline void storeHalfFloats( const Point3 & pnt, unsigned short * hfptr );\r
868 \r
869 #ifdef _VECTORMATH_DEBUG\r
870 \r
871 // Print a 3-D point\r
872 // NOTE: \r
873 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
874 // \r
875 inline void print( const Point3 & pnt );\r
876 \r
877 // Print a 3-D point and an associated string identifier\r
878 // NOTE: \r
879 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
880 // \r
881 inline void print( const Point3 & pnt, const char * name );\r
882 \r
883 #endif\r
884 \r
885 // A quaternion in array-of-structures format\r
886 //\r
887 class Quat\r
888 {\r
889     float mX;\r
890     float mY;\r
891     float mZ;\r
892     float mW;\r
893 \r
894 public:\r
895     // Default constructor; does no initialization\r
896     // \r
897     inline Quat( ) { };\r
898 \r
899     // Copy a quaternion\r
900     // \r
901     inline Quat( const Quat & quat );\r
902 \r
903     // Construct a quaternion from x, y, z, and w elements\r
904     // \r
905     inline Quat( float x, float y, float z, float w );\r
906 \r
907     // Construct a quaternion from a 3-D vector and a scalar\r
908     // \r
909     inline Quat( const Vector3 & xyz, float w );\r
910 \r
911     // Copy elements from a 4-D vector into a quaternion\r
912     // \r
913     explicit inline Quat( const Vector4 & vec );\r
914 \r
915     // Convert a rotation matrix to a unit-length quaternion\r
916     // \r
917     explicit inline Quat( const Matrix3 & rotMat );\r
918 \r
919     // Set all elements of a quaternion to the same scalar value\r
920     // \r
921     explicit inline Quat( float scalar );\r
922 \r
923     // Assign one quaternion to another\r
924     // \r
925     inline Quat & operator =( const Quat & quat );\r
926 \r
927     // Set the x, y, and z elements of a quaternion\r
928     // NOTE: \r
929     // This function does not change the w element.\r
930     // \r
931     inline Quat & setXYZ( const Vector3 & vec );\r
932 \r
933     // Get the x, y, and z elements of a quaternion\r
934     // \r
935     inline const Vector3 getXYZ( ) const;\r
936 \r
937     // Set the x element of a quaternion\r
938     // \r
939     inline Quat & setX( float x );\r
940 \r
941     // Set the y element of a quaternion\r
942     // \r
943     inline Quat & setY( float y );\r
944 \r
945     // Set the z element of a quaternion\r
946     // \r
947     inline Quat & setZ( float z );\r
948 \r
949     // Set the w element of a quaternion\r
950     // \r
951     inline Quat & setW( float w );\r
952 \r
953     // Get the x element of a quaternion\r
954     // \r
955     inline float getX( ) const;\r
956 \r
957     // Get the y element of a quaternion\r
958     // \r
959     inline float getY( ) const;\r
960 \r
961     // Get the z element of a quaternion\r
962     // \r
963     inline float getZ( ) const;\r
964 \r
965     // Get the w element of a quaternion\r
966     // \r
967     inline float getW( ) const;\r
968 \r
969     // Set an x, y, z, or w element of a quaternion by index\r
970     // \r
971     inline Quat & setElem( int idx, float value );\r
972 \r
973     // Get an x, y, z, or w element of a quaternion by index\r
974     // \r
975     inline float getElem( int idx ) const;\r
976 \r
977     // Subscripting operator to set or get an element\r
978     // \r
979     inline float & operator []( int idx );\r
980 \r
981     // Subscripting operator to get an element\r
982     // \r
983     inline float operator []( int idx ) const;\r
984 \r
985     // Add two quaternions\r
986     // \r
987     inline const Quat operator +( const Quat & quat ) const;\r
988 \r
989     // Subtract a quaternion from another quaternion\r
990     // \r
991     inline const Quat operator -( const Quat & quat ) const;\r
992 \r
993     // Multiply two quaternions\r
994     // \r
995     inline const Quat operator *( const Quat & quat ) const;\r
996 \r
997     // Multiply a quaternion by a scalar\r
998     // \r
999     inline const Quat operator *( float scalar ) const;\r
1000 \r
1001     // Divide a quaternion by a scalar\r
1002     // \r
1003     inline const Quat operator /( float scalar ) const;\r
1004 \r
1005     // Perform compound assignment and addition with a quaternion\r
1006     // \r
1007     inline Quat & operator +=( const Quat & quat );\r
1008 \r
1009     // Perform compound assignment and subtraction by a quaternion\r
1010     // \r
1011     inline Quat & operator -=( const Quat & quat );\r
1012 \r
1013     // Perform compound assignment and multiplication by a quaternion\r
1014     // \r
1015     inline Quat & operator *=( const Quat & quat );\r
1016 \r
1017     // Perform compound assignment and multiplication by a scalar\r
1018     // \r
1019     inline Quat & operator *=( float scalar );\r
1020 \r
1021     // Perform compound assignment and division by a scalar\r
1022     // \r
1023     inline Quat & operator /=( float scalar );\r
1024 \r
1025     // Negate all elements of a quaternion\r
1026     // \r
1027     inline const Quat operator -( ) const;\r
1028 \r
1029     // Construct an identity quaternion\r
1030     // \r
1031     static inline const Quat identity( );\r
1032 \r
1033     // Construct a quaternion to rotate between two unit-length 3-D vectors\r
1034     // NOTE: \r
1035     // The result is unpredictable if unitVec0 and unitVec1 point in opposite directions.\r
1036     // \r
1037     static inline const Quat rotation( const Vector3 & unitVec0, const Vector3 & unitVec1 );\r
1038 \r
1039     // Construct a quaternion to rotate around a unit-length 3-D vector\r
1040     // \r
1041     static inline const Quat rotation( float radians, const Vector3 & unitVec );\r
1042 \r
1043     // Construct a quaternion to rotate around the x axis\r
1044     // \r
1045     static inline const Quat rotationX( float radians );\r
1046 \r
1047     // Construct a quaternion to rotate around the y axis\r
1048     // \r
1049     static inline const Quat rotationY( float radians );\r
1050 \r
1051     // Construct a quaternion to rotate around the z axis\r
1052     // \r
1053     static inline const Quat rotationZ( float radians );\r
1054 \r
1055 }\r
1056 #ifdef __GNUC__\r
1057 __attribute__ ((aligned(16)))\r
1058 #endif\r
1059 ;\r
1060 \r
1061 // Multiply a quaternion by a scalar\r
1062 // \r
1063 inline const Quat operator *( float scalar, const Quat & quat );\r
1064 \r
1065 // Compute the conjugate of a quaternion\r
1066 // \r
1067 inline const Quat conj( const Quat & quat );\r
1068 \r
1069 // Use a unit-length quaternion to rotate a 3-D vector\r
1070 // \r
1071 inline const Vector3 rotate( const Quat & unitQuat, const Vector3 & vec );\r
1072 \r
1073 // Compute the dot product of two quaternions\r
1074 // \r
1075 inline float dot( const Quat & quat0, const Quat & quat1 );\r
1076 \r
1077 // Compute the norm of a quaternion\r
1078 // \r
1079 inline float norm( const Quat & quat );\r
1080 \r
1081 // Compute the length of a quaternion\r
1082 // \r
1083 inline float length( const Quat & quat );\r
1084 \r
1085 // Normalize a quaternion\r
1086 // NOTE: \r
1087 // The result is unpredictable when all elements of quat are at or near zero.\r
1088 // \r
1089 inline const Quat normalize( const Quat & quat );\r
1090 \r
1091 // Linear interpolation between two quaternions\r
1092 // NOTE: \r
1093 // Does not clamp t between 0 and 1.\r
1094 // \r
1095 inline const Quat lerp( float t, const Quat & quat0, const Quat & quat1 );\r
1096 \r
1097 // Spherical linear interpolation between two quaternions\r
1098 // NOTE: \r
1099 // Interpolates along the shortest path between orientations.\r
1100 // Does not clamp t between 0 and 1.\r
1101 // \r
1102 inline const Quat slerp( float t, const Quat & unitQuat0, const Quat & unitQuat1 );\r
1103 \r
1104 // Spherical quadrangle interpolation\r
1105 // \r
1106 inline const Quat squad( float t, const Quat & unitQuat0, const Quat & unitQuat1, const Quat & unitQuat2, const Quat & unitQuat3 );\r
1107 \r
1108 // Conditionally select between two quaternions\r
1109 // \r
1110 inline const Quat select( const Quat & quat0, const Quat & quat1, bool select1 );\r
1111 \r
1112 // Load x, y, z, and w elements from the first four words of a float array.\r
1113 // \r
1114 // \r
1115 inline void loadXYZW( Quat & quat, const float * fptr );\r
1116 \r
1117 // Store x, y, z, and w elements of a quaternion in the first four words of a float array.\r
1118 // Memory area of previous 16 bytes and next 32 bytes from fptr might be accessed\r
1119 // \r
1120 inline void storeXYZW( const Quat & quat, float * fptr );\r
1121 \r
1122 #ifdef _VECTORMATH_DEBUG\r
1123 \r
1124 // Print a quaternion\r
1125 // NOTE: \r
1126 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
1127 // \r
1128 inline void print( const Quat & quat );\r
1129 \r
1130 // Print a quaternion and an associated string identifier\r
1131 // NOTE: \r
1132 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
1133 // \r
1134 inline void print( const Quat & quat, const char * name );\r
1135 \r
1136 #endif\r
1137 \r
1138 // A 3x3 matrix in array-of-structures format\r
1139 //\r
1140 class Matrix3\r
1141 {\r
1142     Vector3 mCol0;\r
1143     Vector3 mCol1;\r
1144     Vector3 mCol2;\r
1145 \r
1146 public:\r
1147     // Default constructor; does no initialization\r
1148     // \r
1149     inline Matrix3( ) { };\r
1150 \r
1151     // Copy a 3x3 matrix\r
1152     // \r
1153     inline Matrix3( const Matrix3 & mat );\r
1154 \r
1155     // Construct a 3x3 matrix containing the specified columns\r
1156     // \r
1157     inline Matrix3( const Vector3 & col0, const Vector3 & col1, const Vector3 & col2 );\r
1158 \r
1159     // Construct a 3x3 rotation matrix from a unit-length quaternion\r
1160     // \r
1161     explicit inline Matrix3( const Quat & unitQuat );\r
1162 \r
1163     // Set all elements of a 3x3 matrix to the same scalar value\r
1164     // \r
1165     explicit inline Matrix3( float scalar );\r
1166 \r
1167     // Assign one 3x3 matrix to another\r
1168     // \r
1169     inline Matrix3 & operator =( const Matrix3 & mat );\r
1170 \r
1171     // Set column 0 of a 3x3 matrix\r
1172     // \r
1173     inline Matrix3 & setCol0( const Vector3 & col0 );\r
1174 \r
1175     // Set column 1 of a 3x3 matrix\r
1176     // \r
1177     inline Matrix3 & setCol1( const Vector3 & col1 );\r
1178 \r
1179     // Set column 2 of a 3x3 matrix\r
1180     // \r
1181     inline Matrix3 & setCol2( const Vector3 & col2 );\r
1182 \r
1183     // Get column 0 of a 3x3 matrix\r
1184     // \r
1185     inline const Vector3 getCol0( ) const;\r
1186 \r
1187     // Get column 1 of a 3x3 matrix\r
1188     // \r
1189     inline const Vector3 getCol1( ) const;\r
1190 \r
1191     // Get column 2 of a 3x3 matrix\r
1192     // \r
1193     inline const Vector3 getCol2( ) const;\r
1194 \r
1195     // Set the column of a 3x3 matrix referred to by the specified index\r
1196     // \r
1197     inline Matrix3 & setCol( int col, const Vector3 & vec );\r
1198 \r
1199     // Set the row of a 3x3 matrix referred to by the specified index\r
1200     // \r
1201     inline Matrix3 & setRow( int row, const Vector3 & vec );\r
1202 \r
1203     // Get the column of a 3x3 matrix referred to by the specified index\r
1204     // \r
1205     inline const Vector3 getCol( int col ) const;\r
1206 \r
1207     // Get the row of a 3x3 matrix referred to by the specified index\r
1208     // \r
1209     inline const Vector3 getRow( int row ) const;\r
1210 \r
1211     // Subscripting operator to set or get a column\r
1212     // \r
1213     inline Vector3 & operator []( int col );\r
1214 \r
1215     // Subscripting operator to get a column\r
1216     // \r
1217     inline const Vector3 operator []( int col ) const;\r
1218 \r
1219     // Set the element of a 3x3 matrix referred to by column and row indices\r
1220     // \r
1221     inline Matrix3 & setElem( int col, int row, float val );\r
1222 \r
1223     // Get the element of a 3x3 matrix referred to by column and row indices\r
1224     // \r
1225     inline float getElem( int col, int row ) const;\r
1226 \r
1227     // Add two 3x3 matrices\r
1228     // \r
1229     inline const Matrix3 operator +( const Matrix3 & mat ) const;\r
1230 \r
1231     // Subtract a 3x3 matrix from another 3x3 matrix\r
1232     // \r
1233     inline const Matrix3 operator -( const Matrix3 & mat ) const;\r
1234 \r
1235     // Negate all elements of a 3x3 matrix\r
1236     // \r
1237     inline const Matrix3 operator -( ) const;\r
1238 \r
1239     // Multiply a 3x3 matrix by a scalar\r
1240     // \r
1241     inline const Matrix3 operator *( float scalar ) const;\r
1242 \r
1243     // Multiply a 3x3 matrix by a 3-D vector\r
1244     // \r
1245     inline const Vector3 operator *( const Vector3 & vec ) const;\r
1246 \r
1247     // Multiply two 3x3 matrices\r
1248     // \r
1249     inline const Matrix3 operator *( const Matrix3 & mat ) const;\r
1250 \r
1251     // Perform compound assignment and addition with a 3x3 matrix\r
1252     // \r
1253     inline Matrix3 & operator +=( const Matrix3 & mat );\r
1254 \r
1255     // Perform compound assignment and subtraction by a 3x3 matrix\r
1256     // \r
1257     inline Matrix3 & operator -=( const Matrix3 & mat );\r
1258 \r
1259     // Perform compound assignment and multiplication by a scalar\r
1260     // \r
1261     inline Matrix3 & operator *=( float scalar );\r
1262 \r
1263     // Perform compound assignment and multiplication by a 3x3 matrix\r
1264     // \r
1265     inline Matrix3 & operator *=( const Matrix3 & mat );\r
1266 \r
1267     // Construct an identity 3x3 matrix\r
1268     // \r
1269     static inline const Matrix3 identity( );\r
1270 \r
1271     // Construct a 3x3 matrix to rotate around the x axis\r
1272     // \r
1273     static inline const Matrix3 rotationX( float radians );\r
1274 \r
1275     // Construct a 3x3 matrix to rotate around the y axis\r
1276     // \r
1277     static inline const Matrix3 rotationY( float radians );\r
1278 \r
1279     // Construct a 3x3 matrix to rotate around the z axis\r
1280     // \r
1281     static inline const Matrix3 rotationZ( float radians );\r
1282 \r
1283     // Construct a 3x3 matrix to rotate around the x, y, and z axes\r
1284     // \r
1285     static inline const Matrix3 rotationZYX( const Vector3 & radiansXYZ );\r
1286 \r
1287     // Construct a 3x3 matrix to rotate around a unit-length 3-D vector\r
1288     // \r
1289     static inline const Matrix3 rotation( float radians, const Vector3 & unitVec );\r
1290 \r
1291     // Construct a rotation matrix from a unit-length quaternion\r
1292     // \r
1293     static inline const Matrix3 rotation( const Quat & unitQuat );\r
1294 \r
1295     // Construct a 3x3 matrix to perform scaling\r
1296     // \r
1297     static inline const Matrix3 scale( const Vector3 & scaleVec );\r
1298 \r
1299 };\r
1300 // Multiply a 3x3 matrix by a scalar\r
1301 // \r
1302 inline const Matrix3 operator *( float scalar, const Matrix3 & mat );\r
1303 \r
1304 // Append (post-multiply) a scale transformation to a 3x3 matrix\r
1305 // NOTE: \r
1306 // Faster than creating and multiplying a scale transformation matrix.\r
1307 // \r
1308 inline const Matrix3 appendScale( const Matrix3 & mat, const Vector3 & scaleVec );\r
1309 \r
1310 // Prepend (pre-multiply) a scale transformation to a 3x3 matrix\r
1311 // NOTE: \r
1312 // Faster than creating and multiplying a scale transformation matrix.\r
1313 // \r
1314 inline const Matrix3 prependScale( const Vector3 & scaleVec, const Matrix3 & mat );\r
1315 \r
1316 // Multiply two 3x3 matrices per element\r
1317 // \r
1318 inline const Matrix3 mulPerElem( const Matrix3 & mat0, const Matrix3 & mat1 );\r
1319 \r
1320 // Compute the absolute value of a 3x3 matrix per element\r
1321 // \r
1322 inline const Matrix3 absPerElem( const Matrix3 & mat );\r
1323 \r
1324 // Transpose of a 3x3 matrix\r
1325 // \r
1326 inline const Matrix3 transpose( const Matrix3 & mat );\r
1327 \r
1328 // Compute the inverse of a 3x3 matrix\r
1329 // NOTE: \r
1330 // Result is unpredictable when the determinant of mat is equal to or near 0.\r
1331 // \r
1332 inline const Matrix3 inverse( const Matrix3 & mat );\r
1333 \r
1334 // Determinant of a 3x3 matrix\r
1335 // \r
1336 inline float determinant( const Matrix3 & mat );\r
1337 \r
1338 // Conditionally select between two 3x3 matrices\r
1339 // \r
1340 inline const Matrix3 select( const Matrix3 & mat0, const Matrix3 & mat1, bool select1 );\r
1341 \r
1342 #ifdef _VECTORMATH_DEBUG\r
1343 \r
1344 // Print a 3x3 matrix\r
1345 // NOTE: \r
1346 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
1347 // \r
1348 inline void print( const Matrix3 & mat );\r
1349 \r
1350 // Print a 3x3 matrix and an associated string identifier\r
1351 // NOTE: \r
1352 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
1353 // \r
1354 inline void print( const Matrix3 & mat, const char * name );\r
1355 \r
1356 #endif\r
1357 \r
1358 // A 4x4 matrix in array-of-structures format\r
1359 //\r
1360 class Matrix4\r
1361 {\r
1362     Vector4 mCol0;\r
1363     Vector4 mCol1;\r
1364     Vector4 mCol2;\r
1365     Vector4 mCol3;\r
1366 \r
1367 public:\r
1368     // Default constructor; does no initialization\r
1369     // \r
1370     inline Matrix4( ) { };\r
1371 \r
1372     // Copy a 4x4 matrix\r
1373     // \r
1374     inline Matrix4( const Matrix4 & mat );\r
1375 \r
1376     // Construct a 4x4 matrix containing the specified columns\r
1377     // \r
1378     inline Matrix4( const Vector4 & col0, const Vector4 & col1, const Vector4 & col2, const Vector4 & col3 );\r
1379 \r
1380     // Construct a 4x4 matrix from a 3x4 transformation matrix\r
1381     // \r
1382     explicit inline Matrix4( const Transform3 & mat );\r
1383 \r
1384     // Construct a 4x4 matrix from a 3x3 matrix and a 3-D vector\r
1385     // \r
1386     inline Matrix4( const Matrix3 & mat, const Vector3 & translateVec );\r
1387 \r
1388     // Construct a 4x4 matrix from a unit-length quaternion and a 3-D vector\r
1389     // \r
1390     inline Matrix4( const Quat & unitQuat, const Vector3 & translateVec );\r
1391 \r
1392     // Set all elements of a 4x4 matrix to the same scalar value\r
1393     // \r
1394     explicit inline Matrix4( float scalar );\r
1395 \r
1396     // Assign one 4x4 matrix to another\r
1397     // \r
1398     inline Matrix4 & operator =( const Matrix4 & mat );\r
1399 \r
1400     // Set the upper-left 3x3 submatrix\r
1401     // NOTE: \r
1402     // This function does not change the bottom row elements.\r
1403     // \r
1404     inline Matrix4 & setUpper3x3( const Matrix3 & mat3 );\r
1405 \r
1406     // Get the upper-left 3x3 submatrix of a 4x4 matrix\r
1407     // \r
1408     inline const Matrix3 getUpper3x3( ) const;\r
1409 \r
1410     // Set translation component\r
1411     // NOTE: \r
1412     // This function does not change the bottom row elements.\r
1413     // \r
1414     inline Matrix4 & setTranslation( const Vector3 & translateVec );\r
1415 \r
1416     // Get the translation component of a 4x4 matrix\r
1417     // \r
1418     inline const Vector3 getTranslation( ) const;\r
1419 \r
1420     // Set column 0 of a 4x4 matrix\r
1421     // \r
1422     inline Matrix4 & setCol0( const Vector4 & col0 );\r
1423 \r
1424     // Set column 1 of a 4x4 matrix\r
1425     // \r
1426     inline Matrix4 & setCol1( const Vector4 & col1 );\r
1427 \r
1428     // Set column 2 of a 4x4 matrix\r
1429     // \r
1430     inline Matrix4 & setCol2( const Vector4 & col2 );\r
1431 \r
1432     // Set column 3 of a 4x4 matrix\r
1433     // \r
1434     inline Matrix4 & setCol3( const Vector4 & col3 );\r
1435 \r
1436     // Get column 0 of a 4x4 matrix\r
1437     // \r
1438     inline const Vector4 getCol0( ) const;\r
1439 \r
1440     // Get column 1 of a 4x4 matrix\r
1441     // \r
1442     inline const Vector4 getCol1( ) const;\r
1443 \r
1444     // Get column 2 of a 4x4 matrix\r
1445     // \r
1446     inline const Vector4 getCol2( ) const;\r
1447 \r
1448     // Get column 3 of a 4x4 matrix\r
1449     // \r
1450     inline const Vector4 getCol3( ) const;\r
1451 \r
1452     // Set the column of a 4x4 matrix referred to by the specified index\r
1453     // \r
1454     inline Matrix4 & setCol( int col, const Vector4 & vec );\r
1455 \r
1456     // Set the row of a 4x4 matrix referred to by the specified index\r
1457     // \r
1458     inline Matrix4 & setRow( int row, const Vector4 & vec );\r
1459 \r
1460     // Get the column of a 4x4 matrix referred to by the specified index\r
1461     // \r
1462     inline const Vector4 getCol( int col ) const;\r
1463 \r
1464     // Get the row of a 4x4 matrix referred to by the specified index\r
1465     // \r
1466     inline const Vector4 getRow( int row ) const;\r
1467 \r
1468     // Subscripting operator to set or get a column\r
1469     // \r
1470     inline Vector4 & operator []( int col );\r
1471 \r
1472     // Subscripting operator to get a column\r
1473     // \r
1474     inline const Vector4 operator []( int col ) const;\r
1475 \r
1476     // Set the element of a 4x4 matrix referred to by column and row indices\r
1477     // \r
1478     inline Matrix4 & setElem( int col, int row, float val );\r
1479 \r
1480     // Get the element of a 4x4 matrix referred to by column and row indices\r
1481     // \r
1482     inline float getElem( int col, int row ) const;\r
1483 \r
1484     // Add two 4x4 matrices\r
1485     // \r
1486     inline const Matrix4 operator +( const Matrix4 & mat ) const;\r
1487 \r
1488     // Subtract a 4x4 matrix from another 4x4 matrix\r
1489     // \r
1490     inline const Matrix4 operator -( const Matrix4 & mat ) const;\r
1491 \r
1492     // Negate all elements of a 4x4 matrix\r
1493     // \r
1494     inline const Matrix4 operator -( ) const;\r
1495 \r
1496     // Multiply a 4x4 matrix by a scalar\r
1497     // \r
1498     inline const Matrix4 operator *( float scalar ) const;\r
1499 \r
1500     // Multiply a 4x4 matrix by a 4-D vector\r
1501     // \r
1502     inline const Vector4 operator *( const Vector4 & vec ) const;\r
1503 \r
1504     // Multiply a 4x4 matrix by a 3-D vector\r
1505     // \r
1506     inline const Vector4 operator *( const Vector3 & vec ) const;\r
1507 \r
1508     // Multiply a 4x4 matrix by a 3-D point\r
1509     // \r
1510     inline const Vector4 operator *( const Point3 & pnt ) const;\r
1511 \r
1512     // Multiply two 4x4 matrices\r
1513     // \r
1514     inline const Matrix4 operator *( const Matrix4 & mat ) const;\r
1515 \r
1516     // Multiply a 4x4 matrix by a 3x4 transformation matrix\r
1517     // \r
1518     inline const Matrix4 operator *( const Transform3 & tfrm ) const;\r
1519 \r
1520     // Perform compound assignment and addition with a 4x4 matrix\r
1521     // \r
1522     inline Matrix4 & operator +=( const Matrix4 & mat );\r
1523 \r
1524     // Perform compound assignment and subtraction by a 4x4 matrix\r
1525     // \r
1526     inline Matrix4 & operator -=( const Matrix4 & mat );\r
1527 \r
1528     // Perform compound assignment and multiplication by a scalar\r
1529     // \r
1530     inline Matrix4 & operator *=( float scalar );\r
1531 \r
1532     // Perform compound assignment and multiplication by a 4x4 matrix\r
1533     // \r
1534     inline Matrix4 & operator *=( const Matrix4 & mat );\r
1535 \r
1536     // Perform compound assignment and multiplication by a 3x4 transformation matrix\r
1537     // \r
1538     inline Matrix4 & operator *=( const Transform3 & tfrm );\r
1539 \r
1540     // Construct an identity 4x4 matrix\r
1541     // \r
1542     static inline const Matrix4 identity( );\r
1543 \r
1544     // Construct a 4x4 matrix to rotate around the x axis\r
1545     // \r
1546     static inline const Matrix4 rotationX( float radians );\r
1547 \r
1548     // Construct a 4x4 matrix to rotate around the y axis\r
1549     // \r
1550     static inline const Matrix4 rotationY( float radians );\r
1551 \r
1552     // Construct a 4x4 matrix to rotate around the z axis\r
1553     // \r
1554     static inline const Matrix4 rotationZ( float radians );\r
1555 \r
1556     // Construct a 4x4 matrix to rotate around the x, y, and z axes\r
1557     // \r
1558     static inline const Matrix4 rotationZYX( const Vector3 & radiansXYZ );\r
1559 \r
1560     // Construct a 4x4 matrix to rotate around a unit-length 3-D vector\r
1561     // \r
1562     static inline const Matrix4 rotation( float radians, const Vector3 & unitVec );\r
1563 \r
1564     // Construct a rotation matrix from a unit-length quaternion\r
1565     // \r
1566     static inline const Matrix4 rotation( const Quat & unitQuat );\r
1567 \r
1568     // Construct a 4x4 matrix to perform scaling\r
1569     // \r
1570     static inline const Matrix4 scale( const Vector3 & scaleVec );\r
1571 \r
1572     // Construct a 4x4 matrix to perform translation\r
1573     // \r
1574     static inline const Matrix4 translation( const Vector3 & translateVec );\r
1575 \r
1576     // Construct viewing matrix based on eye position, position looked at, and up direction\r
1577     // \r
1578     static inline const Matrix4 lookAt( const Point3 & eyePos, const Point3 & lookAtPos, const Vector3 & upVec );\r
1579 \r
1580     // Construct a perspective projection matrix\r
1581     // \r
1582     static inline const Matrix4 perspective( float fovyRadians, float aspect, float zNear, float zFar );\r
1583 \r
1584     // Construct a perspective projection matrix based on frustum\r
1585     // \r
1586     static inline const Matrix4 frustum( float left, float right, float bottom, float top, float zNear, float zFar );\r
1587 \r
1588     // Construct an orthographic projection matrix\r
1589     // \r
1590     static inline const Matrix4 orthographic( float left, float right, float bottom, float top, float zNear, float zFar );\r
1591 \r
1592 };\r
1593 // Multiply a 4x4 matrix by a scalar\r
1594 // \r
1595 inline const Matrix4 operator *( float scalar, const Matrix4 & mat );\r
1596 \r
1597 // Append (post-multiply) a scale transformation to a 4x4 matrix\r
1598 // NOTE: \r
1599 // Faster than creating and multiplying a scale transformation matrix.\r
1600 // \r
1601 inline const Matrix4 appendScale( const Matrix4 & mat, const Vector3 & scaleVec );\r
1602 \r
1603 // Prepend (pre-multiply) a scale transformation to a 4x4 matrix\r
1604 // NOTE: \r
1605 // Faster than creating and multiplying a scale transformation matrix.\r
1606 // \r
1607 inline const Matrix4 prependScale( const Vector3 & scaleVec, const Matrix4 & mat );\r
1608 \r
1609 // Multiply two 4x4 matrices per element\r
1610 // \r
1611 inline const Matrix4 mulPerElem( const Matrix4 & mat0, const Matrix4 & mat1 );\r
1612 \r
1613 // Compute the absolute value of a 4x4 matrix per element\r
1614 // \r
1615 inline const Matrix4 absPerElem( const Matrix4 & mat );\r
1616 \r
1617 // Transpose of a 4x4 matrix\r
1618 // \r
1619 inline const Matrix4 transpose( const Matrix4 & mat );\r
1620 \r
1621 // Compute the inverse of a 4x4 matrix\r
1622 // NOTE: \r
1623 // Result is unpredictable when the determinant of mat is equal to or near 0.\r
1624 // \r
1625 inline const Matrix4 inverse( const Matrix4 & mat );\r
1626 \r
1627 // Compute the inverse of a 4x4 matrix, which is expected to be an affine matrix\r
1628 // NOTE: \r
1629 // This can be used to achieve better performance than a general inverse when the specified 4x4 matrix meets the given restrictions.  The result is unpredictable when the determinant of mat is equal to or near 0.\r
1630 // \r
1631 inline const Matrix4 affineInverse( const Matrix4 & mat );\r
1632 \r
1633 // Compute the inverse of a 4x4 matrix, which is expected to be an affine matrix with an orthogonal upper-left 3x3 submatrix\r
1634 // NOTE: \r
1635 // This can be used to achieve better performance than a general inverse when the specified 4x4 matrix meets the given restrictions.\r
1636 // \r
1637 inline const Matrix4 orthoInverse( const Matrix4 & mat );\r
1638 \r
1639 // Determinant of a 4x4 matrix\r
1640 // \r
1641 inline float determinant( const Matrix4 & mat );\r
1642 \r
1643 // Conditionally select between two 4x4 matrices\r
1644 // \r
1645 inline const Matrix4 select( const Matrix4 & mat0, const Matrix4 & mat1, bool select1 );\r
1646 \r
1647 #ifdef _VECTORMATH_DEBUG\r
1648 \r
1649 // Print a 4x4 matrix\r
1650 // NOTE: \r
1651 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
1652 // \r
1653 inline void print( const Matrix4 & mat );\r
1654 \r
1655 // Print a 4x4 matrix and an associated string identifier\r
1656 // NOTE: \r
1657 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
1658 // \r
1659 inline void print( const Matrix4 & mat, const char * name );\r
1660 \r
1661 #endif\r
1662 \r
1663 // A 3x4 transformation matrix in array-of-structures format\r
1664 //\r
1665 class Transform3\r
1666 {\r
1667     Vector3 mCol0;\r
1668     Vector3 mCol1;\r
1669     Vector3 mCol2;\r
1670     Vector3 mCol3;\r
1671 \r
1672 public:\r
1673     // Default constructor; does no initialization\r
1674     // \r
1675     inline Transform3( ) { };\r
1676 \r
1677     // Copy a 3x4 transformation matrix\r
1678     // \r
1679     inline Transform3( const Transform3 & tfrm );\r
1680 \r
1681     // Construct a 3x4 transformation matrix containing the specified columns\r
1682     // \r
1683     inline Transform3( const Vector3 & col0, const Vector3 & col1, const Vector3 & col2, const Vector3 & col3 );\r
1684 \r
1685     // Construct a 3x4 transformation matrix from a 3x3 matrix and a 3-D vector\r
1686     // \r
1687     inline Transform3( const Matrix3 & tfrm, const Vector3 & translateVec );\r
1688 \r
1689     // Construct a 3x4 transformation matrix from a unit-length quaternion and a 3-D vector\r
1690     // \r
1691     inline Transform3( const Quat & unitQuat, const Vector3 & translateVec );\r
1692 \r
1693     // Set all elements of a 3x4 transformation matrix to the same scalar value\r
1694     // \r
1695     explicit inline Transform3( float scalar );\r
1696 \r
1697     // Assign one 3x4 transformation matrix to another\r
1698     // \r
1699     inline Transform3 & operator =( const Transform3 & tfrm );\r
1700 \r
1701     // Set the upper-left 3x3 submatrix\r
1702     // \r
1703     inline Transform3 & setUpper3x3( const Matrix3 & mat3 );\r
1704 \r
1705     // Get the upper-left 3x3 submatrix of a 3x4 transformation matrix\r
1706     // \r
1707     inline const Matrix3 getUpper3x3( ) const;\r
1708 \r
1709     // Set translation component\r
1710     // \r
1711     inline Transform3 & setTranslation( const Vector3 & translateVec );\r
1712 \r
1713     // Get the translation component of a 3x4 transformation matrix\r
1714     // \r
1715     inline const Vector3 getTranslation( ) const;\r
1716 \r
1717     // Set column 0 of a 3x4 transformation matrix\r
1718     // \r
1719     inline Transform3 & setCol0( const Vector3 & col0 );\r
1720 \r
1721     // Set column 1 of a 3x4 transformation matrix\r
1722     // \r
1723     inline Transform3 & setCol1( const Vector3 & col1 );\r
1724 \r
1725     // Set column 2 of a 3x4 transformation matrix\r
1726     // \r
1727     inline Transform3 & setCol2( const Vector3 & col2 );\r
1728 \r
1729     // Set column 3 of a 3x4 transformation matrix\r
1730     // \r
1731     inline Transform3 & setCol3( const Vector3 & col3 );\r
1732 \r
1733     // Get column 0 of a 3x4 transformation matrix\r
1734     // \r
1735     inline const Vector3 getCol0( ) const;\r
1736 \r
1737     // Get column 1 of a 3x4 transformation matrix\r
1738     // \r
1739     inline const Vector3 getCol1( ) const;\r
1740 \r
1741     // Get column 2 of a 3x4 transformation matrix\r
1742     // \r
1743     inline const Vector3 getCol2( ) const;\r
1744 \r
1745     // Get column 3 of a 3x4 transformation matrix\r
1746     // \r
1747     inline const Vector3 getCol3( ) const;\r
1748 \r
1749     // Set the column of a 3x4 transformation matrix referred to by the specified index\r
1750     // \r
1751     inline Transform3 & setCol( int col, const Vector3 & vec );\r
1752 \r
1753     // Set the row of a 3x4 transformation matrix referred to by the specified index\r
1754     // \r
1755     inline Transform3 & setRow( int row, const Vector4 & vec );\r
1756 \r
1757     // Get the column of a 3x4 transformation matrix referred to by the specified index\r
1758     // \r
1759     inline const Vector3 getCol( int col ) const;\r
1760 \r
1761     // Get the row of a 3x4 transformation matrix referred to by the specified index\r
1762     // \r
1763     inline const Vector4 getRow( int row ) const;\r
1764 \r
1765     // Subscripting operator to set or get a column\r
1766     // \r
1767     inline Vector3 & operator []( int col );\r
1768 \r
1769     // Subscripting operator to get a column\r
1770     // \r
1771     inline const Vector3 operator []( int col ) const;\r
1772 \r
1773     // Set the element of a 3x4 transformation matrix referred to by column and row indices\r
1774     // \r
1775     inline Transform3 & setElem( int col, int row, float val );\r
1776 \r
1777     // Get the element of a 3x4 transformation matrix referred to by column and row indices\r
1778     // \r
1779     inline float getElem( int col, int row ) const;\r
1780 \r
1781     // Multiply a 3x4 transformation matrix by a 3-D vector\r
1782     // \r
1783     inline const Vector3 operator *( const Vector3 & vec ) const;\r
1784 \r
1785     // Multiply a 3x4 transformation matrix by a 3-D point\r
1786     // \r
1787     inline const Point3 operator *( const Point3 & pnt ) const;\r
1788 \r
1789     // Multiply two 3x4 transformation matrices\r
1790     // \r
1791     inline const Transform3 operator *( const Transform3 & tfrm ) const;\r
1792 \r
1793     // Perform compound assignment and multiplication by a 3x4 transformation matrix\r
1794     // \r
1795     inline Transform3 & operator *=( const Transform3 & tfrm );\r
1796 \r
1797     // Construct an identity 3x4 transformation matrix\r
1798     // \r
1799     static inline const Transform3 identity( );\r
1800 \r
1801     // Construct a 3x4 transformation matrix to rotate around the x axis\r
1802     // \r
1803     static inline const Transform3 rotationX( float radians );\r
1804 \r
1805     // Construct a 3x4 transformation matrix to rotate around the y axis\r
1806     // \r
1807     static inline const Transform3 rotationY( float radians );\r
1808 \r
1809     // Construct a 3x4 transformation matrix to rotate around the z axis\r
1810     // \r
1811     static inline const Transform3 rotationZ( float radians );\r
1812 \r
1813     // Construct a 3x4 transformation matrix to rotate around the x, y, and z axes\r
1814     // \r
1815     static inline const Transform3 rotationZYX( const Vector3 & radiansXYZ );\r
1816 \r
1817     // Construct a 3x4 transformation matrix to rotate around a unit-length 3-D vector\r
1818     // \r
1819     static inline const Transform3 rotation( float radians, const Vector3 & unitVec );\r
1820 \r
1821     // Construct a rotation matrix from a unit-length quaternion\r
1822     // \r
1823     static inline const Transform3 rotation( const Quat & unitQuat );\r
1824 \r
1825     // Construct a 3x4 transformation matrix to perform scaling\r
1826     // \r
1827     static inline const Transform3 scale( const Vector3 & scaleVec );\r
1828 \r
1829     // Construct a 3x4 transformation matrix to perform translation\r
1830     // \r
1831     static inline const Transform3 translation( const Vector3 & translateVec );\r
1832 \r
1833 };\r
1834 // Append (post-multiply) a scale transformation to a 3x4 transformation matrix\r
1835 // NOTE: \r
1836 // Faster than creating and multiplying a scale transformation matrix.\r
1837 // \r
1838 inline const Transform3 appendScale( const Transform3 & tfrm, const Vector3 & scaleVec );\r
1839 \r
1840 // Prepend (pre-multiply) a scale transformation to a 3x4 transformation matrix\r
1841 // NOTE: \r
1842 // Faster than creating and multiplying a scale transformation matrix.\r
1843 // \r
1844 inline const Transform3 prependScale( const Vector3 & scaleVec, const Transform3 & tfrm );\r
1845 \r
1846 // Multiply two 3x4 transformation matrices per element\r
1847 // \r
1848 inline const Transform3 mulPerElem( const Transform3 & tfrm0, const Transform3 & tfrm1 );\r
1849 \r
1850 // Compute the absolute value of a 3x4 transformation matrix per element\r
1851 // \r
1852 inline const Transform3 absPerElem( const Transform3 & tfrm );\r
1853 \r
1854 // Inverse of a 3x4 transformation matrix\r
1855 // NOTE: \r
1856 // Result is unpredictable when the determinant of the left 3x3 submatrix is equal to or near 0.\r
1857 // \r
1858 inline const Transform3 inverse( const Transform3 & tfrm );\r
1859 \r
1860 // Compute the inverse of a 3x4 transformation matrix, expected to have an orthogonal upper-left 3x3 submatrix\r
1861 // NOTE: \r
1862 // This can be used to achieve better performance than a general inverse when the specified 3x4 transformation matrix meets the given restrictions.\r
1863 // \r
1864 inline const Transform3 orthoInverse( const Transform3 & tfrm );\r
1865 \r
1866 // Conditionally select between two 3x4 transformation matrices\r
1867 // \r
1868 inline const Transform3 select( const Transform3 & tfrm0, const Transform3 & tfrm1, bool select1 );\r
1869 \r
1870 #ifdef _VECTORMATH_DEBUG\r
1871 \r
1872 // Print a 3x4 transformation matrix\r
1873 // NOTE: \r
1874 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
1875 // \r
1876 inline void print( const Transform3 & tfrm );\r
1877 \r
1878 // Print a 3x4 transformation matrix and an associated string identifier\r
1879 // NOTE: \r
1880 // Function is only defined when _VECTORMATH_DEBUG is defined.\r
1881 // \r
1882 inline void print( const Transform3 & tfrm, const char * name );\r
1883 \r
1884 #endif\r
1885 \r
1886 } // namespace Aos\r
1887 } // namespace Vectormath\r
1888 \r
1889 #include "vec_aos.h"\r
1890 #include "quat_aos.h"\r
1891 #include "mat_aos.h"\r
1892 \r
1893 #endif\r