IDirect3DRMInterpolator

Interpolators provide a way of storing actions and applying them to objects with automatic calculation of in-between values. With an interpolator you can blend colors, move objects smoothly between positions, morph meshes, and perform many other transformations.

The IDirect3DRMInterpolator interface is a superset of the IDirect3DRMAnimation2 interface that increases the kinds of object parameters you can animate. While IDirect3DRMAnimation2 allows animation of an object's position, size, and orientation, IDirect3DRMInterpolator further enables animation of color, meshes, texture, and material.

For a conceptual overview, see IDirect3DRMInterpolator Overview.

In addition to the standard IUnknown and IDirect3DRMObject methods, IDirect3DRMInterpolator contains the following methods:

Attaching Objects AttachObject
DetachObject
GetAttachedObjects
Interpolating GetIndex
Interpolate
SetIndex

The IDirect3DRMInterpolator 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, IDirect3DRMInterpolator interface inherits the following methods from the IDirect3DRMObject interface:
AddDestroyCallback
Clone
DeleteDestroyCallback
GetAppData
GetClassName
GetName
SetAppData
SetName

IDirect3DRMInterpolator::AttachObject

IDirect3DRMInterpolator

Connects an object to the interpolator.

Syntax

HRESULT AttachObject(
  LPDIRECT3DRMOBJECT lpD3DRMObject
  )

Parameters

lpD3DRMObject
Address of the IDirect3DRMObject object to be attached to the interpolator.

Return Value

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

Remarks

The attached object can be another interpolator or an object of type x where the interpolator is of type xInterpolator. For example, a Viewport can be attached to a ViewportInterpolator. The interpolator types are:

IDirect3DRMInterpolator::DetachObject

IDirect3DRMInterpolator

Detaches an object from the interpolator.

Syntax

HRESULT DetachObject(
  LPDIRECT3DRMOBJECT lpD3DRMObject
  )

Parameters

lpD3DRMObject
Address of the IDirect3DRMObject object to be detached from the interpolator.

Return Value

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

IDirect3DRMInterpolator::GetAttachedObjects

IDirect3DRMInterpolator

Retrieves an array of objects currently attached to the interpolator.

Syntax

HRESULT GetAttachedObjects(
  LPDIRECT3DRMOBJECTARRAY lpD3DRMObjectArray
  )

Parameters

lpD3DRMObjectArray
Address of an IDirect3DRMObjectArray object containing the IDirect3DRMObject objects currently attached to the interpolator.

Return Value

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

IDirect3DRMInterpolator::GetIndex

IDirect3DRMInterpolator

Retrieves the interpolator's current internal index (time).

Syntax

D3DVALUE GetIndex( )

Return Value

Returns a D3DVALUE that contains the interpolator's current internal index.

Remarks

Every key stored in an interpolator has an index value. When a key is recorded (by using a method), the key is stamped with the current interpolator index value. The key's index value does not change after being stamped.

IDirect3DRMInterpolator::Interpolate

IDirect3DRMInterpolator

Generates a series of actions by interpolating between keys stored in the interpolator. The actions are then applied to the specified object. If no object is specified, the actions are applied to the currently attached objects.

Syntax

HRESULT Interpolate(
  D3DVALUE d3dVal,
  LPDIRECT3DRMOBJECT lpD3DRMObject,
  D3DRMINTERPOLATIONOPTIONS d3drmInterpFlags
  )

Parameters

d3dVal
A D3DVALUE that contains the interpolator's current internal index.
lpD3DRMObject
Address of the IDirect3DRMObject object which will be assigned interpolated values for all properties stored in the interpolator. Can be NULL, in which case the property values of all attached objects will be set to interpolated values.
d3drmInterpFlags
One of several flags that control the kind of interpolation done. Possible values are:
D3DRMINTERPOLATION_CLOSED
D3DRMINTERPOLATION_LINEAR
D3DRMINTERPOLATION_NEAREST
D3DRMINTERPOLATION_OPEN
D3DRMINTERPOLATION_SLERPNORMALS
D3DRMINTERPOLATION_SPLINE
D3DRMINTERPOLATION_VERTEXCOLOR
See Interpolation Options for a description of these options.

Return Value

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

IDirect3DRMInterpolator::SetIndex

IDirect3DRMInterpolator

Sets the interpolator's internal index (time) to the specified value. If other interpolators are attached to the interpolator, this method recursively synchronizes their indices to the same value.

Syntax

HRESULT SetIndex(
  D3DVALUE d3dVal
  )

Parameters

d3dVal
The time to set for the interpolator's internal index.

Return Value

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

Remarks

Every key stored in an interpolator has an index value. When a key is recorded (by using a method), the key is stamped with the current interpolator index value. The key's index value does not change after being stamped.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.