-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsm.lua
More file actions
9861 lines (8265 loc) · 374 KB
/
sm.lua
File metadata and controls
9861 lines (8265 loc) · 374 KB
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
---@diagnostic disable
---@alias type
---| "nil"
---| "number"
---| "string"
---| "boolean"
---| "table"
---| "function"
---| "thread"
---| "userdata"
---| "Shape"
---| "Body"
---| "Character"
---| "Joint"
---| "Harvestable"
---| "AreaTrigger"
---| "Vec3"
---| "Quat"
---| "Container"
---| "RaycastResult"
---| "Interactable"
---| "Network"
---| "Player"
---| "World"
---| "GuiInterface"
---| "Tool"
---| "Portal"
---| "BlueprintVisualization"
---| "PathNode"
---| "AiState"
---| "Unit"
---| "Storage"
---| "Effect"
---| "CullSphereGroup"
---| "BuilderGuide"
---| "Lift"
---| "ScriptableObject"
---| "Uuid"
---@class Vec3
---@operator mul(number): Vec3
---@operator mul(Quat): Vec3
---@operator add(Vec3): Vec3
---@operator sub(Vec3): Vec3
---@operator mul(Vec3): Vec3
---@operator div(number): Vec3
---@operator unm: Vec3
---A userdata object representing a 3D <strong>vector</strong>.
local Vec3 = {}
---**Get**:
---Returns the X value of a vector.
---**Set**:
---Sets the X value of a vector.
---@type number
Vec3.x = {}
---**Get**:
---Returns the Y value of a vector.
---**Set**:
---Sets the Y value of a vector.
---@type number
Vec3.y = {}
---**Get**:
---Returns the Z value of a vector.
---**Set**:
---Sets the Z value of a vector.
---@type number
Vec3.z = {}
---Returns the <a target="_blank" href="https://en.wikipedia.org/wiki/Cross_product">cross product</a> of two vectors.
---@param v2 Vec3 The second vector.
---@return Vec3
function Vec3:cross(v2) end
---Returns the <a target="_blank" href="https://en.wikipedia.org/wiki/Dot_product">dot product</a> of a vector.
---@param v2 Vec3 The second vector.
---@return number
function Vec3:dot(v2) end
---Returns the length of the vector.
---If you want the squared length, using [Vec3.length2, length2] is faster than squaring the result of this function.
---@return number
function Vec3:length() end
---Returns the squared length of the vector.
---@return number
function Vec3:length2() end
---Returns the maximum value between two vectors components.
---@param v2 Vec3 The second vector.
---@return Vec3
function Vec3:max(v2) end
---Returns the minimum value between two vectors components.
---@param v2 Vec3 The second vector.
---@return Vec3
function Vec3:min(v2) end
---Normalizes a vector, ie. converts to a unit vector of length 1.
---@return Vec3
function Vec3:normalize() end
---Rotate a vector around an axis.
---@param angle number The angle.
---@param normal Vec3 The axis to be rotated around.
---@return Vec3
function Vec3:rotate(angle, normal) end
---Rotate a vector around the X axis.
---@param angle number The angle.
---@return Vec3
function Vec3:rotateX(angle) end
---Rotate a vector around the Y axis.
---@param angle number The angle.
---@return Vec3
function Vec3:rotateY(angle) end
---Rotate a vector around the Z axis.
---@param angle number The angle.
---@return Vec3
function Vec3:rotateZ(angle) end
---Normalizes a vector with safety, ie. converts to a unit vector of length 1.
---@param fallback Vec3 The fallback vector
---@return Vec3
function Vec3:safeNormalize(fallback) end
---@class Quat
---@operator mul(Quat): Quat
---@operator mul(Vec3): Vec3
---A userdata object representing a <strong>quaternion</strong>.
local Quat = {}
---**Get**:
---Returns the W value of a quaternion.
---**Set**:
---Sets the W value of a quaternion.
---@type number
Quat.w = {}
---**Get**:
---Returns the X value of a quaternion.
---**Set**:
---Sets the X value of a quaternion.
---@type number
Quat.x = {}
---**Get**:
---Returns the Y value of a quaternion.
---**Set**:
---Sets the Y value of a quaternion.
---@type number
Quat.y = {}
---**Get**:
---Returns the Z value of a quaternion.
---**Set**:
---Sets the Z value of a quaternion.
---@type number
Quat.z = {}
---@class Uuid
---A userdata object representing a <strong>uuid</strong>.
local Uuid = {}
---Checks if the uuid is nil {00000000-0000-0000-0000-000000000000}
---@return bool
function Uuid:isNil() end
---@class Color
---A userdata object representing a <strong>color</strong>.
local Color = {}
---**Get**:
---Returns the alpha value of a color.
---**Set**:
---Sets the alpha value of a color.
---@type number
Color.a = {}
---**Get**:
---Returns the blue value of a color.
---**Set**:
---Sets the blue value of a color.
---@type number
Color.b = {}
---**Get**:
---Returns the green value of a color.
---**Set**:
---Sets the green value of a color.
---@type number
Color.g = {}
---**Get**:
---Returns the red value of a color.
---**Set**:
---Sets the red value of a color.
---@type number
Color.r = {}
---Get the hex representation of the color.
---@return string
function Color:getHexStr() end
---@alias RaycastResultTypes
---| "limiter"
---| "terrainSurface"
---| "terrainAsset"
---| "body"
---| "joint"
---| "lift"
---| "character"
---| "joint"
---| "harvestable"
---| "ragdoll"
---| "areaTrigger"
---| "vision"
---| "voxelTerrain"
---| "tunnelCatcher"
---@class RaycastResult
---A userdata object representing a <strong>raycast result</strong>.
---A <strong>raycast result</strong> is a collection of data received from a raycast. The result contains information about where the raycast travelled and what objects it eventually hit.
---Raycast results are the result of functions such as [sm.physics.raycast], [sm.physics.distanceRaycast] and [sm.localPlayer.getRaycast].
local RaycastResult = {}
---**Get**:
---Returns the direction vector of the raycast
---@type Vec3
RaycastResult.directionWorld = {}
---**Get**:
---Returns the fraction (0–1) of the distance reached until collision divided by the ray's length.
---@type number
RaycastResult.fraction = {}
---**Get**:
---Returns the normal vector of the surface that was hit, relative to the target's rotation.
---@type Vec3
RaycastResult.normalLocal = {}
---**Get**:
---Returns the normal vector of the hit surface
---@type Vec3
RaycastResult.normalWorld = {}
---**Get**:
---Returns the starting world position of the raycast.
---@type Vec3
RaycastResult.originWorld = {}
---**Get**:
---Returns the world position of the point that was hit, relative to the target's position.
---@type Vec3
RaycastResult.pointLocal = {}
---**Get**:
---Returns the world position of the point that was hit.
---@type Vec3
RaycastResult.pointWorld = {}
---**Get**:
---Returns the physics type of the target that was hit. (See [sm.physics.types])
---@type RaycastResultTypes
RaycastResult.type = {}
---**Get**:
---Returns whether the raycast successfully hit a target.
---@type boolean
RaycastResult.valid = {}
---Returns the [AreaTrigger] hit during the raycast. This is only possible if [RaycastResult.type] is equal to "areaTrigger", otherwise this will return nil.
---@return AreaTrigger
function RaycastResult:getAreaTrigger() end
---Returns the [Body] hit during the raycast. This is only possible if [RaycastResult.type] is equal to "body", otherwise this will return nil.
---@return Body
function RaycastResult:getBody() end
---Returns the [Character] hit during the raycast. This is only possible if [RaycastResult.type] is equal to "character", otherwise this will return nil.
---@return Character
function RaycastResult:getCharacter() end
---Returns the [Harvestable] hit during the raycast. This is only possible if [RaycastResult.type] is equal to "harvestable", otherwise this will return nil.
---@return Harvestable
function RaycastResult:getHarvestable() end
---Returns the [Joint] hit during the raycast. This is only possible if [RaycastResult.type] is equal to "joint", otherwise this will return nil.
---@return Joint
function RaycastResult:getJoint() end
---Returns the [Lift] hit during the raycast. This is only possible if [RaycastResult.type] is equal to "lift", otherwise this will return nil.
---@return Lift, boolean isTop; The lift; True if the lift is top
function RaycastResult:getLiftData() end
---Returns the [Shape] hit during the raycast. This is only possible if [RaycastResult.type] is equal to "body", otherwise this will return nil.
---@return Shape
function RaycastResult:getShape() end
---@class LoadCellHandle
---A userdata object representing a <strong>load cell handle</strong>.
local LoadCellHandle = {}
---*Server only*
---@return boolean
function LoadCellHandle:release() end
---@class Shape
---A userdata object representing a <strong>shape</strong> in the game.
local Shape = {}
---**Get**:
---Returns the direction of a shape's front side.
---The direction is affected by the shape's rotation in the world.
---@type Vec3
Shape.at = {}
---**Get**:
---Returns the [Body] a shape is part of.
---@type Body
Shape.body = {}
---**Get**:
---Check if a shape is buildable
---@type boolean
Shape.buildable = {}
---**Get**:
---Returns the buoyancy multiplier of a shape.
---@type number
Shape.buoyancy = {}
---**Get**:
---Returns the color of a shape.
---**Set**:
---*Server only*
---Sets the color of a shape. This is similar to coloring with the <em>Paint Tool</em>.
---@type Color
Shape.color = {}
---**Get**:
---Check if a shape is connectable
---@type boolean
Shape.connectable = {}
---**Get**:
---Check if a shape is convertible to dynamic form
---@type boolean
Shape.convertableToDynamic = {}
---**Get**:
---Check if a shape is destructable.
---@type boolean
Shape.destructable = {}
---**Get**:
---Check if a shape is erasable.
---@type boolean
Shape.erasable = {}
---**Get**:
---Returns the id of a shape.
---@type integer
Shape.id = {}
---**Get**:
---Returns the [Interactable] of a shape, if one exists. Otherwise the function will return nil.
---@type Interactable
Shape.interactable = {}
---**Get**:
---Return true if a shape is a block
---@type boolean
Shape.isBlock = {}
---**Get**:
---Return true if a shape is a wedge
---@type boolean
Shape.isWedge = {}
---**Get**:
---Check if a shape is liftable
---@type boolean
Shape.liftable = {}
---**Get**:
---Returns the local grid postition of a shape.
---@type Vec3
Shape.localPosition = {}
---**Get**:
---Returns the local rotation of a shape.
---@type Quat
Shape.localRotation = {}
---**Get**:
---Returns the mass of a shape.
---@type number
Shape.mass = {}
---**Get**:
---Returns the material of a shape.
---@type string
Shape.material = {}
---**Get**:
---Returns the material id of a shape.
---@type integer
Shape.materialId = {}
---**Get**:
---Check if a shape is paintable
---@type boolean
Shape.paintable = {}
---**Get**:
---Returns the direction of a shape's right side.
---The direction is affected by the shape's rotation in the world.
---@type Vec3
Shape.right = {}
---**Get**:
---Return the amount that is stacked in the shape
---**Set**:
---*Server only*
---Set the amount that is stacked in the shape
---@type integer
Shape.stackedAmount = {}
---**Get**:
---Return the item [Uuid] that is stacked in the shape
---**Set**:
---*Server only*
---Set the item [Uuid] that is stacked in the shape
---@type Uuid
Shape.stackedItem = {}
---**Get**:
---Returns the direction of a shape's top side.
---The direction is affected by the shape's rotation in the world.
---@type Vec3
Shape.up = {}
---**Get**:
---Check if a shape is interactable
---@type boolean
Shape.usable = {}
---**Get**:
---Returns the uuid string unique to a shape/block type.
---@type Uuid
Shape.shapeUuid = {}
---**Get**:
---Returns the uuid string unique to a shape/block type.
---@type Uuid
Shape.uuid = {}
---**Get**:
---Returns the linear velocity of a shape.
---@type Vec3
Shape.velocity = {}
---**Get**:
---Returns the world position of a shape.
---@type Vec3
Shape.worldPosition = {}
---**Get**:
---Returns the world rotation of a shape.
---@type Quat
Shape.worldRotation = {}
---**Get**:
---Returns the local x-axis vector of a shape.
---@type Vec3
Shape.xAxis = {}
---**Get**:
---Returns the local y-axis vector of a shape.
---@type Vec3
Shape.yAxis = {}
---**Get**:
---Returns the local z-axis vector of a shape.
---@type Vec3
Shape.zAxis = {}
---*Server only*
---Create a new joint
---@param uuid Uuid The uuid of the joint.
---@param position Vec3 The joint's grid position.
---@param direction Vec3 The joint's normal direction.
---@return Joint joint The created joint.
function Shape:createJoint(uuid, position, direction) end
---*Server only*
---Destroy a block.
---@param position Vec3 The local position of the removal box corner.
---@param size? Vec3 The size of the removal box. Defaults to 1x1x1 (Optional)
---@param attackLevel? integer Determines which quality level of block the attack can destroy. Setting it to 0 (default) will destroy any block.
function Shape:destroyBlock(position, size, attackLevel) end
---*Server only*
---Destroy a part
---@param attackLevel? integer Determines which quality level of parts the attack can destroy. Setting it to 0 (default) will destroy any part.
function Shape:destroyPart(attackLevel) end
---*Server only*
---Destroy a shape
---@param attackLevel? integer Determines which quality level of shape the attack can destroy. Setting it to 0 (default) will destroy any shape.
function Shape:destroyShape(attackLevel) end
---Returns the direction of a shape's front side.
---The direction is affected by the shape's rotation in the world.
---@return Vec3
function Shape:getAt() end
---Returns the [Body] a shape is part of.
---@return Body
function Shape:getBody() end
---Returns the bounding box of a shape – the dimensions that a shape occupies when building.
---@return Vec3
function Shape:getBoundingBox() end
---Returns the buoyancy multiplier of a shape.
---@return number
function Shape:getBuoyancy() end
---Transform a world position to the closest block's local position in a shape.
---@param position Vec3 The world position.
---@return Vec3
function Shape:getClosestBlockLocalPosition(position) end
---Returns the color of a shape.
---@return Color
function Shape:getColor() end
---Returns the id of a shape.
---@return integer
function Shape:getId() end
---Returns the [Interactable] of a shape, if one exists. Otherwise the function will return nil.
---@return Interactable
function Shape:getInteractable() end
---Returns the interpolated direction of a shape's front side.
---The direction is affected by the shape's rotation in the world.
---@return Vec3
function Shape:getInterpolatedAt() end
---Returns the interpolated direction of a shape's right side.
---The direction is affected by the shape's rotation in the world.
---@return Vec3
function Shape:getInterpolatedRight() end
---Returns the interpolated direction of a shape's top side.
---The direction is affected by the shape's rotation in the world.
---@return Vec3
function Shape:getInterpolatedUp() end
---Returns the interpolated world position of a shape.
---@return Vec3
function Shape:getInterpolatedWorldPosition() end
---Return whether the shape uuid belongs to a harvest shape
---@return boolean
function Shape:getIsHarvest() end
---Return whether the shape uuid belongs to a stackable shape
---@return boolean
function Shape:getIsStackable() end
---Returns a table of all [Joint, joints] that are attached to the shape.
---Will return all attached joints when onlyChildJoints is set to false.
---Will only get the joints which are subshapes to the shape when onlySubshapes is set to true.
---@param onlyChildJoints? boolean Filters what joints to return. Defaults to true (Optional)
---@param onlySubshapes? boolean Only get the joints which are subshapes to the shape. Defaults to false (Optional)
---@return Joint[]
function Shape:getJoints(onlyChildJoints, onlySubshapes) end
---Returns the local grid postition of a shape.
---@return Vec3
function Shape:getLocalPosition() end
---Returns the local rotation of a shape.
---@return Quat
function Shape:getLocalRotation() end
---Returns the mass of a shape.
---@return number
function Shape:getMass() end
---Returns the material of a shape.
---@return string
function Shape:getMaterial() end
---Returns the material id of a shape.
---@return integer
function Shape:getMaterialId() end
---*Server only*
---Returns a table of shapes which are neighbours to the shape
---@return Shape[]
function Shape:getNeighbours() end
---*Server only*
---Returns a table of shapes which are neighbours connected with pipes to the shape
---@return Shape[]
function Shape:getPipedNeighbours() end
---Returns the direction of a shape's right side.
---The direction is affected by the shape's rotation in the world.
---@return Vec3
function Shape:getRight() end
---Returns the uuid string unique to a shape/block type.
---@return Uuid
function Shape:getShapeUuid() end
---Returns the sticky directions of the shape for positive xyz and negative xyz.
---A value of 1 means that the direction is sticky and a value of 0 means that the direction is not sticky.
---@return Vec3, Vec3
function Shape:getSticky() end
---Returns the direction of a shape's top side.
---The direction is affected by the shape's rotation in the world.
---@return Vec3
function Shape:getUp() end
---Returns the linear velocity of a shape.
---@return Vec3
function Shape:getVelocity() end
---Returns the world position of a shape.
---@return Vec3
function Shape:getWorldPosition() end
---Returns the world rotation of a shape.
---@return Quat
function Shape:getWorldRotation() end
---Returns the local x-axis vector of a shape.
---@return Vec3
function Shape:getXAxis() end
---Returns the local y-axis vector of a shape.
---@return Vec3
function Shape:getYAxis() end
---Returns the local z-axis vector of a shape.
---@return Vec3
function Shape:getZAxis() end
---*Server only*
---Creates a new [Shape] from [Uuid] to replace the given [Shape].
---@param uuid Uuid The uuid of the new shape.
function Shape:replaceShape(uuid) end
---*Server only*
---Sets the color of a shape. This is similar to coloring with the <em>Paint Tool</em>.
---@param color Color The color.
function Shape:setColor(color) end
---@deprecated use [sm.exists]
---Return true if a shape exists.
---@return boolean
function Shape:shapeExists() end
---Returns a table of all shapes colliding with a given sphere.
---@param radius number The radius of the sphere.
---@return Shape[]
function Shape:shapesInSphere(radius) end
---Transform a world direction to the local shape transform.
---@param vector Vec3 The untransformed direction.
---@return Vec3
function Shape:transformDirection(vector) end
---Transform a local point to world space.
---```
---local worldPos = self.shape:transformLocalPoint( localPos )
---```
---@param vector Vec3 The local point.
---@return Vec3
function Shape:transformLocalPoint(vector) end
---Transform a world point to the local shape transform.
---```
---local localPos = self.shape:transformPoint( worldPos )
---```
---@param vector Vec3 The world point.
---@return Vec3
function Shape:transformPoint(vector) end
---Transform a world rotation to the local shape transform.
---```
---local worldUp = sm.vec3.new( 0, 0, 1 )
---local worldRot = sm.vec3.getRotation( worldUp, worldDir )
---local localRot = self.shape:transformRotation( worldRot )
---```
---@param quat Quat The untransformed quaternion.
---@return Quat
function Shape:transformRotation(quat) end
---@class Body
---A userdata object representing a <strong>body</strong> in the game.
local Body = {}
---**Get**:
---Returns the angular velocity of a body.
---@type Vec3
Body.angularVelocity = {}
---**Get**:
---Check if a body is buildable
---**Set**:
---*Server only*
---Controls whether a body is buildable
---@type boolean
Body.buildable = {}
---**Get**:
---Returns the center of mass world position of a body.
---@type Vec3
Body.centerOfMassPosition = {}
---**Get**:
---Check if a body is connectable
---**Set**:
---*Server only*
---Controls whether a body is connectable
---@type boolean
Body.connectable = {}
---**Get**:
---Check if a body is convertible to dynamic form
---**Set**:
---*Server only*
---Controls whether a body is convertible to dynamic form
---@type boolean
Body.convertableToDynamic = {}
---**Get**:
---Check if a body is destructable.
---**Set**:
---*Server only*
---Controls whether a body is destructable
---@type boolean
Body.destructable = {}
---**Get**:
---Check if a body is erasable.
---**Set**:
---*Server only*
---Controls whether a body is erasable
---@type boolean
Body.erasable = {}
---**Get**:
---Returns the id of a body.
---@type integer
Body.id = {}
---**Get**:
---Check if a body is liftable
---**Set**:
---*Server only*
---Controls whether a body is liftable
---@type boolean
Body.liftable = {}
---**Get**:
---Returns the mass of a body.
---@type number
Body.mass = {}
---**Get**:
---Check if a body is paintable
---**Set**:
---*Server only*
---Controls whether a body is non paintable
---@type boolean
Body.paintable = {}
---**Get**:
---Check if a body is interactable
---**Set**:
---*Server only*
---Controls whether a body is interactable
---@type boolean
Body.usable = {}
---**Get**:
---Returns the linear velocity of a body.
---@type Vec3
Body.velocity = {}
---**Get**:
---Returns the world position of a body.
---@type Vec3
Body.worldPosition = {}
---**Get**:
---Returns the world rotation of a body.
---@type Quat
Body.worldRotation = {}
---*Server only*
---Create a block on body
---@param uuid Uuid The uuid of the shape.
---@param size Vec3 The shape's size.
---@param position Vec3 The shape's local position.
---@param forceAccept? boolean Set true to force the body to accept the shape. (Defaults to true)
---@return Shape shape
function Body:createBlock(uuid, size, position, forceAccept) end
---*Server only*
---Create a part on body
---@param uuid Uuid The uuid of the shape.
---@param position Vec3 The shape's local position.
---@param z_axis Vec3 The shape's local z direction.
---@param x_axis Vec3 The shape's local x direction.
---@param forceAccept? boolean Set true to force the body to accept the shape. (Defaults to true)
---@return Shape shape
function Body:createPart(uuid, position, z_axis, x_axis, forceAccept) end
---*Server only*
---Creates a wedge attached to a body. The wedge is oriented with one
---cathetus along the Y-axis and the other along the Z-axis, forming a right angle. The wedge's
---rotation is controlled by z-axis and x-axis parameters, similar to standard part rotation.
---@param uuid Uuid The uuid of the shape.
---@param size Vec3 The shape's size.
---@param position Vec3 The shape's local position.
---@param z_axis Vec3 The shape's local z direction.
---@param x_axis Vec3 The shape's local x direction.
---@param forceAccept? boolean Set true to force the body to accept the shape. (Defaults to true)
---@return Shape wedge The created wedge
function Body:createWedge(uuid, size, position, z_axis, x_axis, forceAccept) end
---*Server only*
---Returns a table with all characters seated in this body
---@return Character[]
function Body:getAllSeatedCharacter() end
---Returns the angular velocity of a body.
---@return Vec3
function Body:getAngularVelocity() end
---Returns the center of mass world position of a body.
---@return Vec3
function Body:getCenterOfMassPosition() end
---Returns a table of all bodies in a creation.
---A creation includes all bodies connected by [Joint, joints], etc.
---@return Body[]
function Body:getCreationBodies() end
---*Server only*
---Returns the id of the creation
---@return integer
function Body:getCreationId() end
---Returns a table of all [Joint, joints] that are part of a creation.
---A creation includes all bodies connected by [Joint, joints], etc.
---@return Joint[]
function Body:getCreationJoints() end
---Returns a table of all [Shape, shapes] that are part of a creation.
---A creation includes all bodies connected by [Joint, joints], etc.
---@return Shape[]
function Body:getCreationShapes() end
---Returns the id of a body.
---@return integer
function Body:getId() end
---Returns a table of all [Interactable, interactables] that are part of a body.
---This will <strong>not</strong> return interactables in neighbouring bodies connected by [Joint, joints], etc.
---@return Interactable[]
function Body:getInteractables() end
---Returns a table of all [Joint, joints] that are part of a body.
---This will <strong>not</strong> return joints in neighbouring bodies.
---@return Joint[]
function Body:getJoints() end
---Get the local aabb of the body.
---@return Vec3,Vec3
function Body:getLocalAabb() end
---Returns the mass of a body.
---@return number
function Body:getMass() end
---Returns a table of all [Shape, shapes] that are part of a body.
---This will <strong>not</strong> return shapes in neighbouring bodies connected by [Joint, joints], etc.
---@return Shape[]
function Body:getShapes() end
---Returns the linear velocity of a body.
---@return Vec3
function Body:getVelocity() end
---Returns the world a body exists in.
---@return World
function Body:getWorld() end
---Get the world aabb of the body.
---@return Vec3,Vec3
function Body:getWorldAabb() end
---Returns the world position of a body.
---@return Vec3
function Body:getWorldPosition() end
---Returns true if the given tick is lower than the tick the body was last changed.
---@param tick integer The tick.
---@return boolean
function Body:hasChanged(tick) end
---Check if a body is buildable
---@return boolean
function Body:isBuildable() end
---Check if a body is connectable
---@return boolean
function Body:isConnectable() end
---Check if a body is convertible to dynamic form
---@return boolean
function Body:isConvertibleToDynamic() end
---Check if a body is destructable.
---@return boolean
function Body:isDestructable() end
---Check if a body is dynamic
---@return boolean
function Body:isDynamic() end
---Check if a body is erasable.
---@return boolean
function Body:isErasable() end
---Check if a body is liftable
---@return boolean
function Body:isLiftable() end
---Check if a body is on a lift
---@return boolean
function Body:isOnLift() end
---Check if a body is paintable
---@return boolean
function Body:isPaintable() end
---Check if a body is static
---@return boolean
function Body:isStatic() end
---Check if a body is interactable
---@return boolean
function Body:isUsable() end
---*Server only*
---Controls whether a body is buildable
---@param value boolean Whether the body is buildable.
function Body:setBuildable(value) end
---*Server only*
---Controls whether a body is connectable
---@param value boolean Whether the body is connectable.
function Body:setConnectable(value) end
---*Server only*
---Controls whether a body is convertible to dynamic form
---@param value boolean Whether the body is convertible to dynamic form.
function Body:setConvertibleToDynamic(value) end
---*Server only*
---Controls whether a body is destructable
---@param value boolean Whether the body is destructable.
function Body:setDestructable(value) end