VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/d3dx9math.h@ 33252

Last change on this file since 33252 was 21731, checked in by vboxsync, 15 years ago

crOpenGL: update to wine 1.1.26

  • Property svn:eol-style set to native
File size: 21.8 KB
Line 
1/*
2 * Copyright (C) 2007 David Adam
3 * Copyright (C) 2007 Tony Wasserka
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20/*
21 * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
22 * other than GPL or LGPL is available it will apply instead, Sun elects to use only
23 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
24 * a choice of LGPL license versions is made available with the language indicating
25 * that LGPLv2 or any later version may be used, or where a choice of which version
26 * of the LGPL is applied is otherwise unspecified.
27 */
28
29#include <d3dx9.h>
30
31#ifndef __D3DX9MATH_H__
32#define __D3DX9MATH_H__
33
34#include <math.h>
35
36#define D3DX_PI ((FLOAT)3.141592654)
37#define D3DX_1BYPI ((FLOAT)0.318309886)
38
39#define D3DXToRadian(degree) ((degree) * (D3DX_PI / 180.0f))
40#define D3DXToDegree(radian) ((radian) * (180.0f / D3DX_PI))
41
42
43
44typedef struct D3DXVECTOR2
45{
46#ifdef __cplusplus
47 D3DXVECTOR2();
48 D3DXVECTOR2(CONST FLOAT *pf);
49 D3DXVECTOR2(FLOAT fx, FLOAT fy);
50
51 operator FLOAT* ();
52 operator CONST FLOAT* () const;
53
54 D3DXVECTOR2& operator += (CONST D3DXVECTOR2&);
55 D3DXVECTOR2& operator -= (CONST D3DXVECTOR2&);
56 D3DXVECTOR2& operator *= (FLOAT);
57 D3DXVECTOR2& operator /= (FLOAT);
58
59 D3DXVECTOR2 operator + () const;
60 D3DXVECTOR2 operator - () const;
61
62 D3DXVECTOR2 operator + (CONST D3DXVECTOR2&) const;
63 D3DXVECTOR2 operator - (CONST D3DXVECTOR2&) const;
64 D3DXVECTOR2 operator * (FLOAT) const;
65 D3DXVECTOR2 operator / (FLOAT) const;
66
67 friend D3DXVECTOR2 operator * (FLOAT, CONST D3DXVECTOR2&);
68
69 BOOL operator == (CONST D3DXVECTOR2&) const;
70 BOOL operator != (CONST D3DXVECTOR2&) const;
71#endif /* __cplusplus */
72 FLOAT x, y;
73} D3DXVECTOR2, *LPD3DXVECTOR2;
74
75#ifdef __cplusplus
76typedef struct D3DXVECTOR3 : public D3DVECTOR
77{
78 D3DXVECTOR3();
79 D3DXVECTOR3(CONST FLOAT *pf);
80 D3DXVECTOR3(CONST D3DVECTOR& v);
81 D3DXVECTOR3(FLOAT fx, FLOAT fy, FLOAT fz);
82
83 operator FLOAT* ();
84 operator CONST FLOAT* () const;
85
86 D3DXVECTOR3& operator += (CONST D3DXVECTOR3&);
87 D3DXVECTOR3& operator -= (CONST D3DXVECTOR3&);
88 D3DXVECTOR3& operator *= (FLOAT);
89 D3DXVECTOR3& operator /= (FLOAT);
90
91 D3DXVECTOR3 operator + () const;
92 D3DXVECTOR3 operator - () const;
93
94 D3DXVECTOR3 operator + (CONST D3DXVECTOR3&) const;
95 D3DXVECTOR3 operator - (CONST D3DXVECTOR3&) const;
96 D3DXVECTOR3 operator * (FLOAT) const;
97 D3DXVECTOR3 operator / (FLOAT) const;
98
99 friend D3DXVECTOR3 operator * (FLOAT, CONST struct D3DXVECTOR3&);
100
101 BOOL operator == (CONST D3DXVECTOR3&) const;
102 BOOL operator != (CONST D3DXVECTOR3&) const;
103} D3DXVECTOR3, *LPD3DXVECTOR3;
104#else /* !__cplusplus */
105typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3;
106#endif /* !__cplusplus */
107
108typedef struct D3DXVECTOR4
109{
110#ifdef __cplusplus
111 D3DXVECTOR4();
112 D3DXVECTOR4(CONST FLOAT *pf);
113 D3DXVECTOR4(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw);
114
115 operator FLOAT* ();
116 operator CONST FLOAT* () const;
117
118 D3DXVECTOR4& operator += (CONST D3DXVECTOR4&);
119 D3DXVECTOR4& operator -= (CONST D3DXVECTOR4&);
120 D3DXVECTOR4& operator *= (FLOAT);
121 D3DXVECTOR4& operator /= (FLOAT);
122
123 D3DXVECTOR4 operator + () const;
124 D3DXVECTOR4 operator - () const;
125
126 D3DXVECTOR4 operator + (CONST D3DXVECTOR4&) const;
127 D3DXVECTOR4 operator - (CONST D3DXVECTOR4&) const;
128 D3DXVECTOR4 operator * (FLOAT) const;
129 D3DXVECTOR4 operator / (FLOAT) const;
130
131 friend D3DXVECTOR4 operator * (FLOAT, CONST D3DXVECTOR4&);
132
133 BOOL operator == (CONST D3DXVECTOR4&) const;
134 BOOL operator != (CONST D3DXVECTOR4&) const;
135#endif /* __cplusplus */
136 FLOAT x, y, z, w;
137} D3DXVECTOR4, *LPD3DXVECTOR4;
138
139#ifdef __cplusplus
140typedef struct D3DXMATRIX : public D3DMATRIX
141{
142 D3DXMATRIX();
143 D3DXMATRIX(CONST FLOAT *pf);
144 D3DXMATRIX(CONST D3DMATRIX& mat);
145 D3DXMATRIX(FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14,
146 FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24,
147 FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34,
148 FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44);
149
150 FLOAT& operator () (UINT row, UINT col);
151 FLOAT operator () (UINT row, UINT col) const;
152
153 operator FLOAT* ();
154 operator CONST FLOAT* () const;
155
156 D3DXMATRIX& operator *= (CONST D3DXMATRIX&);
157 D3DXMATRIX& operator += (CONST D3DXMATRIX&);
158 D3DXMATRIX& operator -= (CONST D3DXMATRIX&);
159 D3DXMATRIX& operator *= (FLOAT);
160 D3DXMATRIX& operator /= (FLOAT);
161
162 D3DXMATRIX operator + () const;
163 D3DXMATRIX operator - () const;
164
165 D3DXMATRIX operator * (CONST D3DXMATRIX&) const;
166 D3DXMATRIX operator + (CONST D3DXMATRIX&) const;
167 D3DXMATRIX operator - (CONST D3DXMATRIX&) const;
168 D3DXMATRIX operator * (FLOAT) const;
169 D3DXMATRIX operator / (FLOAT) const;
170
171 friend D3DXMATRIX operator * (FLOAT, CONST D3DXMATRIX&);
172
173 BOOL operator == (CONST D3DXMATRIX&) const;
174 BOOL operator != (CONST D3DXMATRIX&) const;
175} D3DXMATRIX, *LPD3DXMATRIX;
176#else /* !__cplusplus */
177typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX;
178#endif /* !__cplusplus */
179
180typedef struct D3DXQUATERNION
181{
182#ifdef __cplusplus
183 D3DXQUATERNION();
184 D3DXQUATERNION(CONST FLOAT *pf);
185 D3DXQUATERNION(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw);
186
187 operator FLOAT* ();
188 operator CONST FLOAT* () const;
189
190 D3DXQUATERNION& operator += (CONST D3DXQUATERNION&);
191 D3DXQUATERNION& operator -= (CONST D3DXQUATERNION&);
192 D3DXQUATERNION& operator *= (CONST D3DXQUATERNION&);
193 D3DXQUATERNION& operator *= (FLOAT);
194 D3DXQUATERNION& operator /= (FLOAT);
195
196 D3DXQUATERNION operator + () const;
197 D3DXQUATERNION operator - () const;
198
199 D3DXQUATERNION operator + (CONST D3DXQUATERNION&) const;
200 D3DXQUATERNION operator - (CONST D3DXQUATERNION&) const;
201 D3DXQUATERNION operator * (CONST D3DXQUATERNION&) const;
202 D3DXQUATERNION operator * (FLOAT) const;
203 D3DXQUATERNION operator / (FLOAT) const;
204
205 friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION&);
206
207 BOOL operator == (CONST D3DXQUATERNION&) const;
208 BOOL operator != (CONST D3DXQUATERNION&) const;
209#endif /* __cplusplus */
210 FLOAT x, y, z, w;
211} D3DXQUATERNION, *LPD3DXQUATERNION;
212
213typedef struct D3DXPLANE
214{
215#ifdef __cplusplus
216 D3DXPLANE();
217 D3DXPLANE(CONST FLOAT *pf);
218 D3DXPLANE(FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd);
219
220 operator FLOAT* ();
221 operator CONST FLOAT* () const;
222
223 D3DXPLANE operator + () const;
224 D3DXPLANE operator - () const;
225
226 BOOL operator == (CONST D3DXPLANE&) const;
227 BOOL operator != (CONST D3DXPLANE&) const;
228#endif /* __cplusplus */
229 FLOAT a, b, c, d;
230} D3DXPLANE, *LPD3DXPLANE;
231
232typedef struct D3DXCOLOR
233{
234#ifdef __cplusplus
235 D3DXCOLOR();
236 D3DXCOLOR(DWORD col);
237 D3DXCOLOR(CONST FLOAT *pf);
238 D3DXCOLOR(CONST D3DCOLORVALUE& col);
239 D3DXCOLOR(FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa);
240
241 operator DWORD () const;
242
243 operator FLOAT* ();
244 operator CONST FLOAT* () const;
245
246 operator D3DCOLORVALUE* ();
247 operator CONST D3DCOLORVALUE* () const;
248
249 operator D3DCOLORVALUE& ();
250 operator CONST D3DCOLORVALUE& () const;
251
252 D3DXCOLOR& operator += (CONST D3DXCOLOR&);
253 D3DXCOLOR& operator -= (CONST D3DXCOLOR&);
254 D3DXCOLOR& operator *= (FLOAT);
255 D3DXCOLOR& operator /= (FLOAT);
256
257 D3DXCOLOR operator + () const;
258 D3DXCOLOR operator - () const;
259
260 D3DXCOLOR operator + (CONST D3DXCOLOR&) const;
261 D3DXCOLOR operator - (CONST D3DXCOLOR&) const;
262 D3DXCOLOR operator * (FLOAT) const;
263 D3DXCOLOR operator / (FLOAT) const;
264
265 friend D3DXCOLOR operator * (FLOAT, CONST D3DXCOLOR&);
266
267 BOOL operator == (CONST D3DXCOLOR&) const;
268 BOOL operator != (CONST D3DXCOLOR&) const;
269#endif /* __cplusplus */
270 FLOAT r, g, b, a;
271} D3DXCOLOR, *LPD3DXCOLOR;
272
273#ifdef __cplusplus
274extern "C" {
275#endif
276
277D3DXCOLOR* WINAPI D3DXColorAdjustContrast(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s);
278D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s);
279
280FLOAT WINAPI D3DXFresnelTerm(FLOAT costheta, FLOAT refractionindex);
281
282D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, FLOAT scaling, CONST D3DXVECTOR3 *rotationcenter, CONST D3DXQUATERNION *rotation, CONST D3DXVECTOR3 *translation);
283D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D(D3DXMATRIX *pout, FLOAT scaling, CONST D3DXVECTOR2 *protationcenter, FLOAT rotation, CONST D3DXVECTOR2 *ptranslation);
284HRESULT WINAPI D3DXMatrixDecompose(D3DXVECTOR3 *poutscale, D3DXQUATERNION *poutrotation, D3DXVECTOR3 *pouttranslation, CONST D3DXMATRIX *pm);
285FLOAT WINAPI D3DXMatrixDeterminant(CONST D3DXMATRIX *pm);
286D3DXMATRIX* WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, CONST D3DXMATRIX *pm);
287D3DXMATRIX* WINAPI D3DXMatrixLookAtLH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup);
288D3DXMATRIX* WINAPI D3DXMatrixLookAtRH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup);
289D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2);
290D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2);
291D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
292D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
293D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
294D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
295D3DXMATRIX* WINAPI D3DXMatrixOrthoRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
296D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf);
297D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf);
298D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
299D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
300D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
301D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
302D3DXMATRIX* WINAPI D3DXMatrixReflect(D3DXMATRIX *pout, CONST D3DXPLANE *pplane);
303D3DXMATRIX* WINAPI D3DXMatrixRotationAxis(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pv, FLOAT angle);
304D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion(D3DXMATRIX *pout, CONST D3DXQUATERNION *pq);
305D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle);
306D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle);
307D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll(D3DXMATRIX *pout, FLOAT yaw, FLOAT pitch, FLOAT roll);
308D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle);
309D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz);
310D3DXMATRIX* WINAPI D3DXMatrixShadow(D3DXMATRIX *pout, CONST D3DXVECTOR4 *plight, CONST D3DXPLANE *pPlane);
311D3DXMATRIX* WINAPI D3DXMatrixTransformation(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pscalingcenter, CONST D3DXQUATERNION *pscalingrotation, CONST D3DXVECTOR3 *pscaling, CONST D3DXVECTOR3 *protationcenter, CONST D3DXQUATERNION *protation, CONST D3DXVECTOR3 *ptranslation);
312D3DXMATRIX* WINAPI D3DXMatrixTransformation2D(D3DXMATRIX *pout, CONST D3DXVECTOR2 *pscalingcenter, FLOAT scalingrotation, CONST D3DXVECTOR2 *pscaling, CONST D3DXVECTOR2 *protationcenter, FLOAT rotation, CONST D3DXVECTOR2 *ptranslation);
313D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z);
314D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm);
315
316D3DXPLANE* WINAPI D3DXPlaneFromPointNormal(D3DXPLANE *pout, CONST D3DXVECTOR3 *pvpoint, CONST D3DXVECTOR3 *pvnormal);
317D3DXPLANE* WINAPI D3DXPlaneFromPoints(D3DXPLANE *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3);
318D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *pp, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2);
319D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp);
320D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, CONST D3DXMATRIX *pm);
321D3DXPLANE* WINAPI D3DXPlaneTransformArray(D3DXPLANE *pout, UINT outstride, CONST D3DXPLANE *pplane, UINT pstride, CONST D3DXMATRIX *pm, UINT n);
322
323D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, FLOAT f, FLOAT g);
324D3DXQUATERNION* WINAPI D3DXQuaternionExp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
325D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
326D3DXQUATERNION* WINAPI D3DXQuaternionLn(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
327D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2);
328D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
329D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis(D3DXQUATERNION *pout, CONST D3DXVECTOR3 *pv, FLOAT angle);
330D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix(D3DXQUATERNION *pout, CONST D3DXMATRIX *pm);
331D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll(D3DXQUATERNION *pout, FLOAT yaw, FLOAT pitch, FLOAT roll);
332D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, FLOAT t);
333D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, CONST D3DXQUATERNION *pq4, FLOAT t);
334void WINAPI D3DXQuaternionToAxisAngle(CONST D3DXQUATERNION *pq, D3DXVECTOR3 *paxis, FLOAT *pangle);
335
336D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g);
337D3DXVECTOR2* WINAPI D3DXVec2CatmullRom(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv0, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT s);
338D3DXVECTOR2* WINAPI D3DXVec2Hermite(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pt1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pt2, FLOAT s);
339D3DXVECTOR2* WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv);
340D3DXVECTOR4* WINAPI D3DXVec2Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm);
341D3DXVECTOR4* WINAPI D3DXVec2TransformArray(D3DXVECTOR4 *pout, UINT outstride, CONST D3DXVECTOR2 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
342D3DXVECTOR2* WINAPI D3DXVec2TransformCoord(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm);
343D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray(D3DXVECTOR2 *pout, UINT outstride, CONST D3DXVECTOR2 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
344D3DXVECTOR2* WINAPI D3DXVec2TransformNormal(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm);
345D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray(D3DXVECTOR2 *pout, UINT outstride, CONST D3DXVECTOR2 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
346
347D3DXVECTOR3* WINAPI D3DXVec3BaryCentric(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3, FLOAT f, FLOAT g);
348D3DXVECTOR3* WINAPI D3DXVec3CatmullRom( D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv0, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3, FLOAT s);
349D3DXVECTOR3* WINAPI D3DXVec3Hermite(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pt1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pt2, FLOAT s);
350D3DXVECTOR3* WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv);
351D3DXVECTOR3* WINAPI D3DXVec3Project(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT9 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld);
352D3DXVECTOR3* 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);
353D3DXVECTOR4* WINAPI D3DXVec3Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm);
354D3DXVECTOR4* WINAPI D3DXVec3TransformArray(D3DXVECTOR4 *pout, UINT outstride, CONST D3DXVECTOR3 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
355D3DXVECTOR3* WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm);
356D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray(D3DXVECTOR3 *pout, UINT outstride, CONST D3DXVECTOR3 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
357D3DXVECTOR3* WINAPI D3DXVec3TransformNormal(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm);
358D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray(D3DXVECTOR3 *pout, UINT outstride, CONST D3DXVECTOR3 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
359D3DXVECTOR3* WINAPI D3DXVec3Unproject(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT9 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld);
360D3DXVECTOR3* 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);
361
362D3DXVECTOR4* WINAPI D3DXVec4BaryCentric(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3, FLOAT f, FLOAT g);
363D3DXVECTOR4* WINAPI D3DXVec4CatmullRom(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv0, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3, FLOAT s);
364D3DXVECTOR4* WINAPI D3DXVec4Cross(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3);
365D3DXVECTOR4* WINAPI D3DXVec4Hermite(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pt1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pt2, FLOAT s);
366D3DXVECTOR4* WINAPI D3DXVec4Normalize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv);
367D3DXVECTOR4* WINAPI D3DXVec4Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv, CONST D3DXMATRIX *pm);
368D3DXVECTOR4* WINAPI D3DXVec4TransformArray(D3DXVECTOR4 *pout, UINT outstride, CONST D3DXVECTOR4 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
369
370#ifdef __cplusplus
371}
372#endif
373
374typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK;
375
376DEFINE_GUID(IID_ID3DXMatrixStack,
3770xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85);
378
379#undef INTERFACE
380#define INTERFACE ID3DXMatrixStack
381
382DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown)
383{
384 STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
385 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
386 STDMETHOD_(ULONG,Release)(THIS) PURE;
387 STDMETHOD(Pop)(THIS) PURE;
388 STDMETHOD(Push)(THIS) PURE;
389 STDMETHOD(LoadIdentity)(THIS) PURE;
390 STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
391 STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
392 STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE;
393 STDMETHOD(RotateAxis)(THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
394 STDMETHOD(RotateAxisLocal)(THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
395 STDMETHOD(RotateYawPitchRoll)(THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
396 STDMETHOD(RotateYawPitchRollLocal)(THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
397 STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
398 STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
399 STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE;
400 STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
401 STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE;
402};
403
404#undef INTERFACE
405
406#if !defined(__cplusplus) || defined(CINTERFACE)
407
408#define ID3DXMatrixStack_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
409#define ID3DXMatrixStack_AddRef(p) (p)->lpVtbl->AddRef(p)
410#define ID3DXMatrixStack_Release(p) (p)->lpVtbl->Release(p)
411#define ID3DXMatrixStack_Pop(p) (p)->lpVtbl->Pop(p)
412#define ID3DXMatrixStack_Push(p) (p)->lpVtbl->Push(p)
413#define ID3DXMatrixStack_LoadIdentity(p) (p)->lpVtbl->LoadIdentity(p)
414#define ID3DXMatrixStack_LoadMatrix(p,a) (p)->lpVtbl->LoadMatrix(p,a)
415#define ID3DXMatrixStack_MultMatrix(p,a) (p)->lpVtbl->MultMatrix(p,a)
416#define ID3DXMatrixStack_MultMatrixLocal(p,a) (p)->lpVtbl->MultMatrixLocal(p,a)
417#define ID3DXMatrixStack_RotateAxis(p,a,b) (p)->lpVtbl->RotateAxis(p,a,b)
418#define ID3DXMatrixStack_RotateAxisLocal(p,a,b) (p)->lpVtbl->RotateAxisLocal(p,a,b)
419#define ID3DXMatrixStack_RotateYawPitchRoll(p,a,b,c) (p)->lpVtbl->RotateYawPitchRoll(p,a,b,c)
420#define ID3DXMatrixStack_RotateYawPitchRollLocal(p,a,b,c) (p)->lpVtbl->RotateYawPitchRollLocal(p,a,b,c)
421#define ID3DXMatrixStack_Scale(p,a,b,c) (p)->lpVtbl->Scale(p,a,b,c)
422#define ID3DXMatrixStack_ScaleLocal(p,a,b,c) (p)->lpVtbl->ScaleLocal(p,a,b,c)
423#define ID3DXMatrixStack_Translate(p,a,b,c) (p)->lpVtbl->Translate(p,a,b,c)
424#define ID3DXMatrixStack_TranslateLocal(p,a,b,c) (p)->lpVtbl->TranslateLocal(p,a,b,c)
425#define ID3DXMatrixStack_GetTop(p) (p)->lpVtbl->GetTop(p)
426
427#endif
428
429#ifdef __cplusplus
430extern "C" {
431#endif
432
433HRESULT WINAPI D3DXCreateMatrixStack(DWORD flags, LPD3DXMATRIXSTACK* ppstack);
434
435#ifdef __cplusplus
436}
437#endif
438
439#include <d3dx9math.inl>
440
441#endif /* __D3DX9MATH_H__ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette