@zaisma/physics 0.0.0-stage → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,903 @@
1
+ /**
2
+ * Types for the engine this piece ships (Rapier 0.19.3, rapier.js beside this file), for a game that reaches it through
3
+ * physicsEngine() or a character kind's stepContext.engine. They cover what a game asks of the engine most (the world,
4
+ * bodies, colliders, rays and shape casts, joints, the character and vehicle controllers); anything else is there too,
5
+ * typed loosely. Rapier is Apache-2.0 licensed (LICENSE.txt beside this file).
6
+ */
7
+ export interface Vector {
8
+ x: number;
9
+ y: number;
10
+ z: number;
11
+ }
12
+ export interface Rotation {
13
+ x: number;
14
+ y: number;
15
+ z: number;
16
+ w: number;
17
+ }
18
+
19
+ export declare const ENGINE_VERSION: string;
20
+
21
+ export declare enum RigidBodyType {
22
+ Dynamic = 0,
23
+ Fixed = 1,
24
+ KinematicPositionBased = 2,
25
+ KinematicVelocityBased = 3,
26
+ }
27
+
28
+ export declare enum QueryFilterFlags {
29
+ EXCLUDE_FIXED = 1,
30
+ EXCLUDE_KINEMATIC = 2,
31
+ EXCLUDE_DYNAMIC = 4,
32
+ EXCLUDE_SENSORS = 8,
33
+ EXCLUDE_SOLIDS = 16,
34
+ ONLY_DYNAMIC = 3,
35
+ ONLY_KINEMATIC = 5,
36
+ ONLY_FIXED = 6,
37
+ }
38
+
39
+ export declare class RigidBody {
40
+ readonly handle: number;
41
+ translation(): Vector;
42
+ rotation(): Rotation;
43
+ linvel(): Vector;
44
+ angvel(): Vector;
45
+ mass(): number;
46
+ setTranslation(translation: Vector, wakeUp: boolean): void;
47
+ setRotation(rotation: Rotation, wakeUp: boolean): void;
48
+ setLinvel(velocity: Vector, wakeUp: boolean): void;
49
+ setAngvel(velocity: Vector, wakeUp: boolean): void;
50
+ setNextKinematicTranslation(translation: Vector): void;
51
+ setNextKinematicRotation(rotation: Rotation): void;
52
+ applyImpulse(impulse: Vector, wakeUp: boolean): void;
53
+ applyImpulseAtPoint(impulse: Vector, point: Vector, wakeUp: boolean): void;
54
+ addForce(force: Vector, wakeUp: boolean): void;
55
+ resetForces(wakeUp: boolean): void;
56
+ velocityAtPoint(point: Vector): Vector;
57
+ setGravityScale(scale: number, wakeUp: boolean): void;
58
+ setBodyType(type: RigidBodyType, wakeUp: boolean): void;
59
+ isSleeping(): boolean;
60
+ isDynamic(): boolean;
61
+ isFixed(): boolean;
62
+ isKinematic(): boolean;
63
+ sleep(): void;
64
+ wakeUp(): void;
65
+ setEnabled(isEnabled: boolean): void;
66
+ [member: string]: any;
67
+ // Typed loosely: the rest of the engine's own.
68
+ finalizeDeserialization(...args: any[]): any;
69
+ isValid(...args: any[]): any;
70
+ lockTranslations(...args: any[]): any;
71
+ lockRotations(...args: any[]): any;
72
+ setEnabledTranslations(...args: any[]): any;
73
+ restrictTranslations(...args: any[]): any;
74
+ setEnabledRotations(...args: any[]): any;
75
+ restrictRotations(...args: any[]): any;
76
+ dominanceGroup(...args: any[]): any;
77
+ setDominanceGroup(...args: any[]): any;
78
+ additionalSolverIterations(...args: any[]): any;
79
+ setAdditionalSolverIterations(...args: any[]): any;
80
+ enableCcd(...args: any[]): any;
81
+ setSoftCcdPrediction(...args: any[]): any;
82
+ softCcdPrediction(...args: any[]): any;
83
+ nextTranslation(...args: any[]): any;
84
+ nextRotation(...args: any[]): any;
85
+ gravityScale(...args: any[]): any;
86
+ effectiveInvMass(...args: any[]): any;
87
+ invMass(...args: any[]): any;
88
+ localCom(...args: any[]): any;
89
+ worldCom(...args: any[]): any;
90
+ invPrincipalInertia(...args: any[]): any;
91
+ principalInertia(...args: any[]): any;
92
+ principalInertiaLocalFrame(...args: any[]): any;
93
+ effectiveWorldInvInertia(...args: any[]): any;
94
+ effectiveAngularInertia(...args: any[]): any;
95
+ isCcdEnabled(...args: any[]): any;
96
+ numColliders(...args: any[]): any;
97
+ collider(...args: any[]): any;
98
+ isEnabled(...args: any[]): any;
99
+ bodyType(...args: any[]): any;
100
+ isMoving(...args: any[]): any;
101
+ linearDamping(...args: any[]): any;
102
+ angularDamping(...args: any[]): any;
103
+ setLinearDamping(...args: any[]): any;
104
+ recomputeMassPropertiesFromColliders(...args: any[]): any;
105
+ setAdditionalMass(...args: any[]): any;
106
+ setAdditionalMassProperties(...args: any[]): any;
107
+ setAngularDamping(...args: any[]): any;
108
+ resetTorques(...args: any[]): any;
109
+ addTorque(...args: any[]): any;
110
+ applyTorqueImpulse(...args: any[]): any;
111
+ addForceAtPoint(...args: any[]): any;
112
+ userForce(...args: any[]): any;
113
+ userTorque(...args: any[]): any;
114
+ }
115
+
116
+ export declare class Collider {
117
+ readonly handle: number;
118
+ parent(): RigidBody | null;
119
+ translation(): Vector;
120
+ rotation(): Rotation;
121
+ setCollisionGroups(groups: number): void;
122
+ collisionGroups(): number;
123
+ setFriction(friction: number): void;
124
+ setRestitution(restitution: number): void;
125
+ setSensor(isSensor: boolean): void;
126
+ setEnabled(isEnabled: boolean): void;
127
+ [member: string]: any;
128
+ // Typed loosely: the rest of the engine's own.
129
+ finalizeDeserialization(...args: any[]): any;
130
+ ensureShapeIsCached(...args: any[]): any;
131
+ readonly shape: any;
132
+ clearShapeCache(...args: any[]): any;
133
+ isValid(...args: any[]): any;
134
+ translationWrtParent(...args: any[]): any;
135
+ rotationWrtParent(...args: any[]): any;
136
+ isSensor(...args: any[]): any;
137
+ setShape(...args: any[]): any;
138
+ isEnabled(...args: any[]): any;
139
+ frictionCombineRule(...args: any[]): any;
140
+ setFrictionCombineRule(...args: any[]): any;
141
+ restitutionCombineRule(...args: any[]): any;
142
+ setRestitutionCombineRule(...args: any[]): any;
143
+ setSolverGroups(...args: any[]): any;
144
+ contactSkin(...args: any[]): any;
145
+ setContactSkin(...args: any[]): any;
146
+ activeHooks(...args: any[]): any;
147
+ setActiveHooks(...args: any[]): any;
148
+ activeEvents(...args: any[]): any;
149
+ setActiveEvents(...args: any[]): any;
150
+ activeCollisionTypes(...args: any[]): any;
151
+ setContactForceEventThreshold(...args: any[]): any;
152
+ contactForceEventThreshold(...args: any[]): any;
153
+ setActiveCollisionTypes(...args: any[]): any;
154
+ setDensity(...args: any[]): any;
155
+ setMass(...args: any[]): any;
156
+ setMassProperties(...args: any[]): any;
157
+ setTranslation(...args: any[]): any;
158
+ setTranslationWrtParent(...args: any[]): any;
159
+ setRotation(...args: any[]): any;
160
+ setRotationWrtParent(...args: any[]): any;
161
+ shapeType(...args: any[]): any;
162
+ halfExtents(...args: any[]): any;
163
+ setHalfExtents(...args: any[]): any;
164
+ radius(...args: any[]): any;
165
+ setRadius(...args: any[]): any;
166
+ roundRadius(...args: any[]): any;
167
+ setRoundRadius(...args: any[]): any;
168
+ halfHeight(...args: any[]): any;
169
+ setHalfHeight(...args: any[]): any;
170
+ setVoxel(...args: any[]): any;
171
+ propagateVoxelChange(...args: any[]): any;
172
+ combineVoxelStates(...args: any[]): any;
173
+ vertices(...args: any[]): any;
174
+ indices(...args: any[]): any;
175
+ heightfieldHeights(...args: any[]): any;
176
+ heightfieldScale(...args: any[]): any;
177
+ heightfieldNRows(...args: any[]): any;
178
+ heightfieldNCols(...args: any[]): any;
179
+ friction(...args: any[]): any;
180
+ restitution(...args: any[]): any;
181
+ density(...args: any[]): any;
182
+ mass(...args: any[]): any;
183
+ volume(...args: any[]): any;
184
+ solverGroups(...args: any[]): any;
185
+ containsPoint(...args: any[]): any;
186
+ projectPoint(...args: any[]): any;
187
+ intersectsRay(...args: any[]): any;
188
+ castShape(...args: any[]): any;
189
+ castCollider(...args: any[]): any;
190
+ intersectsShape(...args: any[]): any;
191
+ contactShape(...args: any[]): any;
192
+ contactCollider(...args: any[]): any;
193
+ castRay(...args: any[]): any;
194
+ castRayAndGetNormal(...args: any[]): any;
195
+ }
196
+
197
+ export declare class RigidBodyDesc {
198
+ static dynamic(): RigidBodyDesc;
199
+ static fixed(): RigidBodyDesc;
200
+ static kinematicPositionBased(): RigidBodyDesc;
201
+ static kinematicVelocityBased(): RigidBodyDesc;
202
+ setTranslation(x: number, y: number, z: number): RigidBodyDesc;
203
+ setRotation(rotation: Rotation): RigidBodyDesc;
204
+ setLinearDamping(damping: number): RigidBodyDesc;
205
+ setAngularDamping(damping: number): RigidBodyDesc;
206
+ lockRotations(): RigidBodyDesc;
207
+ setCcdEnabled(isEnabled: boolean): RigidBodyDesc;
208
+ [member: string]: any;
209
+ // Typed loosely: the rest of the engine's own.
210
+ static newDynamic(...args: any[]): any;
211
+ static newKinematicPositionBased(...args: any[]): any;
212
+ static newKinematicVelocityBased(...args: any[]): any;
213
+ static newStatic(...args: any[]): any;
214
+ setDominanceGroup(...args: any[]): any;
215
+ setAdditionalSolverIterations(...args: any[]): any;
216
+ setEnabled(...args: any[]): any;
217
+ setGravityScale(...args: any[]): any;
218
+ setAdditionalMass(...args: any[]): any;
219
+ setLinvel(...args: any[]): any;
220
+ setAngvel(...args: any[]): any;
221
+ setAdditionalMassProperties(...args: any[]): any;
222
+ enabledTranslations(...args: any[]): any;
223
+ restrictTranslations(...args: any[]): any;
224
+ lockTranslations(...args: any[]): any;
225
+ enabledRotations(...args: any[]): any;
226
+ restrictRotations(...args: any[]): any;
227
+ setCanSleep(...args: any[]): any;
228
+ setSleeping(...args: any[]): any;
229
+ setSoftCcdPrediction(...args: any[]): any;
230
+ setUserData(...args: any[]): any;
231
+ }
232
+
233
+ export declare class ColliderDesc {
234
+ static cuboid(halfX: number, halfY: number, halfZ: number): ColliderDesc;
235
+ static ball(radius: number): ColliderDesc;
236
+ static capsule(halfHeight: number, radius: number): ColliderDesc;
237
+ static cylinder(halfHeight: number, radius: number): ColliderDesc;
238
+ static convexHull(points: Float32Array): ColliderDesc | null;
239
+ static trimesh(points: Float32Array, indices: Uint32Array): ColliderDesc;
240
+ static heightfield(rowCount: number, columnCount: number, heights: Float32Array, scale: Vector): ColliderDesc;
241
+ setTranslation(x: number, y: number, z: number): ColliderDesc;
242
+ setRotation(rotation: Rotation): ColliderDesc;
243
+ setDensity(density: number): ColliderDesc;
244
+ setMass(mass: number): ColliderDesc;
245
+ setFriction(friction: number): ColliderDesc;
246
+ setRestitution(restitution: number): ColliderDesc;
247
+ setSensor(isSensor: boolean): ColliderDesc;
248
+ setCollisionGroups(groups: number): ColliderDesc;
249
+ [member: string]: any;
250
+ // Typed loosely: the rest of the engine's own.
251
+ static segment(...args: any[]): any;
252
+ static triangle(...args: any[]): any;
253
+ static roundTriangle(...args: any[]): any;
254
+ static polyline(...args: any[]): any;
255
+ static voxels(...args: any[]): any;
256
+ static roundCuboid(...args: any[]): any;
257
+ static roundCylinder(...args: any[]): any;
258
+ static cone(...args: any[]): any;
259
+ static roundCone(...args: any[]): any;
260
+ static convexMesh(...args: any[]): any;
261
+ static roundConvexHull(...args: any[]): any;
262
+ static roundConvexMesh(...args: any[]): any;
263
+ setEnabled(...args: any[]): any;
264
+ setContactSkin(...args: any[]): any;
265
+ setMassProperties(...args: any[]): any;
266
+ setFrictionCombineRule(...args: any[]): any;
267
+ setRestitutionCombineRule(...args: any[]): any;
268
+ setSolverGroups(...args: any[]): any;
269
+ setActiveHooks(...args: any[]): any;
270
+ setActiveEvents(...args: any[]): any;
271
+ setActiveCollisionTypes(...args: any[]): any;
272
+ setContactForceEventThreshold(...args: any[]): any;
273
+ }
274
+
275
+ export declare class Ray {
276
+ constructor(origin: Vector, direction: Vector);
277
+ origin: Vector;
278
+ dir: Vector;
279
+ // Typed loosely: the rest of the engine's own.
280
+ pointAt(...args: any[]): any;
281
+ }
282
+ export declare class Ball {
283
+ constructor(radius: number);
284
+ // Typed loosely: the rest of the engine's own.
285
+ intoRaw(...args: any[]): any;
286
+ }
287
+ export declare class Cuboid {
288
+ constructor(halfX: number, halfY: number, halfZ: number);
289
+ // Typed loosely: the rest of the engine's own.
290
+ intoRaw(...args: any[]): any;
291
+ }
292
+ export declare class Capsule {
293
+ constructor(halfHeight: number, radius: number);
294
+ // Typed loosely: the rest of the engine's own.
295
+ intoRaw(...args: any[]): any;
296
+ }
297
+
298
+ export interface RayColliderIntersection {
299
+ collider: Collider;
300
+ timeOfImpact: number;
301
+ normal: Vector;
302
+ }
303
+ export interface ColliderShapeCastHit {
304
+ collider: Collider;
305
+ time_of_impact: number;
306
+ /** In the cast shape's own space. */
307
+ witness1: Vector;
308
+ witness2: Vector;
309
+ normal1: Vector;
310
+ normal2: Vector;
311
+ }
312
+
313
+ export declare class JointData {
314
+ static fixed(anchor1: Vector, frame1: Rotation, anchor2: Vector, frame2: Rotation): JointData;
315
+ static spherical(anchor1: Vector, anchor2: Vector): JointData;
316
+ static revolute(anchor1: Vector, anchor2: Vector, axis: Vector): JointData;
317
+ static prismatic(anchor1: Vector, anchor2: Vector, axis: Vector): JointData;
318
+ static spring(restLength: number, stiffness: number, damping: number, anchor1: Vector, anchor2: Vector): JointData;
319
+ static rope(length: number, anchor1: Vector, anchor2: Vector): JointData;
320
+ // Typed loosely: the rest of the engine's own.
321
+ static generic(...args: any[]): any;
322
+ intoRaw(...args: any[]): any;
323
+ }
324
+ export declare class ImpulseJoint {
325
+ setLimits(minimum: number, maximum: number): void;
326
+ [member: string]: any;
327
+ // Typed loosely: the rest of the engine's own.
328
+ static newTyped(...args: any[]): any;
329
+ finalizeDeserialization(...args: any[]): any;
330
+ isValid(...args: any[]): any;
331
+ body1(...args: any[]): any;
332
+ body2(...args: any[]): any;
333
+ type(...args: any[]): any;
334
+ frameX1(...args: any[]): any;
335
+ frameX2(...args: any[]): any;
336
+ anchor1(...args: any[]): any;
337
+ anchor2(...args: any[]): any;
338
+ setAnchor1(...args: any[]): any;
339
+ setAnchor2(...args: any[]): any;
340
+ setContactsEnabled(...args: any[]): any;
341
+ contactsEnabled(...args: any[]): any;
342
+ }
343
+
344
+ export declare class KinematicCharacterController {
345
+ setUp(up: Vector): void;
346
+ setSlideEnabled(isEnabled: boolean): void;
347
+ enableAutostep(maximumHeight: number, minimumWidth: number, includesDynamicBodies: boolean): void;
348
+ setMaxSlopeClimbAngle(angleRad: number): void;
349
+ enableSnapToGround(distance: number): void;
350
+ computeColliderMovement(collider: Collider, desiredTranslation: Vector, filterFlags?: QueryFilterFlags, filterGroups?: number, filterPredicate?: (collider: Collider) => boolean): void;
351
+ computedMovement(): Vector;
352
+ computedGrounded(): boolean;
353
+ [member: string]: any;
354
+ // Typed loosely: the rest of the engine's own.
355
+ free(...args: any[]): any;
356
+ up(...args: any[]): any;
357
+ applyImpulsesToDynamicBodies(...args: any[]): any;
358
+ setApplyImpulsesToDynamicBodies(...args: any[]): any;
359
+ characterMass(...args: any[]): any;
360
+ setCharacterMass(...args: any[]): any;
361
+ offset(...args: any[]): any;
362
+ setOffset(...args: any[]): any;
363
+ normalNudgeFactor(...args: any[]): any;
364
+ setNormalNudgeFactor(...args: any[]): any;
365
+ slideEnabled(...args: any[]): any;
366
+ autostepMaxHeight(...args: any[]): any;
367
+ autostepMinWidth(...args: any[]): any;
368
+ autostepIncludesDynamicBodies(...args: any[]): any;
369
+ autostepEnabled(...args: any[]): any;
370
+ disableAutostep(...args: any[]): any;
371
+ maxSlopeClimbAngle(...args: any[]): any;
372
+ minSlopeSlideAngle(...args: any[]): any;
373
+ setMinSlopeSlideAngle(...args: any[]): any;
374
+ snapToGroundDistance(...args: any[]): any;
375
+ disableSnapToGround(...args: any[]): any;
376
+ snapToGroundEnabled(...args: any[]): any;
377
+ numComputedCollisions(...args: any[]): any;
378
+ computedCollision(...args: any[]): any;
379
+ }
380
+
381
+ export declare class DynamicRayCastVehicleController {
382
+ addWheel(chassisConnection: Vector, direction: Vector, axle: Vector, suspensionRestLength: number, radius: number): void;
383
+ setWheelEngineForce(wheelIndex: number, force: number): void;
384
+ setWheelBrake(wheelIndex: number, brake: number): void;
385
+ setWheelSteering(wheelIndex: number, angleRad: number): void;
386
+ wheelRotation(wheelIndex: number): number;
387
+ wheelSuspensionLength(wheelIndex: number): number | null;
388
+ wheelIsInContact(wheelIndex: number): boolean;
389
+ currentVehicleSpeed(): number;
390
+ updateVehicle(durationSec: number, filterFlags?: QueryFilterFlags, filterGroups?: number, filterPredicate?: (collider: Collider) => boolean): void;
391
+ [member: string]: any;
392
+ // Typed loosely: the rest of the engine's own.
393
+ free(...args: any[]): any;
394
+ chassis(...args: any[]): any;
395
+ indexUpAxis: any;
396
+ readonly indexForwardAxis: any;
397
+ setIndexForwardAxis(...args: any[]): any;
398
+ numWheels(...args: any[]): any;
399
+ wheelChassisConnectionPointCs(...args: any[]): any;
400
+ setWheelChassisConnectionPointCs(...args: any[]): any;
401
+ wheelSuspensionRestLength(...args: any[]): any;
402
+ setWheelSuspensionRestLength(...args: any[]): any;
403
+ wheelMaxSuspensionTravel(...args: any[]): any;
404
+ setWheelMaxSuspensionTravel(...args: any[]): any;
405
+ wheelRadius(...args: any[]): any;
406
+ setWheelRadius(...args: any[]): any;
407
+ wheelSuspensionStiffness(...args: any[]): any;
408
+ setWheelSuspensionStiffness(...args: any[]): any;
409
+ wheelSuspensionCompression(...args: any[]): any;
410
+ setWheelSuspensionCompression(...args: any[]): any;
411
+ wheelSuspensionRelaxation(...args: any[]): any;
412
+ setWheelSuspensionRelaxation(...args: any[]): any;
413
+ wheelMaxSuspensionForce(...args: any[]): any;
414
+ setWheelMaxSuspensionForce(...args: any[]): any;
415
+ wheelBrake(...args: any[]): any;
416
+ wheelSteering(...args: any[]): any;
417
+ wheelEngineForce(...args: any[]): any;
418
+ wheelDirectionCs(...args: any[]): any;
419
+ setWheelDirectionCs(...args: any[]): any;
420
+ wheelAxleCs(...args: any[]): any;
421
+ setWheelAxleCs(...args: any[]): any;
422
+ wheelFrictionSlip(...args: any[]): any;
423
+ setWheelFrictionSlip(...args: any[]): any;
424
+ wheelSideFrictionStiffness(...args: any[]): any;
425
+ setWheelSideFrictionStiffness(...args: any[]): any;
426
+ wheelForwardImpulse(...args: any[]): any;
427
+ wheelSideImpulse(...args: any[]): any;
428
+ wheelSuspensionForce(...args: any[]): any;
429
+ wheelContactNormal(...args: any[]): any;
430
+ wheelContactPoint(...args: any[]): any;
431
+ wheelHardPoint(...args: any[]): any;
432
+ wheelGroundObject(...args: any[]): any;
433
+ }
434
+
435
+ export declare class EventQueue {
436
+ constructor(isAutoDrained: boolean);
437
+ drainCollisionEvents(listener: (firstHandle: number, secondHandle: number, isStarted: boolean) => void): void;
438
+ clear(): void;
439
+ free(): void;
440
+ // Typed loosely: the rest of the engine's own.
441
+ drainContactForceEvents(...args: any[]): any;
442
+ }
443
+
444
+ export declare class World {
445
+ constructor(gravity: Vector);
446
+ gravity: Vector;
447
+ timestep: number;
448
+ step(eventQueue?: EventQueue): void;
449
+ createRigidBody(description: RigidBodyDesc): RigidBody;
450
+ createCollider(description: ColliderDesc, parent?: RigidBody): Collider;
451
+ removeRigidBody(rigidBody: RigidBody): void;
452
+ removeCollider(collider: Collider, wakeUp: boolean): void;
453
+ createImpulseJoint(data: JointData, first: RigidBody, second: RigidBody, wakeUp: boolean): ImpulseJoint;
454
+ removeImpulseJoint(joint: ImpulseJoint, wakeUp: boolean): void;
455
+ createCharacterController(offset: number): KinematicCharacterController;
456
+ createVehicleController(chassis: RigidBody): DynamicRayCastVehicleController;
457
+ propagateModifiedBodyPositionsToColliders(): void;
458
+ castRay(ray: Ray, maximumDistance: number, isSolid: boolean, filterFlags?: QueryFilterFlags, filterGroups?: number, excludedCollider?: Collider, excludedRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): { collider: Collider; timeOfImpact: number } | null;
459
+ castRayAndGetNormal(ray: Ray, maximumDistance: number, isSolid: boolean, filterFlags?: QueryFilterFlags, filterGroups?: number, excludedCollider?: Collider, excludedRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): RayColliderIntersection | null;
460
+ castShape(position: Vector, rotation: Rotation, velocity: Vector, shape: Ball | Cuboid | Capsule, targetDistance: number, maximumTimeOfImpact: number, stopsAtPenetration: boolean, filterFlags?: QueryFilterFlags, filterGroups?: number, excludedCollider?: Collider, excludedRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): ColliderShapeCastHit | null;
461
+ intersectionsWithShape(position: Vector, rotation: Rotation, shape: Ball | Cuboid | Capsule, listener: (collider: Collider) => boolean, filterFlags?: QueryFilterFlags, filterGroups?: number, excludedCollider?: Collider, excludedRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): void;
462
+ forEachActiveRigidBody(listener: (rigidBody: RigidBody) => void): void;
463
+ free(): void;
464
+ [member: string]: any;
465
+ // Typed loosely: the rest of the engine's own.
466
+ static fromRaw(...args: any[]): any;
467
+ takeSnapshot(...args: any[]): any;
468
+ static restoreSnapshot(...args: any[]): any;
469
+ debugRender(...args: any[]): any;
470
+ lengthUnit: any;
471
+ numSolverIterations: any;
472
+ numInternalPgsIterations: any;
473
+ maxCcdSubsteps: any;
474
+ removeCharacterController(...args: any[]): any;
475
+ createPidController(...args: any[]): any;
476
+ removePidController(...args: any[]): any;
477
+ removeVehicleController(...args: any[]): any;
478
+ createMultibodyJoint(...args: any[]): any;
479
+ getRigidBody(...args: any[]): any;
480
+ getCollider(...args: any[]): any;
481
+ getImpulseJoint(...args: any[]): any;
482
+ getMultibodyJoint(...args: any[]): any;
483
+ removeMultibodyJoint(...args: any[]): any;
484
+ forEachCollider(...args: any[]): any;
485
+ forEachRigidBody(...args: any[]): any;
486
+ intersectionsWithRay(...args: any[]): any;
487
+ intersectionWithShape(...args: any[]): any;
488
+ projectPoint(...args: any[]): any;
489
+ projectPointAndGetFeature(...args: any[]): any;
490
+ intersectionsWithPoint(...args: any[]): any;
491
+ collidersWithAabbIntersectingAabb(...args: any[]): any;
492
+ contactPairsWith(...args: any[]): any;
493
+ intersectionPairsWith(...args: any[]): any;
494
+ contactPair(...args: any[]): any;
495
+ intersectionPair(...args: any[]): any;
496
+ profilerEnabled: any;
497
+ timingStep(...args: any[]): any;
498
+ timingCollisionDetection(...args: any[]): any;
499
+ timingBroadPhase(...args: any[]): any;
500
+ timingNarrowPhase(...args: any[]): any;
501
+ timingSolver(...args: any[]): any;
502
+ timingVelocityAssembly(...args: any[]): any;
503
+ timingVelocityResolution(...args: any[]): any;
504
+ timingVelocityUpdate(...args: any[]): any;
505
+ timingVelocityWriteback(...args: any[]): any;
506
+ timingCcd(...args: any[]): any;
507
+ timingCcdToiComputation(...args: any[]): any;
508
+ timingCcdBroadPhase(...args: any[]): any;
509
+ timingCcdNarrowPhase(...args: any[]): any;
510
+ timingCcdSolver(...args: any[]): any;
511
+ timingIslandConstruction(...args: any[]): any;
512
+ timingUserChanges(...args: any[]): any;
513
+ }
514
+
515
+ /** Starts the engine from its compiled WebAssembly. The piece does it: loadPhysics() in a game, its server.js on a game server. */
516
+ export declare function startEngine(wasmModule: WebAssembly.Module): void;
517
+ export declare function startEngineLater(wasm: unknown): Promise<void>;
518
+
519
+ // ---- The rest of the engine, typed loosely: every class and call rapier.js exports, for a game's own use ----
520
+
521
+ export declare class BroadPhase {
522
+ free(...args: any[]): any;
523
+ castRay(...args: any[]): any;
524
+ castRayAndGetNormal(...args: any[]): any;
525
+ intersectionsWithRay(...args: any[]): any;
526
+ intersectionWithShape(...args: any[]): any;
527
+ projectPoint(...args: any[]): any;
528
+ projectPointAndGetFeature(...args: any[]): any;
529
+ intersectionsWithPoint(...args: any[]): any;
530
+ castShape(...args: any[]): any;
531
+ intersectionsWithShape(...args: any[]): any;
532
+ collidersWithAabbIntersectingAabb(...args: any[]): any;
533
+ }
534
+
535
+ export declare class CCDSolver {
536
+ free(...args: any[]): any;
537
+ }
538
+
539
+ export declare class CharacterCollision {
540
+ }
541
+
542
+ export declare class ColliderSet {
543
+ free(...args: any[]): any;
544
+ castClosure(...args: any[]): any;
545
+ finalizeDeserialization(...args: any[]): any;
546
+ createCollider(...args: any[]): any;
547
+ remove(...args: any[]): any;
548
+ unmap(...args: any[]): any;
549
+ get(...args: any[]): any;
550
+ len(...args: any[]): any;
551
+ contains(...args: any[]): any;
552
+ forEach(...args: any[]): any;
553
+ getAll(...args: any[]): any;
554
+ }
555
+
556
+ export declare class ColliderShapeCastHit extends ShapeCastHit {
557
+ static fromRaw(...args: any[]): any;
558
+ }
559
+
560
+ export declare class Cone extends Shape {
561
+ intoRaw(...args: any[]): any;
562
+ }
563
+
564
+ export declare class ConvexPolyhedron extends Shape {
565
+ intoRaw(...args: any[]): any;
566
+ }
567
+
568
+ export declare class Cylinder extends Shape {
569
+ intoRaw(...args: any[]): any;
570
+ }
571
+
572
+ export declare class DebugRenderBuffers {
573
+ }
574
+
575
+ export declare class DebugRenderPipeline {
576
+ free(...args: any[]): any;
577
+ render(...args: any[]): any;
578
+ }
579
+
580
+ export declare class FixedImpulseJoint extends ImpulseJoint {
581
+ }
582
+
583
+ export declare class FixedMultibodyJoint extends MultibodyJoint {
584
+ }
585
+
586
+ export declare class GenericImpulseJoint extends ImpulseJoint {
587
+ }
588
+
589
+ export declare class HalfSpace extends Shape {
590
+ intoRaw(...args: any[]): any;
591
+ }
592
+
593
+ export declare class Heightfield extends Shape {
594
+ intoRaw(...args: any[]): any;
595
+ }
596
+
597
+ export declare class ImpulseJointSet {
598
+ free(...args: any[]): any;
599
+ finalizeDeserialization(...args: any[]): any;
600
+ createJoint(...args: any[]): any;
601
+ remove(...args: any[]): any;
602
+ forEachJointHandleAttachedToRigidBody(...args: any[]): any;
603
+ unmap(...args: any[]): any;
604
+ len(...args: any[]): any;
605
+ contains(...args: any[]): any;
606
+ get(...args: any[]): any;
607
+ forEach(...args: any[]): any;
608
+ getAll(...args: any[]): any;
609
+ }
610
+
611
+ export declare class IntegrationParameters {
612
+ free(...args: any[]): any;
613
+ dt: any;
614
+ readonly contact_erp: any;
615
+ lengthUnit: any;
616
+ normalizedAllowedLinearError: any;
617
+ normalizedPredictionDistance: any;
618
+ numSolverIterations: any;
619
+ numInternalPgsIterations: any;
620
+ minIslandSize: any;
621
+ maxCcdSubsteps: any;
622
+ contact_natural_frequency(...args: any[]): any;
623
+ }
624
+
625
+ export declare class IslandManager {
626
+ free(...args: any[]): any;
627
+ forEachActiveRigidBodyHandle(...args: any[]): any;
628
+ }
629
+
630
+ export declare class MultibodyJoint {
631
+ static newTyped(...args: any[]): any;
632
+ isValid(...args: any[]): any;
633
+ setContactsEnabled(...args: any[]): any;
634
+ contactsEnabled(...args: any[]): any;
635
+ }
636
+
637
+ export declare class MultibodyJointSet {
638
+ free(...args: any[]): any;
639
+ createJoint(...args: any[]): any;
640
+ remove(...args: any[]): any;
641
+ unmap(...args: any[]): any;
642
+ len(...args: any[]): any;
643
+ contains(...args: any[]): any;
644
+ get(...args: any[]): any;
645
+ forEach(...args: any[]): any;
646
+ forEachJointHandleAttachedToRigidBody(...args: any[]): any;
647
+ getAll(...args: any[]): any;
648
+ }
649
+
650
+ export declare class NarrowPhase {
651
+ free(...args: any[]): any;
652
+ contactPairsWith(...args: any[]): any;
653
+ intersectionPairsWith(...args: any[]): any;
654
+ contactPair(...args: any[]): any;
655
+ intersectionPair(...args: any[]): any;
656
+ }
657
+
658
+ export declare class PhysicsPipeline {
659
+ free(...args: any[]): any;
660
+ step(...args: any[]): any;
661
+ }
662
+
663
+ export declare class PidController {
664
+ free(...args: any[]): any;
665
+ setKp(...args: any[]): any;
666
+ setKi(...args: any[]): any;
667
+ setKd(...args: any[]): any;
668
+ setAxes(...args: any[]): any;
669
+ resetIntegrals(...args: any[]): any;
670
+ applyLinearCorrection(...args: any[]): any;
671
+ applyAngularCorrection(...args: any[]): any;
672
+ linearCorrection(...args: any[]): any;
673
+ angularCorrection(...args: any[]): any;
674
+ }
675
+
676
+ export declare class PointColliderProjection {
677
+ static fromRaw(...args: any[]): any;
678
+ }
679
+
680
+ export declare class PointProjection {
681
+ static fromRaw(...args: any[]): any;
682
+ }
683
+
684
+ export declare class Polyline extends Shape {
685
+ intoRaw(...args: any[]): any;
686
+ }
687
+
688
+ export declare class PrismaticImpulseJoint extends UnitImpulseJoint {
689
+ rawAxis(...args: any[]): any;
690
+ }
691
+
692
+ export declare class PrismaticMultibodyJoint extends UnitMultibodyJoint {
693
+ rawAxis(...args: any[]): any;
694
+ }
695
+
696
+ export declare class Quaternion {
697
+ }
698
+
699
+ export declare class RayColliderHit {
700
+ static fromRaw(...args: any[]): any;
701
+ }
702
+
703
+ export declare class RayColliderIntersection {
704
+ static fromRaw(...args: any[]): any;
705
+ }
706
+
707
+ export declare class RayIntersection {
708
+ static fromRaw(...args: any[]): any;
709
+ }
710
+
711
+ export declare class RevoluteImpulseJoint extends UnitImpulseJoint {
712
+ rawAxis(...args: any[]): any;
713
+ }
714
+
715
+ export declare class RevoluteMultibodyJoint extends UnitMultibodyJoint {
716
+ rawAxis(...args: any[]): any;
717
+ }
718
+
719
+ export declare class RigidBodySet {
720
+ free(...args: any[]): any;
721
+ finalizeDeserialization(...args: any[]): any;
722
+ createRigidBody(...args: any[]): any;
723
+ remove(...args: any[]): any;
724
+ len(...args: any[]): any;
725
+ contains(...args: any[]): any;
726
+ get(...args: any[]): any;
727
+ forEach(...args: any[]): any;
728
+ forEachActiveRigidBody(...args: any[]): any;
729
+ getAll(...args: any[]): any;
730
+ }
731
+
732
+ export declare class RopeImpulseJoint extends ImpulseJoint {
733
+ }
734
+
735
+ export declare class RotationOps {
736
+ static identity(...args: any[]): any;
737
+ static fromRaw(...args: any[]): any;
738
+ static intoRaw(...args: any[]): any;
739
+ static copy(...args: any[]): any;
740
+ }
741
+
742
+ export declare class RoundCone extends Shape {
743
+ intoRaw(...args: any[]): any;
744
+ }
745
+
746
+ export declare class RoundConvexPolyhedron extends Shape {
747
+ intoRaw(...args: any[]): any;
748
+ }
749
+
750
+ export declare class RoundCuboid extends Shape {
751
+ intoRaw(...args: any[]): any;
752
+ }
753
+
754
+ export declare class RoundCylinder extends Shape {
755
+ intoRaw(...args: any[]): any;
756
+ }
757
+
758
+ export declare class RoundTriangle extends Shape {
759
+ intoRaw(...args: any[]): any;
760
+ }
761
+
762
+ export declare class SdpMatrix3 {
763
+ readonly m11: any;
764
+ readonly m12: any;
765
+ readonly m21: any;
766
+ readonly m13: any;
767
+ readonly m31: any;
768
+ readonly m22: any;
769
+ readonly m23: any;
770
+ readonly m32: any;
771
+ readonly m33: any;
772
+ }
773
+
774
+ export declare class SdpMatrix3Ops {
775
+ static fromRaw(...args: any[]): any;
776
+ }
777
+
778
+ export declare class Segment extends Shape {
779
+ intoRaw(...args: any[]): any;
780
+ }
781
+
782
+ export declare class SerializationPipeline {
783
+ free(...args: any[]): any;
784
+ serializeAll(...args: any[]): any;
785
+ deserializeAll(...args: any[]): any;
786
+ }
787
+
788
+ export declare class Shape {
789
+ static fromRaw(...args: any[]): any;
790
+ castShape(...args: any[]): any;
791
+ intersectsShape(...args: any[]): any;
792
+ contactShape(...args: any[]): any;
793
+ containsPoint(...args: any[]): any;
794
+ projectPoint(...args: any[]): any;
795
+ intersectsRay(...args: any[]): any;
796
+ castRay(...args: any[]): any;
797
+ castRayAndGetNormal(...args: any[]): any;
798
+ }
799
+
800
+ export declare class ShapeCastHit {
801
+ static fromRaw(...args: any[]): any;
802
+ }
803
+
804
+ export declare class ShapeContact {
805
+ static fromRaw(...args: any[]): any;
806
+ }
807
+
808
+ export declare class SphericalImpulseJoint extends ImpulseJoint {
809
+ }
810
+
811
+ export declare class SphericalMultibodyJoint extends MultibodyJoint {
812
+ }
813
+
814
+ export declare class SpringImpulseJoint extends ImpulseJoint {
815
+ }
816
+
817
+ export declare class TempContactForceEvent {
818
+ free(...args: any[]): any;
819
+ collider1(...args: any[]): any;
820
+ collider2(...args: any[]): any;
821
+ totalForce(...args: any[]): any;
822
+ totalForceMagnitude(...args: any[]): any;
823
+ maxForceDirection(...args: any[]): any;
824
+ maxForceMagnitude(...args: any[]): any;
825
+ }
826
+
827
+ export declare class TempContactManifold {
828
+ free(...args: any[]): any;
829
+ normal(...args: any[]): any;
830
+ localNormal1(...args: any[]): any;
831
+ localNormal2(...args: any[]): any;
832
+ subshape1(...args: any[]): any;
833
+ subshape2(...args: any[]): any;
834
+ numContacts(...args: any[]): any;
835
+ localContactPoint1(...args: any[]): any;
836
+ localContactPoint2(...args: any[]): any;
837
+ contactDist(...args: any[]): any;
838
+ contactFid1(...args: any[]): any;
839
+ contactFid2(...args: any[]): any;
840
+ contactImpulse(...args: any[]): any;
841
+ contactTangentImpulseX(...args: any[]): any;
842
+ contactTangentImpulseY(...args: any[]): any;
843
+ numSolverContacts(...args: any[]): any;
844
+ solverContactPoint(...args: any[]): any;
845
+ solverContactDist(...args: any[]): any;
846
+ solverContactFriction(...args: any[]): any;
847
+ solverContactRestitution(...args: any[]): any;
848
+ solverContactTangentVelocity(...args: any[]): any;
849
+ }
850
+
851
+ export declare class TriMesh extends Shape {
852
+ intoRaw(...args: any[]): any;
853
+ }
854
+
855
+ export declare class Triangle extends Shape {
856
+ intoRaw(...args: any[]): any;
857
+ }
858
+
859
+ export declare class UnitImpulseJoint extends ImpulseJoint {
860
+ limitsEnabled(...args: any[]): any;
861
+ limitsMin(...args: any[]): any;
862
+ limitsMax(...args: any[]): any;
863
+ setLimits(...args: any[]): any;
864
+ configureMotorModel(...args: any[]): any;
865
+ configureMotorVelocity(...args: any[]): any;
866
+ configureMotorPosition(...args: any[]): any;
867
+ configureMotor(...args: any[]): any;
868
+ }
869
+
870
+ export declare class UnitMultibodyJoint extends MultibodyJoint {
871
+ }
872
+
873
+ export declare class Vector3 {
874
+ }
875
+
876
+ export declare class VectorOps {
877
+ static new(...args: any[]): any;
878
+ static intoRaw(...args: any[]): any;
879
+ static zeros(...args: any[]): any;
880
+ static fromRaw(...args: any[]): any;
881
+ static copy(...args: any[]): any;
882
+ }
883
+
884
+ export declare class Voxels extends Shape {
885
+ intoRaw(...args: any[]): any;
886
+ }
887
+
888
+ export declare const ActiveCollisionTypes: any;
889
+ export declare const ActiveEvents: any;
890
+ export declare const ActiveHooks: any;
891
+ export declare const CoefficientCombineRule: any;
892
+ export declare const FeatureType: any;
893
+ export declare const HeightFieldFlags: any;
894
+ export declare const JointAxesMask: any;
895
+ export declare const JointType: any;
896
+ export declare const MassPropsMode: any;
897
+ export declare const MotorModel: any;
898
+ export declare const PidAxesMask: any;
899
+ export declare const ShapeType: any;
900
+ export declare const SolverFlags: any;
901
+ export declare const TriMeshFlags: any;
902
+ export declare const reserveMemory: any;
903
+ export declare const version: any;