2 * Copyright (C) 2007 David Adam
3 * Copyright (C) 2007 Tony Wasserka
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.
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.
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
22 #ifndef __D3DX8MATH_H__
23 #define __D3DX8MATH_H__
27 #define D3DX_PI ((FLOAT)3.141592654)
28 #define D3DX_1BYPI ((FLOAT)0.318309886)
30 #define D3DXToRadian(degree) ((degree) * (D3DX_PI / 180.0f))
31 #define D3DXToDegree(radian) ((radian) * (180.0f / D3DX_PI))
33 typedef struct ID3DXMatrixStack *LPD3DXMATRIXSTACK;
35 DEFINE_GUID(IID_ID3DXMatrixStack,
36 0xe3357330, 0xcc5e, 0x11d2, 0xa4, 0x34, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
38 typedef struct D3DXVECTOR2
42 D3DXVECTOR2(CONST FLOAT *pf);
43 D3DXVECTOR2(FLOAT fx, FLOAT fy);
46 operator CONST FLOAT* () const;
48 D3DXVECTOR2& operator += (CONST D3DXVECTOR2&);
49 D3DXVECTOR2& operator -= (CONST D3DXVECTOR2&);
50 D3DXVECTOR2& operator *= (FLOAT);
51 D3DXVECTOR2& operator /= (FLOAT);
53 D3DXVECTOR2 operator + () const;
54 D3DXVECTOR2 operator - () const;
56 D3DXVECTOR2 operator + (CONST D3DXVECTOR2&) const;
57 D3DXVECTOR2 operator - (CONST D3DXVECTOR2&) const;
58 D3DXVECTOR2 operator * (FLOAT) const;
59 D3DXVECTOR2 operator / (FLOAT) const;
61 friend D3DXVECTOR2 operator * (FLOAT, CONST D3DXVECTOR2&);
63 BOOL operator == (CONST D3DXVECTOR2&) const;
64 BOOL operator != (CONST D3DXVECTOR2&) const;
65 #endif /* __cplusplus */
67 } D3DXVECTOR2, *LPD3DXVECTOR2;
70 typedef struct D3DXVECTOR3 : public D3DVECTOR
73 D3DXVECTOR3(CONST FLOAT *pf);
74 D3DXVECTOR3(CONST D3DVECTOR& v);
75 D3DXVECTOR3(FLOAT fx, FLOAT fy, FLOAT fz);
78 operator CONST FLOAT* () const;
80 D3DXVECTOR3& operator += (CONST D3DXVECTOR3&);
81 D3DXVECTOR3& operator -= (CONST D3DXVECTOR3&);
82 D3DXVECTOR3& operator *= (FLOAT);
83 D3DXVECTOR3& operator /= (FLOAT);
85 D3DXVECTOR3 operator + () const;
86 D3DXVECTOR3 operator - () const;
88 D3DXVECTOR3 operator + (CONST D3DXVECTOR3&) const;
89 D3DXVECTOR3 operator - (CONST D3DXVECTOR3&) const;
90 D3DXVECTOR3 operator * (FLOAT) const;
91 D3DXVECTOR3 operator / (FLOAT) const;
93 friend D3DXVECTOR3 operator * (FLOAT, CONST struct D3DXVECTOR3&);
95 BOOL operator == (CONST D3DXVECTOR3&) const;
96 BOOL operator != (CONST D3DXVECTOR3&) const;
97 } D3DXVECTOR3, *LPD3DXVECTOR3;
98 #else /* !__cplusplus */
99 typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3;
100 #endif /* !__cplusplus */
102 typedef struct D3DXVECTOR4
106 D3DXVECTOR4(CONST FLOAT *pf);
107 D3DXVECTOR4(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw);
110 operator CONST FLOAT* () const;
112 D3DXVECTOR4& operator += (CONST D3DXVECTOR4&);
113 D3DXVECTOR4& operator -= (CONST D3DXVECTOR4&);
114 D3DXVECTOR4& operator *= (FLOAT);
115 D3DXVECTOR4& operator /= (FLOAT);
117 D3DXVECTOR4 operator + () const;
118 D3DXVECTOR4 operator - () const;
120 D3DXVECTOR4 operator + (CONST D3DXVECTOR4&) const;
121 D3DXVECTOR4 operator - (CONST D3DXVECTOR4&) const;
122 D3DXVECTOR4 operator * (FLOAT) const;
123 D3DXVECTOR4 operator / (FLOAT) const;
125 friend D3DXVECTOR4 operator * (FLOAT, CONST D3DXVECTOR4&);
127 BOOL operator == (CONST D3DXVECTOR4&) const;
128 BOOL operator != (CONST D3DXVECTOR4&) const;
129 #endif /* __cplusplus */
131 } D3DXVECTOR4, *LPD3DXVECTOR4;
134 typedef struct D3DXMATRIX : public D3DMATRIX
137 D3DXMATRIX(CONST FLOAT *pf);
138 D3DXMATRIX(CONST D3DMATRIX& mat);
139 D3DXMATRIX(FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14,
140 FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24,
141 FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34,
142 FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44);
144 FLOAT& operator () (UINT row, UINT col);
145 FLOAT operator () (UINT row, UINT col) const;
148 operator CONST FLOAT* () const;
150 D3DXMATRIX& operator *= (CONST D3DXMATRIX&);
151 D3DXMATRIX& operator += (CONST D3DXMATRIX&);
152 D3DXMATRIX& operator -= (CONST D3DXMATRIX&);
153 D3DXMATRIX& operator *= (FLOAT);
154 D3DXMATRIX& operator /= (FLOAT);
156 D3DXMATRIX operator + () const;
157 D3DXMATRIX operator - () const;
159 D3DXMATRIX operator * (CONST D3DXMATRIX&) const;
160 D3DXMATRIX operator + (CONST D3DXMATRIX&) const;
161 D3DXMATRIX operator - (CONST D3DXMATRIX&) const;
162 D3DXMATRIX operator * (FLOAT) const;
163 D3DXMATRIX operator / (FLOAT) const;
165 friend D3DXMATRIX operator * (FLOAT, CONST D3DXMATRIX&);
167 BOOL operator == (CONST D3DXMATRIX&) const;
168 BOOL operator != (CONST D3DXMATRIX&) const;
169 } D3DXMATRIX, *LPD3DXMATRIX;
170 #else /* !__cplusplus */
171 typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX;
172 #endif /* !__cplusplus */
174 typedef struct D3DXQUATERNION
178 D3DXQUATERNION(CONST FLOAT *pf);
179 D3DXQUATERNION(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw);
182 operator CONST FLOAT* () const;
184 D3DXQUATERNION& operator += (CONST D3DXQUATERNION&);
185 D3DXQUATERNION& operator -= (CONST D3DXQUATERNION&);
186 D3DXQUATERNION& operator *= (CONST D3DXQUATERNION&);
187 D3DXQUATERNION& operator *= (FLOAT);
188 D3DXQUATERNION& operator /= (FLOAT);
190 D3DXQUATERNION operator + () const;
191 D3DXQUATERNION operator - () const;
193 D3DXQUATERNION operator + (CONST D3DXQUATERNION&) const;
194 D3DXQUATERNION operator - (CONST D3DXQUATERNION&) const;
195 D3DXQUATERNION operator * (CONST D3DXQUATERNION&) const;
196 D3DXQUATERNION operator * (FLOAT) const;
197 D3DXQUATERNION operator / (FLOAT) const;
199 friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION&);
201 BOOL operator == (CONST D3DXQUATERNION&) const;
202 BOOL operator != (CONST D3DXQUATERNION&) const;
203 #endif /* __cplusplus */
205 } D3DXQUATERNION, *LPD3DXQUATERNION;
207 typedef struct D3DXPLANE
211 D3DXPLANE(CONST FLOAT *pf);
212 D3DXPLANE(FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd);
215 operator CONST FLOAT* () const;
217 D3DXPLANE operator + () const;
218 D3DXPLANE operator - () const;
220 BOOL operator == (CONST D3DXPLANE&) const;
221 BOOL operator != (CONST D3DXPLANE&) const;
222 #endif /* __cplusplus */
224 } D3DXPLANE, *LPD3DXPLANE;
226 typedef struct D3DXCOLOR
230 D3DXCOLOR(DWORD col);
231 D3DXCOLOR(CONST FLOAT *pf);
232 D3DXCOLOR(CONST D3DCOLORVALUE& col);
233 D3DXCOLOR(FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa);
235 operator DWORD () const;
238 operator CONST FLOAT* () const;
240 operator D3DCOLORVALUE* ();
241 operator CONST D3DCOLORVALUE* () const;
243 operator D3DCOLORVALUE& ();
244 operator CONST D3DCOLORVALUE& () const;
246 D3DXCOLOR& operator += (CONST D3DXCOLOR&);
247 D3DXCOLOR& operator -= (CONST D3DXCOLOR&);
248 D3DXCOLOR& operator *= (FLOAT);
249 D3DXCOLOR& operator /= (FLOAT);
251 D3DXCOLOR operator + () const;
252 D3DXCOLOR operator - () const;
254 D3DXCOLOR operator + (CONST D3DXCOLOR&) const;
255 D3DXCOLOR operator - (CONST D3DXCOLOR&) const;
256 D3DXCOLOR operator * (FLOAT) const;
257 D3DXCOLOR operator / (FLOAT) const;
259 friend D3DXCOLOR operator * (FLOAT, CONST D3DXCOLOR&);
261 BOOL operator == (CONST D3DXCOLOR&) const;
262 BOOL operator != (CONST D3DXCOLOR&) const;
263 #endif /* __cplusplus */
265 } D3DXCOLOR, *LPD3DXCOLOR;
271 D3DXCOLOR* WINAPI D3DXColorAdjustContrast(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s);
272 D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s);
274 D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, FLOAT scaling, CONST D3DXVECTOR3 *rotationcenter, CONST D3DXQUATERNION *rotation, CONST D3DXVECTOR3 *translation);
275 FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm);
276 D3DXMATRIX* WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, CONST D3DXMATRIX *pm);
277 D3DXMATRIX* WINAPI D3DXMatrixLookAtLH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup);
278 D3DXMATRIX* WINAPI D3DXMatrixLookAtRH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup);
279 D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2);
280 D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2);
281 D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
282 D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
283 D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
284 D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
285 D3DXMATRIX* WINAPI D3DXMatrixOrthoRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
286 D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf);
287 D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf);
288 D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
289 D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
290 D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
291 D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
292 D3DXMATRIX* WINAPI D3DXMatrixReflect(D3DXMATRIX *pout, CONST D3DXPLANE *pplane);
293 D3DXMATRIX* WINAPI D3DXMatrixRotationAxis(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pv, FLOAT angle);
294 D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion(D3DXMATRIX *pout, CONST D3DXQUATERNION *pq);
295 D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle);
296 D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle);
297 D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll(D3DXMATRIX *pout, FLOAT yaw, FLOAT pitch, FLOAT roll);
298 D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle);
299 D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz);
300 D3DXMATRIX* WINAPI D3DXMatrixShadow(D3DXMATRIX *pout, CONST D3DXVECTOR4 *plight, CONST D3DXPLANE *pPlane);
301 D3DXMATRIX* WINAPI D3DXMatrixTransformation(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pscalingcenter, CONST D3DXQUATERNION *pscalingrotation, CONST D3DXVECTOR3 *pscaling, CONST D3DXVECTOR3 *protationcenter, CONST D3DXQUATERNION *protation, CONST D3DXVECTOR3 *ptranslation);
302 D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z);
303 D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm);
305 D3DXPLANE* WINAPI D3DXPlaneFromPointNormal(D3DXPLANE *pout, CONST D3DXVECTOR3 *pvpoint, CONST D3DXVECTOR3 *pvnormal);
306 D3DXPLANE* WINAPI D3DXPlaneFromPoints(D3DXPLANE *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3);
307 D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *pp, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2);
308 D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp);
309 D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, CONST D3DXMATRIX *pm);
311 D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, FLOAT f, FLOAT g);
312 D3DXQUATERNION* WINAPI D3DXQuaternionExp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
313 D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
314 D3DXQUATERNION* WINAPI D3DXQuaternionLn(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
315 D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2);
316 D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
317 D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis(D3DXQUATERNION *pout, CONST D3DXVECTOR3 *pv, FLOAT angle);
318 D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix(D3DXQUATERNION *pout, CONST D3DXMATRIX *pm);
319 D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll(D3DXQUATERNION *pout, FLOAT yaw, FLOAT pitch, FLOAT roll);
320 D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, FLOAT t);
321 D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, CONST D3DXQUATERNION *pq4, FLOAT t);
322 void WINAPI D3DXQuaternionToAxisAngle(CONST D3DXQUATERNION *pq, D3DXVECTOR3 *paxis, FLOAT *pangle);
324 D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g);
325 D3DXVECTOR2* WINAPI D3DXVec2CatmullRom(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv0, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT s);
326 D3DXVECTOR2* WINAPI D3DXVec2Hermite(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pt1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pt2, FLOAT s);
327 D3DXVECTOR2* WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv);
328 D3DXVECTOR4* WINAPI D3DXVec2Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm);
329 D3DXVECTOR2* WINAPI D3DXVec2TransformCoord(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm);
330 D3DXVECTOR2* WINAPI D3DXVec2TransformNormal(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm);
332 D3DXVECTOR3* WINAPI D3DXVec3BaryCentric(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3, FLOAT f, FLOAT g);
333 D3DXVECTOR3* WINAPI D3DXVec3CatmullRom( D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv0, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3, FLOAT s);
334 D3DXVECTOR3* WINAPI D3DXVec3Hermite(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pt1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pt2, FLOAT s);
335 D3DXVECTOR3* WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv);
336 D3DXVECTOR3* WINAPI D3DXVec3Project(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT8 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld);
337 D3DXVECTOR4* WINAPI D3DXVec3Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm);
338 D3DXVECTOR3* WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm);
339 D3DXVECTOR3* WINAPI D3DXVec3TransformNormal(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm);
340 D3DXVECTOR3* WINAPI D3DXVec3Unproject(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT8 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld);
342 D3DXVECTOR4* WINAPI D3DXVec4BaryCentric(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3, FLOAT f, FLOAT g);
343 D3DXVECTOR4* WINAPI D3DXVec4CatmullRom(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv0, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3, FLOAT s);
344 D3DXVECTOR4* WINAPI D3DXVec4Cross(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3);
345 D3DXVECTOR4* WINAPI D3DXVec4Hermite(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pt1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pt2, FLOAT s);
346 D3DXVECTOR4* WINAPI D3DXVec4Normalize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv);
347 D3DXVECTOR4* WINAPI D3DXVec4Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv, CONST D3DXMATRIX *pm);
353 #define INTERFACE ID3DXMatrixStack
354 DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown)
356 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID, LPVOID*) PURE;
357 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
358 STDMETHOD_(ULONG,Release)(THIS) PURE;
359 STDMETHOD(Pop)(THIS) PURE;
360 STDMETHOD(Push)(THIS) PURE;
361 STDMETHOD(LoadIdentity)(THIS) PURE;
362 STDMETHOD(LoadMatrix)(THIS_ CONST LPD3DXMATRIX) PURE;
363 STDMETHOD(MultMatrix)(THIS_ CONST LPD3DXMATRIX) PURE;
364 STDMETHOD(MultMatrixLocal)(THIS_ CONST LPD3DXMATRIX) PURE;
365 STDMETHOD(RotateAxis)(THIS_ CONST LPD3DXVECTOR3, FLOAT) PURE;
366 STDMETHOD(RotateAxisLocal)(THIS_ CONST LPD3DXVECTOR3, FLOAT) PURE;
367 STDMETHOD(RotateYawPitchRoll)(THIS_ FLOAT, FLOAT, FLOAT) PURE;
368 STDMETHOD(RotateYawPitchRollLocal)(THIS_ FLOAT, FLOAT, FLOAT) PURE;
369 STDMETHOD(Scale)(THIS_ FLOAT, FLOAT, FLOAT) PURE;
370 STDMETHOD(ScaleLocal)(THIS_ FLOAT, FLOAT, FLOAT) PURE;
371 STDMETHOD(Translate)(THIS_ FLOAT, FLOAT, FLOAT) PURE;
372 STDMETHOD(TranslateLocal)(THIS_ FLOAT, FLOAT, FLOAT) PURE;
373 STDMETHOD_(LPD3DXMATRIX, GetTop)(THIS) PURE;
378 #if !defined(__cplusplus) || defined(CINTERFACE)
380 #define ID3DXMatrixStack_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
381 #define ID3DXMatrixStack_AddRef(p) (p)->lpVtbl->AddRef(p)
382 #define ID3DXMatrixStack_Release(p) (p)->lpVtbl->Release(p)
383 #define ID3DXMatrixStack_Pop(p) (p)->lpVtbl->Pop(p)
384 #define ID3DXMatrixStack_Push(p) (p)->lpVtbl->Push(p)
385 #define ID3DXMatrixStack_LoadIdentity(p) (p)->lpVtbl->LoadIdentity(p)
386 #define ID3DXMatrixStack_LoadMatrix(p,a) (p)->lpVtbl->LoadMatrix(p,a)
387 #define ID3DXMatrixStack_MultMatrix(p,a) (p)->lpVtbl->MultMatrix(p,a)
388 #define ID3DXMatrixStack_MultMatrixLocal(p,a) (p)->lpVtbl->MultMatrixLocal(p,a)
389 #define ID3DXMatrixStack_RotateAxis(p,a,b) (p)->lpVtbl->RotateAxis(p,a,b)
390 #define ID3DXMatrixStack_RotateAxisLocal(p,a,b) (p)->lpVtbl->RotateAxisLocal(p,a,b)
391 #define ID3DXMatrixStack_RotateYawPitchRoll(p,a,b,c) (p)->lpVtbl->RotateYawPitchRoll(p,a,b,c)
392 #define ID3DXMatrixStack_RotateYawPitchRollLocal(p,a,b,c) (p)->lpVtbl->RotateYawPitchRollLocal(p,a,b,c)
393 #define ID3DXMatrixStack_Scale(p,a,b,c) (p)->lpVtbl->Scale(p,a,b,c)
394 #define ID3DXMatrixStack_ScaleLocal(p,a,b,c) (p)->lpVtbl->ScaleLocal(p,a,b,c)
395 #define ID3DXMatrixStack_Translate(p,a,b,c) (p)->lpVtbl->Translate(p,a,b,c)
396 #define ID3DXMatrixStack_TranslateLocal(p,a,b,c) (p)->lpVtbl->TranslateLocal(p,a,b,c)
397 #define ID3DXMatrixStack_GetTop(p) (p)->lpVtbl->GetTop(p)
405 HRESULT WINAPI D3DXCreateMatrixStack(DWORD flags, LPD3DXMATRIXSTACK* ppstack);
411 #include <d3dx8math.inl>
413 #endif /* __D3DX8MATH_H__ */