/
VisualServer.hx
3266 lines (2665 loc) · 144 KB
/
VisualServer.hx
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
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
Server for anything visible. The visual server is the API backend for everything visible. The whole scene system mounts on it to display.
The visual server is completely opaque, the internals are entirely implementation specific and cannot be accessed.
The visual server can be used to bypass the scene system entirely.
Resources are created using the `*_create` functions.
All objects are drawn to a viewport. You can use the `godot.Viewport` attached to the `godot.SceneTree` or you can create one yourself with `godot.VisualServer.viewportCreate`. When using a custom scenario or canvas, the scenario or canvas needs to be attached to the viewport using `godot.VisualServer.viewportSetScenario` or `godot.VisualServer.viewportAttachCanvas`.
In 3D, all visual objects must be associated with a scenario. The scenario is a visual representation of the world. If accessing the visual server from a running game, the scenario can be accessed from the scene tree from any `godot.Spatial` node with `godot.Spatial.getWorld`. Otherwise, a scenario can be created with `godot.VisualServer.scenarioCreate`.
Similarly, in 2D, a canvas is needed to draw all canvas items.
In 3D, all visible objects are comprised of a resource and an instance. A resource can be a mesh, a particle system, a light, or any other 3D object. In order to be visible resources must be attached to an instance using `godot.VisualServer.instanceSetBase`. The instance must also be attached to the scenario using `godot.VisualServer.instanceSetScenario` in order to be visible.
In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas.
**/
@:libType
@:csNative
@:native("Godot.VisualServer")
@:autoBuild(godot.Godot.buildUserClass())
extern class VisualServer {
/**
`frame_post_draw` signal.
**/
public static var onFramePostDraw(get, never):Signal<Void->Void>;
@:dox(hide) @:noCompletion inline static function get_onFramePostDraw():Signal<Void->Void> {
return new Signal(SINGLETON, "frame_post_draw", Signal.SignalHandlerVoidVoid.connectSignal, Signal.SignalHandlerVoidVoid.disconnectSignal, Signal.SignalHandlerVoidVoid.isSignalConnected);
}
/**
`frame_pre_draw` signal.
**/
public static var onFramePreDraw(get, never):Signal<Void->Void>;
@:dox(hide) @:noCompletion inline static function get_onFramePreDraw():Signal<Void->Void> {
return new Signal(SINGLETON, "frame_pre_draw", Signal.SignalHandlerVoidVoid.connectSignal, Signal.SignalHandlerVoidVoid.disconnectSignal, Signal.SignalHandlerVoidVoid.isSignalConnected);
}
@:native("Singleton")
public static var SINGLETON(default, never):godot.Object;
/**
If `false`, disables rendering completely, but the engine logic is still being processed. You can call `godot.VisualServer.forceDraw` to draw a frame even with rendering disabled.
**/
@:native("RenderLoopEnabled")
public static var RENDER_LOOP_ENABLED:Bool;
/**
The maximum renderpriority of all materials.
**/
@:native("MaterialRenderPriorityMax")
public static var MATERIAL_RENDER_PRIORITY_MAX(default, never):Int;
/**
The minimum renderpriority of all materials.
**/
@:native("MaterialRenderPriorityMin")
public static var MATERIAL_RENDER_PRIORITY_MIN(default, never):Int;
/**
Unused enum in Godot 3.x.
**/
@:native("MaxCursors")
public static var MAX_CURSORS(default, never):Int;
/**
Max number of glow levels that can be used with glow post-process effect.
**/
@:native("MaxGlowLevels")
public static var MAX_GLOW_LEVELS(default, never):Int;
/**
The maximum Z-layer for canvas items.
**/
@:native("CanvasItemZMax")
public static var CANVAS_ITEM_Z_MAX(default, never):Int;
/**
The minimum Z-layer for canvas items.
**/
@:native("CanvasItemZMin")
public static var CANVAS_ITEM_Z_MIN(default, never):Int;
/**
Number of weights/bones per vertex.
**/
@:native("ArrayWeightsSize")
public static var ARRAY_WEIGHTS_SIZE(default, never):Int;
/**
Marks an error that shows that the index array is empty.
**/
@:native("NoIndexArray")
public static var NO_INDEX_ARRAY(default, never):Int;
/**
Synchronizes threads.
**/
@:native("ForceSync")
public static function forceSync():Void;
#if doc_gen
/**
Forces a frame to be drawn when the function is called. Drawing a frame updates all `godot.Viewport`s that are set to update. Use with extreme caution.
**/
@:native("ForceDraw")
public static function forceDraw(?swapBuffers:Bool, ?frameStep:Float):Void;
#else
/**
Forces a frame to be drawn when the function is called. Drawing a frame updates all `godot.Viewport`s that are set to update. Use with extreme caution.
**/
@:native("ForceDraw")
public static overload function forceDraw():Void;
/**
Forces a frame to be drawn when the function is called. Drawing a frame updates all `godot.Viewport`s that are set to update. Use with extreme caution.
**/
@:native("ForceDraw")
public static overload function forceDraw(swapBuffers:Bool):Void;
/**
Forces a frame to be drawn when the function is called. Drawing a frame updates all `godot.Viewport`s that are set to update. Use with extreme caution.
**/
@:native("ForceDraw")
public static overload function forceDraw(swapBuffers:Bool, frameStep:Float):Void;
#end
/**
Not implemented in Godot 3.x.
**/
@:native("Sync")
public static function sync():Void;
#if doc_gen
/**
Draws a frame. This method is deprecated, please use `godot.VisualServer.forceDraw` instead.
**/
@:native("Draw")
public static function draw(?swapBuffers:Bool, ?frameStep:Float):Void;
#else
/**
Draws a frame. This method is deprecated, please use `godot.VisualServer.forceDraw` instead.
**/
@:native("Draw")
public static overload function draw():Void;
/**
Draws a frame. This method is deprecated, please use `godot.VisualServer.forceDraw` instead.
**/
@:native("Draw")
public static overload function draw(swapBuffers:Bool):Void;
/**
Draws a frame. This method is deprecated, please use `godot.VisualServer.forceDraw` instead.
**/
@:native("Draw")
public static overload function draw(swapBuffers:Bool, frameStep:Float):Void;
#end
/**
Creates an empty texture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all `texture_*` VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's `godot.VisualServer.freeRid` static method.
**/
@:native("TextureCreate")
public static function textureCreate():godot.RID;
#if doc_gen
/**
Creates a texture, allocates the space for an image, and fills in the image.
**/
@:native("TextureCreateFromImage")
public static function textureCreateFromImage(image:godot.Image, ?flags:UInt):godot.RID;
#else
/**
Creates a texture, allocates the space for an image, and fills in the image.
**/
@:native("TextureCreateFromImage")
public static overload function textureCreateFromImage(image:godot.Image):godot.RID;
/**
Creates a texture, allocates the space for an image, and fills in the image.
**/
@:native("TextureCreateFromImage")
public static overload function textureCreateFromImage(image:godot.Image, flags:UInt):godot.RID;
#end
#if doc_gen
/**
Allocates the GPU memory for the texture.
**/
@:native("TextureAllocate")
public static function textureAllocate(texture:godot.RID, width:Int, height:Int, depth3d:Int, format:godot.Image_Format, type:godot.VisualServer_TextureType, ?flags:UInt):Void;
#else
/**
Allocates the GPU memory for the texture.
**/
@:native("TextureAllocate")
public static overload function textureAllocate(texture:godot.RID, width:Int, height:Int, depth3d:Int, format:godot.Image_Format, type:godot.VisualServer_TextureType):Void;
/**
Allocates the GPU memory for the texture.
**/
@:native("TextureAllocate")
public static overload function textureAllocate(texture:godot.RID, width:Int, height:Int, depth3d:Int, format:godot.Image_Format, type:godot.VisualServer_TextureType, flags:UInt):Void;
#end
#if doc_gen
/**
Sets the texture's image data. If it's a CubeMap, it sets the image data at a cube side.
**/
@:native("TextureSetData")
public static function textureSetData(texture:godot.RID, image:godot.Image, ?layer:Int):Void;
#else
/**
Sets the texture's image data. If it's a CubeMap, it sets the image data at a cube side.
**/
@:native("TextureSetData")
public static overload function textureSetData(texture:godot.RID, image:godot.Image):Void;
/**
Sets the texture's image data. If it's a CubeMap, it sets the image data at a cube side.
**/
@:native("TextureSetData")
public static overload function textureSetData(texture:godot.RID, image:godot.Image, layer:Int):Void;
#end
#if doc_gen
/**
Sets a part of the data for a texture. Warning: this function calls the underlying graphics API directly and may corrupt your texture if used improperly.
**/
@:native("TextureSetDataPartial")
public static function textureSetDataPartial(texture:godot.RID, image:godot.Image, srcX:Int, srcY:Int, srcW:Int, srcH:Int, dstX:Int, dstY:Int, dstMip:Int, ?layer:Int):Void;
#else
/**
Sets a part of the data for a texture. Warning: this function calls the underlying graphics API directly and may corrupt your texture if used improperly.
**/
@:native("TextureSetDataPartial")
public static overload function textureSetDataPartial(texture:godot.RID, image:godot.Image, srcX:Int, srcY:Int, srcW:Int, srcH:Int, dstX:Int, dstY:Int, dstMip:Int):Void;
/**
Sets a part of the data for a texture. Warning: this function calls the underlying graphics API directly and may corrupt your texture if used improperly.
**/
@:native("TextureSetDataPartial")
public static overload function textureSetDataPartial(texture:godot.RID, image:godot.Image, srcX:Int, srcY:Int, srcW:Int, srcH:Int, dstX:Int, dstY:Int, dstMip:Int, layer:Int):Void;
#end
#if doc_gen
/**
Returns a copy of a texture's image unless it's a CubeMap, in which case it returns the `godot.RID` of the image at one of the cubes sides.
**/
@:native("TextureGetData")
public static function textureGetData(texture:godot.RID, ?cubeSide:Int):godot.Image;
#else
/**
Returns a copy of a texture's image unless it's a CubeMap, in which case it returns the `godot.RID` of the image at one of the cubes sides.
**/
@:native("TextureGetData")
public static overload function textureGetData(texture:godot.RID):godot.Image;
/**
Returns a copy of a texture's image unless it's a CubeMap, in which case it returns the `godot.RID` of the image at one of the cubes sides.
**/
@:native("TextureGetData")
public static overload function textureGetData(texture:godot.RID, cubeSide:Int):godot.Image;
#end
/**
Sets the texture's flags. See `godot.VisualServer_TextureFlags` for options.
**/
@:native("TextureSetFlags")
public static function textureSetFlags(texture:godot.RID, flags:UInt):Void;
/**
Returns the flags of a texture.
**/
@:native("TextureGetFlags")
public static function textureGetFlags(texture:godot.RID):UInt;
/**
Returns the format of the texture's image.
**/
@:native("TextureGetFormat")
public static function textureGetFormat(texture:godot.RID):godot.Image_Format;
/**
Returns the type of the texture, can be any of the `godot.VisualServer_TextureType`.
**/
@:native("TextureGetType")
public static function textureGetType(texture:godot.RID):godot.VisualServer_TextureType;
/**
Returns the opengl id of the texture's image.
**/
@:native("TextureGetTexid")
public static function textureGetTexid(texture:godot.RID):UInt;
/**
Returns the texture's width.
**/
@:native("TextureGetWidth")
public static function textureGetWidth(texture:godot.RID):UInt;
/**
Returns the texture's height.
**/
@:native("TextureGetHeight")
public static function textureGetHeight(texture:godot.RID):UInt;
/**
Returns the depth of the texture.
**/
@:native("TextureGetDepth")
public static function textureGetDepth(texture:godot.RID):UInt;
/**
Resizes the texture to the specified dimensions.
**/
@:native("TextureSetSizeOverride")
public static function textureSetSizeOverride(texture:godot.RID, width:Int, height:Int, depth:Int):Void;
/**
Sets the texture's path.
**/
@:native("TextureSetPath")
public static function textureSetPath(texture:godot.RID, path:std.String):Void;
/**
Returns the texture's path.
**/
@:native("TextureGetPath")
public static function textureGetPath(texture:godot.RID):std.String;
/**
If `true`, sets internal processes to shrink all image data to half the size.
**/
@:native("TextureSetShrinkAllX2OnSetData")
public static function textureSetShrinkAllX2OnSetData(shrink:Bool):Void;
/**
Binds the texture to a texture slot.
**/
@:native("TextureBind")
public static function textureBind(texture:godot.RID, number:UInt):Void;
/**
Returns a list of all the textures and their information.
**/
@:native("TextureDebugUsage")
public static function textureDebugUsage():godot.collections.Array;
/**
If `true`, the image will be stored in the texture's images array if overwritten.
**/
@:native("TexturesKeepOriginal")
public static function texturesKeepOriginal(enable:Bool):Void;
/**
Creates an empty sky and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all `sky_*` VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's `godot.VisualServer.freeRid` static method.
**/
@:native("SkyCreate")
public static function skyCreate():godot.RID;
/**
Sets a sky's texture.
**/
@:native("SkySetTexture")
public static function skySetTexture(sky:godot.RID, cubeMap:godot.RID, radianceSize:Int):Void;
/**
Creates an empty shader and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all `shader_*` VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's `godot.VisualServer.freeRid` static method.
**/
@:native("ShaderCreate")
public static function shaderCreate():godot.RID;
/**
Sets a shader's code.
**/
@:native("ShaderSetCode")
public static function shaderSetCode(shader:godot.RID, code:std.String):Void;
/**
Returns a shader's code.
**/
@:native("ShaderGetCode")
public static function shaderGetCode(shader:godot.RID):std.String;
/**
Returns the parameters of a shader.
**/
@:native("ShaderGetParamList")
public static function shaderGetParamList(shader:godot.RID):godot.collections.Array;
/**
Sets a shader's default texture. Overwrites the texture given by name.
**/
@:native("ShaderSetDefaultTextureParam")
public static function shaderSetDefaultTextureParam(shader:godot.RID, name:std.String, texture:godot.RID):Void;
/**
Returns a default texture from a shader searched by name.
**/
@:native("ShaderGetDefaultTextureParam")
public static function shaderGetDefaultTextureParam(shader:godot.RID, name:std.String):godot.RID;
/**
Creates an empty material and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all `material_*` VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's `godot.VisualServer.freeRid` static method.
**/
@:native("MaterialCreate")
public static function materialCreate():godot.RID;
/**
Sets a shader material's shader.
**/
@:native("MaterialSetShader")
public static function materialSetShader(shaderMaterial:godot.RID, shader:godot.RID):Void;
/**
Returns the shader of a certain material's shader. Returns an empty RID if the material doesn't have a shader.
**/
@:native("MaterialGetShader")
public static function materialGetShader(shaderMaterial:godot.RID):godot.RID;
/**
Sets a material's parameter.
**/
@:native("MaterialSetParam")
public static function materialSetParam(material:godot.RID, parameter:std.String, value:Dynamic):Void;
/**
Returns the value of a certain material's parameter.
**/
@:native("MaterialGetParam")
public static function materialGetParam(material:godot.RID, parameter:std.String):Dynamic;
/**
Returns the default value for the param if available. Returns `null` otherwise.
**/
@:native("MaterialGetParamDefault")
public static function materialGetParamDefault(material:godot.RID, parameter:std.String):Dynamic;
/**
Sets a material's render priority.
**/
@:native("MaterialSetRenderPriority")
public static function materialSetRenderPriority(material:godot.RID, priority:Int):Void;
/**
Sets a material's line width.
**/
@:native("MaterialSetLineWidth")
public static function materialSetLineWidth(material:godot.RID, width:Single):Void;
/**
Sets an object's next material.
**/
@:native("MaterialSetNextPass")
public static function materialSetNextPass(material:godot.RID, nextMaterial:godot.RID):Void;
/**
Creates a new mesh and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all `mesh_*` VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's `godot.VisualServer.freeRid` static method.
To place in a scene, attach this mesh to an instance using `godot.VisualServer.instanceSetBase` using the returned RID.
**/
@:native("MeshCreate")
public static function meshCreate():godot.RID;
/**
Function is unused in Godot 3.x.
**/
@:native("MeshSurfaceGetFormatOffset")
public static function meshSurfaceGetFormatOffset(format:UInt, vertexLen:Int, indexLen:Int, arrayIndex:Int):UInt;
@:native("MeshSurfaceGetFormatStride")
public static function meshSurfaceGetFormatStride(format:UInt, vertexLen:Int, indexLen:Int, arrayIndex:Int):UInt;
#if doc_gen
/**
Adds a surface generated from the Arrays to a mesh. See `godot.VisualServer_PrimitiveType` constants for types.
@param blendShapes If the parameter is null, then the default value is new Godot.Collections.Array { }
**/
@:native("MeshAddSurfaceFromArrays")
public static function meshAddSurfaceFromArrays(mesh:godot.RID, primitive:godot.VisualServer_PrimitiveType, arrays:godot.collections.Array, ?blendShapes:godot.collections.Array, ?compressFormat:UInt):Void;
#else
/**
Adds a surface generated from the Arrays to a mesh. See `godot.VisualServer_PrimitiveType` constants for types.
@param blendShapes If the parameter is null, then the default value is new Godot.Collections.Array { }
**/
@:native("MeshAddSurfaceFromArrays")
public static overload function meshAddSurfaceFromArrays(mesh:godot.RID, primitive:godot.VisualServer_PrimitiveType, arrays:godot.collections.Array):Void;
/**
Adds a surface generated from the Arrays to a mesh. See `godot.VisualServer_PrimitiveType` constants for types.
@param blendShapes If the parameter is null, then the default value is new Godot.Collections.Array { }
**/
@:native("MeshAddSurfaceFromArrays")
public static overload function meshAddSurfaceFromArrays(mesh:godot.RID, primitive:godot.VisualServer_PrimitiveType, arrays:godot.collections.Array, blendShapes:godot.collections.Array):Void;
/**
Adds a surface generated from the Arrays to a mesh. See `godot.VisualServer_PrimitiveType` constants for types.
@param blendShapes If the parameter is null, then the default value is new Godot.Collections.Array { }
**/
@:native("MeshAddSurfaceFromArrays")
public static overload function meshAddSurfaceFromArrays(mesh:godot.RID, primitive:godot.VisualServer_PrimitiveType, arrays:godot.collections.Array, blendShapes:godot.collections.Array, compressFormat:UInt):Void;
#end
/**
Sets a mesh's blend shape count.
**/
@:native("MeshSetBlendShapeCount")
public static function meshSetBlendShapeCount(mesh:godot.RID, amount:Int):Void;
/**
Returns a mesh's blend shape count.
**/
@:native("MeshGetBlendShapeCount")
public static function meshGetBlendShapeCount(mesh:godot.RID):Int;
/**
Sets a mesh's blend shape mode.
**/
@:native("MeshSetBlendShapeMode")
public static function meshSetBlendShapeMode(mesh:godot.RID, mode:godot.VisualServer_BlendShapeMode):Void;
/**
Returns a mesh's blend shape mode.
**/
@:native("MeshGetBlendShapeMode")
public static function meshGetBlendShapeMode(mesh:godot.RID):godot.VisualServer_BlendShapeMode;
/**
Updates a specific region of a vertex buffer for the specified surface. Warning: this function alters the vertex buffer directly with no safety mechanisms, you can easily corrupt your mesh.
**/
@:native("MeshSurfaceUpdateRegion")
public static function meshSurfaceUpdateRegion(mesh:godot.RID, surface:Int, offset:Int, data:HaxeArray<cs.types.UInt8>):Void;
/**
Sets a mesh's surface's material.
**/
@:native("MeshSurfaceSetMaterial")
public static function meshSurfaceSetMaterial(mesh:godot.RID, surface:Int, material:godot.RID):Void;
/**
Returns a mesh's surface's material.
**/
@:native("MeshSurfaceGetMaterial")
public static function meshSurfaceGetMaterial(mesh:godot.RID, surface:Int):godot.RID;
/**
Returns a mesh's surface's amount of vertices.
**/
@:native("MeshSurfaceGetArrayLen")
public static function meshSurfaceGetArrayLen(mesh:godot.RID, surface:Int):Int;
/**
Returns a mesh's surface's amount of indices.
**/
@:native("MeshSurfaceGetArrayIndexLen")
public static function meshSurfaceGetArrayIndexLen(mesh:godot.RID, surface:Int):Int;
/**
Returns a mesh's surface's vertex buffer.
**/
public static extern inline function meshSurfaceGetArray(mesh:godot.RID, surface:Int):std.Array<cs.types.UInt8> {
return cs.Lib.array(cs.Syntax.code("MeshSurfaceGetArray({0}, {1})", mesh, surface));
}
/**
Returns a mesh's surface's index buffer.
**/
public static extern inline function meshSurfaceGetIndexArray(mesh:godot.RID, surface:Int):std.Array<cs.types.UInt8> {
return cs.Lib.array(cs.Syntax.code("MeshSurfaceGetIndexArray({0}, {1})", mesh, surface));
}
/**
Returns a mesh's surface's buffer arrays.
**/
@:native("MeshSurfaceGetArrays")
public static function meshSurfaceGetArrays(mesh:godot.RID, surface:Int):godot.collections.Array;
/**
Returns a mesh's surface's arrays for blend shapes.
**/
@:native("MeshSurfaceGetBlendShapeArrays")
public static function meshSurfaceGetBlendShapeArrays(mesh:godot.RID, surface:Int):godot.collections.Array;
/**
Returns the format of a mesh's surface.
**/
@:native("MeshSurfaceGetFormat")
public static function meshSurfaceGetFormat(mesh:godot.RID, surface:Int):UInt;
/**
Returns the primitive type of a mesh's surface.
**/
@:native("MeshSurfaceGetPrimitiveType")
public static function meshSurfaceGetPrimitiveType(mesh:godot.RID, surface:Int):godot.VisualServer_PrimitiveType;
/**
Returns a mesh's surface's aabb.
**/
@:native("MeshSurfaceGetAabb")
public static function meshSurfaceGetAabb(mesh:godot.RID, surface:Int):godot.AABB;
/**
Returns the aabb of a mesh's surface's skeleton.
**/
@:native("MeshSurfaceGetSkeletonAabb")
public static function meshSurfaceGetSkeletonAabb(mesh:godot.RID, surface:Int):godot.collections.Array;
/**
Removes a mesh's surface.
**/
@:native("MeshRemoveSurface")
public static function meshRemoveSurface(mesh:godot.RID, index:Int):Void;
/**
Returns a mesh's number of surfaces.
**/
@:native("MeshGetSurfaceCount")
public static function meshGetSurfaceCount(mesh:godot.RID):Int;
/**
Sets a mesh's custom aabb.
**/
@:native("MeshSetCustomAabb")
public static function meshSetCustomAabb(mesh:godot.RID, aabb:godot.AABB):Void;
/**
Returns a mesh's custom aabb.
**/
@:native("MeshGetCustomAabb")
public static function meshGetCustomAabb(mesh:godot.RID):godot.AABB;
/**
Removes all surfaces from a mesh.
**/
@:native("MeshClear")
public static function meshClear(mesh:godot.RID):Void;
/**
Creates a new multimesh on the VisualServer and returns an `godot.RID` handle. This RID will be used in all `multimesh_*` VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's `godot.VisualServer.freeRid` static method.
To place in a scene, attach this multimesh to an instance using `godot.VisualServer.instanceSetBase` using the returned RID.
**/
@:native("MultimeshCreate")
public static function multimeshCreate():godot.RID;
#if doc_gen
/**
Allocates space for the multimesh data. Format parameters determine how the data will be stored by OpenGL. See `godot.VisualServer_MultimeshTransformFormat`, `godot.VisualServer_MultimeshColorFormat`, and `godot.VisualServer_MultimeshCustomDataFormat` for usage. Equivalent to `godot.MultiMesh.instanceCount`.
**/
@:native("MultimeshAllocate")
public static function multimeshAllocate(multimesh:godot.RID, instances:Int, transformFormat:godot.VisualServer_MultimeshTransformFormat, colorFormat:godot.VisualServer_MultimeshColorFormat, ?customDataFormat:godot.VisualServer_MultimeshCustomDataFormat):Void;
#else
/**
Allocates space for the multimesh data. Format parameters determine how the data will be stored by OpenGL. See `godot.VisualServer_MultimeshTransformFormat`, `godot.VisualServer_MultimeshColorFormat`, and `godot.VisualServer_MultimeshCustomDataFormat` for usage. Equivalent to `godot.MultiMesh.instanceCount`.
**/
@:native("MultimeshAllocate")
public static overload function multimeshAllocate(multimesh:godot.RID, instances:Int, transformFormat:godot.VisualServer_MultimeshTransformFormat, colorFormat:godot.VisualServer_MultimeshColorFormat):Void;
/**
Allocates space for the multimesh data. Format parameters determine how the data will be stored by OpenGL. See `godot.VisualServer_MultimeshTransformFormat`, `godot.VisualServer_MultimeshColorFormat`, and `godot.VisualServer_MultimeshCustomDataFormat` for usage. Equivalent to `godot.MultiMesh.instanceCount`.
**/
@:native("MultimeshAllocate")
public static overload function multimeshAllocate(multimesh:godot.RID, instances:Int, transformFormat:godot.VisualServer_MultimeshTransformFormat, colorFormat:godot.VisualServer_MultimeshColorFormat, customDataFormat:godot.VisualServer_MultimeshCustomDataFormat):Void;
#end
/**
Returns the number of instances allocated for this multimesh.
**/
@:native("MultimeshGetInstanceCount")
public static function multimeshGetInstanceCount(multimesh:godot.RID):Int;
/**
Sets the mesh to be drawn by the multimesh. Equivalent to `godot.MultiMesh.mesh`.
**/
@:native("MultimeshSetMesh")
public static function multimeshSetMesh(multimesh:godot.RID, mesh:godot.RID):Void;
/**
Sets the `godot.Transform` for this instance. Equivalent to `godot.MultiMesh.setInstanceTransform`.
**/
@:native("MultimeshInstanceSetTransform")
public static function multimeshInstanceSetTransform(multimesh:godot.RID, index:Int, transform:godot.Transform):Void;
/**
Sets the `godot.Transform2D` for this instance. For use when multimesh is used in 2D. Equivalent to `godot.MultiMesh.setInstanceTransform2d`.
**/
@:native("MultimeshInstanceSetTransform2d")
public static function multimeshInstanceSetTransform2d(multimesh:godot.RID, index:Int, transform:godot.Transform2D):Void;
/**
Sets the color by which this instance will be modulated. Equivalent to `godot.MultiMesh.setInstanceColor`.
**/
@:native("MultimeshInstanceSetColor")
public static function multimeshInstanceSetColor(multimesh:godot.RID, index:Int, color:godot.Color):Void;
/**
Sets the custom data for this instance. Custom data is passed as a `godot.Color`, but is interpreted as a `vec4` in the shader. Equivalent to `godot.MultiMesh.setInstanceCustomData`.
**/
@:native("MultimeshInstanceSetCustomData")
public static function multimeshInstanceSetCustomData(multimesh:godot.RID, index:Int, customData:godot.Color):Void;
/**
Returns the RID of the mesh that will be used in drawing this multimesh.
**/
@:native("MultimeshGetMesh")
public static function multimeshGetMesh(multimesh:godot.RID):godot.RID;
/**
Calculates and returns the axis-aligned bounding box that encloses all instances within the multimesh.
**/
@:native("MultimeshGetAabb")
public static function multimeshGetAabb(multimesh:godot.RID):godot.AABB;
/**
Returns the `godot.Transform` of the specified instance.
**/
@:native("MultimeshInstanceGetTransform")
public static function multimeshInstanceGetTransform(multimesh:godot.RID, index:Int):godot.Transform;
/**
Returns the `godot.Transform2D` of the specified instance. For use when the multimesh is set to use 2D transforms.
**/
@:native("MultimeshInstanceGetTransform2d")
public static function multimeshInstanceGetTransform2d(multimesh:godot.RID, index:Int):godot.Transform2D;
/**
Returns the color by which the specified instance will be modulated.
**/
@:native("MultimeshInstanceGetColor")
public static function multimeshInstanceGetColor(multimesh:godot.RID, index:Int):godot.Color;
/**
Returns the custom data associated with the specified instance.
**/
@:native("MultimeshInstanceGetCustomData")
public static function multimeshInstanceGetCustomData(multimesh:godot.RID, index:Int):godot.Color;
/**
Sets the number of instances visible at a given time. If -1, all instances that have been allocated are drawn. Equivalent to `godot.MultiMesh.visibleInstanceCount`.
**/
@:native("MultimeshSetVisibleInstances")
public static function multimeshSetVisibleInstances(multimesh:godot.RID, visible:Int):Void;
/**
Returns the number of visible instances for this multimesh.
**/
@:native("MultimeshGetVisibleInstances")
public static function multimeshGetVisibleInstances(multimesh:godot.RID):Int;
/**
Sets all data related to the instances in one go. This is especially useful when loading the data from disk or preparing the data from GDNative.
All data is packed in one large float array. An array may look like this: Transform for instance 1, color data for instance 1, custom data for instance 1, transform for instance 2, color data for instance 2, etc.
`godot.Transform` is stored as 12 floats, `godot.Transform2D` is stored as 8 floats, `COLOR_8BIT` / `CUSTOM_DATA_8BIT` is stored as 1 float (4 bytes as is) and `COLOR_FLOAT` / `CUSTOM_DATA_FLOAT` is stored as 4 floats.
**/
@:native("MultimeshSetAsBulkArray")
public static function multimeshSetAsBulkArray(multimesh:godot.RID, array:HaxeArray<Single>):Void;
/**
Creates an immediate geometry and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all `immediate_*` VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's `godot.VisualServer.freeRid` static method.
To place in a scene, attach this immediate geometry to an instance using `godot.VisualServer.instanceSetBase` using the returned RID.
**/
@:native("ImmediateCreate")
public static function immediateCreate():godot.RID;
#if doc_gen
/**
Sets up `godot.ImmediateGeometry` internals to prepare for drawing. Equivalent to `godot.ImmediateGeometry.begin`.
**/
@:native("ImmediateBegin")
public static function immediateBegin(immediate:godot.RID, primitive:godot.VisualServer_PrimitiveType, ?texture:godot.RID):Void;
#else
/**
Sets up `godot.ImmediateGeometry` internals to prepare for drawing. Equivalent to `godot.ImmediateGeometry.begin`.
**/
@:native("ImmediateBegin")
public static overload function immediateBegin(immediate:godot.RID, primitive:godot.VisualServer_PrimitiveType):Void;
/**
Sets up `godot.ImmediateGeometry` internals to prepare for drawing. Equivalent to `godot.ImmediateGeometry.begin`.
**/
@:native("ImmediateBegin")
public static overload function immediateBegin(immediate:godot.RID, primitive:godot.VisualServer_PrimitiveType, texture:godot.RID):Void;
#end
/**
Adds the next vertex using the information provided in advance. Equivalent to `godot.ImmediateGeometry.addVertex`.
**/
@:native("ImmediateVertex")
public static function immediateVertex(immediate:godot.RID, vertex:godot.Vector3):Void;
/**
Adds the next vertex using the information provided in advance. This is a helper class that calls `godot.VisualServer.immediateVertex` under the hood. Equivalent to `godot.ImmediateGeometry.addVertex`.
**/
@:native("ImmediateVertex2d")
public static function immediateVertex2d(immediate:godot.RID, vertex:godot.Vector2):Void;
/**
Sets the normal to be used with next vertex. Equivalent to `godot.ImmediateGeometry.setNormal`.
**/
@:native("ImmediateNormal")
public static function immediateNormal(immediate:godot.RID, normal:godot.Vector3):Void;
/**
Sets the tangent to be used with next vertex. Equivalent to `godot.ImmediateGeometry.setTangent`.
**/
@:native("ImmediateTangent")
public static function immediateTangent(immediate:godot.RID, tangent:godot.Plane):Void;
/**
Sets the color to be used with next vertex. Equivalent to `godot.ImmediateGeometry.setColor`.
**/
@:native("ImmediateColor")
public static function immediateColor(immediate:godot.RID, color:godot.Color):Void;
/**
Sets the UV to be used with next vertex. Equivalent to `godot.ImmediateGeometry.setUv`.
**/
@:native("ImmediateUv")
public static function immediateUv(immediate:godot.RID, texUv:godot.Vector2):Void;
/**
Sets the UV2 to be used with next vertex. Equivalent to `godot.ImmediateGeometry.setUv2`.
**/
@:native("ImmediateUv2")
public static function immediateUv2(immediate:godot.RID, texUv:godot.Vector2):Void;
/**
Ends drawing the `godot.ImmediateGeometry` and displays it. Equivalent to `godot.ImmediateGeometry.end`.
**/
@:native("ImmediateEnd")
public static function immediateEnd(immediate:godot.RID):Void;
/**
Clears everything that was set up between `godot.VisualServer.immediateBegin` and `godot.VisualServer.immediateEnd`. Equivalent to `godot.ImmediateGeometry.clear`.
**/
@:native("ImmediateClear")
public static function immediateClear(immediate:godot.RID):Void;
/**
Sets the material to be used to draw the `godot.ImmediateGeometry`.
**/
@:native("ImmediateSetMaterial")
public static function immediateSetMaterial(immediate:godot.RID, material:godot.RID):Void;
/**
Returns the material assigned to the `godot.ImmediateGeometry`.
**/
@:native("ImmediateGetMaterial")
public static function immediateGetMaterial(immediate:godot.RID):godot.RID;
/**
Creates a skeleton and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all `skeleton_*` VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's `godot.VisualServer.freeRid` static method.
**/
@:native("SkeletonCreate")
public static function skeletonCreate():godot.RID;
#if doc_gen
/**
Allocates the GPU buffers for this skeleton.
**/
@:native("SkeletonAllocate")
public static function skeletonAllocate(skeleton:godot.RID, bones:Int, ?is2dSkeleton:Bool):Void;
#else
/**
Allocates the GPU buffers for this skeleton.
**/
@:native("SkeletonAllocate")
public static overload function skeletonAllocate(skeleton:godot.RID, bones:Int):Void;
/**
Allocates the GPU buffers for this skeleton.
**/
@:native("SkeletonAllocate")
public static overload function skeletonAllocate(skeleton:godot.RID, bones:Int, is2dSkeleton:Bool):Void;
#end
/**
Returns the number of bones allocated for this skeleton.
**/
@:native("SkeletonGetBoneCount")
public static function skeletonGetBoneCount(skeleton:godot.RID):Int;
/**
Sets the `godot.Transform` for a specific bone of this skeleton.
**/
@:native("SkeletonBoneSetTransform")
public static function skeletonBoneSetTransform(skeleton:godot.RID, bone:Int, transform:godot.Transform):Void;
/**
Returns the `godot.Transform` set for a specific bone of this skeleton.
**/
@:native("SkeletonBoneGetTransform")
public static function skeletonBoneGetTransform(skeleton:godot.RID, bone:Int):godot.Transform;
/**
Sets the `godot.Transform2D` for a specific bone of this skeleton.
**/
@:native("SkeletonBoneSetTransform2d")
public static function skeletonBoneSetTransform2d(skeleton:godot.RID, bone:Int, transform:godot.Transform2D):Void;
/**
Returns the `godot.Transform2D` set for a specific bone of this skeleton.
**/
@:native("SkeletonBoneGetTransform2d")
public static function skeletonBoneGetTransform2d(skeleton:godot.RID, bone:Int):godot.Transform2D;
/**
Creates a directional light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most `light_*` VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's `godot.VisualServer.freeRid` static method.
To place in a scene, attach this directional light to an instance using `godot.VisualServer.instanceSetBase` using the returned RID.
**/
@:native("DirectionalLightCreate")
public static function directionalLightCreate():godot.RID;
/**
Creates a new omni light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most `light_*` VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's `godot.VisualServer.freeRid` static method.
To place in a scene, attach this omni light to an instance using `godot.VisualServer.instanceSetBase` using the returned RID.
**/
@:native("OmniLightCreate")
public static function omniLightCreate():godot.RID;
/**
Creates a spot light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most `light_*` VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's `godot.VisualServer.freeRid` static method.
To place in a scene, attach this spot light to an instance using `godot.VisualServer.instanceSetBase` using the returned RID.
**/
@:native("SpotLightCreate")
public static function spotLightCreate():godot.RID;
/**
Sets the color of the light. Equivalent to `godot.Light.lightColor`.
**/
@:native("LightSetColor")
public static function lightSetColor(light:godot.RID, color:godot.Color):Void;
/**
Sets the specified light parameter. See `godot.VisualServer_LightParam` for options. Equivalent to `godot.Light.setParam`.
**/
@:native("LightSetParam")
public static function lightSetParam(light:godot.RID, param:godot.VisualServer_LightParam, value:Single):Void;
/**
If `true`, light will cast shadows. Equivalent to `godot.Light.shadowEnabled`.
**/
@:native("LightSetShadow")
public static function lightSetShadow(light:godot.RID, enabled:Bool):Void;
/**
Sets the color of the shadow cast by the light. Equivalent to `godot.Light.shadowColor`.
**/
@:native("LightSetShadowColor")
public static function lightSetShadowColor(light:godot.RID, color:godot.Color):Void;
/**
Not implemented in Godot 3.x.
**/
@:native("LightSetProjector")
public static function lightSetProjector(light:godot.RID, texture:godot.RID):Void;