RetroArch
d3dx9math.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (C) Microsoft Corporation. All Rights Reserved.
4  *
5  * File: d3dx9math.h
6  * Content: D3DX math types and functions
7  */
8 
9 #include "d3dx9.h"
10 
11 #ifndef __D3DX9MATH_H__
12 #define __D3DX9MATH_H__
13 
14 #include <math.h>
15 #if _MSC_VER >= 1200
16 #pragma warning(push)
17 #endif
18 
19 /*
20  *
21  * General purpose utilities
22  *
23  */
24 #define D3DX_PI ((FLOAT) 3.141592654f)
25 #define D3DX_1BYPI ((FLOAT) 0.318309886f)
26 
27 #define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0f))
28 #define D3DXToDegree( radian ) ((radian) * (180.0f / D3DX_PI))
29 
30 /*
31  *
32  * 16 bit floating point numbers
33  */
34 
35 #define D3DX_16F_DIG 3 /* # of decimal digits of precision */
36 #define D3DX_16F_EPSILON 4.8875809e-4f /* smallest such that 1.0 + epsilon != 1.0 */
37 #define D3DX_16F_MANT_DIG 11 /* # of bits in mantissa */
38 #define D3DX_16F_MAX 6.550400e+004 /* max value */
39 #define D3DX_16F_MAX_10_EXP 4 /* max decimal exponent */
40 #define D3DX_16F_MAX_EXP 15 /* max binary exponent */
41 #define D3DX_16F_MIN 6.1035156e-5f /* min positive value */
42 #define D3DX_16F_MIN_10_EXP (-4) /* min decimal exponent */
43 #define D3DX_16F_MIN_EXP (-14) /* min binary exponent */
44 #define D3DX_16F_RADIX 2 /* exponent radix */
45 #define D3DX_16F_ROUNDS 1 /* addition rounding: near */
46 
47 
48 typedef struct D3DXFLOAT16
49 {
50 #ifdef __cplusplus
51 public:
52  D3DXFLOAT16() {};
53  D3DXFLOAT16( FLOAT );
55 
56  /* casting */
57  operator FLOAT ();
58 
59  /* binary operators */
61  BOOL operator != ( CONST D3DXFLOAT16& ) const;
62 
63 protected:
64 #endif /*__cplusplus */
65  WORD value;
67 
68 
69 
70 /*===========================================================================
71  *
72  * Vectors
73  *
74  *===========================================================================
75  */
76 
77 
78 /*
79  * 2D Vector
80  */
81 typedef struct D3DXVECTOR2
82 {
83 #ifdef __cplusplus
84 public:
85  D3DXVECTOR2() {};
86  D3DXVECTOR2( CONST FLOAT * );
89 
90  /* casting */
91  operator FLOAT* ();
92  operator CONST FLOAT* () const;
93 
94  /* assignment operators */
95  D3DXVECTOR2& operator += ( CONST D3DXVECTOR2& );
96  D3DXVECTOR2& operator -= ( CONST D3DXVECTOR2& );
97  D3DXVECTOR2& operator *= ( FLOAT );
98  D3DXVECTOR2& operator /= ( FLOAT );
99 
100  /* unary operators */
101  D3DXVECTOR2 operator + () const;
102  D3DXVECTOR2 operator - () const;
103 
104  /* binary operators */
105  D3DXVECTOR2 operator + ( CONST D3DXVECTOR2& ) const;
106  D3DXVECTOR2 operator - ( CONST D3DXVECTOR2& ) const;
107  D3DXVECTOR2 operator * ( FLOAT ) const;
108  D3DXVECTOR2 operator / ( FLOAT ) const;
109 
110  friend D3DXVECTOR2 operator * ( FLOAT, CONST D3DXVECTOR2& );
111 
113  BOOL operator != ( CONST D3DXVECTOR2& ) const;
114 
115 
116 public:
117 #endif /*__cplusplus */
118  FLOAT x, y;
120 
121 /*
122  * 2D Vector (16 bit)
123  */
124 
125 typedef struct D3DXVECTOR2_16F
126 {
127 #ifdef __cplusplus
128 public:
129  D3DXVECTOR2_16F() {};
133 
134  /* casting */
135  operator D3DXFLOAT16* ();
136  operator CONST D3DXFLOAT16* () const;
137 
138  /* binary operators */
140  BOOL operator != ( CONST D3DXVECTOR2_16F& ) const;
141 
142 public:
143 #endif /*__cplusplus */
145 
147 
148 /*--------------------------
149  * 3D Vector
150  *--------------------------
151  */
152 #ifdef __cplusplus
153 typedef struct D3DXVECTOR3 : public D3DVECTOR
154 {
155 public:
156  D3DXVECTOR3() {};
157  D3DXVECTOR3( CONST FLOAT * );
161 
162  /* casting */
163  operator FLOAT* ();
164  operator CONST FLOAT* () const;
165 
166  /* assignment operators */
167  D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& );
168  D3DXVECTOR3& operator -= ( CONST D3DXVECTOR3& );
169  D3DXVECTOR3& operator *= ( FLOAT );
170  D3DXVECTOR3& operator /= ( FLOAT );
171 
172  /* unary operators */
173  D3DXVECTOR3 operator + () const;
174  D3DXVECTOR3 operator - () const;
175 
176  /* binary operators */
177  D3DXVECTOR3 operator + ( CONST D3DXVECTOR3& ) const;
178  D3DXVECTOR3 operator - ( CONST D3DXVECTOR3& ) const;
179  D3DXVECTOR3 operator * ( FLOAT ) const;
180  D3DXVECTOR3 operator / ( FLOAT ) const;
181 
182  friend D3DXVECTOR3 operator * ( FLOAT, CONST struct D3DXVECTOR3& );
183 
185  BOOL operator != ( CONST D3DXVECTOR3& ) const;
186 
188 
189 #else /* !__cplusplus */
191 #endif /* !__cplusplus */
192 
193 /*--------------------------
194  * 3D Vector (16 bit)
195  *--------------------------
196  */
197 
198 typedef struct D3DXVECTOR3_16F
199 {
200 #ifdef __cplusplus
201 public:
202  D3DXVECTOR3_16F() {};
207 
208  /* casting */
209  operator D3DXFLOAT16* ();
210  operator CONST D3DXFLOAT16* () const;
211 
212  /* binary operators */
214  BOOL operator != ( CONST D3DXVECTOR3_16F& ) const;
215 
216 public:
217 #endif /*__cplusplus */
219 
221 
222 /*--------------------------
223  * 4D Vector
224  *--------------------------
225  */
226 typedef struct D3DXVECTOR4
227 {
228 #ifdef __cplusplus
229 public:
230  D3DXVECTOR4() {};
231  D3DXVECTOR4( CONST FLOAT* );
233  D3DXVECTOR4( CONST D3DVECTOR& xyz, FLOAT w );
235 
236  /* casting */
237  operator FLOAT* ();
238  operator CONST FLOAT* () const;
239 
240  /* assignment operators */
241  D3DXVECTOR4& operator += ( CONST D3DXVECTOR4& );
242  D3DXVECTOR4& operator -= ( CONST D3DXVECTOR4& );
243  D3DXVECTOR4& operator *= ( FLOAT );
244  D3DXVECTOR4& operator /= ( FLOAT );
245 
246  /* unary operators */
247  D3DXVECTOR4 operator + () const;
248  D3DXVECTOR4 operator - () const;
249 
250  /* binary operators */
251  D3DXVECTOR4 operator + ( CONST D3DXVECTOR4& ) const;
252  D3DXVECTOR4 operator - ( CONST D3DXVECTOR4& ) const;
253  D3DXVECTOR4 operator * ( FLOAT ) const;
254  D3DXVECTOR4 operator / ( FLOAT ) const;
255 
256  friend D3DXVECTOR4 operator * ( FLOAT, CONST D3DXVECTOR4& );
257 
259  BOOL operator != ( CONST D3DXVECTOR4& ) const;
260 
261 public:
262 #endif /*__cplusplus */
263  FLOAT x, y, z, w;
265 
266 
267 /*--------------------------
268  * 4D Vector (16 bit)
269  *--------------------------
270  */
271 typedef struct D3DXVECTOR4_16F
272 {
273 #ifdef __cplusplus
274 public:
275  D3DXVECTOR4_16F() {};
280 
281  /* casting */
282  operator D3DXFLOAT16* ();
283  operator CONST D3DXFLOAT16* () const;
284 
285  /* binary operators */
287  BOOL operator != ( CONST D3DXVECTOR4_16F& ) const;
288 
289 public:
290 #endif /* __cplusplus */
292 
294 
295 /*===========================================================================
296  *
297  * Matrices
298  *
299  *===========================================================================
300  */
301 #ifdef __cplusplus
302 typedef struct D3DXMATRIX : public D3DMATRIX
303 {
304 public:
305  D3DXMATRIX() {};
306  D3DXMATRIX( CONST FLOAT * );
313 
314 
315  /* access grants */
316  FLOAT& operator () ( UINT Row, UINT Col );
317  FLOAT operator () ( UINT Row, UINT Col ) const;
318 
319  /* casting operators */
320  operator FLOAT* ();
321  operator CONST FLOAT* () const;
322 
323  /* assignment operators */
324  D3DXMATRIX& operator *= ( CONST D3DXMATRIX& );
325  D3DXMATRIX& operator += ( CONST D3DXMATRIX& );
326  D3DXMATRIX& operator -= ( CONST D3DXMATRIX& );
327  D3DXMATRIX& operator *= ( FLOAT );
328  D3DXMATRIX& operator /= ( FLOAT );
329 
330  /* unary operators */
331  D3DXMATRIX operator + () const;
332  D3DXMATRIX operator - () const;
333 
334  /* binary operators */
335  D3DXMATRIX operator * ( CONST D3DXMATRIX& ) const;
336  D3DXMATRIX operator + ( CONST D3DXMATRIX& ) const;
337  D3DXMATRIX operator - ( CONST D3DXMATRIX& ) const;
338  D3DXMATRIX operator * ( FLOAT ) const;
339  D3DXMATRIX operator / ( FLOAT ) const;
340 
341  friend D3DXMATRIX operator * ( FLOAT, CONST D3DXMATRIX& );
342 
343  BOOL operator == ( CONST D3DXMATRIX& ) const;
344  BOOL operator != ( CONST D3DXMATRIX& ) const;
345 
347 
348 #else /* !__cplusplus */
350 #endif /* !__cplusplus */
351 
352 
353 /*---------------------------------------------------------------------------
354  * Aligned Matrices
355  *
356  * This class helps keep matrices 16-byte aligned as preferred by P4 cpus.
357  * It aligns matrices on the stack and on the heap or in global scope.
358  * It does this using __declspec(align(16)) which works on VC7 and on VC 6
359  * with the processor pack. Unfortunately there is no way to detect the
360  * latter so this is turned on only on VC7. On other compilers this is the
361  * the same as D3DXMATRIX.
362  *
363  * Using this class on a compiler that does not actually do the alignment
364  * can be dangerous since it will not expose bugs that ignore alignment.
365  * E.g if an object of this class in inside a struct or class, and some code
366  * memcopys data in it assuming tight packing. This could break on a compiler
367  * that eventually start aligning the matrix.
368  *---------------------------------------------------------------------------
369  */
370 #ifdef __cplusplus
371 typedef struct _D3DXMATRIXA16 : public D3DXMATRIX
372 {
373  _D3DXMATRIXA16() {}
381 
382  /* new operators */
383  void* operator new ( size_t );
384  void* operator new[] ( size_t );
385 
386  /* delete operators */
387  void operator delete ( void* ); /* These are NOT virtual; Do not */
388  void operator delete[] ( void* ); /* cast to D3DXMATRIX and delete. */
389 
390  /* assignment operators */
391  _D3DXMATRIXA16& operator = ( CONST D3DXMATRIX& );
392 
394 
395 #else /* !__cplusplus */
397 #endif /* !__cplusplus */
398 
399 #if _MSC_VER >= 1300 /* VC7 */
400 #define D3DX_ALIGN16 __declspec(align(16))
401 #else
402 #define D3DX_ALIGN16 /* Earlier compiler may not understand this, do nothing. */
403 #endif
404 
406 
407 /*
408  *
409  * Quaternions
410  */
411 
412 typedef struct D3DXQUATERNION
413 {
414 #ifdef __cplusplus
415 public:
416  D3DXQUATERNION() {}
420 
421  /* casting */
422  operator FLOAT* ();
423  operator CONST FLOAT* () const;
424 
425  /* assignment operators */
426  D3DXQUATERNION& operator += ( CONST D3DXQUATERNION& );
427  D3DXQUATERNION& operator -= ( CONST D3DXQUATERNION& );
428  D3DXQUATERNION& operator *= ( CONST D3DXQUATERNION& );
429  D3DXQUATERNION& operator *= ( FLOAT );
430  D3DXQUATERNION& operator /= ( FLOAT );
431 
432  /* unary operators */
433  D3DXQUATERNION operator + () const;
434  D3DXQUATERNION operator - () const;
435 
436  /* binary operators */
437  D3DXQUATERNION operator + ( CONST D3DXQUATERNION& ) const;
438  D3DXQUATERNION operator - ( CONST D3DXQUATERNION& ) const;
439  D3DXQUATERNION operator * ( CONST D3DXQUATERNION& ) const;
440  D3DXQUATERNION operator * ( FLOAT ) const;
441  D3DXQUATERNION operator / ( FLOAT ) const;
442 
443  friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION& );
444 
446  BOOL operator != ( CONST D3DXQUATERNION& ) const;
447 
448 #endif /* __cplusplus */
449  FLOAT x, y, z, w;
451 
452 /*
453  *
454  * Planes
455  */
456 typedef struct D3DXPLANE
457 {
458 #ifdef __cplusplus
459 public:
460  D3DXPLANE() {}
461  D3DXPLANE( CONST FLOAT* );
463  D3DXPLANE( FLOAT a, FLOAT b, FLOAT c, FLOAT d );
464 
465  /* casting */
466  operator FLOAT* ();
467  operator CONST FLOAT* () const;
468 
469  /* assignment operators */
470  D3DXPLANE& operator *= ( FLOAT );
471  D3DXPLANE& operator /= ( FLOAT );
472 
473  /* unary operators */
474  D3DXPLANE operator + () const;
475  D3DXPLANE operator - () const;
476 
477  /* binary operators */
478  D3DXPLANE operator * ( FLOAT ) const;
479  D3DXPLANE operator / ( FLOAT ) const;
480 
481  friend D3DXPLANE operator * ( FLOAT, CONST D3DXPLANE& );
482 
483  BOOL operator == ( CONST D3DXPLANE& ) const;
484  BOOL operator != ( CONST D3DXPLANE& ) const;
485 
486 #endif /*__cplusplus */
487  FLOAT a, b, c, d;
489 
490 
491 /*
492  *
493  * Colors
494  *
495  */
496 
497 typedef struct D3DXCOLOR
498 {
499 #ifdef __cplusplus
500 public:
501  D3DXCOLOR() {}
502  D3DXCOLOR( DWORD argb );
503  D3DXCOLOR( CONST FLOAT * );
506  D3DXCOLOR( FLOAT r, FLOAT g, FLOAT b, FLOAT a );
507 
508  /* casting */
509  operator DWORD () const;
510 
511  operator FLOAT* ();
512  operator CONST FLOAT* () const;
513 
514  operator D3DCOLORVALUE* ();
515  operator CONST D3DCOLORVALUE* () const;
516 
517  operator D3DCOLORVALUE& ();
518  operator CONST D3DCOLORVALUE& () const;
519 
520  /* assignment operators */
521  D3DXCOLOR& operator += ( CONST D3DXCOLOR& );
522  D3DXCOLOR& operator -= ( CONST D3DXCOLOR& );
523  D3DXCOLOR& operator *= ( FLOAT );
524  D3DXCOLOR& operator /= ( FLOAT );
525 
526  /* unary operators */
527  D3DXCOLOR operator + () const;
528  D3DXCOLOR operator - () const;
529 
530  /* binary operators */
531  D3DXCOLOR operator + ( CONST D3DXCOLOR& ) const;
532  D3DXCOLOR operator - ( CONST D3DXCOLOR& ) const;
533  D3DXCOLOR operator * ( FLOAT ) const;
534  D3DXCOLOR operator / ( FLOAT ) const;
535 
536  friend D3DXCOLOR operator * ( FLOAT, CONST D3DXCOLOR& );
537 
538  BOOL operator == ( CONST D3DXCOLOR& ) const;
539  BOOL operator != ( CONST D3DXCOLOR& ) const;
540 
541 #endif /* __cplusplus */
542  FLOAT r, g, b, a;
544 
545 /*
546  *
547  * D3DX math functions:
548  *
549  * NOTE:
550  * * All these functions can take the same object as in and out parameters.
551  *
552  * * Out parameters are typically also returned as return values, so that
553  * the output of one function may be used as a parameter to another.
554  */
555 
556 /*
557  * Float16
558  */
559 
560 /* non-inline */
561 #ifdef __cplusplus
562 extern "C" {
563 #endif
564 
565 /* Converts an array 32-bit floats to 16-bit floats */
567  ( D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n );
568 
569 /* Converts an array 16-bit floats to 32-bit floats */
571  ( FLOAT *pOut, CONST D3DXFLOAT16 *pIn, UINT n );
572 
573 #ifdef __cplusplus
574 }
575 #endif
576 
577 /*
578  * 2D Vector
579  */
580 
581 /* inline */
582 
584  ( CONST D3DXVECTOR2 *pV );
585 
587  ( CONST D3DXVECTOR2 *pV );
588 
590  ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
591 
592 /* Z component of ((x1,y1,0) cross (x2,y2,0)) */
594  ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
595 
597  ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
598 
600  ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
601 
602 /* Minimize each component. x = min(x1, x2), y = min(y1, y2) */
604  ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
605 
606 /* Maximize each component. x = max(x1, x2), y = max(y1, y2) */
608  ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
609 
611  ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s );
612 
613 /* Linear interpolation. V1 + s(V2-V1) */
615  ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2,
616  FLOAT s );
617 
618 /* non-inline */
619 #ifdef __cplusplus
620 extern "C" {
621 #endif
622 
624  ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV );
625 
626 /* Hermite interpolation between position V1, tangent T1 (when s == 0)
627  * and position V2, tangent T2 (when s == 1). */
629  ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1,
630  CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s );
631 
632 /* CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) */
634  ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1,
635  CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s );
636 
637 /* Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) */
639  ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2,
640  CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g);
641 
642 /* Transform (x, y, 0, 1) by matrix. */
644  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );
645 
646 /* Transform (x, y, 0, 1) by matrix, project result back into w=1. */
648  ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );
649 
650 /* Transform (x, y, 0, 0) by matrix. */
652  ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );
653 
654 /* Transform Array (x, y, 0, 1) by matrix. */
656  ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n);
657 
658 /* Transform Array (x, y, 0, 1) by matrix, project result back into w=1. */
660  ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
661 
662 /* Transform Array (x, y, 0, 0) by matrix. */
664  ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
665 
666 
667 
668 #ifdef __cplusplus
669 }
670 #endif
671 
672 /*
673  * 3D Vector
674  */
675 
676 /* inline */
677 
679  ( CONST D3DXVECTOR3 *pV );
680 
682  ( CONST D3DXVECTOR3 *pV );
683 
685  ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
686 
688  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
689 
691  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
692 
694  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
695 
696 /* Minimize each component. x = min(x1, x2), y = min(y1, y2), ... */
698  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
699 
700 /* Maximize each component. x = max(x1, x2), y = max(y1, y2), ... */
702  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
703 
705  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s);
706 
707 /* Linear interpolation. V1 + s(V2-V1) */
709  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
710  FLOAT s );
711 
712 /* non-inline */
713 #ifdef __cplusplus
714 extern "C" {
715 #endif
716 
718  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV );
719 
720 /* Hermite interpolation between position V1, tangent T1 (when s == 0)
721  * and position V2, tangent T2 (when s == 1). */
723  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1,
724  CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s );
725 
726 /* CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) */
728  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1,
729  CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s );
730 
731 /* Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) */
733  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
734  CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g);
735 
736 /* Transform (x, y, z, 1) by matrix. */
738  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );
739 
740 /* Transform (x, y, z, 1) by matrix, project result back into w=1. */
742  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );
743 
744 /* Transform (x, y, z, 0) by matrix. If you transforming a normal by a
745  * non-affine matrix, the matrix you pass to this function should be the
746  * transpose of the inverse of the matrix you would use to transform a coord.
747  */
749  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );
750 
751 
752 /* Transform Array (x, y, z, 1) by matrix. */
754  ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
755 
756 /* Transform Array (x, y, z, 1) by matrix, project result back into w=1. */
758  ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
759 
760 /* Transform (x, y, z, 0) by matrix. If you transforming a normal by a
761  * non-affine matrix, the matrix you pass to this function should be the
762  * transpose of the inverse of the matrix you would use to transform a coord.
763  */
765  ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
766 
767 /* Project vector from object space into screen space */
769  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport,
770  CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld);
771 
772 /* Project vector from screen space into object space */
774  ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport,
775  CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld);
776 
777 /* Project vector Array from object space into screen space */
779  ( D3DXVECTOR3 *pOut, UINT OutStride,CONST D3DXVECTOR3 *pV, UINT VStride,CONST D3DVIEWPORT9 *pViewport,
780  CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n);
781 
782 /* Project vector Array from screen space into object space */
784  ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DVIEWPORT9 *pViewport,
785  CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n);
786 
787 
788 #ifdef __cplusplus
789 }
790 #endif
791 
792 /*
793  * 4D Vector
794  */
795 
796 /* inline */
797 
799  ( CONST D3DXVECTOR4 *pV );
800 
802  ( CONST D3DXVECTOR4 *pV );
803 
805  ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 );
806 
808  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2);
809 
811  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2);
812 
813 /* Minimize each component. x = min(x1, x2), y = min(y1, y2), ... */
815  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2);
816 
817 /* Maximize each component. x = max(x1, x2), y = max(y1, y2), ... */
819  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2);
820 
822  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s);
823 
824 /* Linear interpolation. V1 + s(V2-V1) */
826  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
827  FLOAT s );
828 
829 /* non-inline */
830 #ifdef __cplusplus
831 extern "C" {
832 #endif
833 
834 /* Cross-product in 4 dimensions. */
836  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
837  CONST D3DXVECTOR4 *pV3);
838 
840  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV );
841 
842 /* Hermite interpolation between position V1, tangent T1 (when s == 0)
843  * and position V2, tangent T2 (when s == 1). */
845  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1,
846  CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s );
847 
848 /* CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) */
850  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1,
851  CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s );
852 
853 /* Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) */
855  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
856  CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g);
857 
858 /* Transform vector by matrix. */
860  ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM );
861 
862 /* Transform vector array by matrix. */
864  ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
865 
866 #ifdef __cplusplus
867 }
868 #endif
869 
870 
871 /*
872  * 4D Matrix
873  */
874 
875 /* inline */
876 
878  ( D3DXMATRIX *pOut );
879 
881  ( CONST D3DXMATRIX *pM );
882 
883 
884 /* non-inline */
885 #ifdef __cplusplus
886 extern "C" {
887 #endif
888 
890  ( CONST D3DXMATRIX *pM );
891 
893  ( D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation,
894  D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM );
895 
897  ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM );
898 
899 /* Matrix multiplication. The result represents the transformation M2
900  * followed by the transformation M1. (Out = M1 * M2) */
902  ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 );
903 
904 /* Matrix multiplication, followed by a transpose. (Out = T(M1 * M2)) */
906  ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 );
907 
908 /* Calculate inverse of matrix. Inversion my fail, in which case NULL will
909  * be returned. The determinant of pM is also returned it pfDeterminant
910  * is non-NULL. */
912  ( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM );
913 
914 /* Build a matrix which scales by (sx, sy, sz) */
916  ( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz );
917 
918 /* Build a matrix which translates by (x, y, z) */
920  ( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z );
921 
922 /* Build a matrix which rotates around the X axis */
924  ( D3DXMATRIX *pOut, FLOAT Angle );
925 
926 /* Build a matrix which rotates around the Y axis */
928  ( D3DXMATRIX *pOut, FLOAT Angle );
929 
930 /* Build a matrix which rotates around the Z axis */
932  ( D3DXMATRIX *pOut, FLOAT Angle );
933 
934 /* Build a matrix which rotates around an arbitrary axis */
936  ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle );
937 
938 /* Build a matrix from a quaternion */
940  ( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ);
941 
942 /* Yaw around the Y axis, a pitch around the X axis,
943  * and a roll around the Z axis. */
945  ( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll );
946 
947 /* Build transformation matrix. NULL arguments are treated as identity.
948  * Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt */
950  ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter,
951  CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling,
952  CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation,
953  CONST D3DXVECTOR3 *pTranslation);
954 
955 /* Build 2D transformation matrix in XY plane. NULL arguments are treated as identity.
956  * Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt */
958  ( D3DXMATRIX *pOut, CONST D3DXVECTOR2* pScalingCenter,
959  FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling,
960  CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation,
961  CONST D3DXVECTOR2* pTranslation);
962 
963 /* Build affine transformation matrix. NULL arguments are treated as identity.
964  * Mout = Ms * Mrc-1 * Mr * Mrc * Mt */
966  ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter,
967  CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation);
968 
969 /* Build 2D affine transformation matrix in XY plane. NULL arguments are treated as identity.
970  * Mout = Ms * Mrc-1 * Mr * Mrc * Mt */
972  ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter,
973  FLOAT Rotation, CONST D3DXVECTOR2* pTranslation);
974 
975 /* Build a lookat matrix. (right-handed) */
977  ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
978  CONST D3DXVECTOR3 *pUp );
979 
980 /* Build a lookat matrix. (left-handed) */
982  ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
983  CONST D3DXVECTOR3 *pUp );
984 
985 /* Build a perspective projection matrix. (right-handed) */
987  ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );
988 
989 /* Build a perspective projection matrix. (left-handed) */
991  ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );
992 
993 /* Build a perspective projection matrix. (right-handed) */
995  ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf );
996 
997 /* Build a perspective projection matrix. (left-handed) */
999  ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf );
1000 
1001 /* Build a perspective projection matrix. (right-handed) */
1003  ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
1004  FLOAT zf );
1005 
1006 /* Build a perspective projection matrix. (left-handed) */
1008  ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
1009  FLOAT zf );
1010 
1011 /* Build an ortho projection matrix. (right-handed) */
1013  ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );
1014 
1015 /* Build an ortho projection matrix. (left-handed) */
1017  ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );
1018 
1019 /* Build an ortho projection matrix. (right-handed) */
1021  ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
1022  FLOAT zf );
1023 
1024 /* Build an ortho projection matrix. (left-handed) */
1026  ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
1027  FLOAT zf );
1028 
1029 /* Build a matrix which flattens geometry into a plane, as if casting
1030  * a shadow from a light. */
1032  ( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight,
1033  CONST D3DXPLANE *pPlane );
1034 
1035 /* Build a matrix which reflects the coordinate system about a plane */
1037  ( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane );
1038 
1039 #ifdef __cplusplus
1040 }
1041 #endif
1042 
1043 /*
1044  * Quaternion
1045  */
1046 
1047 /* inline */
1048 
1050  ( CONST D3DXQUATERNION *pQ );
1051 
1052 /* Length squared, or "norm" */
1054  ( CONST D3DXQUATERNION *pQ );
1055 
1057  ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 );
1058 
1059 /* (0, 0, 0, 1) */
1061  ( D3DXQUATERNION *pOut );
1062 
1064  ( CONST D3DXQUATERNION *pQ );
1065 
1066 /* (-x, -y, -z, w) */
1068  ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
1069 
1070 /* non-inline */
1071 #ifdef __cplusplus
1072 extern "C" {
1073 #endif
1074 
1075 /* Compute a quaternin's axis and angle of rotation. Expects unit quaternions. */
1076 void WINAPI D3DXQuaternionToAxisAngle
1077  ( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle );
1078 
1079 /* Build a quaternion from a rotation matrix. */
1081  ( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM);
1082 
1083 /* Rotation about arbitrary axis. */
1085  ( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle );
1086 
1087 /* Yaw around the Y axis, a pitch around the X axis,
1088  * and a roll around the Z axis. */
1090  ( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll );
1091 
1092 /* Quaternion multiplication. The result represents the rotation Q2
1093  * followed by the rotation Q1. (Out = Q2 * Q1) */
1095  ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
1096  CONST D3DXQUATERNION *pQ2 );
1097 
1099  ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
1100 
1101 /* Conjugate and re-norm */
1103  ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
1104 
1105 /* Expects unit quaternions.
1106  * if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v) */
1108  ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
1109 
1110 /* Expects pure quaternions. (w == 0) w is ignored in calculation.
1111  * if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v) */
1113  ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
1114 
1115 /* Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1).
1116  * Expects unit quaternions. */
1118  ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
1119  CONST D3DXQUATERNION *pQ2, FLOAT t );
1120 
1121 /* Spherical quadrangle interpolation.
1122  * Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t)) */
1124  ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
1126  CONST D3DXQUATERNION *pC, FLOAT t );
1127 
1128 /* Setup control points for spherical quadrangle interpolation
1129  * from Q1 to Q2. The control points are chosen in such a way
1130  * to ensure the continuity of tangents with adjacent segments. */
1131 void WINAPI D3DXQuaternionSquadSetup
1132  ( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut,
1135 
1136 /* Barycentric interpolation.
1137  * Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g)) */
1139  ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
1141  FLOAT f, FLOAT g );
1142 
1143 #ifdef __cplusplus
1144 }
1145 #endif
1146 
1147 
1148 /*
1149  * Plane
1150 */
1151 
1152 /* inline */
1153 
1154 /* ax + by + cz + dw */
1156  ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV);
1157 
1158 /* ax + by + cz + d */
1160  ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV);
1161 
1162 /* ax + by + cz */
1164  ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV);
1165 
1167  (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s);
1168 
1169 /* non-inline */
1170 #ifdef __cplusplus
1171 extern "C" {
1172 #endif
1173 
1174 /* Normalize plane (so that |a,b,c| == 1) */
1176  ( D3DXPLANE *pOut, CONST D3DXPLANE *pP);
1177 
1178 /* Find the intersection between a plane and a line. If the line is
1179  * parallel to the plane, NULL is returned. */
1181  ( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1,
1182  CONST D3DXVECTOR3 *pV2);
1183 
1184 /* Construct a plane from a point and a normal */
1186  ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal);
1187 
1188 /* Construct a plane from 3 points */
1190  ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
1191  CONST D3DXVECTOR3 *pV3);
1192 
1193 /* Transform a plane by a matrix. The vector (a,b,c) must be normal.
1194  * M should be the inverse transpose of the transformation desired. */
1196  ( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM );
1197 
1198 /* Transform an array of planes by a matrix. The vectors (a,b,c) must be normal.
1199  * M should be the inverse transpose of the transformation desired. */
1201  ( D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n );
1202 
1203 #ifdef __cplusplus
1204 }
1205 #endif
1206 
1207 /*
1208  * Color
1209  */
1210 
1211 /* inline */
1212 
1213 /* (1-r, 1-g, 1-b, a) */
1215  (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC);
1216 
1218  (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2);
1219 
1221  (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2);
1222 
1224  (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s);
1225 
1226 /* (r1*r2, g1*g2, b1*b2, a1*a2) */
1228  (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2);
1229 
1230 /* Linear interpolation of r,g,b, and a. C1 + s(C2-C1) */
1232  (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s);
1233 
1234 /* non-inline */
1235 #ifdef __cplusplus
1236 extern "C" {
1237 #endif
1238 
1239 /* Interpolate r,g,b between desaturated color and color.
1240  * DesaturatedColor + s(Color - DesaturatedColor) */
1242  (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s);
1243 
1244 /* Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey) */
1246  (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c);
1247 
1248 #ifdef __cplusplus
1249 }
1250 #endif
1251 
1252 /*
1253  * Misc
1254 */
1255 
1256 #ifdef __cplusplus
1257 extern "C" {
1258 #endif
1259 
1260 /* Calculate Fresnel term given the cosine of theta (likely obtained by
1261  * taking the dot of two normals), and the refraction index of the material. */
1262 FLOAT WINAPI D3DXFresnelTerm
1263  (FLOAT CosTheta, FLOAT RefractionIndex);
1264 
1265 #ifdef __cplusplus
1266 }
1267 #endif
1268 
1269 /*
1270  *
1271  * Matrix Stack
1272  */
1273 
1276 
1277 /* {C7885BA7-F990-4fe7-922D-8515E477DD85} */
1278 DEFINE_GUID(IID_ID3DXMatrixStack,
1279 0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85);
1280 
1281 
1282 #undef INTERFACE
1283 #define INTERFACE ID3DXMatrixStack
1284 
1286 {
1287  /* IUnknown methods */
1288  STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
1289  STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1290  STDMETHOD_(ULONG,Release)(THIS) PURE;
1291 
1292  /* ID3DXMatrixStack methods */
1293 
1294  /* Pops the top of the stack, returns the current top
1295  * *after* popping the top. */
1296  STDMETHOD(Pop)(THIS) PURE;
1297 
1298  /* Pushes the stack by one, duplicating the current matrix. */
1299  STDMETHOD(Push)(THIS) PURE;
1300 
1301  /* Loads identity in the current matrix. */
1302  STDMETHOD(LoadIdentity)(THIS) PURE;
1303 
1304  /* Loads the given matrix into the current matrix */
1305  STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
1306 
1307  /* Right-Multiplies the given matrix to the current matrix.
1308  * (transformation is about the current world origin) */
1309  STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
1310 
1311  /* Left-Multiplies the given matrix to the current matrix
1312  * (transformation is about the local origin of the object) */
1313  STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE;
1314 
1315  /* Right multiply the current matrix with the computed rotation
1316  * matrix, counterclockwise about the given axis with the given angle.
1317  * (rotation is about the current world origin) */
1318  STDMETHOD(RotateAxis)
1319  (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
1320 
1321  /* Left multiply the current matrix with the computed rotation
1322  * matrix, counterclockwise about the given axis with the given angle.
1323  * (rotation is about the local origin of the object) */
1324  STDMETHOD(RotateAxisLocal)
1325  (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
1326 
1327  /* Right multiply the current matrix with the computed rotation
1328  * matrix. All angles are counterclockwise. (rotation is about the
1329  * current world origin)
1330 
1331  * The rotation is composed of a yaw around the Y axis, a pitch around
1332  * the X axis, and a roll around the Z axis.
1333  */
1334  STDMETHOD(RotateYawPitchRoll)
1335  (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
1336 
1337  /* Left multiply the current matrix with the computed rotation
1338  * matrix. All angles are counterclockwise. (rotation is about the
1339  * local origin of the object)
1340 
1341  * The rotation is composed of a yaw around the Y axis, a pitch around
1342  * the X axis, and a roll around the Z axis.
1343  */
1344  STDMETHOD(RotateYawPitchRollLocal)
1345  (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
1346 
1347  /* Right multiply the current matrix with the computed scale
1348  * matrix. (transformation is about the current world origin) */
1349  STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
1350 
1351  /* Left multiply the current matrix with the computed scale
1352  * matrix. (transformation is about the local origin of the object) */
1353  STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
1354 
1355  /* Right multiply the current matrix with the computed translation
1356  * matrix. (transformation is about the current world origin) */
1357  STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE;
1358 
1359  /* Left multiply the current matrix with the computed translation
1360  * matrix. (transformation is about the local origin of the object) */
1361  STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
1362 
1363  /* Obtain the current matrix at the top of the stack */
1364  STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE;
1365 };
1366 
1367 #ifdef __cplusplus
1368 extern "C" {
1369 #endif
1370 
1371 HRESULT WINAPI
1373  DWORD Flags,
1374  LPD3DXMATRIXSTACK* ppStack);
1375 
1376 #ifdef __cplusplus
1377 }
1378 #endif
1379 
1380 /*
1381  *
1382  * Spherical Harmonic Runtime Routines
1383  *
1384  * NOTE:
1385  * * Most of these functions can take the same object as in and out parameters.
1386  * The exceptions are the rotation functions.
1387  *
1388  * * Out parameters are typically also returned as return values, so that
1389  * the output of one function may be used as a parameter to another.
1390  */
1391 
1392 /* non-inline */
1393 #ifdef __cplusplus
1394 extern "C" {
1395 #endif
1396 
1397 /*
1398  *
1399  * Basic Spherical Harmonic math routines
1400  */
1401 
1402 #define D3DXSH_MINORDER 2
1403 #define D3DXSH_MAXORDER 6
1404 
1405 FLOAT* WINAPI D3DXSHEvalDirection
1406  ( FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir );
1407 
1408 FLOAT* WINAPI D3DXSHRotate
1409  ( FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn );
1410 
1411 FLOAT* WINAPI D3DXSHRotateZ
1412  ( FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn );
1413 
1414 FLOAT* WINAPI D3DXSHAdd
1415  ( FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB );
1416 
1417 FLOAT* WINAPI D3DXSHScale
1418  ( FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale );
1419 
1420 FLOAT WINAPI D3DXSHDot
1421  ( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB );
1422 
1423 FLOAT* WINAPI D3DXSHMultiply2( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
1424 FLOAT* WINAPI D3DXSHMultiply3( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
1425 FLOAT* WINAPI D3DXSHMultiply4( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
1426 FLOAT* WINAPI D3DXSHMultiply5( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
1427 FLOAT* WINAPI D3DXSHMultiply6( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
1428 
1429 /*
1430  *
1431  * Basic Spherical Harmonic lighting routines
1432  */
1433 
1435  ( UINT Order, CONST D3DXVECTOR3 *pDir,
1436  FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
1437  FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut );
1438 
1440  ( UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius,
1441  FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
1442  FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut );
1443 
1445  ( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius,
1446  FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
1447  FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut );
1448 
1450  ( UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom,
1451  FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut );
1452 
1453 /*
1454  *
1455  * Basic Spherical Harmonic projection routines
1456  */
1457 
1458 /*
1459  *
1460  * D3DXSHProjectCubeMap:
1461  * --------------------
1462  * Projects a function represented on a cube map into spherical harmonics.
1463  *
1464  * Parameters:
1465  * Order
1466  * Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
1467  * pCubeMap
1468  * CubeMap that is going to be projected into spherical harmonics
1469  * pROut
1470  * Output SH vector for Red.
1471  * pGOut
1472  * Output SH vector for Green
1473  * pBOut
1474  * Output SH vector for Blue
1475  */
1476 
1478  ( UINT uOrder, LPDIRECT3DCUBETEXTURE9 pCubeMap,
1479  FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut );
1480 
1481 
1482 #ifdef __cplusplus
1483 }
1484 #endif
1485 
1486 #if 0
1487 #include "d3dx9math.inl"
1488 #endif
1489 
1490 #if _MSC_VER >= 1200
1491 #pragma warning(pop)
1492 #endif
1493 
1494 #endif /* __D3DX9MATH_H__ */
D3DXPLANE *WINAPI D3DXPlaneTransformArray(D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n)
FLOAT *WINAPI D3DXSHAdd(FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB)
D3DXVECTOR4 *WINAPI D3DXVec2Transform(D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM)
HRESULT WINAPI D3DXSHProjectCubeMap(UINT uOrder, LPDIRECT3DCUBETEXTURE9 pCubeMap, FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut)
FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pV)
Definition: d3dx8math.inl:1078
HRESULT WINAPI D3DXSHEvalConeLight(UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius, FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut)
D3DXVECTOR2 *WINAPI D3DXVec2TransformCoord(D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM)
D3DXQUATERNION * D3DXQuaternionIdentity(D3DXQUATERNION *pOut)
Definition: d3dx8math.inl:1563
HRESULT WINAPI D3DXCreateMatrixStack(DWORD Flags, LPD3DXMATRIXSTACK *ppStack)
D3DXVECTOR2 * D3DXVec2Minimize(D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2)
Definition: d3dx8math.inl:1152
D3DXVECTOR2 * D3DXVec2Lerp(D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, FLOAT s)
Definition: d3dx8math.inl:1191
D3DXQUATERNION *WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2)
D3DXPLANE *WINAPI D3DXPlaneFromPointNormal(D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal)
FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2)
Definition: d3dx8math.inl:1104
struct D3DXPLANE D3DXPLANE
struct D3DXFLOAT16 * LPD3DXFLOAT16
WORD value
Definition: d3dx9math.h:65
float _44
Definition: d3d8types.h:83
FLOAT x
Definition: d3dx8math.h:362
Definition: d3d8types.h:77
FLOAT *WINAPI D3DXSHRotate(FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn)
FLOAT D3DXVec4Length(CONST D3DXVECTOR4 *pV)
Definition: d3dx8math.inl:1355
struct D3DXVECTOR2 D3DXVECTOR2
D3DXMATRIX *WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pOut, FLOAT Angle)
D3DXVECTOR4 *WINAPI D3DXVec4TransformArray(D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n)
BOOL D3DXQuaternionIsIdentity(CONST D3DXQUATERNION *pQ)
Definition: d3dx8math.inl:1576
DEFINE_GUID(IID_ID3DXMatrixStack, 0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85)
float _23
Definition: d3d8types.h:81
D3DXFLOAT16 x
Definition: d3dx9math.h:291
Definition: d3d8types.h:48
struct D3DXQUATERNION * LPD3DXQUATERNION
float _21
Definition: d3d8types.h:81
D3DXMATRIX *WINAPI D3DXMatrixAffineTransformation2D(D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2 *pRotationCenter, FLOAT Rotation, CONST D3DXVECTOR2 *pTranslation)
FLOAT r
Definition: d3dx8math.h:446
Definition: glslang_tab.cpp:129
D3DXVECTOR2 * D3DXVec2Add(D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2)
Definition: d3dx8math.inl:1126
D3DXFLOAT16 z
Definition: d3dx9math.h:291
D3DXMATRIX *WINAPI D3DXMatrixLookAtLH(D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, CONST D3DXVECTOR3 *pUp)
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveLH(D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveOffCenterRH(D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
D3DXVECTOR4 *WINAPI D3DXVec4Normalize(D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV)
struct D3DXVECTOR4_16F D3DXVECTOR4_16F
struct D3DXVECTOR4 D3DXVECTOR4
D3DXMATRIX *WINAPI D3DXMatrixRotationY(D3DXMATRIX *pOut, FLOAT Angle)
D3DXFLOAT16 w
Definition: d3dx9math.h:291
D3DXVECTOR2 *WINAPI D3DXVec2CatmullRom(D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s)
DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown)
Definition: d3dx9math.h:1285
struct _D3DVECTOR D3DXVECTOR3
Definition: d3dx9math.h:190
FLOAT *WINAPI D3DXSHMultiply2(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG)
D3DXCOLOR * D3DXColorNegative(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC)
Definition: d3dx8math.inl:1646
D3DXVECTOR4 * D3DXVec4Subtract(D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2)
Definition: d3dx8math.inl:1407
D3DXVECTOR3 *WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2)
D3DXVECTOR4 *WINAPI D3DXVec4Transform(D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM)
FLOAT D3DXQuaternionLength(CONST D3DXQUATERNION *pQ)
Definition: d3dx8math.inl:1525
float _12
Definition: d3d8types.h:80
GLdouble GLdouble GLdouble r
Definition: glext.h:6406
D3DXVECTOR4 * D3DXVec4Add(D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2)
Definition: d3dx8math.inl:1392
D3DXVECTOR3 *WINAPI D3DXVec3TransformNormal(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM)
D3DXCOLOR * D3DXColorLerp(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s)
Definition: d3dx8math.inl:1721
FLOAT y
Definition: d3dx8math.h:362
GLdouble GLdouble t
Definition: glext.h:6398
struct D3DXVECTOR4_16F * LPD3DXVECTOR4_16F
FLOAT D3DXQuaternionDot(CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2)
Definition: d3dx8math.inl:1551
GLfloat f
Definition: glext.h:8207
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf)
FLOAT WINAPI D3DXMatrixDeterminant(CONST D3DXMATRIX *pM)
FLOAT *WINAPI D3DXFloat16To32Array(FLOAT *pOut, CONST D3DXFLOAT16 *pIn, UINT n)
D3DXVECTOR4 * D3DXVec4Lerp(D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, FLOAT s)
Definition: d3dx8math.inl:1467
D3DXVECTOR3 *WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM)
D3DXMATRIX *WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation)
D3DXVECTOR3 * D3DXVec3Lerp(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, FLOAT s)
Definition: d3dx8math.inl:1335
float _31
Definition: d3d8types.h:82
D3DXVECTOR3 *WINAPI D3DXVec3Project(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport, CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld)
D3DXPLANE *WINAPI D3DXPlaneNormalize(D3DXPLANE *pOut, CONST D3DXPLANE *pP)
GLdouble s
Definition: glext.h:6390
D3DXVECTOR4 *WINAPI D3DXVec4BaryCentric(D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g)
struct D3DXVECTOR2 * LPD3DXVECTOR2
D3DXMATRIX *WINAPI D3DXMatrixRotationAxis(D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle)
GLdouble GLdouble z
Definition: glext.h:6514
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveRH(D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
float _11
Definition: d3d8types.h:80
D3DXVECTOR2 *WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV)
float _32
Definition: d3d8types.h:82
D3DXQUATERNION *WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2, FLOAT t)
typedef HRESULT(WINAPI *PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(_In_ const D3D12_ROOT_SIGNATURE_DESC *pRootSignature
D3DXFLOAT16 x
Definition: d3dx9math.h:144
FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pV)
Definition: d3dx8math.inl:1093
D3DXVECTOR2 *WINAPI D3DXVec2TransformNormalArray(D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n)
FLOAT y
Definition: d3dx8math.h:162
struct D3DXQUATERNION D3DXQUATERNION
D3DXFLOAT16 x
Definition: d3dx9math.h:218
interface ID3DXMatrixStack * LPD3DXMATRIXSTACK
Definition: d3dx8math.h:1094
D3DXFLOAT16 *WINAPI D3DXFloat32To16Array(D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n)
float _42
Definition: d3d8types.h:83
D3DXMATRIX *WINAPI D3DXMatrixTranspose(D3DXMATRIX *pOut, CONST D3DXMATRIX *pM)
FLOAT *WINAPI D3DXSHScale(FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale)
const GLubyte * c
Definition: glext.h:9812
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
D3DXVECTOR2 *WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g)
D3DXVECTOR2 * D3DXVec2Scale(D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s)
Definition: d3dx8math.inl:1178
D3DXVECTOR3 * D3DXVec3Minimize(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2)
Definition: d3dx8math.inl:1293
float _43
Definition: d3d8types.h:83
D3DXVECTOR3 *WINAPI D3DXVec3BaryCentric(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g)
float _13
Definition: d3d8types.h:80
struct IDirect3DCubeTexture9 * LPDIRECT3DCUBETEXTURE9
Definition: d3d9.h:1197
FLOAT D3DXVec3Dot(CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2)
Definition: d3dx8math.inl:1236
D3DXFLOAT16 z
Definition: d3dx9math.h:218
struct D3DXFLOAT16 D3DXFLOAT16
D3DXQUATERNION *WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ)
D3DXVECTOR3 *WINAPI D3DXVec3TransformCoordArray(D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n)
D3DXQUATERNION *WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB, CONST D3DXQUATERNION *pC, FLOAT t)
struct _D3DMATRIX * LPD3DXMATRIX
Definition: d3dx9math.h:349
D3DXVECTOR3 *WINAPI D3DXVec3UnprojectArray(D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DVIEWPORT9 *pViewport, CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n)
struct D3DXPLANE * LPD3DXPLANE
D3DXMATRIX *WINAPI D3DXMatrixTransformation(D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter, CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling, CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation)
Definition: d3dx8math.h:127
Definition: d3dx9math.h:125
FLOAT z
Definition: d3dx8math.h:162
interface ID3DXMatrixStack ID3DXMatrixStack
Definition: d3dx8math.h:1093
FLOAT D3DXVec4Dot(CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2)
Definition: d3dx8math.inl:1381
FLOAT b
Definition: d3dx8math.h:392
FLOAT D3DXPlaneDotNormal(CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV)
Definition: d3dx8math.inl:1630
D3DXQUATERNION *WINAPI D3DXQuaternionLn(D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ)
bool l
Definition: connect_wiiupro.c:37
D3DXPLANE * D3DXPlaneScale(D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s)
Definition: d3dx9math.inl:1783
D3DXCOLOR *WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s)
D3DX_ALIGN16 _D3DXMATRIXA16 * LPD3DXMATRIXA16
Definition: d3dx9math.h:405
HRESULT WINAPI D3DXSHEvalDirectionalLight(UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut)
D3DXVECTOR2 * D3DXVec2Maximize(D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2)
Definition: d3dx8math.inl:1165
D3DXMATRIX *WINAPI D3DXMatrixLookAtRH(D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, CONST D3DXVECTOR3 *pUp)
D3DXMATRIX *WINAPI D3DXMatrixOrthoOffCenterLH(D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
D3DXVECTOR2 *WINAPI D3DXVec2TransformNormal(D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM)
FLOAT d
Definition: d3dx8math.h:392
D3DXVECTOR3 * D3DXVec3Add(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2)
Definition: d3dx8math.inl:1265
D3DXVECTOR4 * D3DXVec4Scale(D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s)
Definition: d3dx8math.inl:1452
FLOAT x
Definition: d3dx8math.h:162
float _33
Definition: d3d8types.h:82
FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2)
Definition: d3dx8math.inl:1115
D3DXVECTOR3 *WINAPI D3DXVec3Hermite(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1, CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s)
FLOAT z
Definition: d3dx8math.h:362
FLOAT D3DXPlaneDotCoord(CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV)
Definition: d3dx8math.inl:1619
D3DXVECTOR3 *WINAPI D3DXVec3TransformNormalArray(D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n)
struct D3DXVECTOR2_16F D3DXVECTOR2_16F
D3DXMATRIX *WINAPI D3DXMatrixMultiplyTranspose(D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2)
struct _D3DMATRIX D3DXMATRIX
Definition: d3dx9math.h:349
D3DXQUATERNION * D3DXQuaternionConjugate(D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ)
Definition: d3dx8math.inl:1588
GLint GLint GLint GLint GLint GLint y
Definition: glext.h:6295
D3DXMATRIX *WINAPI D3DXMatrixShadow(D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight, CONST D3DXPLANE *pPlane)
FLOAT D3DXPlaneDot(CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV)
Definition: d3dx8math.inl:1608
D3DXMATRIX *WINAPI D3DXMatrixTransformation2D(D3DXMATRIX *pOut, CONST D3DXVECTOR2 *pScalingCenter, FLOAT ScalingRotation, CONST D3DXVECTOR2 *pScaling, CONST D3DXVECTOR2 *pRotationCenter, FLOAT Rotation, CONST D3DXVECTOR2 *pTranslation)
D3DXVECTOR4 *WINAPI D3DXVec2TransformArray(D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n)
FLOAT WINAPI D3DXSHDot(UINT Order, CONST FLOAT *pA, CONST FLOAT *pB)
D3DXMATRIX _D3DXMATRIXA16
Definition: d3dx9math.h:396
GLint GLint GLint GLint GLint x
Definition: glext.h:6295
D3DXMATRIX *WINAPI D3DXMatrixRotationQuaternion(D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ)
D3DXVECTOR2 *WINAPI D3DXVec2Hermite(D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1, CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s)
FLOAT D3DXVec3Length(CONST D3DXVECTOR3 *pV)
Definition: d3dx8math.inl:1210
D3DXVECTOR4 * D3DXVec4Minimize(D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2)
Definition: d3dx8math.inl:1422
FLOAT w
Definition: d3dx8math.h:362
D3DXCOLOR * D3DXColorAdd(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2)
Definition: d3dx8math.inl:1661
D3DXMATRIX *WINAPI D3DXMatrixOrthoRH(D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
D3DXVECTOR4 * D3DXVec4Maximize(D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2)
Definition: d3dx8math.inl:1437
struct D3DXVECTOR3_16F D3DXVECTOR3_16F
BOOL D3DXMatrixIsIdentity(CONST D3DXMATRIX *pM)
Definition: d3dx8math.inl:1506
float _34
Definition: d3d8types.h:82
D3DXVECTOR4 *WINAPI D3DXVec3TransformArray(D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n)
FLOAT *WINAPI D3DXSHMultiply5(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG)
float _14
Definition: d3d8types.h:80
HRESULT WINAPI D3DXSHEvalHemisphereLight(UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom, FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut)
FLOAT WINAPI D3DXFresnelTerm(FLOAT CosTheta, FLOAT RefractionIndex)
HRESULT WINAPI D3DXMatrixDecompose(D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation, D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM)
FLOAT a
Definition: d3dx8math.h:446
Definition: d3dx8math.h:371
D3DXQUATERNION *WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ)
Definition: d3dx9math.h:271
void WINAPI D3DXQuaternionSquadSetup(D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut, CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3)
float _22
Definition: d3d8types.h:81
D3DXMATRIX *WINAPI D3DXMatrixRotationX(D3DXMATRIX *pOut, FLOAT Angle)
D3DXVECTOR3 * D3DXVec3Subtract(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2)
Definition: d3dx8math.inl:1279
static INLINE ULONG Release(void *object)
Definition: dxgi_common.h:253
FLOAT *WINAPI D3DXSHMultiply6(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG)
D3DXVECTOR4 *WINAPI D3DXVec4CatmullRom(D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s)
Definition: d3dx8math.h:40
Definition: d3dx9math.h:48
struct D3DXVECTOR2_16F * LPD3DXVECTOR2_16F
D3DXVECTOR3 *WINAPI D3DXVec3CatmullRom(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s)
FLOAT *WINAPI D3DXSHRotateZ(FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn)
bool operator==(const FloatProxy< T > &first, const FloatProxy< T > &second)
Definition: hex_float.h:162
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV)
D3DXVECTOR3 * D3DXVec3Cross(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2)
Definition: d3dx8math.inl:1247
unsigned int BOOL
Definition: gctypes.h:51
D3DXVECTOR2 * D3DXVec2Subtract(D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2)
Definition: d3dx8math.inl:1139
struct D3DXVECTOR4 * LPD3DXVECTOR4
D3DXVECTOR4 *WINAPI D3DXVec4Cross(D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3)
D3DXFLOAT16 y
Definition: d3dx9math.h:218
D3DXQUATERNION *WINAPI D3DXQuaternionExp(D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ)
GLboolean GLboolean g
Definition: glext.h:6844
FLOAT *WINAPI D3DXSHMultiply3(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG)
HRESULT WINAPI D3DXSHEvalSphericalLight(UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius, FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut)
D3DXFLOAT16 y
Definition: d3dx9math.h:144
D3DXQUATERNION *WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3, FLOAT f, FLOAT g)
D3DXCOLOR * D3DXColorModulate(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2)
Definition: d3dx8math.inl:1706
FLOAT y
Definition: d3dx8math.h:76
FLOAT *WINAPI D3DXSHEvalDirection(FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir)
D3DXMATRIX *WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
FLOAT b
Definition: d3dx8math.h:446
D3DXVECTOR4 *WINAPI D3DXVec3Transform(D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM)
D3DX_ALIGN16 _D3DXMATRIXA16 D3DXMATRIXA16
Definition: d3dx9math.h:405
D3DXMATRIX *WINAPI D3DXMatrixScaling(D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz)
D3DXMATRIX *WINAPI D3DXMatrixRotationYawPitchRoll(D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll)
D3DXFLOAT16 y
Definition: d3dx9math.h:291
Definition: glslang_tab.cpp:136
struct D3DXCOLOR D3DXCOLOR
Definition: d3dx8math.h:326
__cplusplus
Definition: d3dx9math.h:198
FLOAT c
Definition: d3dx8math.h:392
struct _D3DVECTOR * LPD3DXVECTOR3
Definition: d3dx9math.h:190
Definition: glslang_tab.cpp:133
FLOAT D3DXVec3LengthSq(CONST D3DXVECTOR3 *pV)
Definition: d3dx8math.inl:1225
D3DXVECTOR3 *WINAPI D3DXVec3ProjectArray(D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DVIEWPORT9 *pViewport, CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n)
D3DXMATRIX *WINAPI D3DXMatrixReflect(D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane)
D3DXVECTOR2 *WINAPI D3DXVec2TransformCoordArray(D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n)
D3DXCOLOR * D3DXColorScale(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s)
Definition: d3dx8math.inl:1691
FLOAT D3DXVec4LengthSq(CONST D3DXVECTOR4 *pV)
Definition: d3dx8math.inl:1370
D3DXQUATERNION *WINAPI D3DXQuaternionRotationYawPitchRoll(D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll)
D3DXMATRIX * D3DXMatrixIdentity(D3DXMATRIX *pOut)
Definition: d3dx8math.inl:1488
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6742
D3DXVECTOR4 *WINAPI D3DXVec4Hermite(D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1, CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s)
FLOAT w
Definition: d3dx8math.h:162
D3DXVECTOR3 *WINAPI D3DXVec3Unproject(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport, CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld)
D3DXPLANE *WINAPI D3DXPlaneTransform(D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM)
float _24
Definition: d3d8types.h:81
#define D3DX_ALIGN16
Definition: d3dx9math.h:402
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveOffCenterLH(D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:8390
D3DXQUATERNION *WINAPI D3DXQuaternionRotationAxis(D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle)
struct D3DXCOLOR * LPD3DXCOLOR
D3DXCOLOR * D3DXColorSubtract(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2)
Definition: d3dx8math.inl:1676
FLOAT g
Definition: d3dx8math.h:446
D3DXPLANE *WINAPI D3DXPlaneFromPoints(D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3)
Definition: d3dx8math.h:402
FLOAT a
Definition: d3dx8math.h:392
struct D3DXVECTOR3_16F * LPD3DXVECTOR3_16F
Definition: d3d9types.h:100
D3DXMATRIX *WINAPI D3DXMatrixInverse(D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM)
D3DXCOLOR *WINAPI D3DXColorAdjustContrast(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c)
GLdouble n
Definition: glext.h:8396
D3DXQUATERNION *WINAPI D3DXQuaternionRotationMatrix(D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM)
D3DXVECTOR3 * D3DXVec3Maximize(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2)
Definition: d3dx8math.inl:1307
D3DXMATRIX *WINAPI D3DXMatrixMultiply(D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2)
D3DXMATRIX *WINAPI D3DXMatrixTranslation(D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z)
The text renderer interface represents a set of application-defined callbacks that perform rendering ...
Definition: d3d8types.h:57
D3DXVECTOR3 * D3DXVec3Scale(D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s)
Definition: d3dx8math.inl:1321
float _41
Definition: d3d8types.h:83
void WINAPI D3DXQuaternionToAxisAngle(CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle)
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6844
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveFovRH(D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf)
interface ID3DXMatrixStack * LPD3DXMATRIXSTACK
Definition: d3dx9math.h:1275
D3DXMATRIX *WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
FLOAT *WINAPI D3DXSHMultiply4(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG)
FLOAT D3DXQuaternionLengthSq(CONST D3DXQUATERNION *pQ)
Definition: d3dx8math.inl:1540
FLOAT x
Definition: d3dx8math.h:76