VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/d3dx8math.h@ 27512

Last change on this file since 27512 was 22496, checked in by vboxsync, 16 years ago

crOpenGL: update wine to 1.1.27 and better fix for depthstencil surface refcounting

  • Property svn:eol-style set to native
File size: 22.0 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/*
30 * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
31 * other than GPL or LGPL is available it will apply instead, Sun elects to use only
32 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
33 * a choice of LGPL license versions is made available with the language indicating
34 * that LGPLv2 or any later version may be used, or where a choice of which version
35 * of the LGPL is applied is otherwise unspecified.
36 */
37
38/*
39 * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
40 * other than GPL or LGPL is available it will apply instead, Sun elects to use only
41 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
42 * a choice of LGPL license versions is made available with the language indicating
43 * that LGPLv2 or any later version may be used, or where a choice of which version
44 * of the LGPL is applied is otherwise unspecified.
45 */
46
47/*
48 * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
49 * other than GPL or LGPL is available it will apply instead, Sun elects to use only
50 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
51 * a choice of LGPL license versions is made available with the language indicating
52 * that LGPLv2 or any later version may be used, or where a choice of which version
53 * of the LGPL is applied is otherwise unspecified.
54 */
55
56/*
57 * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
58 * other than GPL or LGPL is available it will apply instead, Sun elects to use only
59 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
60 * a choice of LGPL license versions is made available with the language indicating
61 * that LGPLv2 or any later version may be used, or where a choice of which version
62 * of the LGPL is applied is otherwise unspecified.
63 */
64
65/*
66 * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
67 * other than GPL or LGPL is available it will apply instead, Sun elects to use only
68 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
69 * a choice of LGPL license versions is made available with the language indicating
70 * that LGPLv2 or any later version may be used, or where a choice of which version
71 * of the LGPL is applied is otherwise unspecified.
72 */
73
74#include <d3dx8.h>
75
76#ifndef __D3DX8MATH_H__
77#define __D3DX8MATH_H__
78
79#include <math.h>
80
81#define D3DX_PI ((FLOAT)3.141592654)
82#define D3DX_1BYPI ((FLOAT)0.318309886)
83
84#define D3DXToRadian(degree) ((degree) * (D3DX_PI / 180.0f))
85#define D3DXToDegree(radian) ((radian) * (180.0f / D3DX_PI))
86
87typedef struct ID3DXMatrixStack *LPD3DXMATRIXSTACK;
88
89DEFINE_GUID(IID_ID3DXMatrixStack,
900xe3357330, 0xcc5e, 0x11d2, 0xa4, 0x34, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
91
92typedef struct D3DXVECTOR2
93{
94#ifdef __cplusplus
95 D3DXVECTOR2();
96 D3DXVECTOR2(CONST FLOAT *pf);
97 D3DXVECTOR2(FLOAT fx, FLOAT fy);
98
99 operator FLOAT* ();
100 operator CONST FLOAT* () const;
101
102 D3DXVECTOR2& operator += (CONST D3DXVECTOR2&);
103 D3DXVECTOR2& operator -= (CONST D3DXVECTOR2&);
104 D3DXVECTOR2& operator *= (FLOAT);
105 D3DXVECTOR2& operator /= (FLOAT);
106
107 D3DXVECTOR2 operator + () const;
108 D3DXVECTOR2 operator - () const;
109
110 D3DXVECTOR2 operator + (CONST D3DXVECTOR2&) const;
111 D3DXVECTOR2 operator - (CONST D3DXVECTOR2&) const;
112 D3DXVECTOR2 operator * (FLOAT) const;
113 D3DXVECTOR2 operator / (FLOAT) const;
114
115 friend D3DXVECTOR2 operator * (FLOAT, CONST D3DXVECTOR2&);
116
117 BOOL operator == (CONST D3DXVECTOR2&) const;
118 BOOL operator != (CONST D3DXVECTOR2&) const;
119#endif /* __cplusplus */
120 FLOAT x, y;
121} D3DXVECTOR2, *LPD3DXVECTOR2;
122
123#ifdef __cplusplus
124typedef struct D3DXVECTOR3 : public D3DVECTOR
125{
126 D3DXVECTOR3();
127 D3DXVECTOR3(CONST FLOAT *pf);
128 D3DXVECTOR3(CONST D3DVECTOR& v);
129 D3DXVECTOR3(FLOAT fx, FLOAT fy, FLOAT fz);
130
131 operator FLOAT* ();
132 operator CONST FLOAT* () const;
133
134 D3DXVECTOR3& operator += (CONST D3DXVECTOR3&);
135 D3DXVECTOR3& operator -= (CONST D3DXVECTOR3&);
136 D3DXVECTOR3& operator *= (FLOAT);
137 D3DXVECTOR3& operator /= (FLOAT);
138
139 D3DXVECTOR3 operator + () const;
140 D3DXVECTOR3 operator - () const;
141
142 D3DXVECTOR3 operator + (CONST D3DXVECTOR3&) const;
143 D3DXVECTOR3 operator - (CONST D3DXVECTOR3&) const;
144 D3DXVECTOR3 operator * (FLOAT) const;
145 D3DXVECTOR3 operator / (FLOAT) const;
146
147 friend D3DXVECTOR3 operator * (FLOAT, CONST struct D3DXVECTOR3&);
148
149 BOOL operator == (CONST D3DXVECTOR3&) const;
150 BOOL operator != (CONST D3DXVECTOR3&) const;
151} D3DXVECTOR3, *LPD3DXVECTOR3;
152#else /* !__cplusplus */
153typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3;
154#endif /* !__cplusplus */
155
156typedef struct D3DXVECTOR4
157{
158#ifdef __cplusplus
159 D3DXVECTOR4();
160 D3DXVECTOR4(CONST FLOAT *pf);
161 D3DXVECTOR4(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw);
162
163 operator FLOAT* ();
164 operator CONST FLOAT* () const;
165
166 D3DXVECTOR4& operator += (CONST D3DXVECTOR4&);
167 D3DXVECTOR4& operator -= (CONST D3DXVECTOR4&);
168 D3DXVECTOR4& operator *= (FLOAT);
169 D3DXVECTOR4& operator /= (FLOAT);
170
171 D3DXVECTOR4 operator + () const;
172 D3DXVECTOR4 operator - () const;
173
174 D3DXVECTOR4 operator + (CONST D3DXVECTOR4&) const;
175 D3DXVECTOR4 operator - (CONST D3DXVECTOR4&) const;
176 D3DXVECTOR4 operator * (FLOAT) const;
177 D3DXVECTOR4 operator / (FLOAT) const;
178
179 friend D3DXVECTOR4 operator * (FLOAT, CONST D3DXVECTOR4&);
180
181 BOOL operator == (CONST D3DXVECTOR4&) const;
182 BOOL operator != (CONST D3DXVECTOR4&) const;
183#endif /* __cplusplus */
184 FLOAT x, y, z, w;
185} D3DXVECTOR4, *LPD3DXVECTOR4;
186
187#ifdef __cplusplus
188typedef struct D3DXMATRIX : public D3DMATRIX
189{
190 D3DXMATRIX();
191 D3DXMATRIX(CONST FLOAT *pf);
192 D3DXMATRIX(CONST D3DMATRIX& mat);
193 D3DXMATRIX(FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14,
194 FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24,
195 FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34,
196 FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44);
197
198 FLOAT& operator () (UINT row, UINT col);
199 FLOAT operator () (UINT row, UINT col) const;
200
201 operator FLOAT* ();
202 operator CONST FLOAT* () const;
203
204 D3DXMATRIX& operator *= (CONST D3DXMATRIX&);
205 D3DXMATRIX& operator += (CONST D3DXMATRIX&);
206 D3DXMATRIX& operator -= (CONST D3DXMATRIX&);
207 D3DXMATRIX& operator *= (FLOAT);
208 D3DXMATRIX& operator /= (FLOAT);
209
210 D3DXMATRIX operator + () const;
211 D3DXMATRIX operator - () const;
212
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} D3DXMATRIX, *LPD3DXMATRIX;
224#else /* !__cplusplus */
225typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX;
226#endif /* !__cplusplus */
227
228typedef struct D3DXQUATERNION
229{
230#ifdef __cplusplus
231 D3DXQUATERNION();
232 D3DXQUATERNION(CONST FLOAT *pf);
233 D3DXQUATERNION(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw);
234
235 operator FLOAT* ();
236 operator CONST FLOAT* () const;
237
238 D3DXQUATERNION& operator += (CONST D3DXQUATERNION&);
239 D3DXQUATERNION& operator -= (CONST D3DXQUATERNION&);
240 D3DXQUATERNION& operator *= (CONST D3DXQUATERNION&);
241 D3DXQUATERNION& operator *= (FLOAT);
242 D3DXQUATERNION& operator /= (FLOAT);
243
244 D3DXQUATERNION operator + () const;
245 D3DXQUATERNION operator - () const;
246
247 D3DXQUATERNION operator + (CONST D3DXQUATERNION&) const;
248 D3DXQUATERNION operator - (CONST D3DXQUATERNION&) const;
249 D3DXQUATERNION operator * (CONST D3DXQUATERNION&) const;
250 D3DXQUATERNION operator * (FLOAT) const;
251 D3DXQUATERNION operator / (FLOAT) const;
252
253 friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION&);
254
255 BOOL operator == (CONST D3DXQUATERNION&) const;
256 BOOL operator != (CONST D3DXQUATERNION&) const;
257#endif /* __cplusplus */
258 FLOAT x, y, z, w;
259} D3DXQUATERNION, *LPD3DXQUATERNION;
260
261typedef struct D3DXPLANE
262{
263#ifdef __cplusplus
264 D3DXPLANE();
265 D3DXPLANE(CONST FLOAT *pf);
266 D3DXPLANE(FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd);
267
268 operator FLOAT* ();
269 operator CONST FLOAT* () const;
270
271 D3DXPLANE operator + () const;
272 D3DXPLANE operator - () const;
273
274 BOOL operator == (CONST D3DXPLANE&) const;
275 BOOL operator != (CONST D3DXPLANE&) const;
276#endif /* __cplusplus */
277 FLOAT a, b, c, d;
278} D3DXPLANE, *LPD3DXPLANE;
279
280typedef struct D3DXCOLOR
281{
282#ifdef __cplusplus
283 D3DXCOLOR();
284 D3DXCOLOR(DWORD col);
285 D3DXCOLOR(CONST FLOAT *pf);
286 D3DXCOLOR(CONST D3DCOLORVALUE& col);
287 D3DXCOLOR(FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa);
288
289 operator DWORD () const;
290
291 operator FLOAT* ();
292 operator CONST FLOAT* () const;
293
294 operator D3DCOLORVALUE* ();
295 operator CONST D3DCOLORVALUE* () const;
296
297 operator D3DCOLORVALUE& ();
298 operator CONST D3DCOLORVALUE& () const;
299
300 D3DXCOLOR& operator += (CONST D3DXCOLOR&);
301 D3DXCOLOR& operator -= (CONST D3DXCOLOR&);
302 D3DXCOLOR& operator *= (FLOAT);
303 D3DXCOLOR& operator /= (FLOAT);
304
305 D3DXCOLOR operator + () const;
306 D3DXCOLOR operator - () const;
307
308 D3DXCOLOR operator + (CONST D3DXCOLOR&) const;
309 D3DXCOLOR operator - (CONST D3DXCOLOR&) const;
310 D3DXCOLOR operator * (FLOAT) const;
311 D3DXCOLOR operator / (FLOAT) const;
312
313 friend D3DXCOLOR operator * (FLOAT, CONST D3DXCOLOR&);
314
315 BOOL operator == (CONST D3DXCOLOR&) const;
316 BOOL operator != (CONST D3DXCOLOR&) const;
317#endif /* __cplusplus */
318 FLOAT r, g, b, a;
319} D3DXCOLOR, *LPD3DXCOLOR;
320
321#ifdef __cplusplus
322extern "C" {
323#endif
324
325D3DXCOLOR* WINAPI D3DXColorAdjustContrast(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s);
326D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s);
327
328FLOAT WINAPI D3DXFresnelTerm(FLOAT costheta, FLOAT refractionindex);
329
330D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, FLOAT scaling, CONST D3DXVECTOR3 *rotationcenter, CONST D3DXQUATERNION *rotation, CONST D3DXVECTOR3 *translation);
331FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm);
332D3DXMATRIX* WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, CONST D3DXMATRIX *pm);
333D3DXMATRIX* WINAPI D3DXMatrixLookAtLH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup);
334D3DXMATRIX* WINAPI D3DXMatrixLookAtRH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup);
335D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2);
336D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2);
337D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
338D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
339D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
340D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
341D3DXMATRIX* WINAPI D3DXMatrixOrthoRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
342D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf);
343D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf);
344D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
345D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
346D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
347D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
348D3DXMATRIX* WINAPI D3DXMatrixReflect(D3DXMATRIX *pout, CONST D3DXPLANE *pplane);
349D3DXMATRIX* WINAPI D3DXMatrixRotationAxis(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pv, FLOAT angle);
350D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion(D3DXMATRIX *pout, CONST D3DXQUATERNION *pq);
351D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle);
352D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle);
353D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll(D3DXMATRIX *pout, FLOAT yaw, FLOAT pitch, FLOAT roll);
354D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle);
355D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz);
356D3DXMATRIX* WINAPI D3DXMatrixShadow(D3DXMATRIX *pout, CONST D3DXVECTOR4 *plight, CONST D3DXPLANE *pPlane);
357D3DXMATRIX* WINAPI D3DXMatrixTransformation(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pscalingcenter, CONST D3DXQUATERNION *pscalingrotation, CONST D3DXVECTOR3 *pscaling, CONST D3DXVECTOR3 *protationcenter, CONST D3DXQUATERNION *protation, CONST D3DXVECTOR3 *ptranslation);
358D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z);
359D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm);
360
361D3DXPLANE* WINAPI D3DXPlaneFromPointNormal(D3DXPLANE *pout, CONST D3DXVECTOR3 *pvpoint, CONST D3DXVECTOR3 *pvnormal);
362D3DXPLANE* WINAPI D3DXPlaneFromPoints(D3DXPLANE *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3);
363D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *pp, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2);
364D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp);
365D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, CONST D3DXMATRIX *pm);
366
367D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, FLOAT f, FLOAT g);
368D3DXQUATERNION* WINAPI D3DXQuaternionExp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
369D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
370D3DXQUATERNION* WINAPI D3DXQuaternionLn(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
371D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2);
372D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
373D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis(D3DXQUATERNION *pout, CONST D3DXVECTOR3 *pv, FLOAT angle);
374D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix(D3DXQUATERNION *pout, CONST D3DXMATRIX *pm);
375D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll(D3DXQUATERNION *pout, FLOAT yaw, FLOAT pitch, FLOAT roll);
376D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, FLOAT t);
377D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, CONST D3DXQUATERNION *pq4, FLOAT t);
378void WINAPI D3DXQuaternionToAxisAngle(CONST D3DXQUATERNION *pq, D3DXVECTOR3 *paxis, FLOAT *pangle);
379
380D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g);
381D3DXVECTOR2* WINAPI D3DXVec2CatmullRom(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv0, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT s);
382D3DXVECTOR2* WINAPI D3DXVec2Hermite(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pt1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pt2, FLOAT s);
383D3DXVECTOR2* WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv);
384D3DXVECTOR4* WINAPI D3DXVec2Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm);
385D3DXVECTOR2* WINAPI D3DXVec2TransformCoord(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm);
386D3DXVECTOR2* WINAPI D3DXVec2TransformNormal(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm);
387
388D3DXVECTOR3* WINAPI D3DXVec3BaryCentric(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3, FLOAT f, FLOAT g);
389D3DXVECTOR3* WINAPI D3DXVec3CatmullRom( D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv0, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3, FLOAT s);
390D3DXVECTOR3* WINAPI D3DXVec3Hermite(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pt1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pt2, FLOAT s);
391D3DXVECTOR3* WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv);
392D3DXVECTOR3* WINAPI D3DXVec3Project(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT8 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld);
393D3DXVECTOR4* WINAPI D3DXVec3Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm);
394D3DXVECTOR3* WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm);
395D3DXVECTOR3* WINAPI D3DXVec3TransformNormal(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm);
396D3DXVECTOR3* WINAPI D3DXVec3Unproject(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT8 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld);
397
398D3DXVECTOR4* WINAPI D3DXVec4BaryCentric(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3, FLOAT f, FLOAT g);
399D3DXVECTOR4* WINAPI D3DXVec4CatmullRom(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv0, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3, FLOAT s);
400D3DXVECTOR4* WINAPI D3DXVec4Cross(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3);
401D3DXVECTOR4* WINAPI D3DXVec4Hermite(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pt1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pt2, FLOAT s);
402D3DXVECTOR4* WINAPI D3DXVec4Normalize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv);
403D3DXVECTOR4* WINAPI D3DXVec4Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv, CONST D3DXMATRIX *pm);
404
405#ifdef __cplusplus
406}
407#endif
408
409#define INTERFACE ID3DXMatrixStack
410DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown)
411{
412 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID, LPVOID*) PURE;
413 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
414 STDMETHOD_(ULONG,Release)(THIS) PURE;
415 STDMETHOD(Pop)(THIS) PURE;
416 STDMETHOD(Push)(THIS) PURE;
417 STDMETHOD(LoadIdentity)(THIS) PURE;
418 STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX *) PURE;
419 STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX *) PURE;
420 STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX *) PURE;
421 STDMETHOD(RotateAxis)(THIS_ CONST D3DXVECTOR3 *, FLOAT) PURE;
422 STDMETHOD(RotateAxisLocal)(THIS_ CONST D3DXVECTOR3 *, FLOAT) PURE;
423 STDMETHOD(RotateYawPitchRoll)(THIS_ FLOAT, FLOAT, FLOAT) PURE;
424 STDMETHOD(RotateYawPitchRollLocal)(THIS_ FLOAT, FLOAT, FLOAT) PURE;
425 STDMETHOD(Scale)(THIS_ FLOAT, FLOAT, FLOAT) PURE;
426 STDMETHOD(ScaleLocal)(THIS_ FLOAT, FLOAT, FLOAT) PURE;
427 STDMETHOD(Translate)(THIS_ FLOAT, FLOAT, FLOAT) PURE;
428 STDMETHOD(TranslateLocal)(THIS_ FLOAT, FLOAT, FLOAT) PURE;
429 STDMETHOD_(LPD3DXMATRIX, GetTop)(THIS) PURE;
430};
431
432#undef INTERFACE
433
434#if !defined(__cplusplus) || defined(CINTERFACE)
435
436#define ID3DXMatrixStack_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
437#define ID3DXMatrixStack_AddRef(p) (p)->lpVtbl->AddRef(p)
438#define ID3DXMatrixStack_Release(p) (p)->lpVtbl->Release(p)
439#define ID3DXMatrixStack_Pop(p) (p)->lpVtbl->Pop(p)
440#define ID3DXMatrixStack_Push(p) (p)->lpVtbl->Push(p)
441#define ID3DXMatrixStack_LoadIdentity(p) (p)->lpVtbl->LoadIdentity(p)
442#define ID3DXMatrixStack_LoadMatrix(p,a) (p)->lpVtbl->LoadMatrix(p,a)
443#define ID3DXMatrixStack_MultMatrix(p,a) (p)->lpVtbl->MultMatrix(p,a)
444#define ID3DXMatrixStack_MultMatrixLocal(p,a) (p)->lpVtbl->MultMatrixLocal(p,a)
445#define ID3DXMatrixStack_RotateAxis(p,a,b) (p)->lpVtbl->RotateAxis(p,a,b)
446#define ID3DXMatrixStack_RotateAxisLocal(p,a,b) (p)->lpVtbl->RotateAxisLocal(p,a,b)
447#define ID3DXMatrixStack_RotateYawPitchRoll(p,a,b,c) (p)->lpVtbl->RotateYawPitchRoll(p,a,b,c)
448#define ID3DXMatrixStack_RotateYawPitchRollLocal(p,a,b,c) (p)->lpVtbl->RotateYawPitchRollLocal(p,a,b,c)
449#define ID3DXMatrixStack_Scale(p,a,b,c) (p)->lpVtbl->Scale(p,a,b,c)
450#define ID3DXMatrixStack_ScaleLocal(p,a,b,c) (p)->lpVtbl->ScaleLocal(p,a,b,c)
451#define ID3DXMatrixStack_Translate(p,a,b,c) (p)->lpVtbl->Translate(p,a,b,c)
452#define ID3DXMatrixStack_TranslateLocal(p,a,b,c) (p)->lpVtbl->TranslateLocal(p,a,b,c)
453#define ID3DXMatrixStack_GetTop(p) (p)->lpVtbl->GetTop(p)
454
455#endif
456
457#ifdef __cplusplus
458extern "C" {
459#endif
460
461HRESULT WINAPI D3DXCreateMatrixStack(DWORD flags, LPD3DXMATRIXSTACK* ppstack);
462
463#ifdef __cplusplus
464}
465#endif
466
467#include <d3dx8math.inl>
468
469#endif /* __D3DX8MATH_H__ */
Note: See TracBrowser for help on using the repository browser.

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