forked from kripken/ammo.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathammo.idl
404 lines (330 loc) · 12.7 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
// Linear Math
interface btVector3 {
void btVector3();
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);
[Operator="*=", Ref] btVector3 op_mul(float x);
};
interface btVector4 {
void btVector4();
void btVector4(float x, float y, float z, float w);
float w();
void setValue(float x, float y, float z, float w);
};
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(float x, float y, float z, float w);
void setValue(float x, float y, float z, float w);
};
btQuaternion implements btQuadWord;
interface btMatrix3x3 {
void setEulerZYX(float ex, float ey, float ez);
};
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();
};
interface btMotionState {
void getWorldTransform([Ref] btTransform worldTrans);
void setWorldTransform([Ref] btTransform worldTrans);
};
interface btDefaultMotionState {
void btDefaultMotionState([Ref] optional btTransform startTrans, [Ref] optional btTransform centerOfMassOffset);
};
btDefaultMotionState implements btMotionState;
// Collision
interface btCollisionObject {
btCollisionShape getCollisionShape();
void setContactProcessingThreshold(float contactProcessingThreshold);
void setActivationState(long newState);
void forceActivationState(long newState);
void activate(optional boolean forceActivation);
boolean isActive();
void setRestitution(float rest);
void setFriction(float frict);
[Ref] btTransform getWorldTransform();
long getCollisionFlags();
void setCollisionFlags(long flags);
};
[NoDelete]
interface btCollisionObjectWrapper {
};
[Prefix="btCollisionWorld::"]
interface RayResultCallback {
// abstract base class, no constructor
boolean hasHit();
[Const] attribute btCollisionObject m_collisionObject;
};
[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 btManifoldPoint {
[Const, Ref] btVector3 getPositionWorldOnA();
[Const, Ref] btVector3 getPositionWorldOnB();
[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;
};
[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);
};
interface btCollisionShape {
void setLocalScaling([Const, Ref] btVector3 scaling);
void calculateLocalInertia(float mass, [Ref] btVector3 inertia);
};
interface btBoxShape {
void btBoxShape([Ref] btVector3 boxHalfExtents);
};
btBoxShape implements btCollisionShape;
interface btCapsuleShape {
void btCapsuleShape(float radius, float height);
};
btCapsuleShape implements btCollisionShape;
interface btCapsuleShapeX {
void btCapsuleShapeX(float radius, float height);
};
btCapsuleShapeX implements btCapsuleShape;
interface btCapsuleShapeZ {
void btCapsuleShapeZ(float radius, float height);
};
btCapsuleShapeZ implements btCapsuleShape;
interface btCylinderShape {
void btCylinderShape([Ref] btVector3 halfExtents);
};
btCylinderShape implements btCollisionShape;
interface btCylinderShapeX {
void btCylinderShapeX([Ref] btVector3 halfExtents);
};
btCylinderShapeX implements btCylinderShape;
interface btCylinderShapeZ {
void btCylinderShapeZ([Ref] btVector3 halfExtents);
};
btCylinderShapeZ implements btCylinderShape;
interface btSphereShape {
void btSphereShape(float radius);
};
btSphereShape 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 btCompoundShape {
void btCompoundShape(optional boolean enableDynamicAabbTree);
void addChildShape([Const, Ref] btTransform localTransform, btCollisionShape shape);
};
btCompoundShape implements btCollisionShape;
interface btStridingMeshInterface {
};
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);
};
btTriangleMesh implements btStridingMeshInterface;
interface btConcaveShape {
};
btConcaveShape implements btCollisionShape;
interface btTriangleMeshShape {
};
btTriangleMeshShape implements btConcaveShape;
interface btBvhTriangleMeshShape {
void btBvhTriangleMeshShape(btStridingMeshInterface meshInterface, boolean useQuantizedAabbCompression, optional boolean buildBvh);
};
btBvhTriangleMeshShape implements btTriangleMeshShape;
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 btOverlappingPairCache {
};
interface btAxisSweep3 {
void btAxisSweep3([Ref] btVector3 worldAabbMin, [Ref] btVector3 worldAabbMax, optional long maxHandles, optional btOverlappingPairCache pairCache, optional boolean disableRaycastAccelerator);
};
interface btBroadphaseInterface {
};
interface btCollisionConfiguration {
};
interface btDbvtBroadphase {
void btDbvtBroadphase();
};
// 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);
void setDamping(float lin_damping, float ang_damping);
void setMassProps(float mass, [Const, Ref] btVector3 inertia);
void setLinearFactor([Const, Ref] btVector3 linearFactor);
void applyTorque([Const, Ref] btVector3 torque);
void applyForce([Const, Ref] btVector3 force, [Const, Ref] btVector3 rel_pos);
void applyTorqueImpulse([Const, Ref] btVector3 torque);
void applyImpulse([Const, Ref] btVector3 impulse, [Const, Ref] btVector3 rel_pos);
void updateInertiaTensor();
[Const, Ref] btVector3 getLinearVelocity();
[Const, Ref] btVector3 getAngularVelocity();
void setLinearVelocity([Const, Ref] btVector3 lin_vel);
void setAngularVelocity([Const, Ref] btVector3 ang_vel);
btMotionState getMotionState();
void setAngularFactor([Const, Ref] btVector3 angularFactor);
btRigidBody upcast([Const] btCollisionObject colObj);
};
btRigidBody implements btCollisionObject;
interface btConstraintSetting {
void btConstraintSetting();
attribute float m_tau;
attribute float m_damping;
attribute float m_impulseClamp;
};
interface btPoint2PointConstraint {
void btPoint2PointConstraint([Ref] btRigidBody rbA, [Ref] btRigidBody rbB, [Ref] btVector3 pivotInA, [Ref] btVector3 pivotInB);
void btPoint2PointConstraint([Ref] btRigidBody rbA, [Ref] btVector3 pivotInA);
void setPivotA([Const, Ref] btVector3 pivotA);
void setPivotB([Const, Ref] btVector3 pivotB);
[Const, Ref] btVector3 getPivotInA();
[Const, Ref] btVector3 getPivotInB();
[Value] attribute btConstraintSetting m_setting;
};
interface btSequentialImpulseConstraintSolver {
void btSequentialImpulseConstraintSolver();
};
interface btTypedConstraint {
};
interface btConeTwistConstraint {
void btConeTwistConstraint([Ref] btRigidBody rbA, [Ref] btRigidBody rbB, [Ref] btTransform rbAFrame, [Ref] btTransform rbBFrame);
void btConeTwistConstraint([Ref] btRigidBody rbA, [Ref] btTransform rbAFrame);
void setLimit(long limitIndex, float limitValue);
};
btConeTwistConstraint implements btTypedConstraint;
interface btConstraintSolver {
};
interface btCollisionWorld {
btDispatcher getDispatcher();
void rayTest([Const, Ref] btVector3 rayFromWorld, [Const, Ref] btVector3 rayToWorld, [Ref] RayResultCallback resultCallback);
};
interface btDynamicsWorld {
void addAction(btActionInterface action);
};
btDynamicsWorld implements btCollisionWorld;
interface btDiscreteDynamicsWorld {
void btDiscreteDynamicsWorld(btDispatcher dispatcher, btBroadphaseInterface pairCache, btConstraintSolver constraintSolver, btCollisionConfiguration collisionConfiguration);
void setGravity([Ref] btVector3 gravity);
[Value] btVector3 getGravity();
void addRigidBody(btRigidBody body);
void addRigidBody(btRigidBody body, short group, short mask);
void removeRigidBody(btRigidBody body);
void addConstraint(btTypedConstraint constraint, optional boolean disableCollisionsBetweenLinkedBodies);
void removeConstraint(btTypedConstraint constraint);
long stepSimulation(float timeStep, optional long maxSubSteps, optional float fixedTimeStep);
};
btDiscreteDynamicsWorld implements btDynamicsWorld;
[Prefix="btRaycastVehicle::", NoDelete]
interface btVehicleTuning {
void btVehicleTuning();
};
interface btVehicleRaycaster {
};
interface btDefaultVehicleRaycaster {
void btDefaultVehicleRaycaster(btDynamicsWorld world);
};
btDefaultVehicleRaycaster implements btVehicleRaycaster;
interface btWheelInfo {
attribute float m_suspensionStiffness;
attribute float m_wheelsDampingRelaxation;
attribute float m_wheelsDampingCompression;
attribute float m_frictionSlip;
attribute float m_rollInfluence;
};
interface btActionInterface {
};
interface btRaycastVehicle {
void btRaycastVehicle([Const, Ref] btVehicleTuning tuning, btRigidBody chassis, btVehicleRaycaster raycaster);
void applyEngineForce(float force, long wheel);
void setSteeringValue(float steering, long wheel);
[Const, Ref] btTransform getWheelTransformWS(long wheelIndex);
void updateWheelTransform(long wheelIndex, boolean interpolatedTransform);
[Ref] btWheelInfo addWheel([Const, Ref] btVector3 connectionPointCS0, [Const, Ref] btVector3 wheelDirectionCS0, [Const, Ref] btVector3 wheelAxleCS, float suspensionRestLength, float wheelRadius, [Const, Ref] btVehicleTuning tuning, boolean isFrontWheel);
long getNumWheels();
btRigidBody getRigidBody();
[Ref] btWheelInfo getWheelInfo(long index);
void setBrake(float brake, long wheelIndex);
void setCoordinateSystem(long rightIndex, long upIndex, long forwardIndex);
};
btRaycastVehicle implements btActionInterface;