-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbox2dxt.lcb
More file actions
3101 lines (2948 loc) · 131 KB
/
Copy pathbox2dxt.lcb
File metadata and controls
3101 lines (2948 loc) · 131 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
/*
box2dxt.lcb - xTalk Builder (LCB) binding library for Box2D v3, via the
box2d_lc C shim. Part of Box2Dxt for OpenXTalk (OXT).
Box2Dxt targets OpenXTalk / the xTalk language family and is compatible with
LiveCode 9.6.3+. Once this extension is loaded, every public handler below is
callable directly from xTalk (OpenXTalk Script), e.g.
put b2NewWorld(0, -10, true, true) into gWorld
Conventions:
* Handles are integers (0 = invalid). Every handler tolerates a stale or 0
handle: getters return 0, actions do nothing (the C shim validates ids).
* All distances are METRES, angles are RADIANS (convert to pixels at draw time).
* Body type codes: 0 = static, 1 = kinematic, 2 = dynamic.
The foreign handlers bind to the shared library "box2dxt" (built by CMakeLists.txt).
Bindings resolve on first use, so the library only needs to be present at run time.
The exported C ABI symbols keep the historical "b2lc_" prefix for binary stability.
*/
library org.openxtalk.box2dxt
use com.livecode.foreign
metadata title is "Box2D for OpenXTalk"
metadata author is "Box2Dxt contributors"
metadata version is "0.2.0"
-- =====================================================================
-- Foreign bindings to the shim (private)
-- =====================================================================
private foreign handler _abi_version() returns CInt binds to "c:box2dxt>b2lc_abi_version!cdecl"
private foreign handler _world_create(in pGx as CDouble, in pGy as CDouble, in pSleep as CInt, in pCont as CInt) returns CInt binds to "c:box2dxt>b2lc_world_create!cdecl"
private foreign handler _world_create_threaded(in pGx as CDouble, in pGy as CDouble, in pSleep as CInt, in pCont as CInt, in pWorkers as CInt) returns CInt binds to "c:box2dxt>b2lc_world_create_threaded!cdecl"
private foreign handler _world_thread_count(in pW as CInt) returns CInt binds to "c:box2dxt>b2lc_world_thread_count!cdecl"
private foreign handler _world_destroy(in pW as CInt) returns nothing binds to "c:box2dxt>b2lc_world_destroy!cdecl"
private foreign handler _world_set_gravity(in pW as CInt, in pGx as CDouble, in pGy as CDouble) returns nothing binds to "c:box2dxt>b2lc_world_set_gravity!cdecl"
private foreign handler _world_enable_sleeping(in pW as CInt, in pFlag as CInt) returns nothing binds to "c:box2dxt>b2lc_world_enable_sleeping!cdecl"
private foreign handler _world_enable_continuous(in pW as CInt, in pFlag as CInt) returns nothing binds to "c:box2dxt>b2lc_world_enable_continuous!cdecl"
private foreign handler _world_step(in pW as CInt, in pDt as CDouble, in pSub as CInt) returns nothing binds to "c:box2dxt>b2lc_world_step!cdecl"
private foreign handler _body_create(in pW as CInt, in pT as CInt, in pX as CDouble, in pY as CDouble, in pA as CDouble, in pBullet as CInt, in pFixedRot as CInt) returns CInt binds to "c:box2dxt>b2lc_body_create!cdecl"
private foreign handler _body_destroy(in pB as CInt) returns nothing binds to "c:box2dxt>b2lc_body_destroy!cdecl"
private foreign handler _body_x(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_x!cdecl"
private foreign handler _body_y(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_y!cdecl"
private foreign handler _body_angle(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_angle!cdecl"
private foreign handler _body_vx(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_vx!cdecl"
private foreign handler _body_vy(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_vy!cdecl"
private foreign handler _body_omega(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_omega!cdecl"
private foreign handler _body_mass(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_mass!cdecl"
private foreign handler _body_is_awake(in pB as CInt) returns CInt binds to "c:box2dxt>b2lc_body_is_awake!cdecl"
private foreign handler _body_world_center_x(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_world_center_x!cdecl"
private foreign handler _body_world_center_y(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_world_center_y!cdecl"
private foreign handler _body_type(in pB as CInt) returns CInt binds to "c:box2dxt>b2lc_body_type!cdecl"
private foreign handler _body_is_bullet(in pB as CInt) returns CInt binds to "c:box2dxt>b2lc_body_is_bullet!cdecl"
private foreign handler _body_is_enabled(in pB as CInt) returns CInt binds to "c:box2dxt>b2lc_body_is_enabled!cdecl"
private foreign handler _body_linear_damping(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_linear_damping!cdecl"
private foreign handler _body_angular_damping(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_angular_damping!cdecl"
private foreign handler _body_gravity_scale(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_gravity_scale!cdecl"
private foreign handler _body_set_transform(in pB as CInt, in pX as CDouble, in pY as CDouble, in pA as CDouble) returns nothing binds to "c:box2dxt>b2lc_body_set_transform!cdecl"
private foreign handler _body_set_velocity(in pB as CInt, in pVx as CDouble, in pVy as CDouble) returns nothing binds to "c:box2dxt>b2lc_body_set_velocity!cdecl"
private foreign handler _body_set_angular_velocity(in pB as CInt, in pW as CDouble) returns nothing binds to "c:box2dxt>b2lc_body_set_angular_velocity!cdecl"
private foreign handler _body_apply_force(in pB as CInt, in pFx as CDouble, in pFy as CDouble, in pWake as CInt) returns nothing binds to "c:box2dxt>b2lc_body_apply_force!cdecl"
private foreign handler _body_apply_impulse(in pB as CInt, in pIx as CDouble, in pIy as CDouble, in pWake as CInt) returns nothing binds to "c:box2dxt>b2lc_body_apply_impulse!cdecl"
private foreign handler _body_apply_torque(in pB as CInt, in pT as CDouble, in pWake as CInt) returns nothing binds to "c:box2dxt>b2lc_body_apply_torque!cdecl"
private foreign handler _body_apply_angular_impulse(in pB as CInt, in pImp as CDouble, in pWake as CInt) returns nothing binds to "c:box2dxt>b2lc_body_apply_angular_impulse!cdecl"
private foreign handler _body_set_bullet(in pB as CInt, in pFlag as CInt) returns nothing binds to "c:box2dxt>b2lc_body_set_bullet!cdecl"
private foreign handler _body_set_awake(in pB as CInt, in pFlag as CInt) returns nothing binds to "c:box2dxt>b2lc_body_set_awake!cdecl"
private foreign handler _body_set_fixed_rotation(in pB as CInt, in pFlag as CInt) returns nothing binds to "c:box2dxt>b2lc_body_set_fixed_rotation!cdecl"
private foreign handler _body_set_type(in pB as CInt, in pT as CInt) returns nothing binds to "c:box2dxt>b2lc_body_set_type!cdecl"
private foreign handler _body_set_linear_damping(in pB as CInt, in pD as CDouble) returns nothing binds to "c:box2dxt>b2lc_body_set_linear_damping!cdecl"
private foreign handler _body_set_angular_damping(in pB as CInt, in pD as CDouble) returns nothing binds to "c:box2dxt>b2lc_body_set_angular_damping!cdecl"
private foreign handler _body_set_gravity_scale(in pB as CInt, in pS as CDouble) returns nothing binds to "c:box2dxt>b2lc_body_set_gravity_scale!cdecl"
private foreign handler _body_set_sleep_threshold(in pB as CInt, in pV as CDouble) returns nothing binds to "c:box2dxt>b2lc_body_set_sleep_threshold!cdecl"
private foreign handler _body_enable(in pB as CInt) returns nothing binds to "c:box2dxt>b2lc_body_enable!cdecl"
private foreign handler _body_disable(in pB as CInt) returns nothing binds to "c:box2dxt>b2lc_body_disable!cdecl"
private foreign handler _shape_add_box(in pB as CInt, in pHw as CDouble, in pHh as CDouble, in pD as CDouble, in pF as CDouble, in pR as CDouble) returns CInt binds to "c:box2dxt>b2lc_shape_add_box!cdecl"
private foreign handler _shape_add_circle(in pB as CInt, in pCx as CDouble, in pCy as CDouble, in pRad as CDouble, in pD as CDouble, in pF as CDouble, in pR as CDouble) returns CInt binds to "c:box2dxt>b2lc_shape_add_circle!cdecl"
private foreign handler _shape_add_capsule(in pB as CInt, in pX1 as CDouble, in pY1 as CDouble, in pX2 as CDouble, in pY2 as CDouble, in pRad as CDouble, in pD as CDouble, in pF as CDouble, in pR as CDouble) returns CInt binds to "c:box2dxt>b2lc_shape_add_capsule!cdecl"
private foreign handler _shape_add_segment(in pB as CInt, in pX1 as CDouble, in pY1 as CDouble, in pX2 as CDouble, in pY2 as CDouble, in pF as CDouble, in pR as CDouble) returns CInt binds to "c:box2dxt>b2lc_shape_add_segment!cdecl"
private foreign handler _poly_begin() returns nothing binds to "c:box2dxt>b2lc_poly_begin!cdecl"
private foreign handler _poly_add(in pX as CDouble, in pY as CDouble) returns nothing binds to "c:box2dxt>b2lc_poly_add!cdecl"
private foreign handler _shape_add_polygon(in pB as CInt, in pD as CDouble, in pF as CDouble, in pR as CDouble) returns CInt binds to "c:box2dxt>b2lc_shape_add_polygon!cdecl"
private foreign handler _shape_destroy(in pS as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_destroy!cdecl"
private foreign handler _shape_set_friction(in pS as CInt, in pF as CDouble) returns nothing binds to "c:box2dxt>b2lc_shape_set_friction!cdecl"
private foreign handler _shape_set_restitution(in pS as CInt, in pR as CDouble) returns nothing binds to "c:box2dxt>b2lc_shape_set_restitution!cdecl"
private foreign handler _shape_set_density(in pS as CInt, in pD as CDouble) returns nothing binds to "c:box2dxt>b2lc_shape_set_density!cdecl"
private foreign handler _shape_body(in pS as CInt) returns CInt binds to "c:box2dxt>b2lc_shape_body!cdecl"
private foreign handler _shape_test_point(in pS as CInt, in pX as CDouble, in pY as CDouble) returns CInt binds to "c:box2dxt>b2lc_shape_test_point!cdecl"
private foreign handler _joint_revolute(in pW as CInt, in pBa as CInt, in pBb as CInt, in pAx as CDouble, in pAy as CDouble, in pBx as CDouble, in pBy as CDouble, in pCollide as CInt) returns CInt binds to "c:box2dxt>b2lc_joint_revolute!cdecl"
private foreign handler _revolute_enable_limit(in pJ as CInt, in pEnable as CInt, in pLo as CDouble, in pHi as CDouble) returns nothing binds to "c:box2dxt>b2lc_revolute_enable_limit!cdecl"
private foreign handler _revolute_enable_motor(in pJ as CInt, in pEnable as CInt, in pSpeed as CDouble, in pMaxTorque as CDouble) returns nothing binds to "c:box2dxt>b2lc_revolute_enable_motor!cdecl"
private foreign handler _revolute_angle(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_revolute_angle!cdecl"
private foreign handler _joint_distance(in pW as CInt, in pBa as CInt, in pBb as CInt, in pAx as CDouble, in pAy as CDouble, in pBx as CDouble, in pBy as CDouble, in pLength as CDouble, in pCollide as CInt) returns CInt binds to "c:box2dxt>b2lc_joint_distance!cdecl"
private foreign handler _distance_set_length(in pJ as CInt, in pLength as CDouble) returns nothing binds to "c:box2dxt>b2lc_distance_set_length!cdecl"
private foreign handler _distance_set_length_range(in pJ as CInt, in pLo as CDouble, in pHi as CDouble) returns nothing binds to "c:box2dxt>b2lc_distance_set_length_range!cdecl"
private foreign handler _distance_enable_spring(in pJ as CInt, in pEnable as CInt, in pHertz as CDouble, in pDamping as CDouble) returns nothing binds to "c:box2dxt>b2lc_distance_enable_spring!cdecl"
private foreign handler _distance_length(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_distance_length!cdecl"
private foreign handler _joint_weld(in pW as CInt, in pBa as CInt, in pBb as CInt, in pAx as CDouble, in pAy as CDouble, in pBx as CDouble, in pBy as CDouble, in pRefAngle as CDouble, in pCollide as CInt) returns CInt binds to "c:box2dxt>b2lc_joint_weld!cdecl"
private foreign handler _weld_set_stiffness(in pJ as CInt, in pLh as CDouble, in pLd as CDouble, in pAh as CDouble, in pAd as CDouble) returns nothing binds to "c:box2dxt>b2lc_weld_set_stiffness!cdecl"
private foreign handler _joint_prismatic(in pW as CInt, in pBa as CInt, in pBb as CInt, in pAx as CDouble, in pAy as CDouble, in pBx as CDouble, in pBy as CDouble, in pAxisX as CDouble, in pAxisY as CDouble, in pRefAngle as CDouble, in pCollide as CInt) returns CInt binds to "c:box2dxt>b2lc_joint_prismatic!cdecl"
private foreign handler _prismatic_enable_limit(in pJ as CInt, in pEnable as CInt, in pLo as CDouble, in pHi as CDouble) returns nothing binds to "c:box2dxt>b2lc_prismatic_enable_limit!cdecl"
private foreign handler _prismatic_enable_motor(in pJ as CInt, in pEnable as CInt, in pSpeed as CDouble, in pMaxForce as CDouble) returns nothing binds to "c:box2dxt>b2lc_prismatic_enable_motor!cdecl"
private foreign handler _prismatic_translation(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_prismatic_translation!cdecl"
private foreign handler _joint_wheel(in pW as CInt, in pBa as CInt, in pBb as CInt, in pAx as CDouble, in pAy as CDouble, in pBx as CDouble, in pBy as CDouble, in pAxisX as CDouble, in pAxisY as CDouble, in pCollide as CInt) returns CInt binds to "c:box2dxt>b2lc_joint_wheel!cdecl"
private foreign handler _wheel_enable_spring(in pJ as CInt, in pEnable as CInt, in pHertz as CDouble, in pDamping as CDouble) returns nothing binds to "c:box2dxt>b2lc_wheel_enable_spring!cdecl"
private foreign handler _wheel_enable_motor(in pJ as CInt, in pEnable as CInt, in pSpeed as CDouble, in pMaxTorque as CDouble) returns nothing binds to "c:box2dxt>b2lc_wheel_enable_motor!cdecl"
private foreign handler _joint_mouse(in pW as CInt, in pBa as CInt, in pBb as CInt, in pTx as CDouble, in pTy as CDouble, in pHertz as CDouble, in pDamping as CDouble, in pMaxForce as CDouble) returns CInt binds to "c:box2dxt>b2lc_joint_mouse!cdecl"
private foreign handler _mouse_set_target(in pJ as CInt, in pTx as CDouble, in pTy as CDouble) returns nothing binds to "c:box2dxt>b2lc_mouse_set_target!cdecl"
private foreign handler _joint_destroy(in pJ as CInt) returns nothing binds to "c:box2dxt>b2lc_joint_destroy!cdecl"
private foreign handler _cast_ray_closest(in pW as CInt, in pX1 as CDouble, in pY1 as CDouble, in pX2 as CDouble, in pY2 as CDouble) returns CInt binds to "c:box2dxt>b2lc_cast_ray_closest!cdecl"
private foreign handler _ray_body() returns CInt binds to "c:box2dxt>b2lc_ray_body!cdecl"
private foreign handler _ray_shape() returns CInt binds to "c:box2dxt>b2lc_ray_shape!cdecl"
private foreign handler _ray_x() returns CDouble binds to "c:box2dxt>b2lc_ray_x!cdecl"
private foreign handler _ray_y() returns CDouble binds to "c:box2dxt>b2lc_ray_y!cdecl"
private foreign handler _ray_normal_x() returns CDouble binds to "c:box2dxt>b2lc_ray_normal_x!cdecl"
private foreign handler _ray_normal_y() returns CDouble binds to "c:box2dxt>b2lc_ray_normal_y!cdecl"
private foreign handler _ray_fraction() returns CDouble binds to "c:box2dxt>b2lc_ray_fraction!cdecl"
private foreign handler _body_at_point(in pW as CInt, in pX as CDouble, in pY as CDouble) returns CInt binds to "c:box2dxt>b2lc_body_at_point!cdecl"
private foreign handler _contacts_update(in pW as CInt) returns CInt binds to "c:box2dxt>b2lc_contacts_update!cdecl"
private foreign handler _contact_begin_count() returns CInt binds to "c:box2dxt>b2lc_contact_begin_count!cdecl"
private foreign handler _contact_end_count() returns CInt binds to "c:box2dxt>b2lc_contact_end_count!cdecl"
private foreign handler _contact_begin_a(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_contact_begin_a!cdecl"
private foreign handler _contact_begin_b(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_contact_begin_b!cdecl"
private foreign handler _contact_end_a(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_contact_end_a!cdecl"
private foreign handler _contact_end_b(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_contact_end_b!cdecl"
-- ===== ABI v3 additions: foreign bindings ===========================
-- shape-def builder (one-shot extras applied by the next shape creation)
private foreign handler _shapedef_reset() returns nothing binds to "c:box2dxt>b2lc_shapedef_reset!cdecl"
private foreign handler _shapedef_set_sensor(in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_shapedef_set_sensor!cdecl"
private foreign handler _shapedef_set_enable_contact_events(in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_shapedef_set_enable_contact_events!cdecl"
private foreign handler _shapedef_set_enable_sensor_events(in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_shapedef_set_enable_sensor_events!cdecl"
private foreign handler _shapedef_set_enable_hit_events(in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_shapedef_set_enable_hit_events!cdecl"
private foreign handler _shapedef_set_enable_presolve_events(in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_shapedef_set_enable_presolve_events!cdecl"
private foreign handler _shapedef_set_filter(in pCat as CDouble, in pMask as CDouble, in pGroup as CInt) returns nothing binds to "c:box2dxt>b2lc_shapedef_set_filter!cdecl"
private foreign handler _shapedef_set_material_id(in pId as CInt) returns nothing binds to "c:box2dxt>b2lc_shapedef_set_material_id!cdecl"
-- contact hit events
private foreign handler _contact_hit_count() returns CInt binds to "c:box2dxt>b2lc_contact_hit_count!cdecl"
private foreign handler _contact_hit_a(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_contact_hit_a!cdecl"
private foreign handler _contact_hit_b(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_contact_hit_b!cdecl"
private foreign handler _contact_hit_x(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_contact_hit_x!cdecl"
private foreign handler _contact_hit_y(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_contact_hit_y!cdecl"
private foreign handler _contact_hit_nx(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_contact_hit_nx!cdecl"
private foreign handler _contact_hit_ny(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_contact_hit_ny!cdecl"
private foreign handler _contact_hit_speed(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_contact_hit_speed!cdecl"
-- sensor events
private foreign handler _sensors_update(in pW as CInt) returns CInt binds to "c:box2dxt>b2lc_sensors_update!cdecl"
private foreign handler _sensor_begin_count() returns CInt binds to "c:box2dxt>b2lc_sensor_begin_count!cdecl"
private foreign handler _sensor_end_count() returns CInt binds to "c:box2dxt>b2lc_sensor_end_count!cdecl"
private foreign handler _sensor_begin_sensor(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_sensor_begin_sensor!cdecl"
private foreign handler _sensor_begin_visitor(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_sensor_begin_visitor!cdecl"
private foreign handler _sensor_end_sensor(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_sensor_end_sensor!cdecl"
private foreign handler _sensor_end_visitor(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_sensor_end_visitor!cdecl"
-- body move events
private foreign handler _bodies_update(in pW as CInt) returns CInt binds to "c:box2dxt>b2lc_bodies_update!cdecl"
private foreign handler _body_move_count() returns CInt binds to "c:box2dxt>b2lc_body_move_count!cdecl"
private foreign handler _body_move_body(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_body_move_body!cdecl"
private foreign handler _body_move_x(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_move_x!cdecl"
private foreign handler _body_move_y(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_move_y!cdecl"
private foreign handler _body_move_angle(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_move_angle!cdecl"
private foreign handler _body_move_asleep(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_body_move_asleep!cdecl"
-- world tuning / info / explode / profile / counters
private foreign handler _world_gravity_x(in pW as CInt) returns CDouble binds to "c:box2dxt>b2lc_world_gravity_x!cdecl"
private foreign handler _world_gravity_y(in pW as CInt) returns CDouble binds to "c:box2dxt>b2lc_world_gravity_y!cdecl"
private foreign handler _world_set_restitution_threshold(in pW as CInt, in pV as CDouble) returns nothing binds to "c:box2dxt>b2lc_world_set_restitution_threshold!cdecl"
private foreign handler _world_restitution_threshold(in pW as CInt) returns CDouble binds to "c:box2dxt>b2lc_world_restitution_threshold!cdecl"
private foreign handler _world_set_hit_event_threshold(in pW as CInt, in pV as CDouble) returns nothing binds to "c:box2dxt>b2lc_world_set_hit_event_threshold!cdecl"
private foreign handler _world_hit_event_threshold(in pW as CInt) returns CDouble binds to "c:box2dxt>b2lc_world_hit_event_threshold!cdecl"
private foreign handler _world_set_contact_tuning(in pW as CInt, in pHz as CDouble, in pDamp as CDouble, in pPush as CDouble) returns nothing binds to "c:box2dxt>b2lc_world_set_contact_tuning!cdecl"
private foreign handler _world_set_joint_tuning(in pW as CInt, in pHz as CDouble, in pDamp as CDouble) returns nothing binds to "c:box2dxt>b2lc_world_set_joint_tuning!cdecl"
private foreign handler _world_set_maximum_linear_speed(in pW as CInt, in pV as CDouble) returns nothing binds to "c:box2dxt>b2lc_world_set_maximum_linear_speed!cdecl"
private foreign handler _world_maximum_linear_speed(in pW as CInt) returns CDouble binds to "c:box2dxt>b2lc_world_maximum_linear_speed!cdecl"
private foreign handler _world_enable_warm_starting(in pW as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_world_enable_warm_starting!cdecl"
private foreign handler _world_is_warm_starting(in pW as CInt) returns CInt binds to "c:box2dxt>b2lc_world_is_warm_starting!cdecl"
private foreign handler _world_enable_speculative(in pW as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_world_enable_speculative!cdecl"
private foreign handler _world_is_sleeping_enabled(in pW as CInt) returns CInt binds to "c:box2dxt>b2lc_world_is_sleeping_enabled!cdecl"
private foreign handler _world_is_continuous_enabled(in pW as CInt) returns CInt binds to "c:box2dxt>b2lc_world_is_continuous_enabled!cdecl"
private foreign handler _world_awake_body_count(in pW as CInt) returns CInt binds to "c:box2dxt>b2lc_world_awake_body_count!cdecl"
private foreign handler _world_explode(in pW as CInt, in pX as CDouble, in pY as CDouble, in pR as CDouble, in pFalloff as CDouble, in pImpulse as CDouble) returns nothing binds to "c:box2dxt>b2lc_world_explode!cdecl"
private foreign handler _world_profile_update(in pW as CInt) returns nothing binds to "c:box2dxt>b2lc_world_profile_update!cdecl"
private foreign handler _world_profile_step() returns CDouble binds to "c:box2dxt>b2lc_world_profile_step!cdecl"
private foreign handler _world_profile_pairs() returns CDouble binds to "c:box2dxt>b2lc_world_profile_pairs!cdecl"
private foreign handler _world_profile_collide() returns CDouble binds to "c:box2dxt>b2lc_world_profile_collide!cdecl"
private foreign handler _world_profile_solve() returns CDouble binds to "c:box2dxt>b2lc_world_profile_solve!cdecl"
private foreign handler _world_profile_refit() returns CDouble binds to "c:box2dxt>b2lc_world_profile_refit!cdecl"
private foreign handler _world_profile_sensors() returns CDouble binds to "c:box2dxt>b2lc_world_profile_sensors!cdecl"
private foreign handler _world_counters_update(in pW as CInt) returns nothing binds to "c:box2dxt>b2lc_world_counters_update!cdecl"
private foreign handler _world_count_bodies() returns CInt binds to "c:box2dxt>b2lc_world_count_bodies!cdecl"
private foreign handler _world_count_shapes() returns CInt binds to "c:box2dxt>b2lc_world_count_shapes!cdecl"
private foreign handler _world_count_contacts() returns CInt binds to "c:box2dxt>b2lc_world_count_contacts!cdecl"
private foreign handler _world_count_joints() returns CInt binds to "c:box2dxt>b2lc_world_count_joints!cdecl"
private foreign handler _world_count_islands() returns CInt binds to "c:box2dxt>b2lc_world_count_islands!cdecl"
-- body: transforms / velocity-at-point / force-at-point / mass / enum
private foreign handler _body_world_point_x(in pB as CInt, in pLx as CDouble, in pLy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_body_world_point_x!cdecl"
private foreign handler _body_world_point_y(in pB as CInt, in pLx as CDouble, in pLy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_body_world_point_y!cdecl"
private foreign handler _body_local_point_x(in pB as CInt, in pWx as CDouble, in pWy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_body_local_point_x!cdecl"
private foreign handler _body_local_point_y(in pB as CInt, in pWx as CDouble, in pWy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_body_local_point_y!cdecl"
private foreign handler _body_world_vector_x(in pB as CInt, in pLx as CDouble, in pLy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_body_world_vector_x!cdecl"
private foreign handler _body_world_vector_y(in pB as CInt, in pLx as CDouble, in pLy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_body_world_vector_y!cdecl"
private foreign handler _body_local_vector_x(in pB as CInt, in pWx as CDouble, in pWy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_body_local_vector_x!cdecl"
private foreign handler _body_local_vector_y(in pB as CInt, in pWx as CDouble, in pWy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_body_local_vector_y!cdecl"
private foreign handler _body_world_point_velocity_x(in pB as CInt, in pWx as CDouble, in pWy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_body_world_point_velocity_x!cdecl"
private foreign handler _body_world_point_velocity_y(in pB as CInt, in pWx as CDouble, in pWy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_body_world_point_velocity_y!cdecl"
private foreign handler _body_local_point_velocity_x(in pB as CInt, in pLx as CDouble, in pLy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_body_local_point_velocity_x!cdecl"
private foreign handler _body_local_point_velocity_y(in pB as CInt, in pLx as CDouble, in pLy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_body_local_point_velocity_y!cdecl"
private foreign handler _body_apply_force_at(in pB as CInt, in pFx as CDouble, in pFy as CDouble, in pPx as CDouble, in pPy as CDouble, in pWake as CInt) returns nothing binds to "c:box2dxt>b2lc_body_apply_force_at!cdecl"
private foreign handler _body_apply_impulse_at(in pB as CInt, in pIx as CDouble, in pIy as CDouble, in pPx as CDouble, in pPy as CDouble, in pWake as CInt) returns nothing binds to "c:box2dxt>b2lc_body_apply_impulse_at!cdecl"
private foreign handler _body_rotational_inertia(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_rotational_inertia!cdecl"
private foreign handler _body_local_center_x(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_local_center_x!cdecl"
private foreign handler _body_local_center_y(in pB as CInt) returns CDouble binds to "c:box2dxt>b2lc_body_local_center_y!cdecl"
private foreign handler _body_mass_data_update(in pB as CInt) returns nothing binds to "c:box2dxt>b2lc_body_mass_data_update!cdecl"
private foreign handler _md_mass() returns CDouble binds to "c:box2dxt>b2lc_md_mass!cdecl"
private foreign handler _md_center_x() returns CDouble binds to "c:box2dxt>b2lc_md_center_x!cdecl"
private foreign handler _md_center_y() returns CDouble binds to "c:box2dxt>b2lc_md_center_y!cdecl"
private foreign handler _md_inertia() returns CDouble binds to "c:box2dxt>b2lc_md_inertia!cdecl"
private foreign handler _body_set_mass_data(in pB as CInt, in pMass as CDouble, in pCx as CDouble, in pCy as CDouble, in pInertia as CDouble) returns nothing binds to "c:box2dxt>b2lc_body_set_mass_data!cdecl"
private foreign handler _body_apply_mass_from_shapes(in pB as CInt) returns nothing binds to "c:box2dxt>b2lc_body_apply_mass_from_shapes!cdecl"
private foreign handler _body_set_target_transform(in pB as CInt, in pX as CDouble, in pY as CDouble, in pAngle as CDouble, in pDt as CDouble) returns nothing binds to "c:box2dxt>b2lc_body_set_target_transform!cdecl"
private foreign handler _body_enable_sleep(in pB as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_body_enable_sleep!cdecl"
private foreign handler _body_is_sleep_enabled(in pB as CInt) returns CInt binds to "c:box2dxt>b2lc_body_is_sleep_enabled!cdecl"
private foreign handler _body_is_fixed_rotation(in pB as CInt) returns CInt binds to "c:box2dxt>b2lc_body_is_fixed_rotation!cdecl"
private foreign handler _body_enable_contact_events(in pB as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_body_enable_contact_events!cdecl"
private foreign handler _body_enable_hit_events(in pB as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_body_enable_hit_events!cdecl"
private foreign handler _body_aabb_update(in pB as CInt) returns nothing binds to "c:box2dxt>b2lc_body_aabb_update!cdecl"
private foreign handler _aabb_lower_x() returns CDouble binds to "c:box2dxt>b2lc_aabb_lower_x!cdecl"
private foreign handler _aabb_lower_y() returns CDouble binds to "c:box2dxt>b2lc_aabb_lower_y!cdecl"
private foreign handler _aabb_upper_x() returns CDouble binds to "c:box2dxt>b2lc_aabb_upper_x!cdecl"
private foreign handler _aabb_upper_y() returns CDouble binds to "c:box2dxt>b2lc_aabb_upper_y!cdecl"
private foreign handler _body_shape_count(in pB as CInt) returns CInt binds to "c:box2dxt>b2lc_body_shape_count!cdecl"
private foreign handler _body_shape_at(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_body_shape_at!cdecl"
private foreign handler _body_joint_count(in pB as CInt) returns CInt binds to "c:box2dxt>b2lc_body_joint_count!cdecl"
private foreign handler _body_joint_at(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_body_joint_at!cdecl"
-- shape: type / material / filter / event flags / geometry / queries
private foreign handler _shape_type(in pS as CInt) returns CInt binds to "c:box2dxt>b2lc_shape_type!cdecl"
private foreign handler _shape_is_sensor(in pS as CInt) returns CInt binds to "c:box2dxt>b2lc_shape_is_sensor!cdecl"
private foreign handler _shape_density(in pS as CInt) returns CDouble binds to "c:box2dxt>b2lc_shape_density!cdecl"
private foreign handler _shape_friction(in pS as CInt) returns CDouble binds to "c:box2dxt>b2lc_shape_friction!cdecl"
private foreign handler _shape_restitution(in pS as CInt) returns CDouble binds to "c:box2dxt>b2lc_shape_restitution!cdecl"
private foreign handler _shape_material_id(in pS as CInt) returns CInt binds to "c:box2dxt>b2lc_shape_material_id!cdecl"
private foreign handler _shape_set_material_id(in pS as CInt, in pM as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_set_material_id!cdecl"
private foreign handler _shape_set_filter(in pS as CInt, in pCat as CDouble, in pMask as CDouble, in pGroup as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_set_filter!cdecl"
private foreign handler _shape_filter_category(in pS as CInt) returns CDouble binds to "c:box2dxt>b2lc_shape_filter_category!cdecl"
private foreign handler _shape_filter_mask(in pS as CInt) returns CDouble binds to "c:box2dxt>b2lc_shape_filter_mask!cdecl"
private foreign handler _shape_filter_group(in pS as CInt) returns CInt binds to "c:box2dxt>b2lc_shape_filter_group!cdecl"
private foreign handler _shape_enable_sensor_events(in pS as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_enable_sensor_events!cdecl"
private foreign handler _shape_are_sensor_events_enabled(in pS as CInt) returns CInt binds to "c:box2dxt>b2lc_shape_are_sensor_events_enabled!cdecl"
private foreign handler _shape_enable_contact_events(in pS as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_enable_contact_events!cdecl"
private foreign handler _shape_are_contact_events_enabled(in pS as CInt) returns CInt binds to "c:box2dxt>b2lc_shape_are_contact_events_enabled!cdecl"
private foreign handler _shape_enable_hit_events(in pS as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_enable_hit_events!cdecl"
private foreign handler _shape_are_hit_events_enabled(in pS as CInt) returns CInt binds to "c:box2dxt>b2lc_shape_are_hit_events_enabled!cdecl"
private foreign handler _shape_enable_presolve_events(in pS as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_enable_presolve_events!cdecl"
private foreign handler _shape_circle_update(in pS as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_circle_update!cdecl"
private foreign handler _shape_circle_x() returns CDouble binds to "c:box2dxt>b2lc_shape_circle_x!cdecl"
private foreign handler _shape_circle_y() returns CDouble binds to "c:box2dxt>b2lc_shape_circle_y!cdecl"
private foreign handler _shape_circle_radius() returns CDouble binds to "c:box2dxt>b2lc_shape_circle_radius!cdecl"
private foreign handler _shape_capsule_update(in pS as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_capsule_update!cdecl"
private foreign handler _shape_capsule_x1() returns CDouble binds to "c:box2dxt>b2lc_shape_capsule_x1!cdecl"
private foreign handler _shape_capsule_y1() returns CDouble binds to "c:box2dxt>b2lc_shape_capsule_y1!cdecl"
private foreign handler _shape_capsule_x2() returns CDouble binds to "c:box2dxt>b2lc_shape_capsule_x2!cdecl"
private foreign handler _shape_capsule_y2() returns CDouble binds to "c:box2dxt>b2lc_shape_capsule_y2!cdecl"
private foreign handler _shape_capsule_radius() returns CDouble binds to "c:box2dxt>b2lc_shape_capsule_radius!cdecl"
private foreign handler _shape_segment_update(in pS as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_segment_update!cdecl"
private foreign handler _shape_segment_x1() returns CDouble binds to "c:box2dxt>b2lc_shape_segment_x1!cdecl"
private foreign handler _shape_segment_y1() returns CDouble binds to "c:box2dxt>b2lc_shape_segment_y1!cdecl"
private foreign handler _shape_segment_x2() returns CDouble binds to "c:box2dxt>b2lc_shape_segment_x2!cdecl"
private foreign handler _shape_segment_y2() returns CDouble binds to "c:box2dxt>b2lc_shape_segment_y2!cdecl"
private foreign handler _shape_polygon_update(in pS as CInt) returns CInt binds to "c:box2dxt>b2lc_shape_polygon_update!cdecl"
private foreign handler _shape_polygon_count() returns CInt binds to "c:box2dxt>b2lc_shape_polygon_count!cdecl"
private foreign handler _shape_polygon_vx(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_shape_polygon_vx!cdecl"
private foreign handler _shape_polygon_vy(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_shape_polygon_vy!cdecl"
private foreign handler _shape_polygon_radius() returns CDouble binds to "c:box2dxt>b2lc_shape_polygon_radius!cdecl"
private foreign handler _shape_set_circle(in pS as CInt, in pCx as CDouble, in pCy as CDouble, in pR as CDouble) returns nothing binds to "c:box2dxt>b2lc_shape_set_circle!cdecl"
private foreign handler _shape_set_capsule(in pS as CInt, in pX1 as CDouble, in pY1 as CDouble, in pX2 as CDouble, in pY2 as CDouble, in pR as CDouble) returns nothing binds to "c:box2dxt>b2lc_shape_set_capsule!cdecl"
private foreign handler _shape_set_segment(in pS as CInt, in pX1 as CDouble, in pY1 as CDouble, in pX2 as CDouble, in pY2 as CDouble) returns nothing binds to "c:box2dxt>b2lc_shape_set_segment!cdecl"
private foreign handler _shape_set_polygon(in pS as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_set_polygon!cdecl"
private foreign handler _shape_raycast(in pS as CInt, in pX1 as CDouble, in pY1 as CDouble, in pX2 as CDouble, in pY2 as CDouble) returns CInt binds to "c:box2dxt>b2lc_shape_raycast!cdecl"
private foreign handler _shape_ray_x() returns CDouble binds to "c:box2dxt>b2lc_shape_ray_x!cdecl"
private foreign handler _shape_ray_y() returns CDouble binds to "c:box2dxt>b2lc_shape_ray_y!cdecl"
private foreign handler _shape_ray_normal_x() returns CDouble binds to "c:box2dxt>b2lc_shape_ray_normal_x!cdecl"
private foreign handler _shape_ray_normal_y() returns CDouble binds to "c:box2dxt>b2lc_shape_ray_normal_y!cdecl"
private foreign handler _shape_ray_fraction() returns CDouble binds to "c:box2dxt>b2lc_shape_ray_fraction!cdecl"
private foreign handler _shape_aabb_update(in pS as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_aabb_update!cdecl"
private foreign handler _shape_closest_point_x(in pS as CInt, in pTx as CDouble, in pTy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_shape_closest_point_x!cdecl"
private foreign handler _shape_closest_point_y(in pS as CInt, in pTx as CDouble, in pTy as CDouble) returns CDouble binds to "c:box2dxt>b2lc_shape_closest_point_y!cdecl"
private foreign handler _shape_mass_data_update(in pS as CInt) returns nothing binds to "c:box2dxt>b2lc_shape_mass_data_update!cdecl"
private foreign handler _shape_sensor_capacity(in pS as CInt) returns CInt binds to "c:box2dxt>b2lc_shape_sensor_capacity!cdecl"
private foreign handler _shape_sensor_overlaps_update(in pS as CInt) returns CInt binds to "c:box2dxt>b2lc_shape_sensor_overlaps_update!cdecl"
private foreign handler _shape_sensor_overlap_count() returns CInt binds to "c:box2dxt>b2lc_shape_sensor_overlap_count!cdecl"
private foreign handler _shape_sensor_overlap_at(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_shape_sensor_overlap_at!cdecl"
-- chains
private foreign handler _chain_begin() returns nothing binds to "c:box2dxt>b2lc_chain_begin!cdecl"
private foreign handler _chain_add_point(in pX as CDouble, in pY as CDouble) returns nothing binds to "c:box2dxt>b2lc_chain_add_point!cdecl"
private foreign handler _chain_create(in pB as CInt, in pLoop as CInt, in pFriction as CDouble, in pRestitution as CDouble) returns CInt binds to "c:box2dxt>b2lc_chain_create!cdecl"
private foreign handler _chain_destroy(in pC as CInt) returns nothing binds to "c:box2dxt>b2lc_chain_destroy!cdecl"
private foreign handler _chain_is_valid(in pC as CInt) returns CInt binds to "c:box2dxt>b2lc_chain_is_valid!cdecl"
private foreign handler _chain_set_friction(in pC as CInt, in pF as CDouble) returns nothing binds to "c:box2dxt>b2lc_chain_set_friction!cdecl"
private foreign handler _chain_friction(in pC as CInt) returns CDouble binds to "c:box2dxt>b2lc_chain_friction!cdecl"
private foreign handler _chain_set_restitution(in pC as CInt, in pR as CDouble) returns nothing binds to "c:box2dxt>b2lc_chain_set_restitution!cdecl"
private foreign handler _chain_restitution(in pC as CInt) returns CDouble binds to "c:box2dxt>b2lc_chain_restitution!cdecl"
private foreign handler _chain_segment_count(in pC as CInt) returns CInt binds to "c:box2dxt>b2lc_chain_segment_count!cdecl"
private foreign handler _chain_segment_at(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_chain_segment_at!cdecl"
-- joints: generic
private foreign handler _joint_type(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_joint_type!cdecl"
private foreign handler _joint_body_a(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_joint_body_a!cdecl"
private foreign handler _joint_body_b(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_joint_body_b!cdecl"
private foreign handler _joint_local_anchor_a_x(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_joint_local_anchor_a_x!cdecl"
private foreign handler _joint_local_anchor_a_y(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_joint_local_anchor_a_y!cdecl"
private foreign handler _joint_local_anchor_b_x(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_joint_local_anchor_b_x!cdecl"
private foreign handler _joint_local_anchor_b_y(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_joint_local_anchor_b_y!cdecl"
private foreign handler _joint_get_collide_connected(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_joint_get_collide_connected!cdecl"
private foreign handler _joint_set_collide_connected(in pJ as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_joint_set_collide_connected!cdecl"
private foreign handler _joint_constraint_force_x(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_joint_constraint_force_x!cdecl"
private foreign handler _joint_constraint_force_y(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_joint_constraint_force_y!cdecl"
private foreign handler _joint_constraint_torque(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_joint_constraint_torque!cdecl"
private foreign handler _joint_wake_bodies(in pJ as CInt) returns nothing binds to "c:box2dxt>b2lc_joint_wake_bodies!cdecl"
-- joints: motor + filter
private foreign handler _joint_motor(in pW as CInt, in pBa as CInt, in pBb as CInt, in pOffX as CDouble, in pOffY as CDouble, in pAngOff as CDouble, in pMaxForce as CDouble, in pMaxTorque as CDouble, in pCorr as CDouble, in pCollide as CInt) returns CInt binds to "c:box2dxt>b2lc_joint_motor!cdecl"
private foreign handler _motor_set_linear_offset(in pJ as CInt, in pX as CDouble, in pY as CDouble) returns nothing binds to "c:box2dxt>b2lc_motor_set_linear_offset!cdecl"
private foreign handler _motor_linear_offset_x(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_motor_linear_offset_x!cdecl"
private foreign handler _motor_linear_offset_y(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_motor_linear_offset_y!cdecl"
private foreign handler _motor_set_angular_offset(in pJ as CInt, in pA as CDouble) returns nothing binds to "c:box2dxt>b2lc_motor_set_angular_offset!cdecl"
private foreign handler _motor_angular_offset(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_motor_angular_offset!cdecl"
private foreign handler _motor_set_max_force(in pJ as CInt, in pF as CDouble) returns nothing binds to "c:box2dxt>b2lc_motor_set_max_force!cdecl"
private foreign handler _motor_max_force(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_motor_max_force!cdecl"
private foreign handler _motor_set_max_torque(in pJ as CInt, in pT as CDouble) returns nothing binds to "c:box2dxt>b2lc_motor_set_max_torque!cdecl"
private foreign handler _motor_max_torque(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_motor_max_torque!cdecl"
private foreign handler _motor_set_correction_factor(in pJ as CInt, in pC as CDouble) returns nothing binds to "c:box2dxt>b2lc_motor_set_correction_factor!cdecl"
private foreign handler _motor_correction_factor(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_motor_correction_factor!cdecl"
private foreign handler _joint_filter(in pW as CInt, in pBa as CInt, in pBb as CInt) returns CInt binds to "c:box2dxt>b2lc_joint_filter!cdecl"
-- joints: revolute granular
private foreign handler _revolute_enable_spring(in pJ as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_revolute_enable_spring!cdecl"
private foreign handler _revolute_is_spring_enabled(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_revolute_is_spring_enabled!cdecl"
private foreign handler _revolute_set_spring_hertz(in pJ as CInt, in pHz as CDouble) returns nothing binds to "c:box2dxt>b2lc_revolute_set_spring_hertz!cdecl"
private foreign handler _revolute_spring_hertz(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_revolute_spring_hertz!cdecl"
private foreign handler _revolute_set_spring_damping(in pJ as CInt, in pD as CDouble) returns nothing binds to "c:box2dxt>b2lc_revolute_set_spring_damping!cdecl"
private foreign handler _revolute_spring_damping(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_revolute_spring_damping!cdecl"
private foreign handler _revolute_is_limit_enabled(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_revolute_is_limit_enabled!cdecl"
private foreign handler _revolute_lower_limit(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_revolute_lower_limit!cdecl"
private foreign handler _revolute_upper_limit(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_revolute_upper_limit!cdecl"
private foreign handler _revolute_is_motor_enabled(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_revolute_is_motor_enabled!cdecl"
private foreign handler _revolute_set_motor_speed(in pJ as CInt, in pS as CDouble) returns nothing binds to "c:box2dxt>b2lc_revolute_set_motor_speed!cdecl"
private foreign handler _revolute_motor_speed(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_revolute_motor_speed!cdecl"
private foreign handler _revolute_motor_torque(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_revolute_motor_torque!cdecl"
private foreign handler _revolute_set_max_motor_torque(in pJ as CInt, in pT as CDouble) returns nothing binds to "c:box2dxt>b2lc_revolute_set_max_motor_torque!cdecl"
private foreign handler _revolute_max_motor_torque(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_revolute_max_motor_torque!cdecl"
-- joints: prismatic granular
private foreign handler _prismatic_enable_spring(in pJ as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_prismatic_enable_spring!cdecl"
private foreign handler _prismatic_is_spring_enabled(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_prismatic_is_spring_enabled!cdecl"
private foreign handler _prismatic_set_spring_hertz(in pJ as CInt, in pHz as CDouble) returns nothing binds to "c:box2dxt>b2lc_prismatic_set_spring_hertz!cdecl"
private foreign handler _prismatic_spring_hertz(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_prismatic_spring_hertz!cdecl"
private foreign handler _prismatic_set_spring_damping(in pJ as CInt, in pD as CDouble) returns nothing binds to "c:box2dxt>b2lc_prismatic_set_spring_damping!cdecl"
private foreign handler _prismatic_spring_damping(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_prismatic_spring_damping!cdecl"
private foreign handler _prismatic_is_limit_enabled(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_prismatic_is_limit_enabled!cdecl"
private foreign handler _prismatic_lower_limit(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_prismatic_lower_limit!cdecl"
private foreign handler _prismatic_upper_limit(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_prismatic_upper_limit!cdecl"
private foreign handler _prismatic_is_motor_enabled(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_prismatic_is_motor_enabled!cdecl"
private foreign handler _prismatic_set_motor_speed(in pJ as CInt, in pS as CDouble) returns nothing binds to "c:box2dxt>b2lc_prismatic_set_motor_speed!cdecl"
private foreign handler _prismatic_motor_speed(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_prismatic_motor_speed!cdecl"
private foreign handler _prismatic_motor_force(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_prismatic_motor_force!cdecl"
private foreign handler _prismatic_max_motor_force(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_prismatic_max_motor_force!cdecl"
private foreign handler _prismatic_speed(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_prismatic_speed!cdecl"
-- joints: distance granular
private foreign handler _distance_is_spring_enabled(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_distance_is_spring_enabled!cdecl"
private foreign handler _distance_spring_hertz(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_distance_spring_hertz!cdecl"
private foreign handler _distance_spring_damping(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_distance_spring_damping!cdecl"
private foreign handler _distance_is_limit_enabled(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_distance_is_limit_enabled!cdecl"
private foreign handler _distance_min_length(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_distance_min_length!cdecl"
private foreign handler _distance_max_length(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_distance_max_length!cdecl"
private foreign handler _distance_current_length(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_distance_current_length!cdecl"
private foreign handler _distance_enable_motor(in pJ as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_distance_enable_motor!cdecl"
private foreign handler _distance_is_motor_enabled(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_distance_is_motor_enabled!cdecl"
private foreign handler _distance_set_motor_speed(in pJ as CInt, in pS as CDouble) returns nothing binds to "c:box2dxt>b2lc_distance_set_motor_speed!cdecl"
private foreign handler _distance_motor_speed(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_distance_motor_speed!cdecl"
private foreign handler _distance_set_max_motor_force(in pJ as CInt, in pF as CDouble) returns nothing binds to "c:box2dxt>b2lc_distance_set_max_motor_force!cdecl"
private foreign handler _distance_max_motor_force(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_distance_max_motor_force!cdecl"
private foreign handler _distance_motor_force(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_distance_motor_force!cdecl"
-- joints: weld
private foreign handler _weld_reference_angle(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_weld_reference_angle!cdecl"
private foreign handler _weld_set_reference_angle(in pJ as CInt, in pA as CDouble) returns nothing binds to "c:box2dxt>b2lc_weld_set_reference_angle!cdecl"
private foreign handler _weld_linear_hertz(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_weld_linear_hertz!cdecl"
private foreign handler _weld_linear_damping(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_weld_linear_damping!cdecl"
private foreign handler _weld_angular_hertz(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_weld_angular_hertz!cdecl"
private foreign handler _weld_angular_damping(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_weld_angular_damping!cdecl"
-- joints: wheel granular
private foreign handler _wheel_is_spring_enabled(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_wheel_is_spring_enabled!cdecl"
private foreign handler _wheel_spring_hertz(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_wheel_spring_hertz!cdecl"
private foreign handler _wheel_spring_damping(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_wheel_spring_damping!cdecl"
private foreign handler _wheel_enable_limit(in pJ as CInt, in pF as CInt) returns nothing binds to "c:box2dxt>b2lc_wheel_enable_limit!cdecl"
private foreign handler _wheel_is_limit_enabled(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_wheel_is_limit_enabled!cdecl"
private foreign handler _wheel_set_limits(in pJ as CInt, in pLo as CDouble, in pHi as CDouble) returns nothing binds to "c:box2dxt>b2lc_wheel_set_limits!cdecl"
private foreign handler _wheel_lower_limit(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_wheel_lower_limit!cdecl"
private foreign handler _wheel_upper_limit(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_wheel_upper_limit!cdecl"
private foreign handler _wheel_is_motor_enabled(in pJ as CInt) returns CInt binds to "c:box2dxt>b2lc_wheel_is_motor_enabled!cdecl"
private foreign handler _wheel_motor_speed(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_wheel_motor_speed!cdecl"
private foreign handler _wheel_motor_torque(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_wheel_motor_torque!cdecl"
private foreign handler _wheel_max_motor_torque(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_wheel_max_motor_torque!cdecl"
-- joints: mouse granular
private foreign handler _mouse_target_x(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_mouse_target_x!cdecl"
private foreign handler _mouse_target_y(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_mouse_target_y!cdecl"
private foreign handler _mouse_set_spring_hertz(in pJ as CInt, in pHz as CDouble) returns nothing binds to "c:box2dxt>b2lc_mouse_set_spring_hertz!cdecl"
private foreign handler _mouse_spring_hertz(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_mouse_spring_hertz!cdecl"
private foreign handler _mouse_set_spring_damping(in pJ as CInt, in pD as CDouble) returns nothing binds to "c:box2dxt>b2lc_mouse_set_spring_damping!cdecl"
private foreign handler _mouse_spring_damping(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_mouse_spring_damping!cdecl"
private foreign handler _mouse_set_max_force(in pJ as CInt, in pF as CDouble) returns nothing binds to "c:box2dxt>b2lc_mouse_set_max_force!cdecl"
private foreign handler _mouse_max_force(in pJ as CInt) returns CDouble binds to "c:box2dxt>b2lc_mouse_max_force!cdecl"
-- world queries (overlap / ray-cast-all / shape-cast)
private foreign handler _query_overlap_aabb(in pW as CInt, in pX1 as CDouble, in pY1 as CDouble, in pX2 as CDouble, in pY2 as CDouble) returns CInt binds to "c:box2dxt>b2lc_query_overlap_aabb!cdecl"
private foreign handler _query_overlap_point(in pW as CInt, in pX as CDouble, in pY as CDouble) returns CInt binds to "c:box2dxt>b2lc_query_overlap_point!cdecl"
private foreign handler _query_overlap_circle(in pW as CInt, in pCx as CDouble, in pCy as CDouble, in pR as CDouble) returns CInt binds to "c:box2dxt>b2lc_query_overlap_circle!cdecl"
private foreign handler _query_overlap_shape(in pW as CInt, in pRadius as CDouble) returns CInt binds to "c:box2dxt>b2lc_query_overlap_shape!cdecl"
private foreign handler _query_raycast_all(in pW as CInt, in pX1 as CDouble, in pY1 as CDouble, in pX2 as CDouble, in pY2 as CDouble) returns CInt binds to "c:box2dxt>b2lc_query_raycast_all!cdecl"
private foreign handler _query_shapecast(in pW as CInt, in pRadius as CDouble, in pDx as CDouble, in pDy as CDouble) returns CInt binds to "c:box2dxt>b2lc_query_shapecast!cdecl"
private foreign handler _query_count() returns CInt binds to "c:box2dxt>b2lc_query_count!cdecl"
private foreign handler _query_body(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_query_body!cdecl"
private foreign handler _query_shape(in pI as CInt) returns CInt binds to "c:box2dxt>b2lc_query_shape!cdecl"
private foreign handler _query_x(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_query_x!cdecl"
private foreign handler _query_y(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_query_y!cdecl"
private foreign handler _query_normal_x(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_query_normal_x!cdecl"
private foreign handler _query_normal_y(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_query_normal_y!cdecl"
private foreign handler _query_fraction(in pI as CInt) returns CDouble binds to "c:box2dxt>b2lc_query_fraction!cdecl"
-- ---- native loader assist (Linux) ----------------------------------
-- The ONLY three bindings that do NOT target the box2dxt shim: they bind to
-- the platform's own loader/libc (dlopen/dlerror/realpath), resolved from the
-- host process's global symbol table. That is the whole point -- they must
-- be callable BEFORE box2dxt.so is loadable, so a script can preload the
-- shim by absolute path. On Linux the engine hands the bare name
-- "box2dxt.so" to dlopen and never searches the stack's folder; preloading
-- the exact file first puts it in the process, so the engine's later
-- bare-name load finds the already-resident copy (matched by soname --
-- build with -DBOX2DXT_BARE_SONAME=ON so that soname is "box2dxt.so").
-- Bindings resolve on first use, so these are harmless dead weight on
-- Windows/macOS as long as nothing calls them there (the engine already
-- finds the library next to the stack on those platforms).
-- If OXT cannot bind "c:>dlopen", swap the empty library token for your
-- libc: glibc >= 2.34 -> "c:libc.so.6>dlopen!cdecl"; older glibc or where
-- dlopen still lives in libdl -> "c:libdl.so.2>dlopen!cdecl".
private foreign handler _dlopen(in pPath as ZStringNative, in pFlags as CInt) returns optional Pointer binds to "c:>dlopen!cdecl"
private foreign handler _dlerror() returns optional ZStringNative binds to "c:>dlerror!cdecl"
-- realpath("/proc/self/exe", nil) -> the running engine's own executable path
-- on Linux; used by the b2LoadNativeLibHere helper below to locate the engine
-- folder. Returns nothing off Linux (no /proc). Only ever called on Linux.
private foreign handler _realpath(in pPath as ZStringNative, in pResolved as optional Pointer) returns optional ZStringNative binds to "c:>realpath!cdecl"
-- small bool -> int helper (no foreign call, so no unsafe needed)
private handler bi(in pB as Boolean) returns Integer
if pB then
return 1
end if
return 0
end handler
-- ---- engine-folder preload (Linux helper) --------------------------
-- Locate the running engine's OWN folder (realpath /proc/self/exe), strip to
-- its directory, and preload "<dir>/box2dxt.so" by absolute path -- so a user
-- can just drop the library beside the OXT engine (or bundle it in a
-- standalone) and a later bare-name bind resolves to it (no /usr/lib, no sudo,
-- no LD_LIBRARY_PATH). Returns 1 if a library was loaded, else 0.
--
-- LINUX ONLY, and deliberately NOT auto-fired: realpath/dlopen are POSIX, so
-- call this ONLY when the platform is Linux (e.g. the Kit gates it with
-- `the platform is "Linux"`). It is intentionally NOT invoked from
-- b2Version/checkABI -- those run on every platform, and touching the POSIX
-- bindings on Windows/macOS would error (those platforms already load the
-- library from beside the stack/app anyway). Requires the library's soname to
-- be "box2dxt.so" (-DBOX2DXT_BARE_SONAME) or the resident copy will not match
-- the engine's bare-name request.
public handler b2LoadNativeLibHere() returns Integer
variable tExe as optional String
variable tPath as String
variable tLen as Integer
variable tCut as Integer
variable i as Integer
variable tLib as String
variable tHandle as optional Pointer
unsafe
put _realpath("/proc/self/exe", nothing) into tExe
end unsafe
if tExe is nothing then
return 0
end if
put tExe into tPath
put the number of chars in tPath into tLen
put 0 into tCut
repeat with i from 1 up to tLen
if char i of tPath is "/" then
put i into tCut
end if
end repeat
if tCut is 0 then
return 0
end if
put char 1 to tCut of tPath into tLib
put tLib & "box2dxt.so" into tLib
unsafe
put _dlopen(tLib, 258) into tHandle
end unsafe
if tHandle is nothing then
return 0
end if
return 1
end handler
-- =====================================================================
-- Public API (callable from xTalk / OpenXTalk Script)
-- =====================================================================
public handler b2Version() returns Integer
variable tR as Integer
unsafe
put _abi_version() into tR
end unsafe
return tR
end handler
-- This binding targets shim ABI 4. A mismatched libbox2dxt would otherwise
-- surface as an opaque crash on whichever call hits the skew first; checking
-- at world creation (the gateway every script goes through) turns it into a
-- clear, catchable error instead.
private handler checkABI()
variable tV as Integer
unsafe
put _abi_version() into tV
end unsafe
if tV is not 4 then
throw "box2dxt: incompatible native library (binding needs ABI 4) - update libbox2dxt / box2dxt.dll"
end if
end handler
-- ---- native loader assist -------------------------------------------
-- Preload the native shim by ABSOLUTE path so the engine's later bare-name
-- load resolves to the already-resident copy. Lets a Linux script point at
-- box2dxt.so sitting next to the stack (no /usr/lib, no sudo, no
-- LD_LIBRARY_PATH). Returns 1 on success, 0 on failure (then call
-- b2LoadNativeLibError for the reason). The library MUST have been built
-- with a soname of "box2dxt.so" (see -DBOX2DXT_BARE_SONAME) or the match
-- fails silently. Flags 258 = RTLD_NOW (2) | RTLD_GLOBAL (256) on Linux:
-- resolve every symbol now and expose them globally so the bare-name
-- bindings bind to them. Intended for Linux; gate the call to Linux when
-- wiring it into the Kit (the dlopen binding will not resolve on Windows).
public handler b2LoadNativeLib(in pPath as String) returns Integer
variable tHandle as optional Pointer
unsafe
put _dlopen(pPath, 258) into tHandle
end unsafe
if tHandle is nothing then
return 0
end if
return 1
end handler
-- The last loader error string ("" if none) -- makes a failed
-- b2LoadNativeLib self-diagnosing (wrong path vs. could-not-load) instead
-- of a bare 0.
public handler b2LoadNativeLibError() returns String
variable tErr as optional String
unsafe
put _dlerror() into tErr
end unsafe
if tErr is nothing then
return ""
end if
return tErr
end handler
-- ---- world ----------------------------------------------------------
public handler b2NewWorld(in pGravityX as Number, in pGravityY as Number, in pAllowSleep as Boolean, in pContinuous as Boolean) returns Integer
variable tR as Integer
checkABI()
unsafe
put _world_create(pGravityX, pGravityY, bi(pAllowSleep), bi(pContinuous)) into tR
end unsafe
return tR
end handler
public handler b2NewThreadedWorld(in pGravityX as Number, in pGravityY as Number, in pAllowSleep as Boolean, in pContinuous as Boolean, in pWorkers as Integer) returns Integer
variable tR as Integer
checkABI()
unsafe
put _world_create_threaded(pGravityX, pGravityY, bi(pAllowSleep), bi(pContinuous), pWorkers) into tR
end unsafe
return tR
end handler
public handler b2WorldThreadCount(in pWorld as Integer) returns Integer
variable tR as Integer
unsafe
put _world_thread_count(pWorld) into tR
end unsafe
return tR
end handler
public handler b2DestroyWorld(in pWorld as Integer)
unsafe
_world_destroy(pWorld)
end unsafe
end handler
public handler b2SetGravity(in pWorld as Integer, in pGx as Number, in pGy as Number)
unsafe
_world_set_gravity(pWorld, pGx, pGy)
end unsafe
end handler
public handler b2EnableSleeping(in pWorld as Integer, in pFlag as Boolean)
unsafe
_world_enable_sleeping(pWorld, bi(pFlag))
end unsafe
end handler
public handler b2EnableContinuous(in pWorld as Integer, in pFlag as Boolean)
unsafe
_world_enable_continuous(pWorld, bi(pFlag))
end unsafe
end handler
-- pSubSteps is the Soft Step sub-step count (4 is a good default).
public handler b2Step(in pWorld as Integer, in pDt as Number, in pSubSteps as Integer)
unsafe
_world_step(pWorld, pDt, pSubSteps)
end unsafe
end handler
-- ---- bodies ----------------------------------------------------------
public handler b2NewBody(in pWorld as Integer, in pType as Integer, in pX as Number, in pY as Number, in pAngle as Number, in pBullet as Boolean, in pFixedRotation as Boolean) returns Integer
variable tR as Integer
unsafe
put _body_create(pWorld, pType, pX, pY, pAngle, bi(pBullet), bi(pFixedRotation)) into tR
end unsafe
return tR
end handler
public handler b2NewStaticBody(in pWorld as Integer, in pX as Number, in pY as Number) returns Integer
return b2NewBody(pWorld, 0, pX, pY, 0, false, false)
end handler
public handler b2NewKinematicBody(in pWorld as Integer, in pX as Number, in pY as Number) returns Integer
return b2NewBody(pWorld, 1, pX, pY, 0, false, false)
end handler
public handler b2NewDynamicBody(in pWorld as Integer, in pX as Number, in pY as Number) returns Integer
return b2NewBody(pWorld, 2, pX, pY, 0, false, false)
end handler
public handler b2DestroyBody(in pBody as Integer)
unsafe
_body_destroy(pBody)
end unsafe
end handler
public handler b2BodyX(in pBody as Integer) returns Number
variable tR as Number
unsafe
put _body_x(pBody) into tR
end unsafe
return tR
end handler
public handler b2BodyY(in pBody as Integer) returns Number
variable tR as Number
unsafe
put _body_y(pBody) into tR
end unsafe
return tR
end handler
public handler b2BodyAngle(in pBody as Integer) returns Number
variable tR as Number
unsafe
put _body_angle(pBody) into tR
end unsafe
return tR
end handler
public handler b2BodyVX(in pBody as Integer) returns Number
variable tR as Number
unsafe
put _body_vx(pBody) into tR
end unsafe
return tR
end handler
public handler b2BodyVY(in pBody as Integer) returns Number
variable tR as Number
unsafe
put _body_vy(pBody) into tR
end unsafe
return tR
end handler
public handler b2BodyAngularVelocity(in pBody as Integer) returns Number
variable tR as Number
unsafe
put _body_omega(pBody) into tR
end unsafe
return tR
end handler
public handler b2BodyMass(in pBody as Integer) returns Number
variable tR as Number
unsafe
put _body_mass(pBody) into tR
end unsafe
return tR
end handler
public handler b2BodyIsAwake(in pBody as Integer) returns Boolean
variable tR as Integer
unsafe
put _body_is_awake(pBody) into tR
end unsafe
return tR is 1
end handler
public handler b2BodyWorldCenterX(in pBody as Integer) returns Number
variable tR as Number
unsafe
put _body_world_center_x(pBody) into tR
end unsafe
return tR
end handler
public handler b2BodyWorldCenterY(in pBody as Integer) returns Number
variable tR as Number
unsafe
put _body_world_center_y(pBody) into tR
end unsafe
return tR
end handler
public handler b2BodyType(in pBody as Integer) returns Integer
variable tR as Integer
unsafe
put _body_type(pBody) into tR
end unsafe
return tR
end handler
public handler b2BodyIsBullet(in pBody as Integer) returns Boolean
variable tR as Integer
unsafe
put _body_is_bullet(pBody) into tR
end unsafe
return tR is 1
end handler
public handler b2BodyIsEnabled(in pBody as Integer) returns Boolean
variable tR as Integer
unsafe
put _body_is_enabled(pBody) into tR
end unsafe
return tR is 1
end handler
public handler b2BodyLinearDamping(in pBody as Integer) returns Number
variable tR as Number
unsafe
put _body_linear_damping(pBody) into tR
end unsafe
return tR
end handler
public handler b2BodyAngularDamping(in pBody as Integer) returns Number
variable tR as Number
unsafe
put _body_angular_damping(pBody) into tR
end unsafe
return tR
end handler
public handler b2BodyGravityScale(in pBody as Integer) returns Number
variable tR as Number
unsafe
put _body_gravity_scale(pBody) into tR
end unsafe
return tR
end handler
public handler b2SetTransform(in pBody as Integer, in pX as Number, in pY as Number, in pAngle as Number)
unsafe
_body_set_transform(pBody, pX, pY, pAngle)
end unsafe
end handler
public handler b2SetVelocity(in pBody as Integer, in pVx as Number, in pVy as Number)
unsafe
_body_set_velocity(pBody, pVx, pVy)
end unsafe
end handler
public handler b2SetAngularVelocity(in pBody as Integer, in pOmega as Number)
unsafe
_body_set_angular_velocity(pBody, pOmega)
end unsafe
end handler
public handler b2ApplyForce(in pBody as Integer, in pFx as Number, in pFy as Number, in pWake as Boolean)
unsafe
_body_apply_force(pBody, pFx, pFy, bi(pWake))
end unsafe
end handler
public handler b2ApplyImpulse(in pBody as Integer, in pIx as Number, in pIy as Number, in pWake as Boolean)
unsafe
_body_apply_impulse(pBody, pIx, pIy, bi(pWake))
end unsafe
end handler
public handler b2ApplyTorque(in pBody as Integer, in pTorque as Number, in pWake as Boolean)
unsafe
_body_apply_torque(pBody, pTorque, bi(pWake))
end unsafe
end handler
public handler b2ApplyAngularImpulse(in pBody as Integer, in pImpulse as Number, in pWake as Boolean)
unsafe
_body_apply_angular_impulse(pBody, pImpulse, bi(pWake))
end unsafe
end handler
public handler b2SetBullet(in pBody as Integer, in pFlag as Boolean)
unsafe
_body_set_bullet(pBody, bi(pFlag))
end unsafe
end handler
public handler b2SetAwake(in pBody as Integer, in pFlag as Boolean)
unsafe
_body_set_awake(pBody, bi(pFlag))
end unsafe
end handler
public handler b2SetFixedRotation(in pBody as Integer, in pFlag as Boolean)
unsafe
_body_set_fixed_rotation(pBody, bi(pFlag))
end unsafe
end handler
public handler b2SetBodyType(in pBody as Integer, in pType as Integer)
unsafe
_body_set_type(pBody, pType)
end unsafe
end handler
public handler b2SetLinearDamping(in pBody as Integer, in pDamping as Number)
unsafe
_body_set_linear_damping(pBody, pDamping)
end unsafe
end handler
public handler b2SetAngularDamping(in pBody as Integer, in pDamping as Number)
unsafe
_body_set_angular_damping(pBody, pDamping)
end unsafe
end handler
public handler b2SetGravityScale(in pBody as Integer, in pScale as Number)
unsafe
_body_set_gravity_scale(pBody, pScale)
end unsafe
end handler
public handler b2SetSleepThreshold(in pBody as Integer, in pThreshold as Number)
unsafe
_body_set_sleep_threshold(pBody, pThreshold)
end unsafe
end handler
public handler b2EnableBody(in pBody as Integer)
unsafe
_body_enable(pBody)
end unsafe
end handler
public handler b2DisableBody(in pBody as Integer)
unsafe
_body_disable(pBody)
end unsafe
end handler
-- ---- shapes ----------------------------------------------------------
public handler b2AddBox(in pBody as Integer, in pHalfW as Number, in pHalfH as Number, in pDensity as Number, in pFriction as Number, in pRestitution as Number) returns Integer
variable tR as Integer
unsafe
put _shape_add_box(pBody, pHalfW, pHalfH, pDensity, pFriction, pRestitution) into tR
end unsafe
return tR
end handler
public handler b2AddCircle(in pBody as Integer, in pCx as Number, in pCy as Number, in pRadius as Number, in pDensity as Number, in pFriction as Number, in pRestitution as Number) returns Integer
variable tR as Integer
unsafe
put _shape_add_circle(pBody, pCx, pCy, pRadius, pDensity, pFriction, pRestitution) into tR
end unsafe
return tR
end handler
public handler b2AddCapsule(in pBody as Integer, in pX1 as Number, in pY1 as Number, in pX2 as Number, in pY2 as Number, in pRadius as Number, in pDensity as Number, in pFriction as Number, in pRestitution as Number) returns Integer
variable tR as Integer
unsafe
put _shape_add_capsule(pBody, pX1, pY1, pX2, pY2, pRadius, pDensity, pFriction, pRestitution) into tR
end unsafe
return tR
end handler
public handler b2AddSegment(in pBody as Integer, in pX1 as Number, in pY1 as Number, in pX2 as Number, in pY2 as Number, in pFriction as Number, in pRestitution as Number) returns Integer
variable tR as Integer
unsafe
put _shape_add_segment(pBody, pX1, pY1, pX2, pY2, pFriction, pRestitution) into tR
end unsafe
return tR
end handler
public handler b2PolyBegin()
unsafe
_poly_begin()
end unsafe
end handler
public handler b2PolyAddPoint(in pX as Number, in pY as Number)
unsafe
_poly_add(pX, pY)
end unsafe
end handler
public handler b2AddPolygon(in pBody as Integer, in pDensity as Number, in pFriction as Number, in pRestitution as Number) returns Integer
variable tR as Integer
unsafe
put _shape_add_polygon(pBody, pDensity, pFriction, pRestitution) into tR
end unsafe
return tR
end handler
public handler b2DestroyShape(in pShape as Integer)
unsafe
_shape_destroy(pShape)
end unsafe
end handler
public handler b2SetShapeFriction(in pShape as Integer, in pFriction as Number)
unsafe
_shape_set_friction(pShape, pFriction)
end unsafe
end handler
public handler b2SetShapeRestitution(in pShape as Integer, in pRestitution as Number)
unsafe
_shape_set_restitution(pShape, pRestitution)
end unsafe
end handler
public handler b2SetShapeDensity(in pShape as Integer, in pDensity as Number)
unsafe
_shape_set_density(pShape, pDensity)
end unsafe
end handler
public handler b2ShapeBody(in pShape as Integer) returns Integer
variable tR as Integer
unsafe
put _shape_body(pShape) into tR
end unsafe
return tR
end handler
public handler b2ShapeTestPoint(in pShape as Integer, in pX as Number, in pY as Number) returns Boolean
variable tR as Integer
unsafe
put _shape_test_point(pShape, pX, pY) into tR
end unsafe
return tR is 1
end handler
-- ---- joints ----------------------------------------------------------
public handler b2RevoluteJoint(in pWorld as Integer, in pBodyA as Integer, in pBodyB as Integer, in pAx as Number, in pAy as Number, in pBx as Number, in pBy as Number, in pCollide as Boolean) returns Integer
variable tR as Integer
unsafe
put _joint_revolute(pWorld, pBodyA, pBodyB, pAx, pAy, pBx, pBy, bi(pCollide)) into tR