| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package SDL2::HapticCondition { |
|
2
|
2
|
|
|
2
|
|
15
|
use SDL2::Utils; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
19
|
|
|
3
|
|
|
|
|
|
|
has |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Header |
|
6
|
|
|
|
|
|
|
type => 'uint16', |
|
7
|
|
|
|
|
|
|
direction => 'opaque', # SDL_HapticDirection |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Replay |
|
10
|
|
|
|
|
|
|
length => 'uint32', |
|
11
|
|
|
|
|
|
|
delay => 'uint16', |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Trigger |
|
14
|
|
|
|
|
|
|
button => 'uint16', |
|
15
|
|
|
|
|
|
|
interval => 'uint16', |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Condition |
|
18
|
|
|
|
|
|
|
right_sat => 'uint16[2]', |
|
19
|
|
|
|
|
|
|
left_sat => 'uint16[2]', |
|
20
|
|
|
|
|
|
|
right_coeff => 'sint16[2]', |
|
21
|
|
|
|
|
|
|
left_coeff => 'sint16[2]', |
|
22
|
|
|
|
|
|
|
deadband => 'uint16[2]', |
|
23
|
|
|
|
|
|
|
center => 'sint16[2]'; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=encoding utf-8 |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 NAME |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
SDL2::HapticCondition - A structure containing a template for a Condition |
|
30
|
|
|
|
|
|
|
effect |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
use SDL2 qw[:all]; |
|
35
|
|
|
|
|
|
|
# TODO: I need to whip up a quick example |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
A SDL2::HapticCondition contains a template for a Condition effect. |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
The struct handles the following effects: |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=over |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=item C - Effect based on axes position |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item C - Effect based on axes velocity |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item C - Effect based on axes acceleration |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item C - Effect based on axes movement |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=back |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Direction is handled by condition internals instead of a direction member. The |
|
56
|
|
|
|
|
|
|
condition effect specific members have three parameters. The first refers to |
|
57
|
|
|
|
|
|
|
the X axis, the second refers to the Y axis and the third refers to the Z axis. |
|
58
|
|
|
|
|
|
|
The right terms refer to the positive side of the axis and the left terms |
|
59
|
|
|
|
|
|
|
refer to the negative side of the axis. Please refer to the |
|
60
|
|
|
|
|
|
|
L diagram for which side is positive and which is |
|
61
|
|
|
|
|
|
|
negative. |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 Fields |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=over |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item C - C, C, C, or C |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item C - Direction of the effect - Not used ATM |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item C - Duration of the effect |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item C - Delay before starting the effect |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item C |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item C - How soon it can be triggered again after button |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item C - Level when joystick is to the positive side; max C<0xFFFF> |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item C - Level when joystick is to the negative side; max C<0xFFFF> |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item C - How fast to increase the force towards the positive side |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item C - How fast to increase the force towards the negative side |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item C - Size of the dead zone; max C<0xFFFF>: whole axis-range when C<0>-centered |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=item C - Position of the dead zone |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=back |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 AUTHOR |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Sanko Robinson Esanko@cpan.orgE |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=begin stopwords |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
struct |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=end stopwords |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=cut |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
}; |
|
106
|
|
|
|
|
|
|
1; |