-
Notifications
You must be signed in to change notification settings - Fork 5
/
Accelerometer.yaml
361 lines (293 loc) · 9.3 KB
/
Accelerometer.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
id: accelerometer
name: Motion & Location
subtitle: Detecting Device Motion and Physical Location
ordering:
- Detecting Motion
- Location
functions:
#---------------------------------
# Gravity
#---------------------------------
- category: const
description: This global variable represents the current direction and amount
of gravity relative to the screen orientation while the viewer is running. The
y component of this vector will almost always be negative, indicating that the
device is being held upright.
group: Detecting Motion
id: Gravity
name: Gravity
parameters:
- description: float, the amount of gravity in the x direction
name: x
- description: float, the amount of gravity in the y direction
name: y
- description: float, the amount of gravity in the z direction
name: z
related:
- vec3
- UserAcceleration
syntax: |
Gravity
Gravity.x
Gravity.y
Gravity.z
#---------------------------------
#---------------------------------
# UserAcceleration
#---------------------------------
- category: const
description: This global variable represents the current acceleration relative
to the device while the viewer is running. You can use this to detect things
such as shaking.
group: Detecting Motion
id: UserAcceleration
name: UserAcceleration
parameters:
- description: float, the amount of acceleration in the x direction
name: x
- description: float, the amount of acceleration in the y direction
name: y
- description: float, the amount of acceleration in the z direction
name: z
related:
- vec3
- Gravity
syntax: |
UserAcceleration
UserAcceleration.x
UserAcceleration.y
UserAcceleration.z
#---------------------------------
#---------------------------------
# RotationRate
#---------------------------------
- category: const
description: This global variable represents the rotation rate of the device around three axes.
Internally, this makes use of the device gyroscope (if available). On devices where a
gyroscope is not available, `RotationRate` is a zero vector.
group: Detecting Motion
id: RotationRate
name: RotationRate
parameters:
- description: float, the amount of rotation around the x axis
name: x
- description: float, the amount of rotation around the y axis
name: y
- description: float, the amount of rotation around the z axis
name: z
related:
- vec3
- Gravity
syntax: |
RotationRate
RotationRate.x
RotationRate.y
RotationRate.z
#---------------------------------
#---------------------------------
# location.enable()
#---------------------------------
- category: function
description: >
Calling this function requests that the device should begin monitoring its physical location.
You must call this before you can reliably read location data. Upon first activation the
device will request permission to access its location, permission must be granted in order to
use location functions.
Location updates are disabled by default.
examples:
- example: |
function setup()
-- enable location updating
location.enable()
print(location)
end
group: Location
id: location.enable
name: location.enable()
related:
- location.disable
- location.available
syntax: |
location.enable()
#---------------------------------
#---------------------------------
# location.disable()
#---------------------------------
- category: function
description: >
Calling this function requests that the device should stop monitoring its physical location.
Disabling location updates preserves battery power.
group: Location
id: location.disable
name: location.disable()
related:
- location.enable
- location.available
syntax: |
location.disable()
#---------------------------------
#---------------------------------
# location.available()
#---------------------------------
- category: function
description: >
This function returns whether location data is available. If location updating has not been enabled,
or is not permitted, this function will return false.
group: Location
id: location.available
name: location.available()
related:
- location.enable
- location.disable
syntax: |
location.available()
returns: A boolean value specifying whether location data is available
#---------------------------------
#---------------------------------
# location.distanceTo()
#---------------------------------
- category: function
description: >
This function returns the distance in meters from the current location (if available) to the
specified `latitude` and `longitude`.
group: Location
id: location.distanceTo
name: location.distanceTo(lat, lon)
related:
- location.distanceBetween
syntax: |
location.distanceTo(lat, lon)
returns: Distance in meters between the current location and specified coordinates
#---------------------------------
#---------------------------------
# location.distanceBetween()
#---------------------------------
- category: function
description: >
This function returns the distance in meters between two locations specified by the
coordinates `lat1`, `lon1`, `lat2`, `lon2`.
group: Location
id: location.distanceBetween
name: location.distanceBetween(lat1,lon1,lat2,lon2)
related:
- location.distanceTo
syntax: |
location.distanceBetween(lat1, lon1, lat2, lon2)
returns: Distance in meters between the two specified coordinates
#---------------------------------
#---------------------------------
# location.latitude
#---------------------------------
- category: const
description: >
This value specifies the current latitude if location is available.
group: Location
id: location.latitude
name: location.latitude
related:
- location.longitude
- location.enable
syntax: |
location.latitude
returns: Current latitude, if available. Nil if not.
#---------------------------------
#---------------------------------
# location.longitude
#---------------------------------
- category: const
description: >
This value specifies the current longitude if location is available.
group: Location
id: location.longitude
name: location.longitude
related:
- location.latitude
- location.enable
syntax: |
location.longitude
returns: Current longitude, if available. Nil if not.
#---------------------------------
#---------------------------------
# location.altitude
#---------------------------------
- category: const
description: >
This value specifies the current altitude if location is available.
Positive values indicate altitudes above sea level. Negative values indicate altitudes below sea level.
group: Location
id: location.altitude
name: location.altitude
related:
- location.enable
syntax: |
location.altitude
returns: Current altitude, if available. Nil if not.
#---------------------------------
#---------------------------------
# location.horizontalAccuracy
#---------------------------------
- category: const
description: >
This value specifies the horizontal accuracy of the latitude and longitude of the current location.
This value indicates the radius of the circle in which the latitude and longitude are at the center.
A negative value indicates that the location’s latitude and longitude are invalid.
group: Location
id: location.horizontalAccuracy
name: location.horizontalAccuracy
related:
- location.latitude
- location.longitude
syntax: |
location.horizontalAccuracy
returns: Current horizontal accuracy, if available. Nil if not.
#---------------------------------
#---------------------------------
# location.verticalAccuracy
#---------------------------------
- category: const
description: >
This value specifies the accuracy of the altitude of the current location.
The altitude value could be plus or minus this value.
A negative value indicates that the current altitude is invalid.
group: Location
id: location.verticalAccuracy
name: location.verticalAccuracy
related:
- location.altitude
syntax: |
location.verticalAccuracy
returns: Current vertical accuracy, if available. Nil if not.
#---------------------------------
#---------------------------------
# location.speed
#---------------------------------
- category: const
description: >
This value specifies the current speed of the device in meters
per second. A negative value indicates an invalid speed.
group: Location
id: location.speed
name: location.speed
related:
- location.course
syntax: |
location.speed
returns: Current speed, if available. Nil if not.
#---------------------------------
#---------------------------------
# location.course
#---------------------------------
- category: const
description: >
This variable specifies the current heading of the device measured in degrees
starting at due north and moving clockwise around the compass. A negative
value indicates an invalid direction.
group: Location
id: location.course
name: location.course
related:
- location.speed
syntax: |
location.course
returns: Current course, if available. Nil if not.
#---------------------------------