-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathPhysics.lua
1445 lines (1444 loc) · 61.6 KB
/
Physics.lua
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
local path = (...):match('(.-)[^%./]+$')
return {
name = 'physics',
description = 'Can simulate 2D rigid body physics in a realistic manner. This module is based on Box2D, and this API corresponds to the Box2D API as closely as possible.',
types = {
require(path .. 'types.Body'),
require(path .. 'types.ChainShape'),
require(path .. 'types.CircleShape'),
require(path .. 'types.Contact'),
require(path .. 'types.DistanceJoint'),
require(path .. 'types.EdgeShape'),
require(path .. 'types.Fixture'),
require(path .. 'types.FrictionJoint'),
require(path .. 'types.GearJoint'),
require(path .. 'types.Joint'),
require(path .. 'types.MotorJoint'),
require(path .. 'types.MouseJoint'),
require(path .. 'types.PolygonShape'),
require(path .. 'types.PrismaticJoint'),
require(path .. 'types.PulleyJoint'),
require(path .. 'types.RevoluteJoint'),
require(path .. 'types.RopeJoint'),
require(path .. 'types.Shape'),
require(path .. 'types.WeldJoint'),
require(path .. 'types.WheelJoint'),
require(path .. 'types.World'),
},
functions = {
{
name = 'getDistance',
description = 'Returns the two closest points between two fixtures and their distance.',
variants = {
{
arguments = {
{
type = 'Fixture',
name = 'fixture1',
description = 'The first fixture.',
},
{
type = 'Fixture',
name = 'fixture2',
description = 'The second fixture.',
},
},
returns = {
{
type = 'number',
name = 'distance',
description = 'The distance of the two points.',
},
{
type = 'number',
name = 'x1',
description = 'The x-coordinate of the first point.',
},
{
type = 'number',
name = 'y1',
description = 'The y-coordinate of the first point.',
},
{
type = 'number',
name = 'x2',
description = 'The x-coordinate of the second point.',
},
{
type = 'number',
name = 'y2',
description = 'The y-coordinate of the second point.',
},
},
},
},
},
{
name = 'getMeter',
description = 'Returns the meter scale factor.\n\nAll coordinates in the physics module are divided by this number, creating a convenient way to draw the objects directly to the screen without the need for graphics transformations.\n\nIt is recommended to create shapes no larger than 10 times the scale. This is important because Box2D is tuned to work well with shape sizes from 0.1 to 10 meters.',
variants = {
{
returns = {
{
type = 'number',
name = 'scale',
description = 'The scale factor as an integer.',
},
},
},
},
},
{
name = 'newBody',
description = 'Creates a new body.\n\nThere are three types of bodies. \n\n* Static bodies do not move, have a infinite mass, and can be used for level boundaries. \n\n* Dynamic bodies are the main actors in the simulation, they collide with everything. \n\n* Kinematic bodies do not react to forces and only collide with dynamic bodies.\n\nThe mass of the body gets calculated when a Fixture is attached or removed, but can be changed at any time with Body:setMass or Body:resetMassData.',
variants = {
{
arguments = {
{
type = 'World',
name = 'world',
description = 'The world to create the body in.',
},
{
type = 'number',
name = 'x',
description = 'The x position of the body.',
default = '0',
},
{
type = 'number',
name = 'y',
description = 'The y position of the body.',
default = '0',
},
{
type = 'BodyType',
name = 'type',
description = 'The type of the body.',
default = '\'static\'',
},
},
returns = {
{
type = 'Body',
name = 'body',
description = 'A new body.',
},
},
},
},
},
{
name = 'newChainShape',
description = 'Creates a new ChainShape.',
variants = {
{
arguments = {
{
type = 'boolean',
name = 'loop',
description = 'If the chain should loop back to the first point.',
},
{
type = 'number',
name = 'x1',
description = 'The x position of the first point.',
},
{
type = 'number',
name = 'y1',
description = 'The y position of the first point.',
},
{
type = 'number',
name = 'x2',
description = 'The x position of the second point.',
},
{
type = 'number',
name = 'y2',
description = 'The y position of the second point.',
},
{
type = 'number',
name = '...',
description = 'Additional point positions.',
},
},
returns = {
{
type = 'ChainShape',
name = 'shape',
description = 'The new shape.',
},
},
},
{
arguments = {
{
type = 'boolean',
name = 'loop',
description = 'If the chain should loop back to the first point.',
},
{
type = 'table',
name = 'points',
description = 'A list of points to construct the ChainShape, in the form of {x1, y1, x2, y2, ...}.',
},
},
returns = {
{
type = 'ChainShape',
name = 'shape',
description = 'The new shape.',
},
},
},
},
},
{
name = 'newCircleShape',
description = 'Creates a new CircleShape.',
variants = {
{
arguments = {
{
type = 'number',
name = 'radius',
description = 'The radius of the circle.',
},
},
returns = {
{
type = 'CircleShape',
name = 'shape',
description = 'The new shape.',
},
},
},
{
arguments = {
{
type = 'number',
name = 'x',
description = 'The x position of the circle.',
},
{
type = 'number',
name = 'y',
description = 'The y position of the circle.',
},
{
type = 'number',
name = 'radius',
description = 'The radius of the circle.',
},
},
returns = {
{
type = 'CircleShape',
name = 'shape',
description = 'The new shape.',
},
},
},
},
},
{
name = 'newDistanceJoint',
description = 'Creates a DistanceJoint between two bodies.\n\nThis joint constrains the distance between two points on two bodies to be constant. These two points are specified in world coordinates and the two bodies are assumed to be in place when this joint is created. The first anchor point is connected to the first body and the second to the second body, and the points define the length of the distance joint.',
variants = {
{
arguments = {
{
type = 'Body',
name = 'body1',
description = 'The first body to attach to the joint.',
},
{
type = 'Body',
name = 'body2',
description = 'The second body to attach to the joint.',
},
{
type = 'number',
name = 'x1',
description = 'The x position of the first anchor point (world space).',
},
{
type = 'number',
name = 'y1',
description = 'The y position of the first anchor point (world space).',
},
{
type = 'number',
name = 'x2',
description = 'The x position of the second anchor point (world space).',
},
{
type = 'number',
name = 'y2',
description = 'The y position of the second anchor point (world space).',
},
{
type = 'boolean',
name = 'collideConnected',
description = 'Specifies whether the two bodies should collide with each other.',
default = 'false',
},
},
returns = {
{
type = 'DistanceJoint',
name = 'joint',
description = 'The new distance joint.',
},
},
},
},
},
{
name = 'newEdgeShape',
description = 'Creates a new EdgeShape.',
variants = {
{
arguments = {
{
type = 'number',
name = 'x1',
description = 'The x position of the first point.',
},
{
type = 'number',
name = 'y1',
description = 'The y position of the first point.',
},
{
type = 'number',
name = 'x2',
description = 'The x position of the second point.',
},
{
type = 'number',
name = 'y2',
description = 'The y position of the second point.',
},
},
returns = {
{
type = 'EdgeShape',
name = 'shape',
description = 'The new shape.',
},
},
},
},
},
{
name = 'newFixture',
description = 'Creates and attaches a Fixture to a body.\n\nNote that the Shape object is copied rather than kept as a reference when the Fixture is created. To get the Shape object that the Fixture owns, use Fixture:getShape.',
variants = {
{
arguments = {
{
type = 'Body',
name = 'body',
description = 'The body which gets the fixture attached.',
},
{
type = 'Shape',
name = 'shape',
description = 'The shape to be copied to the fixture.',
},
{
type = 'number',
name = 'density',
description = 'The density of the fixture.',
default = '1',
},
},
returns = {
{
type = 'Fixture',
name = 'fixture',
description = 'The new fixture.',
},
},
},
},
},
{
name = 'newFrictionJoint',
description = 'Create a friction joint between two bodies. A FrictionJoint applies friction to a body.',
variants = {
{
arguments = {
{
type = 'Body',
name = 'body1',
description = 'The first body to attach to the joint.',
},
{
type = 'Body',
name = 'body2',
description = 'The second body to attach to the joint.',
},
{
type = 'number',
name = 'x',
description = 'The x position of the anchor point.',
},
{
type = 'number',
name = 'y',
description = 'The y position of the anchor point.',
},
{
type = 'boolean',
name = 'collideConnected',
description = 'Specifies whether the two bodies should collide with each other.',
default = 'false',
},
},
returns = {
{
type = 'FrictionJoint',
name = 'joint',
description = 'The new FrictionJoint.',
},
},
},
{
arguments = {
{
type = 'Body',
name = 'body1',
description = 'The first body to attach to the joint.',
},
{
type = 'Body',
name = 'body2',
description = 'The second body to attach to the joint.',
},
{
type = 'number',
name = 'x1',
description = 'The x position of the first anchor point.',
},
{
type = 'number',
name = 'y1',
description = 'The y position of the first anchor point.',
},
{
type = 'number',
name = 'x2',
description = 'The x position of the second anchor point.',
},
{
type = 'number',
name = 'y2',
description = 'The y position of the second anchor point.',
},
{
type = 'boolean',
name = 'collideConnected',
description = 'Specifies whether the two bodies should collide with each other.',
default = 'false',
},
},
returns = {
{
type = 'FrictionJoint',
name = 'joint',
description = 'The new FrictionJoint.',
},
},
},
},
},
{
name = 'newGearJoint',
description = 'Create a GearJoint connecting two Joints.\n\nThe gear joint connects two joints that must be either prismatic or revolute joints. Using this joint requires that the joints it uses connect their respective bodies to the ground and have the ground as the first body. When destroying the bodies and joints you must make sure you destroy the gear joint before the other joints.\n\nThe gear joint has a ratio the determines how the angular or distance values of the connected joints relate to each other. The formula coordinate1 + ratio * coordinate2 always has a constant value that is set when the gear joint is created.',
variants = {
{
arguments = {
{
type = 'Joint',
name = 'joint1',
description = 'The first joint to connect with a gear joint.',
},
{
type = 'Joint',
name = 'joint2',
description = 'The second joint to connect with a gear joint.',
},
{
type = 'number',
name = 'ratio',
description = 'The gear ratio.',
default = '1',
},
{
type = 'boolean',
name = 'collideConnected',
description = 'Specifies whether the two bodies should collide with each other.',
default = 'false',
},
},
returns = {
{
type = 'GearJoint',
name = 'joint',
description = 'The new gear joint.',
},
},
},
},
},
{
name = 'newMotorJoint',
description = 'Creates a joint between two bodies which controls the relative motion between them.\n\nPosition and rotation offsets can be specified once the MotorJoint has been created, as well as the maximum motor force and torque that will be be applied to reach the target offsets.',
variants = {
{
arguments = {
{
type = 'Body',
name = 'body1',
description = 'The first body to attach to the joint.',
},
{
type = 'Body',
name = 'body2',
description = 'The second body to attach to the joint.',
},
{
type = 'number',
name = 'correctionFactor',
description = 'The joint\'s initial position correction factor, in the range of 1.',
default = '0.3',
},
},
returns = {
{
type = 'MotorJoint',
name = 'joint',
description = 'The new MotorJoint.',
},
},
},
{
arguments = {
{
type = 'Body',
name = 'body1',
description = 'The first body to attach to the joint.',
},
{
type = 'Body',
name = 'body2',
description = 'The second body to attach to the joint.',
},
{
type = 'number',
name = 'correctionFactor',
description = 'The joint\'s initial position correction factor, in the range of 1.',
default = '0.3',
},
{
type = 'boolean',
name = 'collideConnected',
description = 'Specifies whether the two bodies should collide with each other.',
default = 'false',
},
},
returns = {
{
type = 'MotorJoint',
name = 'joint',
description = 'The new MotorJoint.',
},
},
},
},
},
{
name = 'newMouseJoint',
description = 'Create a joint between a body and the mouse.\n\nThis joint actually connects the body to a fixed point in the world. To make it follow the mouse, the fixed point must be updated every timestep (example below).\n\nThe advantage of using a MouseJoint instead of just changing a body position directly is that collisions and reactions to other joints are handled by the physics engine. ',
variants = {
{
arguments = {
{
type = 'Body',
name = 'body',
description = 'The body to attach to the mouse.',
},
{
type = 'number',
name = 'x',
description = 'The x position of the connecting point.',
},
{
type = 'number',
name = 'y',
description = 'The y position of the connecting point.',
},
},
returns = {
{
type = 'MouseJoint',
name = 'joint',
description = 'The new mouse joint.',
},
},
},
},
},
{
name = 'newPolygonShape',
description = 'Creates a new PolygonShape.\n\nThis shape can have 8 vertices at most, and must form a convex shape.',
variants = {
{
arguments = {
{
type = 'number',
name = 'x1',
description = 'The x position of the first point.',
},
{
type = 'number',
name = 'y1',
description = 'The y position of the first point.',
},
{
type = 'number',
name = 'x2',
description = 'The x position of the second point.',
},
{
type = 'number',
name = 'y2',
description = 'The y position of the second point.',
},
{
type = 'number',
name = 'x3',
description = 'The x position of the third point.',
},
{
type = 'number',
name = 'y3',
description = 'The y position of the third point.',
},
{
type = 'number',
name = '...',
description = 'You can continue passing more point positions to create the PolygonShape.',
},
},
returns = {
{
type = 'PolygonShape',
name = 'shape',
description = 'A new PolygonShape.',
},
},
},
{
arguments = {
{
type = 'table',
name = 'vertices',
description = 'A list of vertices to construct the polygon, in the form of {x1, y1, x2, y2, x3, y3, ...}.',
},
},
returns = {
{
type = 'PolygonShape',
name = 'shape',
description = 'A new PolygonShape.',
},
},
},
},
},
{
name = 'newPrismaticJoint',
description = 'Creates a PrismaticJoint between two bodies.\n\nA prismatic joint constrains two bodies to move relatively to each other on a specified axis. It does not allow for relative rotation. Its definition and operation are similar to a revolute joint, but with translation and force substituted for angle and torque.',
variants = {
{
arguments = {
{
type = 'Body',
name = 'body1',
description = 'The first body to connect with a prismatic joint.',
},
{
type = 'Body',
name = 'body2',
description = 'The second body to connect with a prismatic joint.',
},
{
type = 'number',
name = 'x',
description = 'The x coordinate of the anchor point.',
},
{
type = 'number',
name = 'y',
description = 'The y coordinate of the anchor point.',
},
{
type = 'number',
name = 'ax',
description = 'The x coordinate of the axis vector.',
},
{
type = 'number',
name = 'ay',
description = 'The y coordinate of the axis vector.',
},
{
type = 'boolean',
name = 'collideConnected',
description = 'Specifies whether the two bodies should collide with each other.',
default = 'false',
},
},
returns = {
{
type = 'PrismaticJoint',
name = 'joint',
description = 'The new prismatic joint.',
},
},
},
{
arguments = {
{
type = 'Body',
name = 'body1',
description = 'The first body to connect with a prismatic joint.',
},
{
type = 'Body',
name = 'body2',
description = 'The second body to connect with a prismatic joint.',
},
{
type = 'number',
name = 'x1',
description = 'The x coordinate of the first anchor point.',
},
{
type = 'number',
name = 'y1',
description = 'The y coordinate of the first anchor point.',
},
{
type = 'number',
name = 'x2',
description = 'The x coordinate of the second anchor point.',
},
{
type = 'number',
name = 'y2',
description = 'The y coordinate of the second anchor point.',
},
{
type = 'number',
name = 'ax',
description = 'The x coordinate of the axis unit vector.',
},
{
type = 'number',
name = 'ay',
description = 'The y coordinate of the axis unit vector.',
},
{
type = 'boolean',
name = 'collideConnected',
description = 'Specifies whether the two bodies should collide with each other.',
default = 'false',
},
},
returns = {
{
type = 'PrismaticJoint',
name = 'joint',
description = 'The new prismatic joint.',
},
},
},
{
arguments = {
{
type = 'Body',
name = 'body1',
description = 'The first body to connect with a prismatic joint.',
},
{
type = 'Body',
name = 'body2',
description = 'The second body to connect with a prismatic joint.',
},
{
type = 'number',
name = 'x1',
description = 'The x coordinate of the first anchor point.',
},
{
type = 'number',
name = 'y1',
description = 'The y coordinate of the first anchor point.',
},
{
type = 'number',
name = 'x2',
description = 'The x coordinate of the second anchor point.',
},
{
type = 'number',
name = 'y2',
description = 'The y coordinate of the second anchor point.',
},
{
type = 'number',
name = 'ax',
description = 'The x coordinate of the axis unit vector.',
},
{
type = 'number',
name = 'ay',
description = 'The y coordinate of the axis unit vector.',
},
{
type = 'boolean',
name = 'collideConnected',
description = 'Specifies whether the two bodies should collide with each other.',
default = 'false',
},
{
type = 'number',
name = 'referenceAngle',
description = 'The reference angle between body1 and body2, in radians.',
default = '0',
},
},
returns = {
{
type = 'PrismaticJoint',
name = 'joint',
description = 'The new prismatic joint.',
},
},
},
},
},
{
name = 'newPulleyJoint',
description = 'Creates a PulleyJoint to join two bodies to each other and the ground.\n\nThe pulley joint simulates a pulley with an optional block and tackle. If the ratio parameter has a value different from one, then the simulated rope extends faster on one side than the other. In a pulley joint the total length of the simulated rope is the constant length1 + ratio * length2, which is set when the pulley joint is created.\n\nPulley joints can behave unpredictably if one side is fully extended. It is recommended that the method setMaxLengths be used to constrain the maximum lengths each side can attain.',
variants = {
{
arguments = {
{
type = 'Body',
name = 'body1',
description = 'The first body to connect with a pulley joint.',
},
{
type = 'Body',
name = 'body2',
description = 'The second body to connect with a pulley joint.',
},
{
type = 'number',
name = 'gx1',
description = 'The x coordinate of the first body\'s ground anchor.',
},
{
type = 'number',
name = 'gy1',
description = 'The y coordinate of the first body\'s ground anchor.',
},
{
type = 'number',
name = 'gx2',
description = 'The x coordinate of the second body\'s ground anchor.',
},
{
type = 'number',
name = 'gy2',
description = 'The y coordinate of the second body\'s ground anchor.',
},
{
type = 'number',
name = 'x1',
description = 'The x coordinate of the pulley joint anchor in the first body.',
},
{
type = 'number',
name = 'y1',
description = 'The y coordinate of the pulley joint anchor in the first body.',
},
{
type = 'number',
name = 'x2',
description = 'The x coordinate of the pulley joint anchor in the second body.',
},
{
type = 'number',
name = 'y2',
description = 'The y coordinate of the pulley joint anchor in the second body.',
},
{
type = 'number',
name = 'ratio',
description = 'The joint ratio.',
default = '1',
},
{
type = 'boolean',
name = 'collideConnected',
description = 'Specifies whether the two bodies should collide with each other.',
default = 'true',
},
},
returns = {
{
type = 'PulleyJoint',
name = 'joint',
description = 'The new pulley joint.',
},
},
},
},
},
{
name = 'newRectangleShape',
description = 'Shorthand for creating rectangular PolygonShapes. \n\nBy default, the local origin is located at the \'\'\'center\'\'\' of the rectangle as opposed to the top left for graphics.',
variants = {
{
arguments = {
{
type = 'number',
name = 'width',
description = 'The width of the rectangle.',
},
{
type = 'number',
name = 'height',
description = 'The height of the rectangle.',
},
},
returns = {
{
type = 'PolygonShape',
name = 'shape',
description = 'A new PolygonShape.',
},
},
},
{
arguments = {
{
type = 'number',
name = 'x',
description = 'The offset along the x-axis.',
},
{
type = 'number',
name = 'y',
description = 'The offset along the y-axis.',
},
{
type = 'number',
name = 'width',
description = 'The width of the rectangle.',
},
{
type = 'number',
name = 'height',
description = 'The height of the rectangle.',
},
{
type = 'number',
name = 'angle',
description = 'The initial angle of the rectangle.',
default = '0',
},
},
returns = {
{
type = 'PolygonShape',
name = 'shape',
description = 'A new PolygonShape.',
},
},
},
},
},
{
name = 'newRevoluteJoint',
description = 'Creates a pivot joint between two bodies.\n\nThis joint connects two bodies to a point around which they can pivot.',
variants = {
{
arguments = {
{
type = 'Body',
name = 'body1',
description = 'The first body.',
},
{
type = 'Body',
name = 'body2',
description = 'The second body.',
},
{
type = 'number',
name = 'x',