-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathammo.idl
2378 lines (2015 loc) · 89.5 KB
/
ammo.idl
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
interface TopLevelFunctions {
[Value] static btVector3 quatRotate_([Const, Ref] btQuaternion rotation, [Const, Ref] btVector3 v);
static void set_gContactAddedCallback(VoidPtr cb);
};
interface AdapterFunctions {
static void setInternalTickCallback(btDynamicsWorld world, VoidPtr cb, optional VoidPtr worldUserInfo, optional boolean isPreTick);
};
interface Clone {
static btVector3 Vector3([Const, Ref] btVector3 v);
static btQuaternion Quaternion([Const, Ref] btQuaternion q);
};
// Linear Math
interface btIDebugDraw {
void drawLine([Const, Ref] btVector3 from, [Const, Ref] btVector3 to, [Const, Ref] btVector3 color);
void drawContactPoint([Const, Ref] btVector3 pointOnB, [Const, Ref] btVector3 normalOnB, float distance, long lifeTime, [Const, Ref] btVector3 color);
void reportErrorWarning([Const] DOMString warningString);
void draw3dText([Const, Ref] btVector3 location, [Const] DOMString textString);
void setDebugMode(long debugMode);
long getDebugMode();
};
[JSImplementation="btIDebugDraw"]
interface DebugDrawer {
void DebugDrawer();
void drawLine([Const, Ref] btVector3 from, [Const, Ref] btVector3 to, [Const, Ref] btVector3 color);
void drawContactPoint([Const, Ref] btVector3 pointOnB, [Const, Ref] btVector3 normalOnB, float distance, long lifeTime, [Const, Ref] btVector3 color);
void reportErrorWarning([Const] DOMString warningString);
void draw3dText([Const, Ref] btVector3 location, [Const] DOMString textString);
void setDebugMode(long debugMode);
[Const] long getDebugMode();
};
interface btVector3 {
void btVector3();
// void btVector3([Const, Ref] btVector3 v);
void btVector3(float x, float y, float z);
float length();
float x();
float y();
float z();
void setX(float x);
void setY(float y);
void setZ(float z);
void setValue(float x, float y, float z);
void normalize();
[Value] btVector3 normalized();
[Value] btVector3 rotate([Const, Ref] btVector3 wAxis, [Const] float angle);
float dot([Ref] btVector3 v);
float angle([Const, Ref] btVector3 v);
[Value] btVector3 absolute();
[Value] btVector3 cross([Const, Ref] btVector3 v);
float triple([Const, Ref] btVector3 v1, [Const, Ref] btVector3 v2);
long minAxis();
long maxAxis();
long furthestAxis();
long closestAxis();
void setInterpolate3([Const, Ref] btVector3 v0, [Const, Ref] btVector3 v1, float rt);
// [Value] btVector3 lerp([Const, Ref] btVector3 v, [Const, Ref] float t);
[Operator="*=", Ref] btVector3 op_mul(float x);
[Operator="+=", Ref] btVector3 op_add([Ref] btVector3 v);
[Operator="-=", Ref] btVector3 op_sub([Ref] btVector3 v);
};
interface btVector4 {
void btVector4();
void btVector4(float x, float y, float z, float w);
float w();
[Value] btVector4 absolute4();
long maxAxis4();
long minAxis4();
long closestAxis4();
[Operator="="] void op_set([Const, Ref] btVector4 v);
// cannot be included because btVector4 doesn't implement btVector3::setValue(x, y, z)
// void setValue(float x, float y, float z, float w);
float length();
float x();
float y();
float z();
void setX(float x);
void setY(float y);
void setZ(float z);
void normalize();
[Value] btVector3 normalized();
[Value] btVector3 rotate([Const, Ref] btVector3 wAxis, [Const] float angle);
float dot([Ref] btVector3 v);
float angle([Const, Ref] btVector3 v);
[Value] btVector3 absolute();
[Value] btVector3 cross([Const, Ref] btVector3 v);
float triple([Const, Ref] btVector3 v1, [Const, Ref] btVector3 v2);
long minAxis();
long maxAxis();
long furthestAxis();
long closestAxis();
void setInterpolate3([Const, Ref] btVector3 v0, [Const, Ref] btVector3 v1, float rt);
// [Value] btVector3 lerp([Const, Ref] btVector3 v, [Const, Ref] float t);
[Operator="*=", Ref] btVector3 op_mul(float x);
[Operator="+=", Ref] btVector3 op_add([Ref] btVector3 v);
[Operator="-=", Ref] btVector3 op_sub([Ref] btVector3 v);
};
// //btVector4 implements btVector3;
interface btQuadWord {
float x();
float y();
float z();
float w();
void setX(float x);
void setY(float y);
void setZ(float z);
void setW(float w);
};
interface btQuaternion {
void btQuaternion();
// void btQuaternion([Const, Ref] btQuaternion q);
void btQuaternion(float x, float y, float z, float w);
void setValue(float x, float y, float z, float w);
void setEulerZYX(float z, float y, float x);
void setRotation([Ref] btVector3 axis, float angle);
void normalize();
float length2();
float length();
float dot([Ref] btQuaternion q);
[Value] btQuaternion normalized();
[Value] btVector3 getAxis();
[Value] btQuaternion inverse();
float getAngle();
float getAngleShortestPath();
float angle([Ref] btQuaternion q);
float angleShortestPath([Ref] btQuaternion q);
[Operator="+=", Ref] btQuaternion op_add([Ref] btQuaternion q);
[Operator="-=", Ref] btQuaternion op_sub([Ref] btQuaternion q);
[Operator="*=", Ref] btQuaternion op_mul(float s);
[Operator="*=", Ref] btQuaternion op_mulq([Ref] btQuaternion q);
[Operator="/=", Ref] btQuaternion op_div(float s);
};
btQuaternion implements btQuadWord;
interface btMatrix3x3 {
void setEulerZYX(float ex, float ey, float ez);
void getRotation([Ref] btQuaternion q);
[Value] btVector3 getRow(long y);
};
interface btTransform {
void btTransform();
void btTransform([Ref] btQuaternion q, [Ref] btVector3 v);
void setIdentity();
void setOrigin([Ref] btVector3 origin);
void setRotation([Ref] btQuaternion rotation);
[Ref] btVector3 getOrigin();
[Value] btQuaternion getRotation();
[Ref] btMatrix3x3 getBasis();
void setFromOpenGLMatrix(float[] m);
[Value] btTransform inverse();
[Operator="*=", Ref] btTransform op_mul([Ref] btTransform t);
};
interface btMotionState {
void getWorldTransform([Ref] btTransform worldTrans);
void setWorldTransform([Ref] btTransform worldTrans);
};
[JSImplementation="btMotionState"]
interface MotionState {
void MotionState();
[Const] void getWorldTransform([Ref] btTransform worldTrans);
void setWorldTransform([Const, Ref] btTransform worldTrans);
};
interface btDefaultMotionState {
void btDefaultMotionState([Ref] optional btTransform startTrans, [Ref] optional btTransform centerOfMassOffset);
[Value] attribute btTransform m_graphicsWorldTrans;
};
btDefaultMotionState implements btMotionState;
interface btSpatialForceVector {
[Value] attribute btVector3 m_topVec;
[Value] attribute btVector3 m_bottomVec;
//
void btSpatialForceVector();
void btSpatialForceVector([Const, Ref] btVector3 angular, [Const, Ref] btVector3 linear);
// void btSpatialForceVector([Const, Ref] float ax, [Const, Ref] float ay, [Const, Ref] float az, [Const, Ref] float lx, [Const, Ref] float ly, [Const, Ref] float lz);
//
void setVector([Const, Ref] btVector3 angular, [Const, Ref] btVector3 linear);
// void setValue([Const, Ref] float ax, [Const, Ref] float ay, [Const, Ref] float az, [Const, Ref] float lx, [Const, Ref] float ly, [Const, Ref] float lz);
//
void addVector([Const, Ref] btVector3 angular, [Const, Ref] btVector3 linear);
// void addValue([Const, Ref] float ax, [Const, Ref] float ay, [Const, Ref] float az, [Const, Ref] float lx, [Const, Ref] float ly, [Const, Ref] float lz);
//
[Const, Ref] btVector3 getLinear();
[Const, Ref] btVector3 getAngular();
//
void setLinear([Const, Ref] btVector3 linear);
void setAngular([Const, Ref] btVector3 angular);
//
void addAngular([Const, Ref] btVector3 angular);
void addLinear([Const, Ref] btVector3 linear);
//
void setZero();
//
[Operator="+=", Ref] btSpatialForceVector op_add([Const, Ref] btSpatialForceVector vec);
[Operator="-=", Ref] btSpatialForceVector op_sub([Const, Ref] btSpatialForceVector vec);
};
interface btSpatialMotionVector
{
[Value] attribute btVector3 m_topVec;
[Value] attribute btVector3 m_bottomVec;
void btSpatialMotionVector();
void btSpatialMotionVector([Const, Ref] btVector3 angular, [Const, Ref] btVector3 linear);
void setVector([Const, Ref] btVector3 angular, [Const, Ref] btVector3 linear);
// void setValue([Const, Ref] float ax, [Const, Ref] float ay, [Const, Ref] float az, [Const, Ref] float lx, [Const, Ref] float ly, [Const, Ref] float lz);
void addVector([Const, Ref] btVector3 angular, [Const, Ref] btVector3 linear);
// void addValue([Const, Ref] float ax, [Const, Ref] float ay, [Const, Ref] float az, [Const, Ref] float lx, [Const, Ref] float ly, [Const, Ref] float lz);
[Const, Ref] btVector3 getAngular();
[Const, Ref] btVector3 getLinear();
void setAngular([Const, Ref] btVector3 angular);
void setLinear([Const, Ref] btVector3 linear);
void addAngular([Const, Ref] btVector3 angular);
void addLinear([Const, Ref] btVector3 linear);
void setZero();
float dot([Const, Ref] btSpatialForceVector b);
[Operator="+=", Ref] btSpatialMotionVector op_add([Const, Ref] btSpatialMotionVector vec);
[Operator="-=", Ref] btSpatialMotionVector op_sub([Const, Ref] btSpatialMotionVector vec);
// [Operator="*=", Ref] btSpatialMotionVector op_mul([Const, Ref] float s);
};
interface btSymmetricSpatialDyad {
[Value] attribute btMatrix3x3 m_topLeftMat;
[Value] attribute btMatrix3x3 m_topRightMat;
[Value] attribute btMatrix3x3 m_bottomLeftMat;
void btSymmetricSpatialDyad();
void btSymmetricSpatialDyad([Const, Ref] btMatrix3x3 topLeftMat, [Const, Ref] btMatrix3x3 topRightMat, [Const, Ref] btMatrix3x3 bottomLeftMat);
void setMatrix([Const, Ref] btMatrix3x3 topLeftMat, [Const, Ref] btMatrix3x3 topRightMat, [Const, Ref] btMatrix3x3 bottomLeftMat);
void addMatrix([Const, Ref] btMatrix3x3 topLeftMat, [Const, Ref] btMatrix3x3 topRightMat, [Const, Ref] btMatrix3x3 bottomLeftMat);
void setIdentity();
[Operator="-=", Ref] btSymmetricSpatialDyad op_sub([Const, Ref] btSymmetricSpatialDyad mat);
};
// Collision
enum btCollisionObject_CollisionFlags {
"btCollisionObject::CF_DYNAMIC_OBJECT",
"btCollisionObject::CF_STATIC_OBJECT",
"btCollisionObject::CF_KINEMATIC_OBJECT",
"btCollisionObject::CF_NO_CONTACT_RESPONSE",
"btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK", //this allows per-triangle material (friction/restitution)
"btCollisionObject::CF_CHARACTER_OBJECT",
"btCollisionObject::CF_DISABLE_VISUALIZE_OBJECT", //disable debug drawing
"btCollisionObject::CF_DISABLE_SPU_COLLISION_PROCESSING", //disable parallel/SPU processing
"btCollisionObject::CF_HAS_CONTACT_STIFFNESS_DAMPING",
"btCollisionObject::CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR",
"btCollisionObject::CF_HAS_FRICTION_ANCHOR",
"btCollisionObject::CF_HAS_COLLISION_SOUND_TRIGGER"
};
enum btCollisionObject_CollisionObjectTypes {
"btCollisionObject::CO_COLLISION_OBJECT",
"btCollisionObject::CO_RIGID_BODY",
"btCollisionObject::CO_GHOST_OBJECT",
"btCollisionObject::CO_SOFT_BODY",
"btCollisionObject::CO_HF_FLUID",
"btCollisionObject::CO_USER_TYPE",
"btCollisionObject::CO_FEATHERSTONE_LINK"
};
enum btCollisionObject_AnisotropicFrictionFlags {
"btCollisionObject::CF_ANISOTROPIC_FRICTION_DISABLED",
"btCollisionObject::CF_ANISOTROPIC_FRICTION",
"btCollisionObject::CF_ANISOTROPIC_ROLLING_FRICTION"
};
interface btCollisionObject {
[Const, Ref] btVector3 getAnisotropicFriction();
void setAnisotropicFriction([Const, Ref] btVector3 anisotropicFriction, long frictionMode);
boolean hasAnisotropicFriction(optional long frictionMode);
btCollisionShape getCollisionShape();
float getContactProcessingThreshold();
void setContactProcessingThreshold(float contactProcessingThreshold);
long getActivationState();
void setActivationState(long newState);
void forceActivationState(long newState);
void activate(optional boolean forceActivation);
void setDeactivationTime(float time);
float getDeactivationTime();
boolean isActive();
boolean isKinematicObject();
boolean isStaticObject();
boolean isStaticOrKinematicObject();
[Const] float getRestitution();
[Const] float getFriction();
[Const] float getRollingFriction();
float getSpinningFriction();
float getContactStiffness();
float getContactDamping();
void setRestitution(float rest);
void setFriction(float frict);
void setRollingFriction(float frict);
void setSpinningFriction(float frict);
void setContactStiffnessAndDamping(float stiffness, float damping);
[Ref] btTransform getWorldTransform();
long getCollisionFlags();
void setCollisionFlags(long flags);
void setWorldTransform([Const, Ref] btTransform worldTrans);
void setCollisionShape(btCollisionShape collisionShape);
void setCcdMotionThreshold (float ccdMotionThreshold);
void setCcdSweptSphereRadius (float radius);
long getUserIndex();
long getUserIndex2();
long getUserIndex3();
void setUserIndex(long index);
void setUserIndex2(long index);
void setUserIndex3(long index);
VoidPtr getUserPointer();
void setUserPointer(VoidPtr userPointer);
[Const] btBroadphaseProxy getBroadphaseHandle();
};
[NoDelete]
interface btCollisionObjectWrapper {
[Const, Ref] btTransform getWorldTransform();
[Const] btCollisionObject getCollisionObject();
[Const] btCollisionShape getCollisionShape();
};
[Prefix="btCollisionWorld::"]
interface RayResultCallback {
// abstract base class, no constructor
boolean hasHit();
attribute long m_collisionFilterGroup;
attribute long m_collisionFilterMask;
attribute float m_closestHitFraction;
[Const] attribute btCollisionObject m_collisionObject;
attribute unsigned long m_flags;
};
[Prefix="btCollisionWorld::"]
interface ClosestRayResultCallback {
void ClosestRayResultCallback([Const, Ref] btVector3 from, [Const, Ref] btVector3 to);
[Value] attribute btVector3 m_rayFromWorld;
[Value] attribute btVector3 m_rayToWorld;
[Value] attribute btVector3 m_hitNormalWorld;
[Value] attribute btVector3 m_hitPointWorld;
};
ClosestRayResultCallback implements RayResultCallback;
interface btConstCollisionObjectArray {
long size();
[Const] btCollisionObject at(long n);
};
interface btScalarArray {
long size();
float at(long n);
};
[Prefix="btCollisionWorld::"]
interface AllHitsRayResultCallback {
void AllHitsRayResultCallback([Const, Ref] btVector3 from, [Const, Ref] btVector3 to);
[Value] attribute btConstCollisionObjectArray m_collisionObjects;
[Value] attribute btVector3 m_rayFromWorld;
[Value] attribute btVector3 m_rayToWorld;
[Value] attribute btVector3Array m_hitNormalWorld;
[Value] attribute btVector3Array m_hitPointWorld;
[Value] attribute btScalarArray m_hitFractions;
};
AllHitsRayResultCallback implements RayResultCallback;
interface btManifoldPoint {
[Const, Ref] btVector3 getPositionWorldOnA();
[Const, Ref] btVector3 getPositionWorldOnB();
[Const] double getAppliedImpulse();
[Const] double getDistance();
[Value] attribute btVector3 m_localPointA;
[Value] attribute btVector3 m_localPointB;
[Value] attribute btVector3 m_positionWorldOnB;
[Value] attribute btVector3 m_positionWorldOnA;
[Value] attribute btVector3 m_normalWorldOnB;
// Contact callback support
attribute any m_userPersistentData;
};
[Prefix="btCollisionWorld::"]
interface ContactResultCallback {
float addSingleResult([Ref] btManifoldPoint cp, [Const] btCollisionObjectWrapper colObj0Wrap, long partId0, long index0, [Const] btCollisionObjectWrapper colObj1Wrap, long partId1, long index1);
};
[JSImplementation="ContactResultCallback"]
interface ConcreteContactResultCallback {
void ConcreteContactResultCallback();
float addSingleResult([Ref] btManifoldPoint cp, [Const] btCollisionObjectWrapper colObj0Wrap, long partId0, long index0, [Const] btCollisionObjectWrapper colObj1Wrap, long partId1, long index1);
};
[Prefix="btCollisionWorld::"]
interface LocalShapeInfo {
attribute long m_shapePart;
attribute long m_triangleIndex;
};
[Prefix="btCollisionWorld::"]
interface LocalConvexResult {
void LocalConvexResult([Const] btCollisionObject hitCollisionObject, LocalShapeInfo localShapeInfo, [Const, Ref] btVector3 hitNormalLocal, [Const, Ref] btVector3 hitPointLocal, float hitFraction);
[Const] attribute btCollisionObject m_hitCollisionObject;
attribute LocalShapeInfo m_localShapeInfo;
[Value] attribute btVector3 m_hitNormalLocal;
[Value] attribute btVector3 m_hitPointLocal;
attribute float m_hitFraction;
};
[Prefix="btCollisionWorld::"]
interface ConvexResultCallback {
// abstract base class, no constructor
boolean hasHit();
attribute short m_collisionFilterGroup;
attribute short m_collisionFilterMask;
attribute float m_closestHitFraction;
};
[Prefix="btCollisionWorld::"]
interface ClosestConvexResultCallback {
void ClosestConvexResultCallback([Const, Ref] btVector3 convexFromWorld, [Const, Ref] btVector3 convexToWorld);
[Const] attribute btCollisionObject m_hitCollisionObject;
[Value] attribute btVector3 m_convexFromWorld;
[Value] attribute btVector3 m_convexToWorld;
[Value] attribute btVector3 m_hitNormalWorld;
[Value] attribute btVector3 m_hitPointWorld;
};
ClosestConvexResultCallback implements ConvexResultCallback;
interface btCollisionShape {
void setLocalScaling([Const, Ref] btVector3 scaling);
[Const, Ref] btVector3 getLocalScaling();
void calculateLocalInertia(float mass, [Ref] btVector3 inertia);
void setMargin(float margin);
float getMargin();
};
interface btConvexShape {
};
btConvexShape implements btCollisionShape;
interface btConvexTriangleMeshShape {
void btConvexTriangleMeshShape(btStridingMeshInterface meshInterface, optional boolean calcAabb);
};
btConvexTriangleMeshShape implements btConvexShape;
interface btBoxShape {
void btBoxShape([Ref] btVector3 boxHalfExtents);
void setMargin(float margin);
float getMargin();
};
btBoxShape implements btCollisionShape;
interface btCapsuleShape {
void btCapsuleShape(float radius, float height);
void setMargin(float margin);
float getMargin();
long getUpAxis();
float getRadius();
float getHalfHeight();
};
btCapsuleShape implements btCollisionShape;
interface btCapsuleShapeX {
void btCapsuleShapeX(float radius, float height);
void setMargin(float margin);
float getMargin();
};
btCapsuleShapeX implements btCapsuleShape;
interface btCapsuleShapeZ {
void btCapsuleShapeZ(float radius, float height);
void setMargin(float margin);
float getMargin();
};
btCapsuleShapeZ implements btCapsuleShape;
interface btCylinderShape {
void btCylinderShape([Ref] btVector3 halfExtents);
void setMargin(float margin);
float getMargin();
};
btCylinderShape implements btCollisionShape;
interface btCylinderShapeX {
void btCylinderShapeX([Ref] btVector3 halfExtents);
void setMargin(float margin);
float getMargin();
};
btCylinderShapeX implements btCylinderShape;
interface btCylinderShapeZ {
void btCylinderShapeZ([Ref] btVector3 halfExtents);
void setMargin(float margin);
float getMargin();
};
btCylinderShapeZ implements btCylinderShape;
interface btSphereShape {
void btSphereShape(float radius);
void setMargin(float margin);
float getMargin();
};
btSphereShape implements btCollisionShape;
interface btMultiSphereShape {
void btMultiSphereShape([Const] btVector3 positions, [Const] float[] radii, long numPoints);
};
btMultiSphereShape implements btCollisionShape;
interface btConeShape {
void btConeShape(float radius, float height);
};
btConeShape implements btCollisionShape;
interface btConeShapeX {
void btConeShapeX(float radius, float height);
};
btConeShapeX implements btConeShape;
interface btConeShapeZ {
void btConeShapeZ(float radius, float height);
};
btConeShapeZ implements btConeShape;
interface btIntArray {
long size();
long at(long n);
};
interface btFace {
[Value] attribute btIntArray m_indices;
attribute float[] m_plane;
};
interface btVector3Array {
void btVector3Array();
long size();
[Const, Ref] btVector3 at(long n);
void clear();
void pop_back();
void resize(long newsize, [Const, Ref] btVector3? fillData);
[Ref] btVector3 expandNonInitializing();
[Ref] btVector3 expand([Const, Ref] btVector3? fillValue);
void push_back([Const, Ref] btVector3 _Val);
long capacity();
void reserve(long _Count);
};
interface btQuaternionArray {
void btQuaternionArray();
long size();
[Const, Ref] btQuaternion at(long n);
void clear();
void pop_back();
void resize(long newsize, [Const, Ref] btQuaternion? fillData);
[Ref] btQuaternion expandNonInitializing();
[Ref] btQuaternion expand([Const, Ref] btQuaternion? fillValue);
void push_back([Const, Ref] btQuaternion _Val);
long capacity();
void reserve(long _Count);
};
interface btMatrix3x3Array {
void btMatrix3x3Array();
long size();
[Const, Ref] btMatrix3x3 at(long n);
void clear();
void pop_back();
void resize(long newsize, [Const, Ref] btMatrix3x3? fillData);
[Ref] btMatrix3x3 expandNonInitializing();
[Ref] btMatrix3x3 expand([Const, Ref] btMatrix3x3? fillValue);
void push_back([Const, Ref] btMatrix3x3 _Val);
long capacity();
void reserve(long _Count);
};
interface btFaceArray {
void btFaceArray();
long size();
[Const, Ref] btFace at(long n);
void clear();
void pop_back();
void resize(long newsize, [Const, Ref] btFace? fillData);
[Ref] btFace expandNonInitializing();
[Ref] btFace expand([Const, Ref] btFace? fillValue);
void push_back([Const, Ref] btFace _Val);
long capacity();
void reserve(long _Count);
};
interface btConvexPolyhedron {
[Value] attribute btVector3Array m_vertices;
[Value] attribute btFaceArray m_faces;
};
interface btConvexHullShape {
void btConvexHullShape([Const] optional float[] points, optional long numPoints);
void addPoint([Const, Ref] btVector3 point, optional boolean recalculateLocalAABB);
void setMargin(float margin);
float getMargin();
long getNumVertices();
boolean initializePolyhedralFeatures(long shiftVerticesByMargin);
void recalcLocalAabb();
[Const] btConvexPolyhedron getConvexPolyhedron();
};
btConvexHullShape implements btCollisionShape;
interface btShapeHull {
void btShapeHull(btConvexShape shape);
boolean buildHull(float margin);
long numVertices();
[Const] btVector3 getVertexPointer();
};
interface btCompoundShape {
void btCompoundShape(optional boolean enableDynamicAabbTree);
void addChildShape([Const, Ref] btTransform localTransform, btCollisionShape shape);
void removeChildShape(btCollisionShape shape);
void removeChildShapeByIndex(long childShapeindex);
[Const] long getNumChildShapes();
btCollisionShape getChildShape(long index);
void updateChildTransform(long childIndex, [Const, Ref] btTransform newChildTransform, optional boolean shouldRecalculateLocalAabb);
void setMargin(float margin);
float getMargin();
};
btCompoundShape implements btCollisionShape;
interface btStridingMeshInterface {
void setScaling([Const, Ref] btVector3 scaling);
};
interface btIndexedMesh {
attribute long m_numTriangles;
};
interface btIndexedMeshArray {
long size();
[Const, Ref] btIndexedMesh at(long n);
};
interface btTriangleMesh {
void btTriangleMesh(optional boolean use32bitIndices, optional boolean use4componentVertices);
void addTriangle([Const, Ref] btVector3 vertex0, [Const, Ref] btVector3 vertex1, [Const, Ref] btVector3 vertex2, optional boolean removeDuplicateVertices);
void addTriangleIndices(long index1, long index2, long index3);
long findOrAddVertex([Const, Ref] btVector3 vertex, boolean removeDuplicateVertices);
void addIndex(long index);
[Ref] btIndexedMeshArray getIndexedMeshArray();
};
btTriangleMesh implements btStridingMeshInterface;
enum PHY_ScalarType {
"PHY_FLOAT",
"PHY_DOUBLE",
"PHY_INTEGER",
"PHY_SHORT",
"PHY_FIXEDPOINT88",
"PHY_UCHAR"
};
interface btTriangleCallback {
void processTriangle(btVector3 triangle, long partId, long triangleIndex);
};
[JSImplementation="btTriangleCallback"]
interface btTriangleCallback_implJS {
void processTriangle(btVector3 triangle, long partId, long triangleIndex);
};
interface btConcaveShape {
};
btConcaveShape implements btCollisionShape;
interface btEmptyShape {
void btEmptyShape();
};
btEmptyShape implements btConcaveShape;
interface btStaticPlaneShape {
void btStaticPlaneShape([Const, Ref] btVector3 planeNormal, float planeConstant);
};
btStaticPlaneShape implements btConcaveShape;
interface btTriangleMeshShape {
};
btTriangleMeshShape implements btConcaveShape;
interface btBvhTriangleMeshShape {
void btBvhTriangleMeshShape(btStridingMeshInterface meshInterface, boolean useQuantizedAabbCompression, optional boolean buildBvh);
void performRaycast(btTriangleCallback callback, [Const, Ref] btVector3 raySource, [Const, Ref] btVector3 rayTarget);
};
btBvhTriangleMeshShape implements btTriangleMeshShape;
interface btHeightfieldTerrainShape {
void btHeightfieldTerrainShape(long heightStickWidth, long heightStickLength, VoidPtr heightfieldData, float heightScale, float minHeight, float maxHeight, long upAxis, PHY_ScalarType hdt, boolean flipQuadEdges);
void setMargin(float margin);
float getMargin();
};
btHeightfieldTerrainShape implements btConcaveShape;
// GImpact
interface btAABB {
void btAABB([ Const, Ref ] btVector3 V1, [ Const, Ref ] btVector3 V2, [ Const, Ref ] btVector3 V3, float margin);
void invalidate();
void increment_margin(float margin);
void copy_with_margin([ Const, Ref ] btAABB other, float margin);
};
interface btPrimitiveTriangle {
void btPrimitiveTriangle();
};
interface btTriangleShapeEx {
void btTriangleShapeEx([ Const, Ref ] btVector3 p1, [ Const, Ref ] btVector3 p2, [ Const, Ref ] btVector3 p3);
void getAabb([ Const, Ref ] btTransform t, [ Ref ] btVector3 aabbMin, [ Ref ] btVector3 aabbMax);
void applyTransform([ Const, Ref ] btTransform t);
// void buildTriPlane([ Ref ] btVector4 plane);
};
interface btPrimitiveManagerBase {
boolean is_trimesh();
long get_primitive_count();
void get_primitive_box(long prim_index , [Ref] btAABB primbox);
void get_primitive_triangle(long prim_index, [Ref] btPrimitiveTriangle triangle);
};
enum eGIMPACT_SHAPE_TYPE {
"CONST_GIMPACT_COMPOUND_SHAPE",
"CONST_GIMPACT_TRIMESH_SHAPE_PART",
"CONST_GIMPACT_TRIMESH_SHAPE"
};
interface btTetrahedronShapeEx {
void btTetrahedronShapeEx();
void setVertices([ Const, Ref ] btVector3 v0, [ Const, Ref ] btVector3 v1, [ Const, Ref ] btVector3 v2, [ Const, Ref ] btVector3 v3);
};
interface btGImpactShapeInterface {
void updateBound();
void postUpdate();
long getShapeType();
[Const] DOMString getName();
eGIMPACT_SHAPE_TYPE getGImpactShapeType();
[Const] btPrimitiveManagerBase getPrimitiveManager();
long getNumChildShapes();
boolean childrenHasTransform();
boolean needsRetrieveTriangles();
boolean needsRetrieveTetrahedrons();
void getBulletTriangle(long prim_index, [Ref] btTriangleShapeEx triangle);
void getBulletTetrahedron(long prim_index, [Ref] btTetrahedronShapeEx tetrahedron);
[Const] btCollisionShape getChildShape(long index);
[Value] btTransform getChildTransform(long index);
void setChildTransform(long index, [Const, Ref] btTransform transform);
};
btGImpactShapeInterface implements btConcaveShape;
[Prefix="btGImpactCompoundShape::"]
interface CompoundPrimitiveManager {
attribute btGImpactCompoundShape m_compoundShape;
long get_primitive_count();
void get_primitive_box(long prim_index, [Ref] btAABB primbox);
void get_primitive_triangle(long prim_index, [Ref] btPrimitiveTriangle triangle);
};
CompoundPrimitiveManager implements btPrimitiveManagerBase;
interface btGImpactCompoundShape {
void btGImpactCompoundShape(optional boolean children_has_transform = true);
boolean childrenHasTransform();
[Const] btPrimitiveManagerBase getPrimitiveManager();
CompoundPrimitiveManager getCompoundPrimitiveManager();
long getNumChildShapes();
void addChildShape([ Const, Ref ] btTransform localTransform, btCollisionShape shape);
btCollisionShape getChildShape(long index);
void getChildAabb(long child_index, [ Const, Ref ] btTransform t, [Ref] btVector3 aabbMin, [Ref] btVector3 aabbMax);
[Value] btTransform getChildTransform(long index);
void setChildTransform(long index, [ Const, Ref ] btTransform transform);
void calculateLocalInertia(float mass, [Ref] btVector3 inertia);
[Const] DOMString getName();
eGIMPACT_SHAPE_TYPE getGImpactShapeType();
};
btGImpactCompoundShape implements btGImpactShapeInterface;
[Prefix = "btGImpactMeshShapePart::"]
interface TrimeshPrimitiveManager {
attribute float m_margin;
attribute btStridingMeshInterface m_meshInterface;
attribute long m_part;
attribute long m_lock_count;
attribute long numverts;
attribute PHY_ScalarType type;
attribute long stride;
attribute long indexstride;
attribute long numfaces;
attribute PHY_ScalarType indicestype;
void TrimeshPrimitiveManager([Const, Ref] optional TrimeshPrimitiveManager manager);
void lock();
void unlock();
boolean is_trimesh();
long get_vertex_count();
void get_indices(long face_index, unsigned long i0, unsigned long i1, unsigned long i2);
void get_vertex(unsigned long vertex_index, [Ref] btVector3 vertex);
void get_bullet_triangle(long prim_index, [Ref] btTriangleShapeEx triangle);
};
TrimeshPrimitiveManager implements btPrimitiveManagerBase;
interface btGImpactMeshShapePart {
void btGImpactMeshShapePart(btStridingMeshInterface meshInterface, long part);
TrimeshPrimitiveManager getTrimeshPrimitiveManager();
long getVertexCount();
void getVertex(long vertex_index, [Ref] btVector3 vertex);
long getPart();
};
btGImpactMeshShapePart implements btGImpactShapeInterface;
interface btGImpactMeshShape {
void btGImpactMeshShape(btStridingMeshInterface meshInterface);
[Const] btStridingMeshInterface getMeshInterface();
long getMeshPartCount();
[Const] btGImpactMeshShapePart getMeshPart(long index);
long calculateSerializeBufferSize();
};
btGImpactMeshShape implements btGImpactShapeInterface;
interface btCollisionAlgorithmConstructionInfo {
void btCollisionAlgorithmConstructionInfo();
void btCollisionAlgorithmConstructionInfo(btDispatcher dispatcher, long temp);
attribute btDispatcher m_dispatcher1;
attribute btPersistentManifold m_manifold;
};
interface btCollisionAlgorithm {
};
interface btActivatingCollisionAlgorithm {
};
btActivatingCollisionAlgorithm implements btCollisionAlgorithm;
interface btGImpactCollisionAlgorithm {
void btGImpactCollisionAlgorithm([Const, Ref] btCollisionAlgorithmConstructionInfo ci, [Const] btCollisionObjectWrapper body0Wrap, [Const] btCollisionObjectWrapper body1Wrap);
static void registerAlgorithm(btCollisionDispatcher dispatcher);
};
btGImpactCollisionAlgorithm implements btActivatingCollisionAlgorithm;
//
interface btDefaultCollisionConstructionInfo {
void btDefaultCollisionConstructionInfo();
};
interface btDefaultCollisionConfiguration {
void btDefaultCollisionConfiguration([Ref] optional btDefaultCollisionConstructionInfo info);
};
interface btPersistentManifold {
void btPersistentManifold();
[Const] btCollisionObject getBody0();
[Const] btCollisionObject getBody1();
long getNumContacts();
[Ref] btManifoldPoint getContactPoint(long index);
};
interface btDispatcher {
long getNumManifolds();
btPersistentManifold getManifoldByIndexInternal(long index);
};
interface btCollisionDispatcher {
void btCollisionDispatcher(btDefaultCollisionConfiguration conf);
};
btCollisionDispatcher implements btDispatcher;
interface btOverlappingPairCallback {
};
interface btOverlappingPairCache {
void setInternalGhostPairCallback(btOverlappingPairCallback ghostPairCallback);
[Const] float getNumOverlappingPairs();
};
interface btAxisSweep3 {
void btAxisSweep3([Ref] btVector3 worldAabbMin, [Ref] btVector3 worldAabbMax, optional long maxHandles, optional btOverlappingPairCache pairCache, optional boolean disableRaycastAccelerator);
};
interface btBroadphaseInterface {
btOverlappingPairCache getOverlappingPairCache();
};
interface btCollisionConfiguration {
};
interface btDbvtBroadphase {
void btDbvtBroadphase();
};
btDbvtBroadphase implements btBroadphaseInterface;
interface btBroadphaseProxy {
attribute long m_collisionFilterGroup;
attribute long m_collisionFilterMask;
};
// Dynamics
[Prefix="btRigidBody::"]
interface btRigidBodyConstructionInfo {
void btRigidBodyConstructionInfo(float mass, btMotionState motionState, btCollisionShape collisionShape, [Ref] optional btVector3 localInertia);
attribute float m_linearDamping;
attribute float m_angularDamping;
attribute float m_friction;
attribute float m_rollingFriction;
attribute float m_restitution;
attribute float m_linearSleepingThreshold;
attribute float m_angularSleepingThreshold;
attribute boolean m_additionalDamping;
attribute float m_additionalDampingFactor;
attribute float m_additionalLinearDampingThresholdSqr;
attribute float m_additionalAngularDampingThresholdSqr;
attribute float m_additionalAngularDampingFactor;
};
interface btRigidBody {
void btRigidBody([Const, Ref] btRigidBodyConstructionInfo constructionInfo);
[Const, Ref] btTransform getCenterOfMassTransform();
void setCenterOfMassTransform([Const, Ref] btTransform xform);
void setSleepingThresholds(float linear, float angular);
float getLinearSleepingThreshold();
float getAngularSleepingThreshold();
[Const] float getLinearDamping();
[Const] float getAngularDamping();
void setDamping(float lin_damping, float ang_damping);
void applyDamping(float timeStep);
void setMassProps(float mass, [Const, Ref] btVector3 inertia);
float getInvMass();
float getMass();
[Const, Ref] btVector3 getLinearFactor();
void setLinearFactor([Const, Ref] btVector3 linearFactor);
void applyTorque([Const, Ref] btVector3 torque);
// void applyLocalTorque([Const, Ref] btVector3 torque);
void applyForce([Const, Ref] btVector3 force, [Const, Ref] btVector3 rel_pos);
// void applyCentralForce([Const, Ref] btVector3 force);
// void applyCentralLocalForce([Const, Ref] btVector3 force);
void applyCentralImpulse([Const, Ref] btVector3 impulse);
void applyTorqueImpulse([Const, Ref] btVector3 torque);
void applyImpulse([Const, Ref] btVector3 impulse, [Const, Ref] btVector3 rel_pos);
void applyPushImpulse([Const, Ref] btVector3 impulse, [Const, Ref] btVector3 rel_pos);
[Value] btVector3 getPushVelocity();
[Value] btVector3 getTurnVelocity();
void setPushVelocity([Const, Ref] btVector3 v);
void setTurnVelocity([Const, Ref] btVector3 v);
void applyCentralPushImpulse([Const, Ref] btVector3 impulse);
void applyTorqueTurnImpulse([Const, Ref] btVector3 torque);
[Const, Ref] btVector3 getCenterOfMassPosition();
[Value] btQuaternion getOrientation();
[Const, Ref] btVector3 getTotalForce();
[Const, Ref] btVector3 getTotalTorque();
[Const, Ref] btVector3 getInvInertiaDiagLocal();
void setInvInertiaDiagLocal([Const, Ref] btVector3 diagInvInertia);
void updateInertiaTensor();
[Const, Ref] btVector3 getLinearVelocity();
[Const, Ref] btVector3 getAngularVelocity();
void setLinearVelocity([Const, Ref] btVector3 lin_vel);
void setAngularVelocity([Const, Ref] btVector3 ang_vel);
[Value] btVector3 getVelocityInLocalPoint([Const, Ref] btVector3 rel_pos);
[Value] btVector3 getPushVelocityInLocalPoint([Const, Ref] btVector3 rel_pos);
void translate([Const, Ref] btVector3 v);
btMotionState getMotionState();
void setMotionState(btMotionState motionState);
[Const, Ref] btVector3 getAngularFactor();
void setAngularFactor([Const, Ref] btVector3 angularFactor);
btRigidBody upcast(btCollisionObject colObj);
void getAabb([Ref] btVector3 aabbMin, [Ref] btVector3 aabbMax);
void applyGravity();
void clearGravity();
[Const, Ref] btVector3 getGravity();
void setGravity([Const, Ref] btVector3 acceleration);
[Const] btBroadphaseProxy getBroadphaseProxy();
void clearForces();
void setFlags(long flags);
[Const] long getFlags();