TSdlHapticPeriodic
A record containing a template for a Periodic effect.
The record handles the following effects:
- TSdlHapticKind.Sine
- TSdlHapticKind.Square
- TSdlHapticKind.Triangle
- TSdlHapticKind.SawToothUp
- TSdlHapticKind.SawToothDown
A periodic effect consists in a wave-shaped effect that repeats itself over time. The type determines the shape of the wave and the parameters determine the dimensions of the wave.
Phase is given by hundredth of a degree meaning that giving the phase a value of 9000 will displace it 25% of its period. Here are sample values:
- 0 : No phase displacement.
- 9000 : Displaced 25% of its period.
- 18000: Displaced 50% of its period.
- 27000: Displaced 75% of its period.
- 36000: Displaced 100% of its period, same as 0, but 0 is preferred.
Examples:
TSdlHapticKind.Sine
__ __ __ __
/ \ / \ / \ /
/ \__/ \__/ \__/
TSdlHapticKind.Square
__ __ __ __ __
| | | | | | | | | |
| |__| |__| |__| |__| |
TSdlHapticKind.Triangle
/\ /\ /\ /\ /\
/ \ / \ / \ / \ /
/ \/ \/ \/ \/
TSdlHapticKind.SawToothUp
/| /| /| /| /| /| /|
/ | / | / | / | / | / | / |
/ |/ |/ |/ |/ |/ |/ |
TSdlHapticKind.SawToothDown
\ |\ |\ |\ |\ |\ |\ |
\ | \ | \ | \ | \ | \ | \ |
\| \| \| \| \| \| \|
Definition
Unit: Neslib.Sdl3.Haptic
See Also
Properties
Name | Description |
---|---|
AttackLength | Duration of the attack. |
AttackLevel | Level at the start of the attack. |
Button | Button that triggers the effect. |
Delay | Delay before starting the effect. |
Direction | Direction of the effect. |
FadeLength | Duration of the fade. |
FadeLevel | Level at the end of the fade. |
Interval | How soon it can be triggered again after button. |
Kind | TSdlHapticKind.Sine, TSdlHapticKind.Square, TSdlHapticKind.Triangle, TSdlHapticKind.SawToothUp or TSdlHapticKind.SawToothDown. |
Length | Duration of the effect in milliseconds. |
Magnitude | Peak value; if negative, equivalent to 180 degrees extra phase shift. |
Offset | Mean value of the wave. |
Period | Period of the wave. |
Phase | Positive phase shift given by hundredth of a degree. |
Property Descriptions
AttackLength
Duration of the attack.
property AttackLength: Word read FHandle.attack_length write FHandle.attack_length
Type: Word
AttackLevel
Level at the start of the attack.
property AttackLevel: Word read FHandle.attack_level write FHandle.attack_level
Type: Word
Button
Button that triggers the effect.
property Button: Word read FHandle.button write FHandle.button
Type: Word
Delay
Delay before starting the effect.
property Delay: Word read FHandle.delay write FHandle.delay
Type: Word
Direction
Direction of the effect.
property Direction: PSdlHapticDirection read GetDirection
Type: PSdlHapticDirection
FadeLength
Duration of the fade.
property FadeLength: Word read FHandle.fade_length write FHandle.fade_length
Type: Word
FadeLevel
Level at the end of the fade.
property FadeLevel: Word read FHandle.fade_level write FHandle.fade_level
Type: Word
Interval
How soon it can be triggered again after button.
property Interval: Word read FHandle.interval write FHandle.interval
Type: Word
Kind
TSdlHapticKind.Sine, TSdlHapticKind.Square, TSdlHapticKind.Triangle, TSdlHapticKind.SawToothUp or TSdlHapticKind.SawToothDown.
property Kind: TSdlHapticKind read GetKind write SetKind
Type: TSdlHapticKind
Length
Duration of the effect in milliseconds.
property Length: Cardinal read FHandle.length write FHandle.length
Type: Cardinal
Magnitude
Peak value; if negative, equivalent to 180 degrees extra phase shift.
property Magnitude: Smallint read FHandle.magnitude write FHandle.magnitude
Type: Smallint
Offset
Mean value of the wave.
property Offset: Smallint read FHandle.offset write FHandle.offset
Type: Smallint
Period
Period of the wave.
property Period: Word read FHandle.period write FHandle.period
Type: Word
Phase
Positive phase shift given by hundredth of a degree.
property Phase: Word read FHandle.phase write FHandle.phase
Type: Word