Microsoft DirectX 8.1 (Visual Basic)

DICONDITION

Describes parameters for a force-feedback condition in the DIEFFECT type.

Type DICONDITION
    lDeadBand As Long
    lNegativeCoefficient As Long
    lNegativeSaturation As Long
    lOffset As Long
    lPositiveCoefficient As Long
    lPositiveSaturation As Long
End Type

Members

lDeadBand
The region around lOffset where the condition is not active, in the range 0 to 10,000. In other words, the condition is not active between lOffset - lDeadBand and lOffset + lDeadBand.
lNegativeCoefficient
The coefficient constant on the negative side of the offset, in the range -10,000 to +10,000.

If the device does not support separate positive and negative coefficients, then the value of lNegativeCoefficient is ignored and the value of lPositiveCoefficient is used as both the positive and negative coefficients.

lNegativeSaturation
The maximum force output on the negative side of the offset, in the range 0 to 10,000.

If the device does not support force saturations, then the value of this member is ignored.

If the device does not support separate positive and negative saturations, then the value of lNegativeSaturation is ignored and the value of lPositiveSaturation is used as both the positive and negative saturations.

lOffset
The offset for the condition, in the range -10,000 to +10,000.
lPositiveCoefficient
The coefficient constant on the positive side of the offset, in the range -10,000 to +10,000.
lPositiveSaturation
The maximum force output on the positive side of the offset, in the range 0 to 10,000.

If the device does not support force saturation, then the value of this member is ignored.

Remarks

Different types of conditions will interpret the parameters differently, but the basic idea is that force resulting from a condition is equal to A(q - q0) where A is a scaling coefficient, q is some metric, and q0 is the neutral value for that metric.

The preceding simplified formula must be adjusted if a nonzero dead band is provided. If the metric is less than lOffset - lDeadBand, then the resulting force is given by the following formula:

force = lNegativeCoefficient * (q - (lOffset - lDeadBand))

Similarly, if the metric is greater than lOffset + lDeadBand, then the resulting force is given by the following formula:

force = lPositiveCoefficient * (q - (lOffset + lDeadBand))

A spring condition uses axis position as the metric.

A damper condition uses axis velocity as the metric.

An inertia condition uses axis acceleration as the metric.