VirtualBox

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

Last change on this file since 30705 was 28475, checked in by vboxsync, 15 years ago

crOpenGL: update to wine 1.1.43

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