Microsoft DirectX 8.1 (Visual Basic) |
You can modify the basic magnitude of some effects by applying an envelope and an offset. For an overview, see Basic Concepts of Force Feedback.
To apply an envelope when creating or modifying an effect, set the bUseEnvelope member of the DIEFFECT type to True and initialize the envelope member, which is a DIENVELOPE type.
The device driver determines which effects support envelopes. Typically, you can apply an envelope to a constant force, a ramp force, or a periodic effect, but not to a condition. To determine whether a particular effect supports an envelope, call the DirectInputEnumEffects.GetStaticParams method and check for the DIEP_ENVELOPE flag in the returned value.
To apply an offset, set the lOffset member of the DIPERIODICFORCE or DICONDITION type used in the periodicForce, conditionX or conditionY member of DIEFFECT. For periodic effects, the absolute value of the offset plus the magnitude of the effect must not exceed 10,000.
You cannot apply an offset to a constant force or ramp force. In these cases, you can achieve the same effect by altering the magnitude.