IDirect3DRMAnimationSet2

Applications use the methods of the IDirect3DRMAnimationSet2 interface to group Direct3DRMAnimation objects together, which can simplify the playback of complex animation sequences.

A Direct3DRMAnimationSet object allows Direct3DRMAnimation objects to be grouped together. This allows all the animations in an animation set to share the same time parameter, simplifying the playback of complex articulated animation sequences. An application can add an animation to an animation set by using the IDirect3DRMAnimationSet2::AddAnimation method, and it can remove one by using the IDirect3DRMAnimationSet2::DeleteAnimation method. Animation sets are driven by calling the IDirect3DRMAnimationSet2::SetTime method.

Microsoft DirectX version 6.0 introduces the IDirect3DRMAnimationSet2 interface. IDirect3DRMAnimationSet2 extends the older IDirect3DRMAnimationSet interface that it replaces by adding the GetAnimations method that allows you to retrieve the constituent animations. For a history of the Direct3D Retained Mode interfaces, see Interface Changes.

The methods of the IDirect3DRMAnimationSet2 interface can be organized into the following groups:

Adding, removing, retrieving, and loading AddAnimation
DeleteAnimation
GetAnimations
Load
Time SetTime

The IDirect3DRMAnimationSet2 interface, like all Component Object Model (COM) interfaces, inherits the IUnknown interface methods. The IUnknown interface supports the following three methods:
AddRef
QueryInterface
Release

In addition, the IDirect3DRMAnimationSet2 interface inherits the following methods from the IDirect3DRMObject interface:
AddDestroyCallback
Clone
DeleteDestroyCallback
GetAppData
GetClassName
GetName
SetAppData
SetName

The Direct3DRMAnimationSet object is obtained by calling the IDirect3DRM3::CreateAnimationSet method.

IDirect3DRMAnimationSet2::AddAnimation

IDirect3DRMAnimationSet2

Adds an animation to the animation set.

Syntax

HRESULT AddAnimation(
  LPDIRECT3DRMANIMATION2 lpD3DRMAnimation
  );

Parameters

lpD3DRMAnimation
Address of the Direct3DRMAnimation object to be added to the animation set.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible return codes, see Direct3D Retained Mode Return Values.

IDirect3DRMAnimationSet2::DeleteAnimation

IDirect3DRMAnimationSet2

Removes a previously added animation from the animation set.

Syntax

HRESULT DeleteAnimation(
  LPDIRECT3DRMANIMATION2 lpD3DRMAnimation
  );

Parameters

lpD3DRMAnimation
Address of the Direct3DRMAnimation object to be removed from the animation set.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible return codes, see Direct3D Retained Mode Return Values.

IDirect3DRMAnimationSet2::GetAnimations

IDirect3DRMAnimationSet2

Retrieves an array containing the animations in the animation set.

Syntax

HRESULT GetAnimations
(LPDIRECT3DRMANIMATIONARRAY* lplpArray);

Parameters

lplpArray
Array that receives a pointer to the corresponding Direct3DRMAnimationArray object.

Return Value

Returns one of the following values.

DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DD_OK

Remarks

This method was introduced with DirectX version 6.0.

IDirect3DRMAnimationSet2::Load

IDirect3DRMAnimationSet2

Loads an animation set.

Syntax

HRESULT Load(
  LPVOID lpvObjSource,
  LPVOID lpvObjID,
  D3DRMLOADOPTIONS d3drmLOFlags,
  D3DRMLOADTEXTURE3CALLBACK d3drmLoadTextureProc,
  LPVOID lpArgLTP,
  LPDIRECT3DRMFRAME3 lpParentFrame
  );

Parameters

lpvObjSource
Source for the object to be loaded. This source can be a file, resource, memory block, or stream, depending on the source flags specified in the d3drmLOFlags parameter.
lpvObjID
Object name or position to be loaded. The use of this parameter depends on the identifier flags specified in the d3drmLOFlags parameter. If the D3DRMLOAD_BYPOSITION flag is specified, this parameter is a pointer to a DWORD value that gives the object's order in the file. This parameter can be NULL.
d3drmLOFlags
Value of the D3DRMLOADOPTIONS type describing the load options.
d3drmLoadTextureProc
D3DRMLOADTEXTURE3CALLBACK callback function used to load any textures used by the object that require special formatting. This parameter can be NULL.
lpArgLTP
Address of application-defined data passed to the D3DRMLOADTEXTURE3CALLBACK callback function.
lpParentFrame
Address of a parent Direct3DRMFrame object. This argument only affects the loading of animation sets. When an animation that is loaded from an .x file references an unparented frame in the .x file, the frame's parent is set to this parent frame argument. However, if you use Load to load any frames in the .x file, the parent frame argument will not be used as the parent frame for frames in the .x file with no parent. That is, the parent frame argument is used only when you load animation sets. The value of this argument can be NULL.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible return codes, see Direct3D Retained Mode Return Values.

Remarks

By default, this method loads the first animation set in the file specified by the lpvObjSource parameter. By default, perspective correction is on.

IDirect3DRMAnimationSet2::SetTime

IDirect3DRMAnimationSet2

Sets the time for this animation set.

Syntax

HRESULT SetTime(
  D3DVALUE rvTime
  );

Parameters

rvTime
New time.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible return codes, see Direct3D Retained Mode Return Values.


Top of Page Top of Page
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.