/[cvs]/api/include/d3dx8math.h
ViewVC logotype

Annotation of /api/include/d3dx8math.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (hide annotations) (vendor branch)
Sun Jul 1 20:47:59 2001 UTC (22 years, 10 months ago) by bearsoft
Branch: lazy, MAIN
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
File MIME type: text/plain
First import

1 bearsoft 1.1 //////////////////////////////////////////////////////////////////////////////
2     //
3     // Copyright (C) 1998 Microsoft Corporation. All Rights Reserved.
4     //
5     // File: d3dx8math.h
6     // Content: D3DX math types and functions
7     //
8     //////////////////////////////////////////////////////////////////////////////
9    
10     #include "d3dx8.h"
11    
12     #ifndef __D3DX8MATH_H__
13     #define __D3DX8MATH_H__
14    
15     #include <math.h>
16     #pragma warning(disable:4201) // anonymous unions warning
17    
18    
19    
20     typedef struct ID3DXMatrixStack *LPD3DXMATRIXSTACK;
21    
22     // {E3357330-CC5E-11d2-A434-00A0C90629A8}
23     DEFINE_GUID( IID_ID3DXMatrixStack,
24     0xe3357330, 0xcc5e, 0x11d2, 0xa4, 0x34, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
25    
26    
27     //===========================================================================
28     //
29     // General purpose utilities
30     //
31     //===========================================================================
32     #define D3DX_PI ((FLOAT) 3.141592654f)
33     #define D3DX_1BYPI ((FLOAT) 0.318309886f)
34    
35     #define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0f))
36     #define D3DXToDegree( radian ) ((radian) * (180.0f / D3DX_PI))
37    
38    
39    
40     //===========================================================================
41     //
42     // Vectors
43     //
44     //===========================================================================
45    
46     //--------------------------
47     // 2D Vector
48     //--------------------------
49     typedef struct D3DXVECTOR2
50     {
51     #ifdef __cplusplus
52     public:
53     D3DXVECTOR2() {};
54     D3DXVECTOR2( CONST FLOAT * );
55     D3DXVECTOR2( FLOAT x, FLOAT y );
56    
57     // casting
58     operator FLOAT* ();
59     operator CONST FLOAT* () const;
60    
61     // assignment operators
62     D3DXVECTOR2& operator += ( CONST D3DXVECTOR2& );
63     D3DXVECTOR2& operator -= ( CONST D3DXVECTOR2& );
64     D3DXVECTOR2& operator *= ( FLOAT );
65     D3DXVECTOR2& operator /= ( FLOAT );
66    
67     // unary operators
68     D3DXVECTOR2 operator + () const;
69     D3DXVECTOR2 operator - () const;
70    
71     // binary operators
72     D3DXVECTOR2 operator + ( CONST D3DXVECTOR2& ) const;
73     D3DXVECTOR2 operator - ( CONST D3DXVECTOR2& ) const;
74     D3DXVECTOR2 operator * ( FLOAT ) const;
75     D3DXVECTOR2 operator / ( FLOAT ) const;
76    
77     friend D3DXVECTOR2 operator * ( FLOAT, CONST D3DXVECTOR2& );
78    
79     BOOL operator == ( CONST D3DXVECTOR2& ) const;
80     BOOL operator != ( CONST D3DXVECTOR2& ) const;
81    
82    
83     public:
84     #endif //__cplusplus
85     FLOAT x, y;
86     } D3DXVECTOR2, *LPD3DXVECTOR2;
87    
88    
89     //--------------------------
90     // 3D Vector
91     //--------------------------
92     #ifdef __cplusplus
93     typedef struct D3DXVECTOR3 : public D3DVECTOR
94     {
95     public:
96     D3DXVECTOR3() {};
97     D3DXVECTOR3( CONST FLOAT * );
98     D3DXVECTOR3( CONST D3DVECTOR& );
99     D3DXVECTOR3( FLOAT x, FLOAT y, FLOAT z );
100    
101     // casting
102     operator FLOAT* ();
103     operator CONST FLOAT* () const;
104    
105     // assignment operators
106     D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& );
107     D3DXVECTOR3& operator -= ( CONST D3DXVECTOR3& );
108     D3DXVECTOR3& operator *= ( FLOAT );
109     D3DXVECTOR3& operator /= ( FLOAT );
110    
111     // unary operators
112     D3DXVECTOR3 operator + () const;
113     D3DXVECTOR3 operator - () const;
114    
115     // binary operators
116     D3DXVECTOR3 operator + ( CONST D3DXVECTOR3& ) const;
117     D3DXVECTOR3 operator - ( CONST D3DXVECTOR3& ) const;
118     D3DXVECTOR3 operator * ( FLOAT ) const;
119     D3DXVECTOR3 operator / ( FLOAT ) const;
120    
121     friend D3DXVECTOR3 operator * ( FLOAT, CONST struct D3DXVECTOR3& );
122    
123     BOOL operator == ( CONST D3DXVECTOR3& ) const;
124     BOOL operator != ( CONST D3DXVECTOR3& ) const;
125    
126     } D3DXVECTOR3, *LPD3DXVECTOR3;
127    
128     #else //!__cplusplus
129     typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3;
130     #endif //!__cplusplus
131    
132    
133     //--------------------------
134     // 4D Vector
135     //--------------------------
136     typedef struct D3DXVECTOR4
137     {
138     #ifdef __cplusplus
139     public:
140     D3DXVECTOR4() {};
141     D3DXVECTOR4( CONST FLOAT* );
142     D3DXVECTOR4( FLOAT x, FLOAT y, FLOAT z, FLOAT w );
143    
144     // casting
145     operator FLOAT* ();
146     operator CONST FLOAT* () const;
147    
148     // assignment operators
149     D3DXVECTOR4& operator += ( CONST D3DXVECTOR4& );
150     D3DXVECTOR4& operator -= ( CONST D3DXVECTOR4& );
151     D3DXVECTOR4& operator *= ( FLOAT );
152     D3DXVECTOR4& operator /= ( FLOAT );
153    
154     // unary operators
155     D3DXVECTOR4 operator + () const;
156     D3DXVECTOR4 operator - () const;
157    
158     // binary operators
159     D3DXVECTOR4 operator + ( CONST D3DXVECTOR4& ) const;
160     D3DXVECTOR4 operator - ( CONST D3DXVECTOR4& ) const;
161     D3DXVECTOR4 operator * ( FLOAT ) const;
162     D3DXVECTOR4 operator / ( FLOAT ) const;
163    
164     friend D3DXVECTOR4 operator * ( FLOAT, CONST D3DXVECTOR4& );
165    
166     BOOL operator == ( CONST D3DXVECTOR4& ) const;
167     BOOL operator != ( CONST D3DXVECTOR4& ) const;
168    
169     public:
170     #endif //__cplusplus
171     FLOAT x, y, z, w;
172     } D3DXVECTOR4, *LPD3DXVECTOR4;
173    
174    
175     //===========================================================================
176     //
177     // Matrices
178     //
179     //===========================================================================
180     #ifdef __cplusplus
181     typedef struct D3DXMATRIX : public D3DMATRIX
182     {
183     public:
184     D3DXMATRIX() {};
185     D3DXMATRIX( CONST FLOAT * );
186     D3DXMATRIX( CONST D3DMATRIX& );
187     D3DXMATRIX( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14,
188     FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24,
189     FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34,
190     FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 );
191    
192    
193     // access grants
194     FLOAT& operator () ( UINT Row, UINT Col );
195     FLOAT operator () ( UINT Row, UINT Col ) const;
196    
197     // casting operators
198     operator FLOAT* ();
199     operator CONST FLOAT* () const;
200    
201     // assignment operators
202     D3DXMATRIX& operator *= ( CONST D3DXMATRIX& );
203     D3DXMATRIX& operator += ( CONST D3DXMATRIX& );
204     D3DXMATRIX& operator -= ( CONST D3DXMATRIX& );
205     D3DXMATRIX& operator *= ( FLOAT );
206     D3DXMATRIX& operator /= ( FLOAT );
207    
208     // unary operators
209     D3DXMATRIX operator + () const;
210     D3DXMATRIX operator - () const;
211    
212     // binary operators
213     D3DXMATRIX operator * ( CONST D3DXMATRIX& ) const;
214     D3DXMATRIX operator + ( CONST D3DXMATRIX& ) const;
215     D3DXMATRIX operator - ( CONST D3DXMATRIX& ) const;
216     D3DXMATRIX operator * ( FLOAT ) const;
217     D3DXMATRIX operator / ( FLOAT ) const;
218    
219     friend D3DXMATRIX operator * ( FLOAT, CONST D3DXMATRIX& );
220    
221     BOOL operator == ( CONST D3DXMATRIX& ) const;
222     BOOL operator != ( CONST D3DXMATRIX& ) const;
223    
224     } D3DXMATRIX, *LPD3DXMATRIX;
225    
226     #else //!__cplusplus
227     typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX;
228     #endif //!__cplusplus
229    
230    
231     //===========================================================================
232     //
233     // Quaternions
234     //
235     //===========================================================================
236     typedef struct D3DXQUATERNION
237     {
238     #ifdef __cplusplus
239     public:
240     D3DXQUATERNION() {}
241     D3DXQUATERNION( CONST FLOAT * );
242     D3DXQUATERNION( FLOAT x, FLOAT y, FLOAT z, FLOAT w );
243    
244     // casting
245     operator FLOAT* ();
246     operator CONST FLOAT* () const;
247    
248     // assignment operators
249     D3DXQUATERNION& operator += ( CONST D3DXQUATERNION& );
250     D3DXQUATERNION& operator -= ( CONST D3DXQUATERNION& );
251     D3DXQUATERNION& operator *= ( CONST D3DXQUATERNION& );
252     D3DXQUATERNION& operator *= ( FLOAT );
253     D3DXQUATERNION& operator /= ( FLOAT );
254    
255     // unary operators
256     D3DXQUATERNION operator + () const;
257     D3DXQUATERNION operator - () const;
258    
259     // binary operators
260     D3DXQUATERNION operator + ( CONST D3DXQUATERNION& ) const;
261     D3DXQUATERNION operator - ( CONST D3DXQUATERNION& ) const;
262     D3DXQUATERNION operator * ( CONST D3DXQUATERNION& ) const;
263     D3DXQUATERNION operator * ( FLOAT ) const;
264     D3DXQUATERNION operator / ( FLOAT ) const;
265    
266     friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION& );
267    
268     BOOL operator == ( CONST D3DXQUATERNION& ) const;
269     BOOL operator != ( CONST D3DXQUATERNION& ) const;
270    
271     #endif //__cplusplus
272     FLOAT x, y, z, w;
273     } D3DXQUATERNION, *LPD3DXQUATERNION;
274    
275    
276     //===========================================================================
277     //
278     // Planes
279     //
280     //===========================================================================
281     typedef struct D3DXPLANE
282     {
283     #ifdef __cplusplus
284     public:
285     D3DXPLANE() {}
286     D3DXPLANE( CONST FLOAT* );
287     D3DXPLANE( FLOAT a, FLOAT b, FLOAT c, FLOAT d );
288    
289     // casting
290     operator FLOAT* ();
291     operator CONST FLOAT* () const;
292    
293     // unary operators
294     D3DXPLANE operator + () const;
295     D3DXPLANE operator - () const;
296    
297     // binary operators
298     BOOL operator == ( CONST D3DXPLANE& ) const;
299     BOOL operator != ( CONST D3DXPLANE& ) const;
300    
301     #endif //__cplusplus
302     FLOAT a, b, c, d;
303     } D3DXPLANE, *LPD3DXPLANE;
304    
305    
306     //===========================================================================
307     //
308     // Colors
309     //
310     //===========================================================================
311    
312     typedef struct D3DXCOLOR
313     {
314     #ifdef __cplusplus
315     public:
316     D3DXCOLOR() {}
317     D3DXCOLOR( DWORD argb );
318     D3DXCOLOR( CONST FLOAT * );
319     D3DXCOLOR( CONST D3DCOLORVALUE& );
320     D3DXCOLOR( FLOAT r, FLOAT g, FLOAT b, FLOAT a );
321    
322     // casting
323     operator DWORD () const;
324    
325     operator FLOAT* ();
326     operator CONST FLOAT* () const;
327    
328     operator D3DCOLORVALUE* ();
329     operator CONST D3DCOLORVALUE* () const;
330    
331     operator D3DCOLORVALUE& ();
332     operator CONST D3DCOLORVALUE& () const;
333    
334     // assignment operators
335     D3DXCOLOR& operator += ( CONST D3DXCOLOR& );
336     D3DXCOLOR& operator -= ( CONST D3DXCOLOR& );
337     D3DXCOLOR& operator *= ( FLOAT );
338     D3DXCOLOR& operator /= ( FLOAT );
339    
340     // unary operators
341     D3DXCOLOR operator + () const;
342     D3DXCOLOR operator - () const;
343    
344     // binary operators
345     D3DXCOLOR operator + ( CONST D3DXCOLOR& ) const;
346     D3DXCOLOR operator - ( CONST D3DXCOLOR& ) const;
347     D3DXCOLOR operator * ( FLOAT ) const;
348     D3DXCOLOR operator / ( FLOAT ) const;
349    
350     friend D3DXCOLOR operator * (FLOAT, CONST D3DXCOLOR& );
351    
352     BOOL operator == ( CONST D3DXCOLOR& ) const;
353     BOOL operator != ( CONST D3DXCOLOR& ) const;
354    
355     #endif //__cplusplus
356     FLOAT r, g, b, a;
357     } D3DXCOLOR, *LPD3DXCOLOR;
358    
359    
360    
361     //===========================================================================
362     //
363     // D3DX math functions:
364     //
365     // NOTE:
366     // * All these functions can take the same object as in and out parameters.
367     //
368     // * Out parameters are typically also returned as return values, so that
369     // the output of one function may be used as a parameter to another.
370     //
371     //===========================================================================
372    
373     //--------------------------
374     // 2D Vector
375     //--------------------------
376    
377     // inline
378    
379     FLOAT D3DXVec2Length
380     ( CONST D3DXVECTOR2 *pV );
381    
382     FLOAT D3DXVec2LengthSq
383     ( CONST D3DXVECTOR2 *pV );
384    
385     FLOAT D3DXVec2Dot
386     ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
387    
388     // Z component of ((x1,y1,0) cross (x2,y2,0))
389     FLOAT D3DXVec2CCW
390     ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
391    
392     D3DXVECTOR2* D3DXVec2Add
393     ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
394    
395     D3DXVECTOR2* D3DXVec2Subtract
396     ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
397    
398     // Minimize each component. x = min(x1, x2), y = min(y1, y2)
399     D3DXVECTOR2* D3DXVec2Minimize
400     ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
401    
402     // Maximize each component. x = max(x1, x2), y = max(y1, y2)
403     D3DXVECTOR2* D3DXVec2Maximize
404     ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
405    
406     D3DXVECTOR2* D3DXVec2Scale
407     ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s );
408    
409     // Linear interpolation. V1 + s(V2-V1)
410     D3DXVECTOR2* D3DXVec2Lerp
411     ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2,
412     FLOAT s );
413    
414     // non-inline
415     #ifdef __cplusplus
416     extern "C" {
417     #endif
418    
419     D3DXVECTOR2* WINAPI D3DXVec2Normalize
420     ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV );
421    
422     // Hermite interpolation between position V1, tangent T1 (when s == 0)
423     // and position V2, tangent T2 (when s == 1).
424     D3DXVECTOR2* WINAPI D3DXVec2Hermite
425     ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1,
426     CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s );
427    
428     // CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
429     D3DXVECTOR2* WINAPI D3DXVec2CatmullRom
430     ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1,
431     CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s );
432    
433     // Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1)
434     D3DXVECTOR2* WINAPI D3DXVec2BaryCentric
435     ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2,
436     D3DXVECTOR2 *pV3, FLOAT f, FLOAT g);
437    
438     // Transform (x, y, 0, 1) by matrix.
439     D3DXVECTOR4* WINAPI D3DXVec2Transform
440     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );
441    
442     // Transform (x, y, 0, 1) by matrix, project result back into w=1.
443     D3DXVECTOR2* WINAPI D3DXVec2TransformCoord
444     ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );
445    
446     // Transform (x, y, 0, 0) by matrix.
447     D3DXVECTOR2* WINAPI D3DXVec2TransformNormal
448     ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );
449    
450     #ifdef __cplusplus
451     }
452     #endif
453    
454    
455     //--------------------------
456     // 3D Vector
457     //--------------------------
458    
459     // inline
460    
461     FLOAT D3DXVec3Length
462     ( CONST D3DXVECTOR3 *pV );
463    
464     FLOAT D3DXVec3LengthSq
465     ( CONST D3DXVECTOR3 *pV );
466    
467     FLOAT D3DXVec3Dot
468     ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
469    
470     D3DXVECTOR3* D3DXVec3Cross
471     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
472    
473     D3DXVECTOR3* D3DXVec3Add
474     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
475    
476     D3DXVECTOR3* D3DXVec3Subtract
477     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
478    
479     // Minimize each component. x = min(x1, x2), y = min(y1, y2), ...
480     D3DXVECTOR3* D3DXVec3Minimize
481     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
482    
483     // Maximize each component. x = max(x1, x2), y = max(y1, y2), ...
484     D3DXVECTOR3* D3DXVec3Maximize
485     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
486    
487     D3DXVECTOR3* D3DXVec3Scale
488     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s);
489    
490     // Linear interpolation. V1 + s(V2-V1)
491     D3DXVECTOR3* D3DXVec3Lerp
492     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
493     FLOAT s );
494    
495     // non-inline
496     #ifdef __cplusplus
497     extern "C" {
498     #endif
499    
500     D3DXVECTOR3* WINAPI D3DXVec3Normalize
501     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV );
502    
503     // Hermite interpolation between position V1, tangent T1 (when s == 0)
504     // and position V2, tangent T2 (when s == 1).
505     D3DXVECTOR3* WINAPI D3DXVec3Hermite
506     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1,
507     CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s );
508    
509     // CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
510     D3DXVECTOR3* WINAPI D3DXVec3CatmullRom
511     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1,
512     CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s );
513    
514     // Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1)
515     D3DXVECTOR3* WINAPI D3DXVec3BaryCentric
516     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
517     CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g);
518    
519     // Transform (x, y, z, 1) by matrix.
520     D3DXVECTOR4* WINAPI D3DXVec3Transform
521     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );
522    
523     // Transform (x, y, z, 1) by matrix, project result back into w=1.
524     D3DXVECTOR3* WINAPI D3DXVec3TransformCoord
525     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );
526    
527     // Transform (x, y, z, 0) by matrix. If you transforming a normal by a
528     // non-affine matrix, the matrix you pass to this function should be the
529     // transpose of the inverse of the matrix you would use to transform a coord.
530     D3DXVECTOR3* WINAPI D3DXVec3TransformNormal
531     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );
532    
533     // Project vector from object space into screen space
534     D3DXVECTOR3* WINAPI D3DXVec3Project
535     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT8 *pViewport,
536     CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld);
537    
538     // Project vector from screen space into object space
539     D3DXVECTOR3* WINAPI D3DXVec3Unproject
540     ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT8 *pViewport,
541     CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld);
542    
543     #ifdef __cplusplus
544     }
545     #endif
546    
547    
548    
549     //--------------------------
550     // 4D Vector
551     //--------------------------
552    
553     // inline
554    
555     FLOAT D3DXVec4Length
556     ( CONST D3DXVECTOR4 *pV );
557    
558     FLOAT D3DXVec4LengthSq
559     ( CONST D3DXVECTOR4 *pV );
560    
561     FLOAT D3DXVec4Dot
562     ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 );
563    
564     D3DXVECTOR4* D3DXVec4Add
565     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2);
566    
567     D3DXVECTOR4* D3DXVec4Subtract
568     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2);
569    
570     // Minimize each component. x = min(x1, x2), y = min(y1, y2), ...
571     D3DXVECTOR4* D3DXVec4Minimize
572     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2);
573    
574     // Maximize each component. x = max(x1, x2), y = max(y1, y2), ...
575     D3DXVECTOR4* D3DXVec4Maximize
576     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2);
577    
578     D3DXVECTOR4* D3DXVec4Scale
579     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s);
580    
581     // Linear interpolation. V1 + s(V2-V1)
582     D3DXVECTOR4* D3DXVec4Lerp
583     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
584     FLOAT s );
585    
586     // non-inline
587     #ifdef __cplusplus
588     extern "C" {
589     #endif
590    
591     // Cross-product in 4 dimensions.
592     D3DXVECTOR4* WINAPI D3DXVec4Cross
593     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
594     CONST D3DXVECTOR4 *pV3);
595    
596     D3DXVECTOR4* WINAPI D3DXVec4Normalize
597     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV );
598    
599     // Hermite interpolation between position V1, tangent T1 (when s == 0)
600     // and position V2, tangent T2 (when s == 1).
601     D3DXVECTOR4* WINAPI D3DXVec4Hermite
602     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1,
603     CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s );
604    
605     // CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
606     D3DXVECTOR4* WINAPI D3DXVec4CatmullRom
607     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1,
608     CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s );
609    
610     // Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1)
611     D3DXVECTOR4* WINAPI D3DXVec4BaryCentric
612     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
613     CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g);
614    
615     // Transform vector by matrix.
616     D3DXVECTOR4* WINAPI D3DXVec4Transform
617     ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM );
618    
619     #ifdef __cplusplus
620     }
621     #endif
622    
623    
624     //--------------------------
625     // 4D Matrix
626     //--------------------------
627    
628     // inline
629    
630     D3DXMATRIX* D3DXMatrixIdentity
631     ( D3DXMATRIX *pOut );
632    
633     BOOL D3DXMatrixIsIdentity
634     ( CONST D3DXMATRIX *pM );
635    
636    
637     // non-inline
638     #ifdef __cplusplus
639     extern "C" {
640     #endif
641    
642     FLOAT WINAPI D3DXMatrixfDeterminant
643     ( CONST D3DXMATRIX *pM );
644    
645     // Matrix multiplication. The result represents the transformation M2
646     // followed by the transformation M1. (Out = M1 * M2)
647     D3DXMATRIX* WINAPI D3DXMatrixMultiply
648     ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 );
649    
650     D3DXMATRIX* WINAPI D3DXMatrixTranspose
651     ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM );
652    
653     // Calculate inverse of matrix. Inversion my fail, in which case NULL will
654     // be returned. The determinant of pM is also returned it pfDeterminant
655     // is non-NULL.
656     D3DXMATRIX* WINAPI D3DXMatrixInverse
657     ( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM );
658    
659     // Build a matrix which scales by (sx, sy, sz)
660     D3DXMATRIX* WINAPI D3DXMatrixScaling
661     ( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz );
662    
663     // Build a matrix which translates by (x, y, z)
664     D3DXMATRIX* WINAPI D3DXMatrixTranslation
665     ( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z );
666    
667     // Build a matrix which rotates around the X axis
668     D3DXMATRIX* WINAPI D3DXMatrixRotationX
669     ( D3DXMATRIX *pOut, FLOAT Angle );
670    
671     // Build a matrix which rotates around the Y axis
672     D3DXMATRIX* WINAPI D3DXMatrixRotationY
673     ( D3DXMATRIX *pOut, FLOAT Angle );
674    
675     // Build a matrix which rotates around the Z axis
676     D3DXMATRIX* WINAPI D3DXMatrixRotationZ
677     ( D3DXMATRIX *pOut, FLOAT Angle );
678    
679     // Build a matrix which rotates around an arbitrary axis
680     D3DXMATRIX* WINAPI D3DXMatrixRotationAxis
681     ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle );
682    
683     // Build a matrix from a quaternion
684     D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion
685     ( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ);
686    
687     // Yaw around the Y axis, a pitch around the X axis,
688     // and a roll around the Z axis.
689     D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll
690     ( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll );
691    
692    
693     // Build transformation matrix. NULL arguments are treated as identity.
694     // Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
695     D3DXMATRIX* WINAPI D3DXMatrixTransformation
696     ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter,
697     CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling,
698     CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation,
699     CONST D3DXVECTOR3 *pTranslation);
700    
701     // Build affine transformation matrix. NULL arguments are treated as identity.
702     // Mout = Ms * Mrc-1 * Mr * Mrc * Mt
703     D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation
704     ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter,
705     CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation);
706    
707     // Build a lookat matrix. (right-handed)
708     D3DXMATRIX* WINAPI D3DXMatrixLookAtRH
709     ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
710     CONST D3DXVECTOR3 *pUp );
711    
712     // Build a lookat matrix. (left-handed)
713     D3DXMATRIX* WINAPI D3DXMatrixLookAtLH
714     ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
715     CONST D3DXVECTOR3 *pUp );
716    
717     // Build a perspective projection matrix. (right-handed)
718     D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH
719     ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );
720    
721     // Build a perspective projection matrix. (left-handed)
722     D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH
723     ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );
724    
725     // Build a perspective projection matrix. (right-handed)
726     D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH
727     ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf );
728    
729     // Build a perspective projection matrix. (left-handed)
730     D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH
731     ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf );
732    
733     // Build a perspective projection matrix. (right-handed)
734     D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH
735     ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
736     FLOAT zf );
737    
738     // Build a perspective projection matrix. (left-handed)
739     D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH
740     ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
741     FLOAT zf );
742    
743     // Build an ortho projection matrix. (right-handed)
744     D3DXMATRIX* WINAPI D3DXMatrixOrthoRH
745     ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );
746    
747     // Build an ortho projection matrix. (left-handed)
748     D3DXMATRIX* WINAPI D3DXMatrixOrthoLH
749     ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );
750    
751     // Build an ortho projection matrix. (right-handed)
752     D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH
753     ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
754     FLOAT zf );
755    
756     // Build an ortho projection matrix. (left-handed)
757     D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH
758     ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
759     FLOAT zf );
760    
761     // Build a matrix which flattens geometry into a plane, as if casting
762     // a shadow from a light.
763     D3DXMATRIX* WINAPI D3DXMatrixShadow
764     ( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight,
765     CONST D3DXPLANE *pPlane );
766    
767     // Build a matrix which reflects the coordinate system about a plane
768     D3DXMATRIX* WINAPI D3DXMatrixReflect
769     ( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane );
770    
771     #ifdef __cplusplus
772     }
773     #endif
774    
775    
776     //--------------------------
777     // Quaternion
778     //--------------------------
779    
780     // inline
781    
782     FLOAT D3DXQuaternionLength
783     ( CONST D3DXQUATERNION *pQ );
784    
785     // Length squared, or "norm"
786     FLOAT D3DXQuaternionLengthSq
787     ( CONST D3DXQUATERNION *pQ );
788    
789     FLOAT D3DXQuaternionDot
790     ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 );
791    
792     // (0, 0, 0, 1)
793     D3DXQUATERNION* D3DXQuaternionIdentity
794     ( D3DXQUATERNION *pOut );
795    
796     BOOL D3DXQuaternionIsIdentity
797     ( CONST D3DXQUATERNION *pQ );
798    
799     // (-x, -y, -z, w)
800     D3DXQUATERNION* D3DXQuaternionConjugate
801     ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
802    
803    
804     // non-inline
805     #ifdef __cplusplus
806     extern "C" {
807     #endif
808    
809     // Compute a quaternin's axis and angle of rotation. Expects unit quaternions.
810     void WINAPI D3DXQuaternionToAxisAngle
811     ( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle );
812    
813     // Build a quaternion from a rotation matrix.
814     D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix
815     ( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM);
816    
817     // Rotation about arbitrary axis.
818     D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis
819     ( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle );
820    
821     // Yaw around the Y axis, a pitch around the X axis,
822     // and a roll around the Z axis.
823     D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll
824     ( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll );
825    
826     // Quaternion multiplication. The result represents the rotation Q2
827     // followed by the rotation Q1. (Out = Q2 * Q1)
828     D3DXQUATERNION* WINAPI D3DXQuaternionMultiply
829     ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
830     CONST D3DXQUATERNION *pQ2 );
831    
832     D3DXQUATERNION* WINAPI D3DXQuaternionNormalize
833     ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
834    
835     // Conjugate and re-norm
836     D3DXQUATERNION* WINAPI D3DXQuaternionInverse
837     ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
838    
839     // Expects unit quaternions.
840     // if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v)
841     D3DXQUATERNION* WINAPI D3DXQuaternionLn
842     ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
843    
844     // Expects pure quaternions. (w == 0) w is ignored in calculation.
845     // if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v)
846     D3DXQUATERNION* WINAPI D3DXQuaternionExp
847     ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
848    
849     // Spherical linear interpolation between Q1 (s == 0) and Q2 (s == 1).
850     // Expects unit quaternions.
851     D3DXQUATERNION* WINAPI D3DXQuaternionSlerp
852     ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
853     CONST D3DXQUATERNION *pQ2, FLOAT t );
854    
855     // Spherical quadrangle interpolation.
856     // Slerp(Slerp(Q1, Q4, t), Slerp(Q2, Q3, t), 2t(1-t))
857     D3DXQUATERNION* WINAPI D3DXQuaternionSquad
858     ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
859     CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3,
860     CONST D3DXQUATERNION *pQ4, FLOAT t );
861    
862     // Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g))
863     D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric
864     ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
865     CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3,
866     FLOAT f, FLOAT g );
867    
868     #ifdef __cplusplus
869     }
870     #endif
871    
872    
873     //--------------------------
874     // Plane
875     //--------------------------
876    
877     // inline
878    
879     // ax + by + cz + dw
880     FLOAT D3DXPlaneDot
881     ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV);
882    
883     // ax + by + cz + d
884     FLOAT D3DXPlaneDotCoord
885     ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV);
886    
887     // ax + by + cz
888     FLOAT D3DXPlaneDotNormal
889     ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV);
890    
891     // non-inline
892     #ifdef __cplusplus
893     extern "C" {
894     #endif
895    
896     // Normalize plane (so that |a,b,c| == 1)
897     D3DXPLANE* WINAPI D3DXPlaneNormalize
898     ( D3DXPLANE *pOut, CONST D3DXPLANE *pP);
899    
900     // Find the intersection between a plane and a line. If the line is
901     // parallel to the plane, NULL is returned.
902     D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine
903     ( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1,
904     CONST D3DXVECTOR3 *pV2);
905    
906     // Construct a plane from a point and a normal
907     D3DXPLANE* WINAPI D3DXPlaneFromPointNormal
908     ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal);
909    
910     // Construct a plane from 3 points
911     D3DXPLANE* WINAPI D3DXPlaneFromPoints
912     ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
913     CONST D3DXVECTOR3 *pV3);
914    
915     // Transform a plane by a matrix. The vector (a,b,c) must be normal.
916     // M must be an affine transform.
917     D3DXPLANE* WINAPI D3DXPlaneTransform
918     ( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM );
919    
920     #ifdef __cplusplus
921     }
922     #endif
923    
924    
925     //--------------------------
926     // Color
927     //--------------------------
928    
929     // inline
930    
931     // (1-r, 1-g, 1-b, a)
932     D3DXCOLOR* D3DXColorNegative
933     (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC);
934    
935     D3DXCOLOR* D3DXColorAdd
936     (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2);
937    
938     D3DXCOLOR* D3DXColorSubtract
939     (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2);
940    
941     D3DXCOLOR* D3DXColorScale
942     (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s);
943    
944     // (r1*r2, g1*g2, b1*b2, a1*a2)
945     D3DXCOLOR* D3DXColorModulate
946     (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2);
947    
948     // Linear interpolation of r,g,b, and a. C1 + s(C2-C1)
949     D3DXCOLOR* D3DXColorLerp
950     (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s);
951    
952     // non-inline
953     #ifdef __cplusplus
954     extern "C" {
955     #endif
956    
957     // Interpolate r,g,b between desaturated color and color.
958     // DesaturatedColor + s(Color - DesaturatedColor)
959     D3DXCOLOR* WINAPI D3DXColorAdjustSaturation
960     (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s);
961    
962     // Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey)
963     D3DXCOLOR* WINAPI D3DXColorAdjustContrast
964     (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c);
965    
966     #ifdef __cplusplus
967     }
968     #endif
969    
970    
971    
972    
973    
974    
975     //===========================================================================
976     //
977     // Matrix Stack
978     //
979     //===========================================================================
980    
981     DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown)
982     {
983     //
984     // IUnknown methods
985     //
986     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
987     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
988     STDMETHOD_(ULONG,Release)(THIS) PURE;
989    
990     //
991     // ID3DXMatrixStack methods
992     //
993    
994     // Pops the top of the stack, returns the current top
995     // *after* popping the top.
996     STDMETHOD(Pop)(THIS) PURE;
997    
998     // Pushes the stack by one, duplicating the current matrix.
999     STDMETHOD(Push)(THIS) PURE;
1000    
1001     // Loads identity in the current matrix.
1002     STDMETHOD(LoadIdentity)(THIS) PURE;
1003    
1004     // Loads the given matrix into the current matrix
1005     STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
1006    
1007     // Right-Multiplies the given matrix to the current matrix.
1008     // (transformation is about the current world origin)
1009     STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
1010    
1011     // Left-Multiplies the given matrix to the current matrix
1012     // (transformation is about the local origin of the object)
1013     STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE;
1014    
1015     // Right multiply the current matrix with the computed rotation
1016     // matrix, counterclockwise about the given axis with the given angle.
1017     // (rotation is about the current world origin)
1018     STDMETHOD(RotateAxis)
1019     (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
1020    
1021     // Left multiply the current matrix with the computed rotation
1022     // matrix, counterclockwise about the given axis with the given angle.
1023     // (rotation is about the local origin of the object)
1024     STDMETHOD(RotateAxisLocal)
1025     (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
1026    
1027     // Right multiply the current matrix with the computed rotation
1028     // matrix. All angles are counterclockwise. (rotation is about the
1029     // current world origin)
1030    
1031     // The rotation is composed of a yaw around the Y axis, a pitch around
1032     // the X axis, and a roll around the Z axis.
1033     STDMETHOD(RotateYawPitchRoll)
1034     (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
1035    
1036     // Left multiply the current matrix with the computed rotation
1037     // matrix. All angles are counterclockwise. (rotation is about the
1038     // local origin of the object)
1039    
1040     // The rotation is composed of a yaw around the Y axis, a pitch around
1041     // the X axis, and a roll around the Z axis.
1042     STDMETHOD(RotateYawPitchRollLocal)
1043     (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
1044    
1045     // Right multiply the current matrix with the computed scale
1046     // matrix. (transformation is about the current world origin)
1047     STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
1048    
1049     // Left multiply the current matrix with the computed scale
1050     // matrix. (transformation is about the local origin of the object)
1051     STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
1052    
1053     // Right multiply the current matrix with the computed translation
1054     // matrix. (transformation is about the current world origin)
1055     STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE;
1056    
1057     // Left multiply the current matrix with the computed translation
1058     // matrix. (transformation is about the local origin of the object)
1059     STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
1060    
1061     // Obtain the current matrix at the top of the stack
1062     STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE;
1063     };
1064    
1065     #ifdef __cplusplus
1066     extern "C" {
1067     #endif
1068    
1069     HRESULT WINAPI D3DXCreateMatrixStack( DWORD Flags, LPD3DXMATRIXSTACK *ppStack );
1070    
1071     #ifdef __cplusplus
1072     }
1073     #endif
1074    
1075     #include "d3dx8math.inl"
1076    
1077     #pragma warning(default:4201)
1078    
1079     #endif // __D3DX8MATH_H__

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26