1 /*==========================================================================;
3 * Copyright (c) Microsoft Corporation. All rights reserved.
6 * Content: Direct3DRM include file
8 ***************************************************************************/
10 #ifndef __D3DRMDEFS_H__
11 #define __D3DRMDEFS_H__
17 #define D3DRMAPI __stdcall
22 #if defined(__cplusplus)
31 typedef struct _D3DRMVECTOR4D
32 { D3DVALUE x
, y
, z
, w
;
33 } D3DRMVECTOR4D
, *LPD3DRMVECTOR4D
;
35 typedef D3DVALUE D3DRMMATRIX4D
[4][4];
37 typedef struct _D3DRMQUATERNION
40 } D3DRMQUATERNION
, *LPD3DRMQUATERNION
;
42 typedef struct _D3DRMRAY
45 } D3DRMRAY
, *LPD3DRMRAY
;
47 typedef struct _D3DRMBOX
49 } D3DRMBOX
, *LPD3DRMBOX
;
51 typedef void (*D3DRMWRAPCALLBACK
)
52 (LPD3DVECTOR
, int* u
, int* v
, LPD3DVECTOR a
, LPD3DVECTOR b
, LPVOID
);
54 typedef enum _D3DRMLIGHTTYPE
58 D3DRMLIGHT_DIRECTIONAL
,
59 D3DRMLIGHT_PARALLELPOINT
60 } D3DRMLIGHTTYPE
, *LPD3DRMLIGHTTYPE
;
62 typedef enum _D3DRMSHADEMODE
{
64 D3DRMSHADE_GOURAUD
= 1,
69 } D3DRMSHADEMODE
, *LPD3DRMSHADEMODE
;
71 typedef enum _D3DRMLIGHTMODE
{
72 D3DRMLIGHT_OFF
= 0 * D3DRMSHADE_MAX
,
73 D3DRMLIGHT_ON
= 1 * D3DRMSHADE_MAX
,
75 D3DRMLIGHT_MASK
= 7 * D3DRMSHADE_MAX
,
76 D3DRMLIGHT_MAX
= 8 * D3DRMSHADE_MAX
77 } D3DRMLIGHTMODE
, *LPD3DRMLIGHTMODE
;
79 typedef enum _D3DRMFILLMODE
{
80 D3DRMFILL_POINTS
= 0 * D3DRMLIGHT_MAX
,
81 D3DRMFILL_WIREFRAME
= 1 * D3DRMLIGHT_MAX
,
82 D3DRMFILL_SOLID
= 2 * D3DRMLIGHT_MAX
,
84 D3DRMFILL_MASK
= 7 * D3DRMLIGHT_MAX
,
85 D3DRMFILL_MAX
= 8 * D3DRMLIGHT_MAX
86 } D3DRMFILLMODE
, *LPD3DRMFILLMODE
;
88 typedef DWORD D3DRMRENDERQUALITY
, *LPD3DRMRENDERQUALITY
;
90 #define D3DRMRENDER_WIREFRAME (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_WIREFRAME)
91 #define D3DRMRENDER_UNLITFLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_SOLID)
92 #define D3DRMRENDER_FLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
93 #define D3DRMRENDER_GOURAUD (D3DRMSHADE_GOURAUD+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
94 #define D3DRMRENDER_PHONG (D3DRMSHADE_PHONG+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
96 #define D3DRMRENDERMODE_BLENDEDTRANSPARENCY 1
97 #define D3DRMRENDERMODE_SORTEDTRANSPARENCY 2
98 #define D3DRMRENDERMODE_LIGHTINMODELSPACE 8
99 #define D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR 16
100 #define D3DRMRENDERMODE_DISABLESORTEDALPHAZWRITE 32
102 typedef enum _D3DRMTEXTUREQUALITY
103 { D3DRMTEXTURE_NEAREST
, /* choose nearest texel */
104 D3DRMTEXTURE_LINEAR
, /* interpolate 4 texels */
105 D3DRMTEXTURE_MIPNEAREST
, /* nearest texel in nearest mipmap */
106 D3DRMTEXTURE_MIPLINEAR
, /* interpolate 2 texels from 2 mipmaps */
107 D3DRMTEXTURE_LINEARMIPNEAREST
, /* interpolate 4 texels in nearest mipmap */
108 D3DRMTEXTURE_LINEARMIPLINEAR
/* interpolate 8 texels from 2 mipmaps */
109 } D3DRMTEXTUREQUALITY
, *LPD3DRMTEXTUREQUALITY
;
114 #define D3DRMTEXTURE_FORCERESIDENT 0x00000001 /* texture should be kept in video memory */
115 #define D3DRMTEXTURE_STATIC 0x00000002 /* texture will not change */
116 #define D3DRMTEXTURE_DOWNSAMPLEPOINT 0x00000004 /* point filtering should be used when downsampling */
117 #define D3DRMTEXTURE_DOWNSAMPLEBILINEAR 0x00000008 /* bilinear filtering should be used when downsampling */
118 #define D3DRMTEXTURE_DOWNSAMPLEREDUCEDEPTH 0x00000010 /* reduce bit depth when downsampling */
119 #define D3DRMTEXTURE_DOWNSAMPLENONE 0x00000020 /* texture should never be downsampled */
120 #define D3DRMTEXTURE_CHANGEDPIXELS 0x00000040 /* pixels have changed */
121 #define D3DRMTEXTURE_CHANGEDPALETTE 0x00000080 /* palette has changed */
122 #define D3DRMTEXTURE_INVALIDATEONLY 0x00000100 /* dirty regions are invalid */
127 #define D3DRMSHADOW_TRUEALPHA 0x00000001 /* shadow should render without artifacts when true alpha is on */
129 typedef enum _D3DRMCOMBINETYPE
130 { D3DRMCOMBINE_REPLACE
,
133 } D3DRMCOMBINETYPE
, *LPD3DRMCOMBINETYPE
;
135 typedef D3DCOLORMODEL D3DRMCOLORMODEL
, *LPD3DRMCOLORMODEL
;
137 typedef enum _D3DRMPALETTEFLAGS
138 { D3DRMPALETTE_FREE
, /* renderer may use this entry freely */
139 D3DRMPALETTE_READONLY
, /* fixed but may be used by renderer */
140 D3DRMPALETTE_RESERVED
/* may not be used by renderer */
141 } D3DRMPALETTEFLAGS
, *LPD3DRMPALETTEFLAGS
;
143 typedef struct _D3DRMPALETTEENTRY
144 { unsigned char red
; /* 0 .. 255 */
145 unsigned char green
; /* 0 .. 255 */
146 unsigned char blue
; /* 0 .. 255 */
147 unsigned char flags
; /* one of D3DRMPALETTEFLAGS */
148 } D3DRMPALETTEENTRY
, *LPD3DRMPALETTEENTRY
;
150 typedef struct _D3DRMIMAGE
151 { int width
, height
; /* width and height in pixels */
152 int aspectx
, aspecty
; /* aspect ratio for non-square pixels */
153 int depth
; /* bits per pixel */
154 int rgb
; /* if false, pixels are indices into a
155 palette otherwise, pixels encode
157 int bytes_per_line
; /* number of bytes of memory for a
158 scanline. This must be a multiple
160 void* buffer1
; /* memory to render into (first buffer). */
161 void* buffer2
; /* second rendering buffer for double
162 buffering, set to NULL for single
164 unsigned long red_mask
;
165 unsigned long green_mask
;
166 unsigned long blue_mask
;
167 unsigned long alpha_mask
; /* if rgb is true, these are masks for
168 the red, green and blue parts of a
169 pixel. Otherwise, these are masks
170 for the significant bits of the
171 red, green and blue elements in the
172 palette. For instance, most SVGA
173 displays use 64 intensities of red,
174 green and blue, so the masks should
175 all be set to 0xfc. */
176 int palette_size
; /* number of entries in palette */
177 D3DRMPALETTEENTRY
* palette
; /* description of the palette (only if
178 rgb is false). Must be (1<<depth)
180 } D3DRMIMAGE
, *LPD3DRMIMAGE
;
182 typedef enum _D3DRMWRAPTYPE
189 } D3DRMWRAPTYPE
, *LPD3DRMWRAPTYPE
;
191 #define D3DRMWIREFRAME_CULL 1 /* cull backfaces */
192 #define D3DRMWIREFRAME_HIDDENLINE 2 /* lines are obscured by closer objects */
195 * Do not use righthanded perspective in Viewport2::SetProjection().
196 * Set up righthanded mode by using IDirect3DRM3::SetOptions().
198 typedef enum _D3DRMPROJECTIONTYPE
199 { D3DRMPROJECT_PERSPECTIVE
,
200 D3DRMPROJECT_ORTHOGRAPHIC
,
201 D3DRMPROJECT_RIGHTHANDPERSPECTIVE
, /* Only valid pre-DX6 */
202 D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC
/* Only valid pre-DX6 */
203 } D3DRMPROJECTIONTYPE
, *LPD3DRMPROJECTIONTYPE
;
205 #define D3DRMOPTIONS_LEFTHANDED 0x00000001L /* Default */
206 #define D3DRMOPTIONS_RIGHTHANDED 0x00000002L
208 typedef enum _D3DRMXOFFORMAT
212 } D3DRMXOFFORMAT
, *LPD3DRMXOFFORMAT
;
214 typedef DWORD D3DRMSAVEOPTIONS
;
215 #define D3DRMXOFSAVE_NORMALS 1
216 #define D3DRMXOFSAVE_TEXTURECOORDINATES 2
217 #define D3DRMXOFSAVE_MATERIALS 4
218 #define D3DRMXOFSAVE_TEXTURENAMES 8
219 #define D3DRMXOFSAVE_ALL 15
220 #define D3DRMXOFSAVE_TEMPLATES 16
221 #define D3DRMXOFSAVE_TEXTURETOPOLOGY 32
223 typedef enum _D3DRMCOLORSOURCE
224 { D3DRMCOLOR_FROMFACE
,
225 D3DRMCOLOR_FROMVERTEX
226 } D3DRMCOLORSOURCE
, *LPD3DRMCOLORSOURCE
;
228 typedef enum _D3DRMFRAMECONSTRAINT
229 { D3DRMCONSTRAIN_Z
, /* use only X and Y rotations */
230 D3DRMCONSTRAIN_Y
, /* use only X and Z rotations */
231 D3DRMCONSTRAIN_X
/* use only Y and Z rotations */
232 } D3DRMFRAMECONSTRAINT
, *LPD3DRMFRAMECONSTRAINT
;
234 typedef enum _D3DRMMATERIALMODE
235 { D3DRMMATERIAL_FROMMESH
,
236 D3DRMMATERIAL_FROMPARENT
,
237 D3DRMMATERIAL_FROMFRAME
238 } D3DRMMATERIALMODE
, *LPD3DRMMATERIALMODE
;
240 typedef enum _D3DRMFOGMODE
241 { D3DRMFOG_LINEAR
, /* linear between start and end */
242 D3DRMFOG_EXPONENTIAL
, /* density * exp(-distance) */
243 D3DRMFOG_EXPONENTIALSQUARED
/* density * exp(-distance*distance) */
244 } D3DRMFOGMODE
, *LPD3DRMFOGMODE
;
246 typedef enum _D3DRMZBUFFERMODE
{
247 D3DRMZBUFFER_FROMPARENT
, /* default */
248 D3DRMZBUFFER_ENABLE
, /* enable zbuffering */
249 D3DRMZBUFFER_DISABLE
/* disable zbuffering */
250 } D3DRMZBUFFERMODE
, *LPD3DRMZBUFFERMODE
;
252 typedef enum _D3DRMSORTMODE
{
253 D3DRMSORT_FROMPARENT
, /* default */
254 D3DRMSORT_NONE
, /* don't sort child frames */
255 D3DRMSORT_FRONTTOBACK
, /* sort child frames front-to-back */
256 D3DRMSORT_BACKTOFRONT
/* sort child frames back-to-front */
257 } D3DRMSORTMODE
, *LPD3DRMSORTMODE
;
259 typedef struct _D3DRMMATERIALOVERRIDE
261 DWORD dwSize
; /* Size of this structure */
262 DWORD dwFlags
; /* Indicate which fields are valid */
263 D3DCOLORVALUE dcDiffuse
; /* RGBA */
264 D3DCOLORVALUE dcAmbient
; /* RGB */
265 D3DCOLORVALUE dcEmissive
; /* RGB */
266 D3DCOLORVALUE dcSpecular
; /* RGB */
268 LPUNKNOWN lpD3DRMTex
;
269 } D3DRMMATERIALOVERRIDE
, *LPD3DRMMATERIALOVERRIDE
;
271 #define D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAONLY 0x00000001L
272 #define D3DRMMATERIALOVERRIDE_DIFFUSE_RGBONLY 0x00000002L
273 #define D3DRMMATERIALOVERRIDE_DIFFUSE 0x00000003L
274 #define D3DRMMATERIALOVERRIDE_AMBIENT 0x00000004L
275 #define D3DRMMATERIALOVERRIDE_EMISSIVE 0x00000008L
276 #define D3DRMMATERIALOVERRIDE_SPECULAR 0x00000010L
277 #define D3DRMMATERIALOVERRIDE_POWER 0x00000020L
278 #define D3DRMMATERIALOVERRIDE_TEXTURE 0x00000040L
279 #define D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAMULTIPLY 0x00000080L
280 #define D3DRMMATERIALOVERRIDE_ALL 0x000000FFL
282 #define D3DRMFPTF_ALPHA 0x00000001L
283 #define D3DRMFPTF_NOALPHA 0x00000002L
284 #define D3DRMFPTF_PALETTIZED 0x00000004L
285 #define D3DRMFPTF_NOTPALETTIZED 0x00000008L
287 #define D3DRMSTATECHANGE_UPDATEONLY 0x000000001L
288 #define D3DRMSTATECHANGE_VOLATILE 0x000000002L
289 #define D3DRMSTATECHANGE_NONVOLATILE 0x000000004L
290 #define D3DRMSTATECHANGE_RENDER 0x000000020L
291 #define D3DRMSTATECHANGE_LIGHT 0x000000040L
294 * Values for flags in RM3::CreateDeviceFromSurface
296 #define D3DRMDEVICE_NOZBUFFER 0x00000001L
299 * Values for flags in Object2::SetClientData
301 #define D3DRMCLIENTDATA_NONE 0x00000001L
302 #define D3DRMCLIENTDATA_LOCALFREE 0x00000002L
303 #define D3DRMCLIENTDATA_IUNKNOWN 0x00000004L
306 * Values for flags in Frame2::AddMoveCallback.
308 #define D3DRMCALLBACK_PREORDER 0
309 #define D3DRMCALLBACK_POSTORDER 1
312 * Values for flags in MeshBuilder2::RayPick.
314 #define D3DRMRAYPICK_ONLYBOUNDINGBOXES 1
315 #define D3DRMRAYPICK_IGNOREFURTHERPRIMITIVES 2
316 #define D3DRMRAYPICK_INTERPOLATEUV 4
317 #define D3DRMRAYPICK_INTERPOLATECOLOR 8
318 #define D3DRMRAYPICK_INTERPOLATENORMAL 0x10
321 * Values for flags in MeshBuilder3::AddFacesIndexed.
323 #define D3DRMADDFACES_VERTICESONLY 1
326 * Values for flags in MeshBuilder2::GenerateNormals.
328 #define D3DRMGENERATENORMALS_PRECOMPACT 1
329 #define D3DRMGENERATENORMALS_USECREASEANGLE 2
332 * Values for MeshBuilder3::GetParentMesh
334 #define D3DRMMESHBUILDER_DIRECTPARENT 1
335 #define D3DRMMESHBUILDER_ROOTMESH 2
338 * Flags for MeshBuilder3::Enable
340 #define D3DRMMESHBUILDER_RENDERENABLE 0x00000001L
341 #define D3DRMMESHBUILDER_PICKENABLE 0x00000002L
344 * Flags for MeshBuilder3::AddMeshBuilder
346 #define D3DRMADDMESHBUILDER_DONTCOPYAPPDATA 1
347 #define D3DRMADDMESHBUILDER_FLATTENSUBMESHES 2
348 #define D3DRMADDMESHBUILDER_NOSUBMESHES 4
351 * Flags for Object2::GetAge when used with MeshBuilders
353 #define D3DRMMESHBUILDERAGE_GEOMETRY 0x00000001L
354 #define D3DRMMESHBUILDERAGE_MATERIALS 0x00000002L
355 #define D3DRMMESHBUILDERAGE_TEXTURES 0x00000004L
358 * Format flags for MeshBuilder3::AddTriangles.
360 #define D3DRMFVF_TYPE 0x00000001L
361 #define D3DRMFVF_NORMAL 0x00000002L
362 #define D3DRMFVF_COLOR 0x00000004L
363 #define D3DRMFVF_TEXTURECOORDS 0x00000008L
365 #define D3DRMVERTEX_STRIP 0x00000001L
366 #define D3DRMVERTEX_FAN 0x00000002L
367 #define D3DRMVERTEX_LIST 0x00000004L
370 * Values for flags in Viewport2::Clear2
372 #define D3DRMCLEAR_TARGET 0x00000001L
373 #define D3DRMCLEAR_ZBUFFER 0x00000002L
374 #define D3DRMCLEAR_DIRTYRECTS 0x00000004L
375 #define D3DRMCLEAR_ALL (D3DRMCLEAR_TARGET | \
376 D3DRMCLEAR_ZBUFFER | \
377 D3DRMCLEAR_DIRTYRECTS)
380 * Values for flags in Frame3::SetSceneFogMethod
382 #define D3DRMFOGMETHOD_VERTEX 0x00000001L
383 #define D3DRMFOGMETHOD_TABLE 0x00000002L
384 #define D3DRMFOGMETHOD_ANY 0x00000004L
387 * Values for flags in Frame3::SetTraversalOptions
389 #define D3DRMFRAME_RENDERENABLE 0x00000001L
390 #define D3DRMFRAME_PICKENABLE 0x00000002L
392 typedef DWORD D3DRMANIMATIONOPTIONS
;
393 #define D3DRMANIMATION_OPEN 0x01L
394 #define D3DRMANIMATION_CLOSED 0x02L
395 #define D3DRMANIMATION_LINEARPOSITION 0x04L
396 #define D3DRMANIMATION_SPLINEPOSITION 0x08L
397 #define D3DRMANIMATION_SCALEANDROTATION 0x00000010L
398 #define D3DRMANIMATION_POSITION 0x00000020L
400 typedef DWORD D3DRMINTERPOLATIONOPTIONS
;
401 #define D3DRMINTERPOLATION_OPEN 0x01L
402 #define D3DRMINTERPOLATION_CLOSED 0x02L
403 #define D3DRMINTERPOLATION_NEAREST 0x0100L
404 #define D3DRMINTERPOLATION_LINEAR 0x04L
405 #define D3DRMINTERPOLATION_SPLINE 0x08L
406 #define D3DRMINTERPOLATION_VERTEXCOLOR 0x40L
407 #define D3DRMINTERPOLATION_SLERPNORMALS 0x80L
409 typedef DWORD D3DRMLOADOPTIONS
;
411 #define D3DRMLOAD_FROMFILE 0x00L
412 #define D3DRMLOAD_FROMRESOURCE 0x01L
413 #define D3DRMLOAD_FROMMEMORY 0x02L
414 #define D3DRMLOAD_FROMSTREAM 0x04L
415 #define D3DRMLOAD_FROMURL 0x08L
417 #define D3DRMLOAD_BYNAME 0x10L
418 #define D3DRMLOAD_BYPOSITION 0x20L
419 #define D3DRMLOAD_BYGUID 0x40L
420 #define D3DRMLOAD_FIRST 0x80L
422 #define D3DRMLOAD_INSTANCEBYREFERENCE 0x100L
423 #define D3DRMLOAD_INSTANCEBYCOPYING 0x200L
425 #define D3DRMLOAD_ASYNCHRONOUS 0x400L
427 typedef struct _D3DRMLOADRESOURCE
{
431 } D3DRMLOADRESOURCE
, *LPD3DRMLOADRESOURCE
;
433 typedef struct _D3DRMLOADMEMORY
{
436 } D3DRMLOADMEMORY
, *LPD3DRMLOADMEMORY
;
438 #define D3DRMPMESHSTATUS_VALID 0x01L
439 #define D3DRMPMESHSTATUS_INTERRUPTED 0x02L
440 #define D3DRMPMESHSTATUS_BASEMESHCOMPLETE 0x04L
441 #define D3DRMPMESHSTATUS_COMPLETE 0x08L
442 #define D3DRMPMESHSTATUS_RENDERABLE 0x10L
444 #define D3DRMPMESHEVENT_BASEMESH 0x01L
445 #define D3DRMPMESHEVENT_COMPLETE 0x02L
447 typedef struct _D3DRMPMESHLOADSTATUS
{
448 DWORD dwSize
; // Size of this structure
449 DWORD dwPMeshSize
; // Total Size (bytes)
450 DWORD dwBaseMeshSize
; // Total Size of the Base Mesh
451 DWORD dwBytesLoaded
; // Total bytes loaded
452 DWORD dwVerticesLoaded
; // Number of vertices loaded
453 DWORD dwFacesLoaded
; // Number of faces loaded
454 HRESULT dwLoadResult
; // Result of the load operation
456 } D3DRMPMESHLOADSTATUS
, *LPD3DRMPMESHLOADSTATUS
;
458 typedef enum _D3DRMUSERVISUALREASON
{
459 D3DRMUSERVISUAL_CANSEE
,
460 D3DRMUSERVISUAL_RENDER
461 } D3DRMUSERVISUALREASON
, *LPD3DRMUSERVISUALREASON
;
464 typedef struct _D3DRMANIMATIONKEY
470 #if (!defined __cplusplus) || (!defined D3D_OVERLOADS)
473 D3DRMQUATERNION dqRotateKey
;
474 D3DVECTOR dvScaleKey
;
475 D3DVECTOR dvPositionKey
;
479 * We do this as D3D_OVERLOADS defines constructors for D3DVECTOR,
480 * this can then not be used in a union. Use the inlines provided
481 * to extract and set the required component.
486 typedef D3DRMANIMATIONKEY
*LPD3DRMANIMATIONKEY
;
488 #if (defined __cplusplus) && (defined D3D_OVERLOADS)
490 D3DRMAnimationGetRotateKey(const D3DRMANIMATIONKEY
& rmKey
,
491 D3DRMQUATERNION
& rmQuat
)
493 rmQuat
.s
= rmKey
.dvK
[0];
494 rmQuat
.v
= D3DVECTOR(rmKey
.dvK
[1], rmKey
.dvK
[2], rmKey
.dvK
[3]);
498 D3DRMAnimationGetScaleKey(const D3DRMANIMATIONKEY
& rmKey
,
501 dvVec
= D3DVECTOR(rmKey
.dvK
[0], rmKey
.dvK
[1], rmKey
.dvK
[2]);
505 D3DRMAnimationGetPositionKey(const D3DRMANIMATIONKEY
& rmKey
,
508 dvVec
= D3DVECTOR(rmKey
.dvK
[0], rmKey
.dvK
[1], rmKey
.dvK
[2]);
511 D3DRMAnimationSetRotateKey(D3DRMANIMATIONKEY
& rmKey
,
512 const D3DRMQUATERNION
& rmQuat
)
514 rmKey
.dvK
[0] = rmQuat
.s
;
515 rmKey
.dvK
[1] = rmQuat
.v
.x
;
516 rmKey
.dvK
[2] = rmQuat
.v
.y
;
517 rmKey
.dvK
[3] = rmQuat
.v
.z
;
521 D3DRMAnimationSetScaleKey(D3DRMANIMATIONKEY
& rmKey
,
522 const D3DVECTOR
& dvVec
)
524 rmKey
.dvK
[0] = dvVec
.x
;
525 rmKey
.dvK
[1] = dvVec
.y
;
526 rmKey
.dvK
[2] = dvVec
.z
;
530 D3DRMAnimationSetPositionKey(D3DRMANIMATIONKEY
& rmKey
,
531 const D3DVECTOR
& dvVec
)
533 rmKey
.dvK
[0] = dvVec
.x
;
534 rmKey
.dvK
[1] = dvVec
.y
;
535 rmKey
.dvK
[2] = dvVec
.z
;
539 #define D3DRMANIMATION_ROTATEKEY 0x01
540 #define D3DRMANIMATION_SCALEKEY 0x02
541 #define D3DRMANIMATION_POSITIONKEY 0x03
544 typedef DWORD D3DRMMAPPING
, D3DRMMAPPINGFLAG
, *LPD3DRMMAPPING
;
545 static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPU
= 1;
546 static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPV
= 2;
547 static const D3DRMMAPPINGFLAG D3DRMMAP_PERSPCORRECT
= 4;
549 typedef struct _D3DRMVERTEX
550 { D3DVECTOR position
;
554 } D3DRMVERTEX
, *LPD3DRMVERTEX
;
556 typedef LONG D3DRMGROUPINDEX
; /* group indexes begin a 0 */
557 static const D3DRMGROUPINDEX D3DRMGROUP_ALLGROUPS
= -1;
560 * Create a color from three components in the range 0-1 inclusive.
562 extern D3DCOLOR D3DRMAPI
D3DRMCreateColorRGB(D3DVALUE red
,
567 * Create a color from four components in the range 0-1 inclusive.
569 extern D3DCOLOR D3DRMAPI
D3DRMCreateColorRGBA(D3DVALUE red
,
575 * Get the red component of a color.
577 extern D3DVALUE D3DRMAPI
D3DRMColorGetRed(D3DCOLOR
);
580 * Get the green component of a color.
582 extern D3DVALUE D3DRMAPI
D3DRMColorGetGreen(D3DCOLOR
);
585 * Get the blue component of a color.
587 extern D3DVALUE D3DRMAPI
D3DRMColorGetBlue(D3DCOLOR
);
590 * Get the alpha component of a color.
592 extern D3DVALUE D3DRMAPI
D3DRMColorGetAlpha(D3DCOLOR
);
595 * Add two vectors. Returns its first argument.
597 extern LPD3DVECTOR D3DRMAPI
D3DRMVectorAdd(LPD3DVECTOR d
,
602 * Subtract two vectors. Returns its first argument.
604 extern LPD3DVECTOR D3DRMAPI
D3DRMVectorSubtract(LPD3DVECTOR d
,
608 * Reflect a ray about a given normal. Returns its first argument.
610 extern LPD3DVECTOR D3DRMAPI
D3DRMVectorReflect(LPD3DVECTOR d
,
615 * Calculate the vector cross product. Returns its first argument.
617 extern LPD3DVECTOR D3DRMAPI
D3DRMVectorCrossProduct(LPD3DVECTOR d
,
621 * Return the vector dot product.
623 extern D3DVALUE D3DRMAPI
D3DRMVectorDotProduct(LPD3DVECTOR s1
,
627 * Scale a vector so that its modulus is 1. Returns its argument or
628 * NULL if there was an error (e.g. a zero vector was passed).
630 extern LPD3DVECTOR D3DRMAPI
D3DRMVectorNormalize(LPD3DVECTOR
);
631 #define D3DRMVectorNormalise D3DRMVectorNormalize
634 * Return the length of a vector (e.g. sqrt(x*x + y*y + z*z)).
636 extern D3DVALUE D3DRMAPI
D3DRMVectorModulus(LPD3DVECTOR v
);
639 * Set the rotation part of a matrix to be a rotation of theta radians
640 * around the given axis.
643 extern LPD3DVECTOR D3DRMAPI
D3DRMVectorRotate(LPD3DVECTOR r
, LPD3DVECTOR v
, LPD3DVECTOR axis
, D3DVALUE theta
);
646 * Scale a vector uniformly in all three axes
648 extern LPD3DVECTOR D3DRMAPI
D3DRMVectorScale(LPD3DVECTOR d
, LPD3DVECTOR s
, D3DVALUE factor
);
651 * Return a random unit vector
653 extern LPD3DVECTOR D3DRMAPI
D3DRMVectorRandom(LPD3DVECTOR d
);
656 * Returns a unit quaternion that represents a rotation of theta radians
657 * around the given axis.
660 extern LPD3DRMQUATERNION D3DRMAPI
D3DRMQuaternionFromRotation(LPD3DRMQUATERNION quat
,
665 * Calculate the product of two quaternions
667 extern LPD3DRMQUATERNION D3DRMAPI
D3DRMQuaternionMultiply(LPD3DRMQUATERNION q
,
669 LPD3DRMQUATERNION b
);
672 * Interpolate between two quaternions
674 extern LPD3DRMQUATERNION D3DRMAPI
D3DRMQuaternionSlerp(LPD3DRMQUATERNION q
,
680 * Calculate the matrix for the rotation that a unit quaternion represents
682 extern void D3DRMAPI
D3DRMMatrixFromQuaternion(D3DRMMATRIX4D dmMat
, LPD3DRMQUATERNION lpDqQuat
);
685 * Calculate the quaternion that corresponds to a rotation matrix
687 extern LPD3DRMQUATERNION D3DRMAPI
D3DRMQuaternionFromMatrix(LPD3DRMQUATERNION
, D3DRMMATRIX4D
);
690 #if defined(__cplusplus)