forked from Borf/NetworkEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.htm
1275 lines (1152 loc) · 30.2 KB
/
api.htm
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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<style>
body
{
font-family: tahoma;
}
.code
{
display: block;
font-family: monospace;
white-space: pre;
margin: 1em 0;
border: 1px solid black;
}
.call
{
margin-bottom: 100px;
margin-top: 20px;
margin-left: 5px;
padding-left: 5px;
border-left: 10px solid black;
display: block;
}
.container
{
overflow: auto;
}
h1
{
text-align: center;
}
</style>
<h1>Network Protocol</h1>
<p>The network-engine is built upon the networking facilities of VrLib. Every VrLib application connects to a central server, and listens to commands from that server.</p>
<p>One of the features this server provides, is tunneling of data from one application to another. This is done through the central server, as this allows the connections to cross firewalls, NATs and other kinds of network obstructions. The network protocol of this vr-server is quite simple. Each packet consists of 4 bytes of the packetlength, in big endian, followed by the packet data. The packet data is a (valid) json object, with a field "id" that indicate the type of the packet, and a field "data" that contains the payload of the packet.</p>
<p>In order to get to another application, first you need to create a tunnel. This is done in the following steps:
<ol>
<li>Connect to the Vr Server on port 6666</li>
<li>Send the following packet:
<div class="code">{
"id" : "session/list"
}
</div>
This structure is 27 bytes long, so prepend it with 0x18,0x00,0x00,0x00
</li>
<li>You should get a response in the same format, 4 bytes with the packet length, and then a json payload.
<div class="code">{
"id" : "session/list",
"data" :
[
...
]
}</div>
The actual data returned depends on the applications connected, but will include an id field with a unique identifier. We'll need to find the session we're interested in and use this in the next step
</li>
<li>
Send a tunnel/create command to create the tunnel. The data packet is like the following structure (key field is optional)
<div class="code">{
"id" : "tunnel/create",
"data" :
{
"session" : "ce55ab4b-2743-4bf0-83fe-1cf0cfe02b03",
"key" : ""
}
}</div>
You should get a packet back with the ID of this tunnel
<div class="code">{
"id" : "tunnel/create",
"data" :
{
"status" : "ok",
"id" : "2150373e-d796-4e3d-a2b7-c50be14feaa1"
}
}</div>
This ID is used to send data to the tunnel.
</li>
<li>
To send a command through the tunnel, we can use the tunnel/send command:
<div class="code">{
"id" : "tunnel/send",
"data" :
{
"dest" : "2150373e-d796-4e3d-a2b7-c50be14feaa1",
"data" :
{
"id" : "scene/reset",
"data" : {}
}
}
}</div>
This will send some data through this tunnel. The server won't send any response back on this, but the application might. If the application sends something through the tunnel, it will be the following structure:
<div class="code">{
"id" : "tunnel/send",
"data" :
{
"id" : "2150373e-d796-4e3d-a2b7-c50be14feaa1",
"data" :
{
"id" : "scene/node/movevto",
"data" :
{
"status" : "done"
}
}
}
}</div>
</li>
</ol>
A wireshark trace is provided for further reference
</p>
<p>After connecting to the network engine through the tunnel, you can send commands through the tunnel to change parts in the engine</p>
<p>All requests should send a response, with the same id. The general structure of a successful request is
<div class="code">{
"id" : "packetid",
"data" :
{
.....packetdata......
"status" : "ok"
}
</div>
and a request with an error would be
<div class="code">{
"id" : "packetid",
"data" :
{
"status" : "error",
"error" : "error description"
}
</div>
these status/errors are not mentioned in the API documentation, but have a seperate block with error messages
</p>
<h1>Commands</h1>
<ul>
<li>scene
<ul>
<li><a href="#scene/get">scene/get</a></li>
<li><a href="#scene/reset">scene/reset</a></li>
<li><a href="#scene/save">scene/save</a></li>
<li><a href="#scene/load">scene/load</a></li>
<li><a href="#scene/raycast">scene/raycast</a></li>
<li>node<ul>
<li><a href="#scene/node/add">scene/node/add</a></li>
<li><a href="#scene/node/moveto">scene/node/moveto</a></li>
<li><a href="#scene/node/update">scene/node/update</a></li>
<li><a href="#scene/node/delete">scene/node/delete</a></li>
<li><a href="#scene/node/addlayer">scene/node/addlayer</a></li>
<li><a href="#scene/node/dellayer">scene/node/dellayer</a></li>
<li><a href="#scene/node/find">scene/node/find</a></li>
</ul></li>
<li>terrain<ul>
<li><a href="#scene/terrain/add">scene/terrain/add</a></li>
<li><a href="#scene/terrain/update">scene/terrain/update</a></li>
<li><a href="#scene/terrain/delete">scene/terrain/delete</a></li>
<li><a href="#scene/terrain/getheight">scene/terrain/getheight</a></li>
</ul></li>
<li>panel<ul>
<li><a href="#scene/panel/clear">scene/panel/clear</a></li>
<li><a href="#scene/panel/drawlines">scene/panel/drawlines</a></li>
<li><a href="#scene/panel/drawtext">scene/panel/drawtext</a></li>
<li><a href="#scene/panel/image">scene/panel/image</a></li>
<li><a href="#scene/panel/setclearcolor">scene/panel/setclearcolor</a></li>
<li><a href="#scene/panel/swap">scene/panel/sawp</a></li>
</ul></li>
<li>skybox<ul>
<li><a href="#scene/skybox/settime">scene/skybox/settime</a></li>
<li><a href="#scene/skybox/update">scene/skybox/update</a></li>
</ul></li>
<li>road<ul>
<li><a href="#scene/road/add">scene/road/add</a></li>
<li><a href="#scene/road/delete">scene/road/delete</a></li>
</ul></li>
</ul></li>
<li>route
<ul>
<li><a href="#route/add">route/add</a></li>
<li><a href="#route/update">route/update</a></li>
<li><a href="#route/delete">route/delete</a></li>
<li><a href="#route/follow">route/follow</a></li>
<li><a href="#route/follow/speed">route/follow/speed</a></li>
<li><a href="#route/show">route/show</a></li>
</ul></li>
<li><a href="#get">get</a></li>
<li><a href="#setcallback">setcallback</a></li>
<li><a href="#play">play</a></li>
<li><a href="#pause">pause</a></li>
</ul>
<div class="container">
<h1>scene</h1>
<div class="call" id="scene/get">
<h2>scene/get</h2>
gets a json structure of the scene
<div class="code">{
"id" : "scene/get"
}
</div>
Response
<div class="code">{
"data" : {scene data}
}</div>
Errors:
<ul>
<li></li>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/reset">
<h2>scene/reset</h2>
Resets the scene to the default scene
<div class="code">{
"id" : "scene/reset"
}
</div>
Response
<div class="code">{
"id" : "scene/reset",
"data" :
{
}
}</div>
Errors:
<ul>
<li></li>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/save">
<h2>scene/save</h2>
saves the scene to a file. filename parameter indicates the filename, overwrite indicates if the file should be overwritten. if overwrite is not specified, or is false, the file will not be overwritten but an error will be returned
<div class="code">{
"id" : "scene/save",
"data" :
{
"filename" : "cookie.json",
"overwrite" : false
}
}
</div>
Response
<div class="code">{
"id" : "scene/save",
"data" :
{
}
}</div>
Errors:
<ul>
<li>File Exists: The file exists and the overwrite flag is set to false</li>
<li>Error saving: an unspecified error occurred while saving (disk full, file in use)</li>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/load">
<h2>scene/load</h2>
loads the scene from a file
<div class="code">{
"id" : "scene/load",
"data" :
{
"filename" : "cookie.json"
}
}
</div>
Response
<div class="code">{
"id" : "scene/load",
"data" :
{
}
}</div>
Errors:
<ul>
<li>File does not exist: Could not find the file with the filename specified</li>
<li>Invalid file: the file is not a valid scene file</li>
</ul>
</div>
<div class="call" id="scene/raycast">
<h2>scene/raycast</h2>
Casts a ray through the scene, and returns an array of collision points. Physics indicate if the ray should be cast by the physics engine or by the internal polygon structure (slower)
<div class="code">{
"id" : "scene/raycast",
"data" :
{
"start" : [ 0, 0, 0 ],
"direction" : [ 0, 1, 0 ],
"physics" : true
}
}
</div>
Response
<div class="code">{
"status" : "ok",
"data" :
[
[ 0, 0.4, 0 ],
[ 0, 0.6, 0 ],
[ 0, 1.4, 0 ],
[ 0, 1.6, 0 ]
]
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<h1>scene/node</h1>
<div class="call" id="scene/node/add">
<h2>scene/node/add</h2>
Adds a node to the scene. Returns the guid of the newly created node.<br />
name is a mandatory field, parent is optional. Also all fields in components are optional<br />
Transform indicates the position of the new node. Transformation is relative to parent, including scaling<br/>
Model indicates a modelrenderer is attached to this node. Optional cullbackfaces indicates the backfaces are not being drawn (default), Optional animated indicates if the animations should be loaded (default no). If animated, the default animation can be set with the animation field<br/>
Terrain indicates a terrain renderer. Terrain should be added first with scene/terrain/add API<br/>
Panel creates a virtual drawing panel that can be drawn on. ID can be used for scene/panel/* API calls<br />
Water creates a sheet of water. Uses a default environment reflection map for now. Size indicates the size of the water quad, resolution indicates the number of quads used. Size 10,10 and resolution 0.1 results in 10000 polygons
<div class="code">{
"id" : "scene/node/add",
"data" :
{
"name" : "name",
"parent" : "guid",
"components" :
{
"transform" :
{
"position" : [ 0, 0, 0 ],
"scale" : 1,
"rotation" : [ 0, 0, 0 ]
},
"model" :
{
"file" : "filename",
"cullbackfaces" : true,
"animated" : false,
"animation" : "animationname"
},
"terrain" :
{
"smoothnormals" : true
},
"panel" :
{
"size" : [ 1, 1 ],
"resolution" : [ 512, 512 ],
"background" : [ 1, 1, 1, 1]
},
"water" :
{
"size" : [ 20, 20 ],
"resolution" : 0.1
}
}
}
}
</div>
Response
<div class="code">{
"id" : "scene/node/add",
"data" :
{
"uuid" : "guid",
"name" : "name"
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/node/update">
<h2>scene/node/update</h2>
Updates one ore more properties of a node. id in the data field is mandatory, other fields are optional
<div class="code">{
"id" : "scene/node/update",
"data" :
{
"id" : {guid},
"parent" : {guid},
"transform" :
{
"position" : [ 0, 0, 0 ],
"scale" : 1.0,
"rotation" : [ 0, 0, 0 ],
},
"animation" :
{
"name" : "walk",
"speed" : 0.5
}
}
}
</div>
Response
<div class="code">{
"id" : "route/node/update",
"data" :
{
"status" : "ok"
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/node/moveto">
<h2>scene/node/moveto</h2>
Use either time or speed!
if stop is set, the moveto gets stopped, no more callback
<div class="code">{
"id" : "scene/node/moveto",
"data" :
{
"id" : {guid},
"stop" : "stop",
"position" : [ 0, 0, 0 ],
"rotate" : "XY",
"interpolate" : "linear",
"followheight" : false,
"speed" : 10,
"time" : 1
}
}
</div>
Response
<div class="code">{
"id" : "route/node/moveto",
"data" :
{
"status" : "ok"
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/node/delete">
<h2>scene/node/delete</h2>
<div class="code">{
"id" : "scene/node/delete",
"data" :
{
"id" : {guid}
}
}
</div>
Response
<div class="code">{
"id" : "route/node/delete",
"data" :
{
"status" : "ok"
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/node/find">
<h2>scene/node/find</h2>
<div class="code">{
"id" : "scene/node/find",
"data" :
{
"name" : {name}
}
}
</div>
Response
<div class="code">{
"id" : "route/road/delete",
"data" :
[
...node info...
]
</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/node/addlayer">
<h2>scene/node/addlayer</h2>
Adds a texture layer on top of a terrain. The texture is repeated over the terrain, and is only visible between heights between minHeight and maxHeight. After those heights the texture fades out after fadeDist distance
<div class="code">{
"id" : "scene/node/addlayer",
"data" :
{
"id" : {uuid},
"diffuse" : {texture.png},
"normal" : {texture.png},
"minHeight" : 0,
"maxHeight" : 10,
"fadeDist" : 1
}
}
</div>
Response
<div class="code">{
"id" : "route/node/addlayer",
"data" :
{
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/node/dellayer">
<h2>scene/node/dellayer</h2>
<div class="code">{
"id" : "scene/node/dellayer",
"data" :
{
}
}
</div>
Response
<div class="code">{
"id" : "route/node/dellayer",
"data" :
{
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<h1>scene/panel</h1>
<p>Panels are virtual drawing boards in the VR scene. Basically it's a rectangle with a texture stuck on it, where the texture can be drawn on. This quad is double-buffered, meaning your drawings won't show up until the buffers are swapped.</p>
<div class="call" id="scene/panel/clear">
<h2>scene/panel/clear</h2>
Clears the contents of the panel to the background color. Should be used before drawing anything on it. id should be the uuid of the node with the panel
<div class="code">{
"id" : "scene/panel/clear",
"data" :
{
"id" : "uuid"
}
}
</div>
Response
<div class="code">{
"id" : "route/panel/clear",
"data" :
{
}
}</div>
Errors:
<ul>
<li>id not found: the ID field is not in the json structure</li>
<li>node not found: the node with this id is not found</li>
<li>panel component not found: the node with this ID does not have a panel component</li>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/panel/swap">
<h2>scene/panel/swap</h2>
Swaps the buffers for this panel. id should be the uuid of the node of the panel to be cleared
<div class="code">{
"id" : "scene/panel/swap",
"data" :
{
"id" : "uuid"
}
}
</div>
Response
<div class="code">{
"id" : "route/panel/swap",
"data" :
{
}
}</div>
Errors:
<ul>
<li>id not found: the ID field is not in the json structure</li>
<li>node not found: the node with this id is not found</li>
<li>panel component not found: the node with this ID does not have a panel component</li>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/panel/drawlines">
<h2>scene/panel/drawlines</h2>
Draws multiple multiple lines on the the backbuffer for this panel. Lines can have different colors, but all share the same width. id should be the uuid of the node of the panel
<div class="code">{
"id" : "scene/panel/drawlines",
"data" :
{
"id" : "uuid",
"width" : 1,
lines :
[
0,0, 10,10, 0,0,0,1, // x1,y1, x2,y2, r,g,b,a
0,0, 100,10, 0,0,0,1, // x1,y1, x2,y2, r,g,b,a
]
}
}
</div>
Response
<div class="code">{
"id" : "route/panel/drawlines",
"data" :
{
}
}</div>
Errors:
<ul>
<li>id not found: the ID field is not in the json structure</li>
<li>node not found: the node with this id is not found</li>
<li>panel component not found: the node with this ID does not have a panel component</li>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/panel/setclearcolor">
<h2>scene/panel/setclearcolor</h2>
Changes the clear color. Color values are in the range of 0 - 1 (0,0,0 is black, 1,1,1 is white), fourth value is alpha value, 0 is transparent, 1 is opaque
<div class="code">{
"id" : "scene/panel/setclearcolor",
"data" :
{
"id" : {panelid},
"color" : [ 1,1,1,1 ]
}
}
</div>
Response
<div class="code">{
"id" : "route/panel/setclearcolor",
"data" :
{
"status" : "ok"
}
}</div>
Errors:
<ul>
<li>id not found: the ID field is not in the json structure</li>
<li>node not found: the node with this id is not found</li>
<li>panel component not found: the node with this ID does not have a panel component</li>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/panel/drawtext">
<h2>scene/panel/drawtext</h2>
Draws a text on the panel. size, color and font are optional. Font is the name of a ttf font file, found in c:\windows\fonts. A texture is loaded per font/size, so don't use too many different fonts or sizes
<div class="code">{
"id" : "scene/panel/drawtext",
"data" :
{
"id" : {panelid},
"text" : "Hello World",
"position" : [ 100.0, 100.0 ],
"size" : 32.0,
"color" : [ 0,0,0,1 ],
"font" : "segoeui"
}
}
</div>
Response
<div class="code">{
"id" : "route/panel/drawtext",
"data" :
{
"status" : "ok"
}
}</div>
Errors:
<ul>
<li>id not found: the ID field is not in the json structure</li>
<li>node not found: the node with this id is not found</li>
<li>panel component not found: the node with this ID does not have a panel component</li>
<li>font not found: the font file was not found</li>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/panel/image">
<h2>scene/panel/image</h2>
Draws an image on the panel. Image must be available on the NetworkEngine
<div class="code">{
"id" : "scene/panel/image",
"data" :
{
"id" : {panelid},
"image" : "data/NetworkEngine/textures/SkyBoxes/interstellar/interstellar_up.png",
"position" : [ 0.0, 0.0 ],
"size" : [ 512.0, 512.0]
}
}
</div>
Response
<div class="code">{
"id" : "route/panel/image",
"data" :
{
"status" : "ok"
}
}</div>
Errors:
<ul>
<li>id not found: the ID field is not in the json structure</li>
<li>node not found: the node with this id is not found</li>
<li>panel component not found: the node with this ID does not have a panel component</li>
<li>Error drawing image: the image file was not found</li>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<h1>scene/terrain</h1>
<div class="call" id="scene/terrain/add">
<h2>scene/terrain/add</h2>
Adds a terrain to the engine. This terrain has an id, although only one terrain can be loaded at this time.
<div class="code">{
"id" : "scene/terrain/add",
"data" :
{
"size" : [ 256, 256 ],
"heights" : [ 0, 0, 0, ...... 0, 0, 0 ], // 65536 values
}
}
</div>
Response
<div class="code">{
"id" : "route/terrain/add",
"data" :
{
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/terrain/update">
<h2>scene/terrain/update</h2>
<div class="code">{
"id" : "scene/terrain/update",
"data" :
{
}
}
</div>
Response
<div class="code">{
"id" : "route/terrain/update",
"data" :
{
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/terrain/delete">
<h2>scene/terrain/delete</h2>
<div class="code">{
"id" : "scene/terrain/delete",
"data" :
{
}
}
</div>
Response
<div class="code">{
"id" : "route/terrain/delete",
"data" :
{
"status" : "ok"
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/terrain/getheight">
<h2>scene/terrain/getheight</h2>
Gets a single height or multiple heights from the heightmap. Positions are mapped according to the position of the terrain rendering node.
<div class="code">{
"id" : "scene/terrain/getheight",
"data" :
{
"position" : [ 10.2, 4.4 ],
"positions" :
[
[ 10.2, 4.4 ],
[ 11.2, 4.4 ],
[ 12.2, 4.4 ]
]
}
}
</div>
Response
<div class="code">{
"id" : "route/terrain/getheight",
"data" :
{
"status" : "ok",
"height" : 10.3,
"heights" : [ 10.3, 10.4, 10.4]
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<h1>scene/skybox</h1>
<div class="call" id="scene/skybox/settime">
<h2>scene/skybox/settime</h2>
Sets the time of the sky, if the skybox is set to the dynamic skybox. Time value ranges from 0 to 24. 12.5 is equal to 12:30
<div class="code">{
"id" : "scene/skybox/settime",
"data" :
{
"time" : 12
}
}
</div>
Response
<div class="code">{
"id" : "scene/skybox/settime",
"data" :
{
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/skybox/update">
<h2>scene/skybox/update</h2>
Updates or changes the skybox. Type can be 'static' or 'dynamic'. If set to dynamic, a default dynamic skybox with sun and moon will be used. If set to static, a static version will be used, with 6 seperate images in a cubemap.
<div class="code">{
"id" : "scene/skybox/update",
"data" :
{
"type" : "static",
"files" :
{
"xpos" : "data/NetworkEngine/textures/SkyBoxes/interstellar/interstellar_rt.png",
"xneg" : "data/NetworkEngine/textures/SkyBoxes/interstellar/interstellar_lf.png",
"ypos" : "data/NetworkEngine/textures/SkyBoxes/interstellar/interstellar_up.png",
"yneg" : "data/NetworkEngine/textures/SkyBoxes/interstellar/interstellar_dn.png",
"zpos" : "data/NetworkEngine/textures/SkyBoxes/interstellar/interstellar_bk.png",
"zneg" : "data/NetworkEngine/textures/SkyBoxes/interstellar/interstellar_ft.png"
}
}
}
</div>
Response
<div class="code">{
"id" : "route/skybox/update",
"data" :
{
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<h1>scene/road</h1>
<div class="call" id="scene/road/add">
<h2>scene/road/add</h2>
<div class="code">{
"id" : "scene/road/add",
"data" :
{
"route" : "route uuid",
"heightoffset" : 0.01
}
}
</div>
Response
<div class="code">{
"id" : "route/road/add",
"data" :
{
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->
<div class="call" id="scene/road/delete">
<h2>scene/road/delete</h2>
<div class="code">{
"id" : "scene/road/delete",
"data" :
{
}
}
</div>
Response
<div class="code">{
"id" : "route/road/delete",
"data" :
{
}
}</div>
Errors:
<ul>
</ul>
</div>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------- -->