The DIEFFECT structure is used by the IDirectInputDevice2::CreateEffect method to initialize a new IDirectInputEffect object. It is also used by the IDirectInputEffect::SetParameters and IDirectInputEffect::GetParameters methods.
typedef struct {
DWORD dwSize;
DWORD dwFlags;
DWORD dwDuration;
DWORD dwSamplePeriod;
DWORD dwGain;
DWORD dwTriggerButton;
DWORD dwTriggerRepeatInterval;
DWORD cAxes;
LPDWORD rgdwAxes;
LPLONG rglDirection;
LPDIENVELOPE lpEnvelope;
DWORD cbTypeSpecificParams;
LPVOID lpvTypeSpecificParams;
} DIEFFECT, *LPDIEFFECT;
typedef const DIEFFECT *LPCDIEFFECT;
DIEFF_CARTESIAN | |
The values of rglDirection are to be interpreted as Cartesian coordinates. | |
DIEFF_OBJECTIDS | |
The values of dwTriggerButton and rgdwAxes are object identifiers as obtained via IDirectInputDevice::EnumObjects. | |
DIEFF_OBJECTOFFSETS | |
The values of dwTriggerButton and rgdwAxes are data format offsets, relative to the data format selected by IDirectInput::SetDataFormat. | |
DIEFF_POLAR | |
The values of rglDirection are to be interpreted as polar coordinates. | |
DIEFF_SPHERICAL | |
The values of rglDirection are to be interpreted as spherical coordinates. |
If the device is not capable of playing back the effect at the specified rate, it will choose the supported rate that is closest to the requested value.
Setting a custom dwSamplePeriod can be used for special effects. For example, playing a sine wave at an artificially large sample period results in a rougher texture.
Support for trigger repeat for an effect is indicated by the presence of the DIEP_TRIGGERREPEATINTERVAL flag in the dwStaticParams member of the DIEFFECTINFO structure.
The number of axes for an effect cannot be changed once it has been set.
The list of axes associated with an effect cannot be changed once it has been set.
No more than 32 axes can be associated with a single effect.
If Cartesian, then each value in rglDirection is associated with the corresponding axis in rgdwAxes.
If polar, then the angle is measured in hundredths of degrees from the (0, -1) direction, rotated in the direction of (1, 0). This usually means that "north" is away from the user, and "east" is to the user's right. The last element is not used.
If spherical, then the first angle is measured in hundredths of degrees from the (1, 0) direction, rotated in the direction of (0, 1). The second angle (if the number of axes is three or more) is measured in hundredths of degrees towards (0, 0, 1). The third angle (if the number of axes is four or more) is measured in hundredths of degrees towards (0, 0, 0, 1), and so on. The last element is not used.
Note The rglDirection array must contain cAxes entries, even if polar or spherical coordinates are given. In these cases the last element in the rglDirection array is reserved for future use and must be zero.
If the effect is of type DIEFT_CONDITION, then this member contains a pointer to an array of DICONDITION structures that define the parameters for the condition. A single structure may be used, in which case the condition is applied in the direction specified in the rglDirection array. Otherwise there must be one structure for each axis, in the same order as the axes in rgdwAxes array. If a structure is supplied for each axis, the effect should not be rotated; you should use the following values in the rglDirection array:
If the effect is of type DIEFT_CUSTOMFORCE, then this member contains a pointer to a DICUSTOMFORCE structure that defines the parameters for the custom force.
If the effect is of type DIEFT_PERIODIC, then this member contains a pointer to a DIPERIODIC structure that defines the parameters for the effect.
If the effect is of type DIEFT_CONSTANTFORCE, then this member contains a pointer to a DICONSTANTFORCE structure that defines the parameters for the constant force.
If the effect is of type DIEFT_RAMPFORCE, then this member contains a pointer to a DIRAMPFORCE structure that defines the parameters for the ramp force.
Windows NT: Use version 5.0 or later.
Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in dinput.h.