Debian Codegraph @

Input/Joysticks/OpenTrack/opentrack-headpose.xml

raw symbols SCIP
1 <?xml version="1.0"?>
2 <PropertyList>
3 <nasal>
4 <script>
5
6 var opentrackToAxis = func(jsAxis,viewAxis,axisValue,axisFactor) {
7 var viewNumber = getprop("/sim/current-view/view-number-raw");
8 var viewInitialOffset = getprop("/sim/view["~viewNumber~"]/config/"~viewAxis~"-offset-m");
9
10 if(viewInitialOffset == nil) {
11 viewInitialOffset = 0;
12 }
13
14 setprop("/sim/current-view/"~viewAxis~"-offset-m", viewInitialOffset + ( axisValue * axisFactor ) );
15 }
16
17 </script>
18 </nasal>
19
20 <propiedad type="string">1</propiedad>
21 <name type="string">opentrack headpose</name>
22 <axis n="0">
23 <desc type="string">View X Axis</desc>
24 <binding>
25 <command>nasal</command>
26 <script>
27 var setting = cmdarg().getNode("setting").getValue();
28 var factor = cmdarg().getNode("factor").getValue();
29 opentrackToAxis(0, "x", setting, factor);
30 </script>
31 <factor type="double">-0.5</factor>
32 <offset type="double">0</offset>
33 </binding>
34 </axis>
35 <axis n="1">
36 <desc type="string">View Y Axis</desc>
37 <binding>
38 <command>nasal</command>
39 <script>
40 var setting = cmdarg().getNode("setting").getValue();
41 var factor = cmdarg().getNode("factor").getValue();
42 opentrackToAxis(1, "y", setting, factor);
43 </script>
44 <factor type="double">0.5</factor>
45 <offset type="double">0</offset>
46 </binding>
47 </axis>
48 <axis n="2">
49 <desc type="string">View Z Axis</desc>
50 <binding>
51 <command>nasal</command>
52 <script>
53 var setting = cmdarg().getNode("setting").getValue();
54 var factor = cmdarg().getNode("factor").getValue();
55 opentrackToAxis(2, "z", setting, factor);
56 </script>
57 <factor type="double">0.5</factor>
58 <offset type="double">0</offset>
59 </binding>
60 </axis>
61 <axis n="3">
62 <desc type="string">View Heading Axis</desc>
63 <binding>
64 <command type="string">property-scale</command>
65 <property type="string">/sim/current-view/goal-heading-offset-deg</property>
66 <factor type="double">-180</factor>
67 <offset type="double">0</offset>
68 </binding>
69 </axis>
70 <axis n="4">
71 <desc type="string">View Pitch Axis</desc>
72 <binding>
73 <command type="string">property-scale</command>
74 <property type="string">/sim/current-view/goal-pitch-offset-deg</property>
75 <factor type="double">180</factor>
76 <offset type="double">0</offset>
77 </binding>
78 </axis>
79 <axis n="5">
80 <desc type="string">View Roll Axis</desc>
81 <binding>
82 <command type="string">property-scale</command>
83 <property type="string">/sim/current-view/goal-roll-offset-deg</property>
84 <factor type="double">-180</factor>
85 <offset type="double">0</offset>
86 </binding>
87 </axis>
88 </PropertyList>