-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
/
PhysicsServer3D.xml
1806 lines (1806 loc) · 83.2 KB
/
PhysicsServer3D.xml
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
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PhysicsServer3D" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A server interface for low-level 3D physics access.
</brief_description>
<description>
PhysicsServer3D is the server responsible for all 3D physics. It can directly create and manipulate all physics objects:
- A [i]space[/i] is a self-contained world for a physics simulation. It contains bodies, areas, and joints. Its state can be queried for collision and intersection information, and several parameters of the simulation can be modified.
- A [i]shape[/i] is a geometric shape such as a sphere, a box, a cylinder, or a polygon. It can be used for collision detection by adding it to a body/area, possibly with an extra transformation relative to the body/area's origin. Bodies/areas can have multiple (transformed) shapes added to them, and a single shape can be added to bodies/areas multiple times with different local transformations.
- A [i]body[/i] is a physical object which can be in static, kinematic, or rigid mode. Its state (such as position and velocity) can be queried and updated. A force integration callback can be set to customize the body's physics.
- An [i]area[/i] is a region in space which can be used to detect bodies and areas entering and exiting it. A body monitoring callback can be set to report entering/exiting body shapes, and similarly an area monitoring callback can be set. Gravity and damping can be overridden within the area by setting area parameters.
- A [i]joint[/i] is a constraint, either between two bodies or on one body relative to a point. Parameters such as the joint bias and the rest length of a spring joint can be adjusted.
Physics objects in [PhysicsServer3D] may be created and manipulated independently; they do not have to be tied to nodes in the scene tree.
[b]Note:[/b] All the 3D physics nodes use the physics server internally. Adding a physics node to the scene tree will cause a corresponding physics object to be created in the physics server. A rigid body node registers a callback that updates the node's transform with the transform of the respective body object in the physics server (every physics update). An area node registers a callback to inform the area node about overlaps with the respective area object in the physics server. The raycast node queries the direct state of the relevant space in the physics server.
</description>
<tutorials>
</tutorials>
<methods>
<method name="area_add_shape">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="shape" type="RID" />
<param index="2" name="transform" type="Transform3D" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)" />
<param index="3" name="disabled" type="bool" default="false" />
<description>
Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index.
</description>
</method>
<method name="area_attach_object_instance_id">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="id" type="int" />
<description>
Assigns the area to a descendant of [Object], so it can exist in the node tree.
</description>
</method>
<method name="area_clear_shapes">
<return type="void" />
<param index="0" name="area" type="RID" />
<description>
Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later.
</description>
</method>
<method name="area_create">
<return type="RID" />
<description>
Creates a 3D area object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to [code]1[/code], and [code]monitorable[/code] set to [code]false[/code].
Use [method area_add_shape] to add shapes to it, use [method area_set_transform] to set its transform, and use [method area_set_space] to add the area to a space. If you want the area to be detectable use [method area_set_monitorable].
</description>
</method>
<method name="area_get_collision_layer" qualifiers="const">
<return type="int" />
<param index="0" name="area" type="RID" />
<description>
Returns the physics layer or layers an area belongs to.
</description>
</method>
<method name="area_get_collision_mask" qualifiers="const">
<return type="int" />
<param index="0" name="area" type="RID" />
<description>
Returns the physics layer or layers an area can contact with.
</description>
</method>
<method name="area_get_object_instance_id" qualifiers="const">
<return type="int" />
<param index="0" name="area" type="RID" />
<description>
Gets the instance ID of the object the area is assigned to.
</description>
</method>
<method name="area_get_param" qualifiers="const">
<return type="Variant" />
<param index="0" name="area" type="RID" />
<param index="1" name="param" type="int" enum="PhysicsServer3D.AreaParameter" />
<description>
Returns an area parameter value. A list of available parameters is on the [enum AreaParameter] constants.
</description>
</method>
<method name="area_get_shape" qualifiers="const">
<return type="RID" />
<param index="0" name="area" type="RID" />
<param index="1" name="shape_idx" type="int" />
<description>
Returns the [RID] of the nth shape of an area.
</description>
</method>
<method name="area_get_shape_count" qualifiers="const">
<return type="int" />
<param index="0" name="area" type="RID" />
<description>
Returns the number of shapes assigned to an area.
</description>
</method>
<method name="area_get_shape_transform" qualifiers="const">
<return type="Transform3D" />
<param index="0" name="area" type="RID" />
<param index="1" name="shape_idx" type="int" />
<description>
Returns the transform matrix of a shape within an area.
</description>
</method>
<method name="area_get_space" qualifiers="const">
<return type="RID" />
<param index="0" name="area" type="RID" />
<description>
Returns the space assigned to the area.
</description>
</method>
<method name="area_get_transform" qualifiers="const">
<return type="Transform3D" />
<param index="0" name="area" type="RID" />
<description>
Returns the transform matrix for an area.
</description>
</method>
<method name="area_remove_shape">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="shape_idx" type="int" />
<description>
Removes a shape from an area. It does not delete the shape, so it can be reassigned later.
</description>
</method>
<method name="area_set_area_monitor_callback">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="callback" type="Callable" />
<description>
Sets the area's area monitor callback. This callback will be called when any other (shape of an) area enters or exits (a shape of) the given area, and must take the following five parameters:
1. an integer [code]status[/code]: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other area's shape entered or exited the area,
2. an [RID] [code]area_rid[/code]: the [RID] of the other area that entered or exited the area,
3. an integer [code]instance_id[/code]: the [code]ObjectID[/code] attached to the other area,
4. an integer [code]area_shape_idx[/code]: the index of the shape of the other area that entered or exited the area,
5. an integer [code]self_shape_idx[/code]: the index of the shape of the area where the other area entered or exited.
By counting (or keeping track of) the shapes that enter and exit, it can be determined if an area (with all its shapes) is entering for the first time or exiting for the last time.
</description>
</method>
<method name="area_set_collision_layer">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="layer" type="int" />
<description>
Assigns the area to one or many physics layers.
</description>
</method>
<method name="area_set_collision_mask">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="mask" type="int" />
<description>
Sets which physics layers the area will monitor.
</description>
</method>
<method name="area_set_monitor_callback">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="callback" type="Callable" />
<description>
Sets the area's body monitor callback. This callback will be called when any other (shape of a) body enters or exits (a shape of) the given area, and must take the following five parameters:
1. an integer [code]status[/code]: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other body shape entered or exited the area,
2. an [RID] [code]body_rid[/code]: the [RID] of the body that entered or exited the area,
3. an integer [code]instance_id[/code]: the [code]ObjectID[/code] attached to the body,
4. an integer [code]body_shape_idx[/code]: the index of the shape of the body that entered or exited the area,
5. an integer [code]self_shape_idx[/code]: the index of the shape of the area where the body entered or exited.
By counting (or keeping track of) the shapes that enter and exit, it can be determined if a body (with all its shapes) is entering for the first time or exiting for the last time.
</description>
</method>
<method name="area_set_monitorable">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="monitorable" type="bool" />
<description>
</description>
</method>
<method name="area_set_param">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="param" type="int" enum="PhysicsServer3D.AreaParameter" />
<param index="2" name="value" type="Variant" />
<description>
Sets the value for an area parameter. A list of available parameters is on the [enum AreaParameter] constants.
</description>
</method>
<method name="area_set_ray_pickable">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="enable" type="bool" />
<description>
Sets object pickable with rays.
</description>
</method>
<method name="area_set_shape">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="shape_idx" type="int" />
<param index="2" name="shape" type="RID" />
<description>
Substitutes a given area shape by another. The old shape is selected by its index, the new one by its [RID].
</description>
</method>
<method name="area_set_shape_disabled">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="shape_idx" type="int" />
<param index="2" name="disabled" type="bool" />
<description>
</description>
</method>
<method name="area_set_shape_transform">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="shape_idx" type="int" />
<param index="2" name="transform" type="Transform3D" />
<description>
Sets the transform matrix for an area shape.
</description>
</method>
<method name="area_set_space">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="space" type="RID" />
<description>
Assigns a space to the area.
</description>
</method>
<method name="area_set_transform">
<return type="void" />
<param index="0" name="area" type="RID" />
<param index="1" name="transform" type="Transform3D" />
<description>
Sets the transform matrix for an area.
</description>
</method>
<method name="body_add_collision_exception">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="excepted_body" type="RID" />
<description>
Adds a body to the list of bodies exempt from collisions.
</description>
</method>
<method name="body_add_constant_central_force">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="force" type="Vector3" />
<description>
Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with [code]body_set_constant_force(body, Vector3(0, 0, 0))[/code].
This is equivalent to using [method body_add_constant_force] at the body's center of mass.
</description>
</method>
<method name="body_add_constant_force">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="force" type="Vector3" />
<param index="2" name="position" type="Vector3" default="Vector3(0, 0, 0)" />
<description>
Adds a constant positioned force to the body that keeps being applied over time until cleared with [code]body_set_constant_force(body, Vector3(0, 0, 0))[/code].
[param position] is the offset from the body origin in global coordinates.
</description>
</method>
<method name="body_add_constant_torque">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="torque" type="Vector3" />
<description>
Adds a constant rotational force without affecting position that keeps being applied over time until cleared with [code]body_set_constant_torque(body, Vector3(0, 0, 0))[/code].
</description>
</method>
<method name="body_add_shape">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="shape" type="RID" />
<param index="2" name="transform" type="Transform3D" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)" />
<param index="3" name="disabled" type="bool" default="false" />
<description>
Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index.
</description>
</method>
<method name="body_apply_central_force">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="force" type="Vector3" />
<description>
Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update.
This is equivalent to using [method body_apply_force] at the body's center of mass.
</description>
</method>
<method name="body_apply_central_impulse">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="impulse" type="Vector3" />
<description>
Applies a directional impulse without affecting rotation.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
This is equivalent to using [method body_apply_impulse] at the body's center of mass.
</description>
</method>
<method name="body_apply_force">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="force" type="Vector3" />
<param index="2" name="position" type="Vector3" default="Vector3(0, 0, 0)" />
<description>
Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update.
[param position] is the offset from the body origin in global coordinates.
</description>
</method>
<method name="body_apply_impulse">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="impulse" type="Vector3" />
<param index="2" name="position" type="Vector3" default="Vector3(0, 0, 0)" />
<description>
Applies a positioned impulse to the body.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
[param position] is the offset from the body origin in global coordinates.
</description>
</method>
<method name="body_apply_torque">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="torque" type="Vector3" />
<description>
Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update.
</description>
</method>
<method name="body_apply_torque_impulse">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="impulse" type="Vector3" />
<description>
Applies a rotational impulse to the body without affecting the position.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
</description>
</method>
<method name="body_attach_object_instance_id">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="id" type="int" />
<description>
Assigns the area to a descendant of [Object], so it can exist in the node tree.
</description>
</method>
<method name="body_clear_shapes">
<return type="void" />
<param index="0" name="body" type="RID" />
<description>
Removes all shapes from a body.
</description>
</method>
<method name="body_create">
<return type="RID" />
<description>
Creates a 3D body object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to [code]1[/code], and body mode set to [constant BODY_MODE_RIGID].
Use [method body_add_shape] to add shapes to it, use [method body_set_state] to set its transform, and use [method body_set_space] to add the body to a space.
</description>
</method>
<method name="body_get_collision_layer" qualifiers="const">
<return type="int" />
<param index="0" name="body" type="RID" />
<description>
Returns the physics layer or layers a body belongs to.
</description>
</method>
<method name="body_get_collision_mask" qualifiers="const">
<return type="int" />
<param index="0" name="body" type="RID" />
<description>
Returns the physics layer or layers a body can collide with.
</description>
</method>
<method name="body_get_collision_priority" qualifiers="const">
<return type="float" />
<param index="0" name="body" type="RID" />
<description>
Returns the body's collision priority.
</description>
</method>
<method name="body_get_constant_force" qualifiers="const">
<return type="Vector3" />
<param index="0" name="body" type="RID" />
<description>
Returns the body's total constant positional forces applied during each physics update.
See [method body_add_constant_force] and [method body_add_constant_central_force].
</description>
</method>
<method name="body_get_constant_torque" qualifiers="const">
<return type="Vector3" />
<param index="0" name="body" type="RID" />
<description>
Returns the body's total constant rotational forces applied during each physics update.
See [method body_add_constant_torque].
</description>
</method>
<method name="body_get_direct_state">
<return type="PhysicsDirectBodyState3D" />
<param index="0" name="body" type="RID" />
<description>
Returns the [PhysicsDirectBodyState3D] of the body. Returns [code]null[/code] if the body is destroyed or removed from the physics space.
</description>
</method>
<method name="body_get_max_contacts_reported" qualifiers="const">
<return type="int" />
<param index="0" name="body" type="RID" />
<description>
Returns the maximum contacts that can be reported. See [method body_set_max_contacts_reported].
</description>
</method>
<method name="body_get_mode" qualifiers="const">
<return type="int" enum="PhysicsServer3D.BodyMode" />
<param index="0" name="body" type="RID" />
<description>
Returns the body mode.
</description>
</method>
<method name="body_get_object_instance_id" qualifiers="const">
<return type="int" />
<param index="0" name="body" type="RID" />
<description>
Gets the instance ID of the object the area is assigned to.
</description>
</method>
<method name="body_get_param" qualifiers="const">
<return type="Variant" />
<param index="0" name="body" type="RID" />
<param index="1" name="param" type="int" enum="PhysicsServer3D.BodyParameter" />
<description>
Returns the value of a body parameter. A list of available parameters is on the [enum BodyParameter] constants.
</description>
</method>
<method name="body_get_shape" qualifiers="const">
<return type="RID" />
<param index="0" name="body" type="RID" />
<param index="1" name="shape_idx" type="int" />
<description>
Returns the [RID] of the nth shape of a body.
</description>
</method>
<method name="body_get_shape_count" qualifiers="const">
<return type="int" />
<param index="0" name="body" type="RID" />
<description>
Returns the number of shapes assigned to a body.
</description>
</method>
<method name="body_get_shape_transform" qualifiers="const">
<return type="Transform3D" />
<param index="0" name="body" type="RID" />
<param index="1" name="shape_idx" type="int" />
<description>
Returns the transform matrix of a body shape.
</description>
</method>
<method name="body_get_space" qualifiers="const">
<return type="RID" />
<param index="0" name="body" type="RID" />
<description>
Returns the [RID] of the space assigned to a body.
</description>
</method>
<method name="body_get_state" qualifiers="const">
<return type="Variant" />
<param index="0" name="body" type="RID" />
<param index="1" name="state" type="int" enum="PhysicsServer3D.BodyState" />
<description>
Returns a body state.
</description>
</method>
<method name="body_is_axis_locked" qualifiers="const">
<return type="bool" />
<param index="0" name="body" type="RID" />
<param index="1" name="axis" type="int" enum="PhysicsServer3D.BodyAxis" />
<description>
</description>
</method>
<method name="body_is_continuous_collision_detection_enabled" qualifiers="const">
<return type="bool" />
<param index="0" name="body" type="RID" />
<description>
If [code]true[/code], the continuous collision detection mode is enabled.
</description>
</method>
<method name="body_is_omitting_force_integration" qualifiers="const">
<return type="bool" />
<param index="0" name="body" type="RID" />
<description>
Returns [code]true[/code] if the body is omitting the standard force integration. See [method body_set_omit_force_integration].
</description>
</method>
<method name="body_remove_collision_exception">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="excepted_body" type="RID" />
<description>
Removes a body from the list of bodies exempt from collisions.
Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided.
</description>
</method>
<method name="body_remove_shape">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="shape_idx" type="int" />
<description>
Removes a shape from a body. The shape is not deleted, so it can be reused afterwards.
</description>
</method>
<method name="body_reset_mass_properties">
<return type="void" />
<param index="0" name="body" type="RID" />
<description>
Restores the default inertia and center of mass based on shapes to cancel any custom values previously set using [method body_set_param].
</description>
</method>
<method name="body_set_axis_lock">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="axis" type="int" enum="PhysicsServer3D.BodyAxis" />
<param index="2" name="lock" type="bool" />
<description>
</description>
</method>
<method name="body_set_axis_velocity">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="axis_velocity" type="Vector3" />
<description>
Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior.
</description>
</method>
<method name="body_set_collision_layer">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="layer" type="int" />
<description>
Sets the physics layer or layers a body belongs to.
</description>
</method>
<method name="body_set_collision_mask">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="mask" type="int" />
<description>
Sets the physics layer or layers a body can collide with.
</description>
</method>
<method name="body_set_collision_priority">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="priority" type="float" />
<description>
Sets the body's collision priority.
</description>
</method>
<method name="body_set_constant_force">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="force" type="Vector3" />
<description>
Sets the body's total constant positional forces applied during each physics update.
See [method body_add_constant_force] and [method body_add_constant_central_force].
</description>
</method>
<method name="body_set_constant_torque">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="torque" type="Vector3" />
<description>
Sets the body's total constant rotational forces applied during each physics update.
See [method body_add_constant_torque].
</description>
</method>
<method name="body_set_enable_continuous_collision_detection">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="enable" type="bool" />
<description>
If [code]true[/code], the continuous collision detection mode is enabled.
Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided.
</description>
</method>
<method name="body_set_force_integration_callback">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="callable" type="Callable" />
<param index="2" name="userdata" type="Variant" default="null" />
<description>
Sets the body's custom force integration callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()[/code]) to clear the custom callback.
The function [param callable] will be called every physics tick, before the standard force integration (see [method body_set_omit_force_integration]). It can be used for example to update the body's linear and angular velocity based on contact with other bodies.
If [param userdata] is not [code]null[/code], the function [param callable] must take the following two parameters:
1. [code]state[/code]: a [PhysicsDirectBodyState3D], used to retrieve and modify the body's state,
2. [code skip-lint]userdata[/code]: a [Variant]; its value will be the [param userdata] passed into this method.
If [param userdata] is [code]null[/code], then [param callable] must take only the [code]state[/code] parameter.
</description>
</method>
<method name="body_set_max_contacts_reported">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="amount" type="int" />
<description>
Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies. This is enabled by setting the maximum number of contacts reported to a number greater than 0.
</description>
</method>
<method name="body_set_mode">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="mode" type="int" enum="PhysicsServer3D.BodyMode" />
<description>
Sets the body mode, from one of the [enum BodyMode] constants.
</description>
</method>
<method name="body_set_omit_force_integration">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="enable" type="bool" />
<description>
Sets whether the body omits the standard force integration. If [param enable] is [code]true[/code], the body will not automatically use applied forces, torques, and damping to update the body's linear and angular velocity. In this case, [method body_set_force_integration_callback] can be used to manually update the linear and angular velocity instead.
This method is called when the property [member RigidBody3D.custom_integrator] is set.
</description>
</method>
<method name="body_set_param">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="param" type="int" enum="PhysicsServer3D.BodyParameter" />
<param index="2" name="value" type="Variant" />
<description>
Sets a body parameter. A list of available parameters is on the [enum BodyParameter] constants.
</description>
</method>
<method name="body_set_ray_pickable">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="enable" type="bool" />
<description>
Sets the body pickable with rays if [param enable] is set.
</description>
</method>
<method name="body_set_shape">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="shape_idx" type="int" />
<param index="2" name="shape" type="RID" />
<description>
Substitutes a given body shape by another. The old shape is selected by its index, the new one by its [RID].
</description>
</method>
<method name="body_set_shape_disabled">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="shape_idx" type="int" />
<param index="2" name="disabled" type="bool" />
<description>
</description>
</method>
<method name="body_set_shape_transform">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="shape_idx" type="int" />
<param index="2" name="transform" type="Transform3D" />
<description>
Sets the transform matrix for a body shape.
</description>
</method>
<method name="body_set_space">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="space" type="RID" />
<description>
Assigns a space to the body (see [method space_create]).
</description>
</method>
<method name="body_set_state">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="state" type="int" enum="PhysicsServer3D.BodyState" />
<param index="2" name="value" type="Variant" />
<description>
Sets a body state (see [enum BodyState] constants).
</description>
</method>
<method name="body_set_state_sync_callback">
<return type="void" />
<param index="0" name="body" type="RID" />
<param index="1" name="callable" type="Callable" />
<description>
Sets the body's state synchronization callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()[/code]) to clear the callback.
The function [param callable] will be called every physics frame, assuming that the body was active during the previous physics tick, and can be used to fetch the latest state from the physics server.
The function [param callable] must take the following parameters:
1. [code]state[/code]: a [PhysicsDirectBodyState3D], used to retrieve the body's state.
</description>
</method>
<method name="body_test_motion">
<return type="bool" />
<param index="0" name="body" type="RID" />
<param index="1" name="parameters" type="PhysicsTestMotionParameters3D" />
<param index="2" name="result" type="PhysicsTestMotionResult3D" default="null" />
<description>
Returns [code]true[/code] if a collision would result from moving along a motion vector from a given point in space. [PhysicsTestMotionParameters3D] is passed to set motion parameters. [PhysicsTestMotionResult3D] can be passed to return additional information.
</description>
</method>
<method name="box_shape_create">
<return type="RID" />
<description>
</description>
</method>
<method name="capsule_shape_create">
<return type="RID" />
<description>
</description>
</method>
<method name="concave_polygon_shape_create">
<return type="RID" />
<description>
</description>
</method>
<method name="cone_twist_joint_get_param" qualifiers="const">
<return type="float" />
<param index="0" name="joint" type="RID" />
<param index="1" name="param" type="int" enum="PhysicsServer3D.ConeTwistJointParam" />
<description>
Gets a cone_twist_joint parameter (see [enum ConeTwistJointParam] constants).
</description>
</method>
<method name="cone_twist_joint_set_param">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="param" type="int" enum="PhysicsServer3D.ConeTwistJointParam" />
<param index="2" name="value" type="float" />
<description>
Sets a cone_twist_joint parameter (see [enum ConeTwistJointParam] constants).
</description>
</method>
<method name="convex_polygon_shape_create">
<return type="RID" />
<description>
</description>
</method>
<method name="custom_shape_create">
<return type="RID" />
<description>
</description>
</method>
<method name="cylinder_shape_create">
<return type="RID" />
<description>
</description>
</method>
<method name="free_rid">
<return type="void" />
<param index="0" name="rid" type="RID" />
<description>
Destroys any of the objects created by PhysicsServer3D. If the [RID] passed is not one of the objects that can be created by PhysicsServer3D, an error will be sent to the console.
</description>
</method>
<method name="generic_6dof_joint_get_flag" qualifiers="const">
<return type="bool" />
<param index="0" name="joint" type="RID" />
<param index="1" name="axis" type="int" enum="Vector3.Axis" />
<param index="2" name="flag" type="int" enum="PhysicsServer3D.G6DOFJointAxisFlag" />
<description>
Returns the value of a generic 6DOF joint flag. See [enum G6DOFJointAxisFlag] for the list of available flags.
</description>
</method>
<method name="generic_6dof_joint_get_param" qualifiers="const">
<return type="float" />
<param index="0" name="joint" type="RID" />
<param index="1" name="axis" type="int" enum="Vector3.Axis" />
<param index="2" name="param" type="int" enum="PhysicsServer3D.G6DOFJointAxisParam" />
<description>
Returns the value of a generic 6DOF joint parameter. See [enum G6DOFJointAxisParam] for the list of available parameters.
</description>
</method>
<method name="generic_6dof_joint_set_flag">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="axis" type="int" enum="Vector3.Axis" />
<param index="2" name="flag" type="int" enum="PhysicsServer3D.G6DOFJointAxisFlag" />
<param index="3" name="enable" type="bool" />
<description>
Sets the value of a given generic 6DOF joint flag. See [enum G6DOFJointAxisFlag] for the list of available flags.
</description>
</method>
<method name="generic_6dof_joint_set_param">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="axis" type="int" enum="Vector3.Axis" />
<param index="2" name="param" type="int" enum="PhysicsServer3D.G6DOFJointAxisParam" />
<param index="3" name="value" type="float" />
<description>
Sets the value of a given generic 6DOF joint parameter. See [enum G6DOFJointAxisParam] for the list of available parameters.
</description>
</method>
<method name="get_process_info">
<return type="int" />
<param index="0" name="process_info" type="int" enum="PhysicsServer3D.ProcessInfo" />
<description>
Returns information about the current state of the 3D physics engine. See [enum ProcessInfo] for a list of available states.
</description>
</method>
<method name="heightmap_shape_create">
<return type="RID" />
<description>
</description>
</method>
<method name="hinge_joint_get_flag" qualifiers="const">
<return type="bool" />
<param index="0" name="joint" type="RID" />
<param index="1" name="flag" type="int" enum="PhysicsServer3D.HingeJointFlag" />
<description>
Gets a hinge_joint flag (see [enum HingeJointFlag] constants).
</description>
</method>
<method name="hinge_joint_get_param" qualifiers="const">
<return type="float" />
<param index="0" name="joint" type="RID" />
<param index="1" name="param" type="int" enum="PhysicsServer3D.HingeJointParam" />
<description>
Gets a hinge_joint parameter (see [enum HingeJointParam]).
</description>
</method>
<method name="hinge_joint_set_flag">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="flag" type="int" enum="PhysicsServer3D.HingeJointFlag" />
<param index="2" name="enabled" type="bool" />
<description>
Sets a hinge_joint flag (see [enum HingeJointFlag] constants).
</description>
</method>
<method name="hinge_joint_set_param">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="param" type="int" enum="PhysicsServer3D.HingeJointParam" />
<param index="2" name="value" type="float" />
<description>
Sets a hinge_joint parameter (see [enum HingeJointParam] constants).
</description>
</method>
<method name="joint_clear">
<return type="void" />
<param index="0" name="joint" type="RID" />
<description>
</description>
</method>
<method name="joint_create">
<return type="RID" />
<description>
</description>
</method>
<method name="joint_disable_collisions_between_bodies">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="disable" type="bool" />
<description>
Sets whether the bodies attached to the [Joint3D] will collide with each other.
</description>
</method>
<method name="joint_get_solver_priority" qualifiers="const">
<return type="int" />
<param index="0" name="joint" type="RID" />
<description>
Gets the priority value of the Joint3D.
</description>
</method>
<method name="joint_get_type" qualifiers="const">
<return type="int" enum="PhysicsServer3D.JointType" />
<param index="0" name="joint" type="RID" />
<description>
Returns the type of the Joint3D.
</description>
</method>
<method name="joint_is_disabled_collisions_between_bodies" qualifiers="const">
<return type="bool" />
<param index="0" name="joint" type="RID" />
<description>
Returns whether the bodies attached to the [Joint3D] will collide with each other.
</description>
</method>
<method name="joint_make_cone_twist">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="body_A" type="RID" />
<param index="2" name="local_ref_A" type="Transform3D" />
<param index="3" name="body_B" type="RID" />
<param index="4" name="local_ref_B" type="Transform3D" />
<description>
</description>
</method>
<method name="joint_make_generic_6dof">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="body_A" type="RID" />
<param index="2" name="local_ref_A" type="Transform3D" />
<param index="3" name="body_B" type="RID" />
<param index="4" name="local_ref_B" type="Transform3D" />
<description>
Make the joint a generic six degrees of freedom (6DOF) joint. Use [method generic_6dof_joint_set_flag] and [method generic_6dof_joint_set_param] to set the joint's flags and parameters respectively.
</description>
</method>
<method name="joint_make_hinge">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="body_A" type="RID" />
<param index="2" name="hinge_A" type="Transform3D" />
<param index="3" name="body_B" type="RID" />
<param index="4" name="hinge_B" type="Transform3D" />
<description>
</description>
</method>
<method name="joint_make_pin">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="body_A" type="RID" />
<param index="2" name="local_A" type="Vector3" />
<param index="3" name="body_B" type="RID" />
<param index="4" name="local_B" type="Vector3" />
<description>
</description>
</method>
<method name="joint_make_slider">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="body_A" type="RID" />
<param index="2" name="local_ref_A" type="Transform3D" />
<param index="3" name="body_B" type="RID" />
<param index="4" name="local_ref_B" type="Transform3D" />
<description>
</description>
</method>
<method name="joint_set_solver_priority">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="priority" type="int" />
<description>
Sets the priority value of the Joint3D.
</description>
</method>
<method name="pin_joint_get_local_a" qualifiers="const">
<return type="Vector3" />
<param index="0" name="joint" type="RID" />
<description>
Returns position of the joint in the local space of body a of the joint.
</description>
</method>
<method name="pin_joint_get_local_b" qualifiers="const">
<return type="Vector3" />
<param index="0" name="joint" type="RID" />
<description>
Returns position of the joint in the local space of body b of the joint.
</description>
</method>
<method name="pin_joint_get_param" qualifiers="const">
<return type="float" />
<param index="0" name="joint" type="RID" />
<param index="1" name="param" type="int" enum="PhysicsServer3D.PinJointParam" />
<description>
Gets a pin_joint parameter (see [enum PinJointParam] constants).
</description>
</method>
<method name="pin_joint_set_local_a">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="local_A" type="Vector3" />
<description>
Sets position of the joint in the local space of body a of the joint.
</description>
</method>
<method name="pin_joint_set_local_b">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="local_B" type="Vector3" />
<description>
Sets position of the joint in the local space of body b of the joint.
</description>
</method>
<method name="pin_joint_set_param">
<return type="void" />
<param index="0" name="joint" type="RID" />
<param index="1" name="param" type="int" enum="PhysicsServer3D.PinJointParam" />
<param index="2" name="value" type="float" />
<description>
Sets a pin_joint parameter (see [enum PinJointParam] constants).
</description>
</method>
<method name="separation_ray_shape_create">
<return type="RID" />
<description>
</description>
</method>
<method name="set_active">
<return type="void" />
<param index="0" name="active" type="bool" />
<description>
Activates or deactivates the 3D physics engine.
</description>
</method>
<method name="shape_get_data" qualifiers="const">
<return type="Variant" />
<param index="0" name="shape" type="RID" />
<description>