react-three-rapier-unified 1.0.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,1191 @@
1
+ import { ActiveCollisionTypes } from '@dimforge/rapier3d-compat';
2
+ import { CoefficientCombineRule } from '@dimforge/rapier3d-compat';
3
+ import { ColliderHandle } from '@dimforge/rapier3d-compat';
4
+ import { default as default_2 } from 'react';
5
+ import { default as default_3 } from '@dimforge/rapier3d-compat';
6
+ import { Euler } from 'three';
7
+ import { FC } from 'react';
8
+ import { FixedImpulseJoint } from '@dimforge/rapier3d-compat';
9
+ import { ImpulseJoint } from '@dimforge/rapier3d-compat';
10
+ import { InteractionGroups } from '@dimforge/rapier3d-compat';
11
+ import { JSX } from 'react/jsx-runtime';
12
+ import { Matrix4 } from 'three';
13
+ import { Object3D } from 'three';
14
+ import { PrismaticImpulseJoint } from '@dimforge/rapier3d-compat';
15
+ import { Quaternion } from '@react-three/fiber';
16
+ import { Quaternion as Quaternion_2 } from 'three';
17
+ import { Collider as RapierCollider } from '@dimforge/rapier3d-compat';
18
+ import { RigidBody as RapierRigidBody } from '@dimforge/rapier3d-compat';
19
+ import { ReactNode } from 'react';
20
+ import { Ref } from 'react';
21
+ import { RefObject } from 'react';
22
+ import { RevoluteImpulseJoint } from '@dimforge/rapier3d-compat';
23
+ import { RigidBodyHandle } from '@dimforge/rapier3d-compat';
24
+ import { RopeImpulseJoint } from '@dimforge/rapier3d-compat';
25
+ import { Rotation } from '@dimforge/rapier3d-compat';
26
+ import { SolverFlags } from '@dimforge/rapier3d-compat';
27
+ import { SphericalImpulseJoint } from '@dimforge/rapier3d-compat';
28
+ import { SpringImpulseJoint } from '@dimforge/rapier3d-compat';
29
+ import { TempContactManifold } from '@dimforge/rapier3d-compat';
30
+ import { ThreeElements } from '@react-three/fiber';
31
+ import { Vector } from '@dimforge/rapier3d-compat';
32
+ import { Vector3 } from 'three';
33
+ import { Vector3 as Vector3_2 } from '@react-three/fiber';
34
+ import { World } from '@dimforge/rapier3d-compat';
35
+
36
+ /* Excluded from this release type: AnyCollider */
37
+
38
+ export declare const applyAttractorForceOnRigidBody: (rigidBody: RapierRigidBody, { object, strength, range, gravitationalConstant, collisionGroups, type }: AttractorState & {
39
+ object: Object3D;
40
+ }) => void;
41
+
42
+ export declare const Attractor: FC<AttractorProps>;
43
+
44
+ export declare const AttractorDebugHelper: (props: AttractorState & {
45
+ object: RefObject<Object3D>;
46
+ }) => any;
47
+
48
+ export declare type AttractorGravityType = "static" | "linear" | "newtonian";
49
+
50
+ export declare interface AttractorProps {
51
+ /**
52
+ * The relative position of this attractor
53
+ */
54
+ position?: Object3DProps["position"];
55
+ /**
56
+ * The strength of the attractor.
57
+ * Positive values attract, negative values repel.
58
+ *
59
+ * @defaultValue 1
60
+ */
61
+ strength?: number;
62
+ /**
63
+ * The range of the attractor. Will not affect objects outside of this range.
64
+ *
65
+ * @defaultValue 10
66
+ * @min 0
67
+ */
68
+ range?: number;
69
+ /**
70
+ * The type of gravity to use.
71
+ * - static: The gravity is constant and does not change over time.
72
+ * - linear: The gravity is linearly interpolated the closer the object is to the attractor.
73
+ * - newtonian: The gravity is calculated using the newtonian gravity formula.
74
+ * @defaultValue "static"
75
+ */
76
+ type?: AttractorGravityType;
77
+ /**
78
+ * The mass of the attractor. Used when type is `newtonian`.
79
+ * @defaultValue 6.673e-11
80
+ */
81
+ gravitationalConstant?: number;
82
+ /**
83
+ * The collision groups that this attractor will apply effects to. If a RigidBody contains one or more colliders that are in one of the mask group, it will be affected by this attractor.
84
+ * If not specified, the attractor will apply effects to all RigidBodies.
85
+ */
86
+ collisionGroups?: InteractionGroups;
87
+ }
88
+
89
+ export declare interface AttractorState extends Required<Omit<AttractorProps, "position" | "collisionGroups">> {
90
+ collisionGroups?: InteractionGroups;
91
+ }
92
+
93
+ export declare type BallArgs = [radius: number];
94
+
95
+ /**
96
+ * A ball collider shape
97
+ * @category Colliders
98
+ */
99
+ export declare const BallCollider: default_2.ForwardRefExoticComponent<Omit<ColliderOptions<BallArgs>, "args"> & {
100
+ args: BallArgs;
101
+ children?: ReactNode;
102
+ } & default_2.RefAttributes<RapierCollider>>;
103
+
104
+ export declare type BallColliderProps = ColliderOptionsRequiredArgs<BallArgs>;
105
+
106
+ export declare type Boolean3Tuple = [x: boolean, y: boolean, z: boolean];
107
+
108
+ export declare type CapsuleArgs = [halfHeight: number, radius: number];
109
+
110
+ /**
111
+ * A capsule collider shape
112
+ * @category Colliders
113
+ */
114
+ export declare const CapsuleCollider: default_2.ForwardRefExoticComponent<Omit<ColliderOptions<CapsuleArgs>, "args"> & {
115
+ args: CapsuleArgs;
116
+ children?: ReactNode;
117
+ } & default_2.RefAttributes<RapierCollider>>;
118
+
119
+ export declare type CapsuleColliderProps = ColliderOptionsRequiredArgs<CapsuleArgs>;
120
+
121
+ export { CoefficientCombineRule }
122
+
123
+ export declare interface ColliderOptions<ColliderArgs extends Array<unknown>> {
124
+ /**
125
+ * The optional name passed to THREE's Object3D
126
+ */
127
+ name?: string;
128
+ /**
129
+ * The shape of your collider
130
+ */
131
+ shape?: ColliderShape;
132
+ /**
133
+ * Arguments to pass to the collider
134
+ */
135
+ args?: ColliderArgs;
136
+ /**
137
+ * Principal angular inertia of this rigid body
138
+ */
139
+ principalAngularInertia?: Vector3Tuple;
140
+ /**
141
+ * Restitution controls how elastic (aka. bouncy) a contact is. Le elasticity of a contact is controlled by the restitution coefficient
142
+ */
143
+ restitution?: number;
144
+ /**
145
+ * What happens when two bodies meet. See https://rapier.rs/docs/user_guides/javascript/colliders#friction.
146
+ */
147
+ restitutionCombineRule?: CoefficientCombineRule;
148
+ /**
149
+ * Friction is a force that opposes the relative tangential motion between two rigid-bodies with colliders in contact.
150
+ * A friction coefficient of 0 implies no friction at all (completely sliding contact) and a coefficient
151
+ * greater or equal to 1 implies a very strong friction. Values greater than 1 are allowed.
152
+ */
153
+ friction?: number;
154
+ /**
155
+ * What happens when two bodies meet. See https://rapier.rs/docs/user_guides/javascript/colliders#friction.
156
+ */
157
+ frictionCombineRule?: CoefficientCombineRule;
158
+ /**
159
+ * The position of this collider relative to the rigid body
160
+ */
161
+ position?: ThreeElements["object3D"]["position"];
162
+ /**
163
+ * The rotation of this collider relative to the rigid body
164
+ */
165
+ rotation?: ThreeElements["object3D"]["rotation"];
166
+ /**
167
+ * The rotation, as a Quaternion, of this collider relative to the rigid body
168
+ */
169
+ quaternion?: ThreeElements["object3D"]["quaternion"];
170
+ /**
171
+ * The scale of this collider relative to the rigid body
172
+ */
173
+ scale?: ThreeElements["object3D"]["scale"];
174
+ /**
175
+ * Callback when this collider collideas with another collider.
176
+ */
177
+ onCollisionEnter?: CollisionEnterHandler;
178
+ /**
179
+ * Callback when this collider stops colliding with another collider.
180
+ */
181
+ onCollisionExit?: CollisionExitHandler;
182
+ /**
183
+ * Callback when this collider, or another collider starts intersecting, and at least one of them is a `sensor`.
184
+ */
185
+ onIntersectionEnter?: IntersectionEnterHandler;
186
+ /**
187
+ * Callback when this, or another collider stops intersecting, and at least one of them is a `sensor`.
188
+ */
189
+ onIntersectionExit?: IntersectionExitHandler;
190
+ /**
191
+ * Callback when this, or another collider triggers a contact force event
192
+ */
193
+ onContactForce?: ContactForceHandler;
194
+ /**
195
+ * The bit mask configuring the groups and mask for collision handling.
196
+ */
197
+ collisionGroups?: InteractionGroups;
198
+ /**
199
+ * The bit mask configuring the groups and mask for solver handling.
200
+ */
201
+ solverGroups?: InteractionGroups;
202
+ /**
203
+ * The collision types active for this collider.
204
+ *
205
+ * Use `ActiveCollisionTypes` to specify which collision types should be active for this collider.
206
+ *
207
+ * @see https://rapier.rs/javascript3d/classes/Collider.html#setActiveCollisionTypes
208
+ * @see https://rapier.rs/javascript3d/enums/ActiveCollisionTypes.html
209
+ */
210
+ activeCollisionTypes?: ActiveCollisionTypes;
211
+ /**
212
+ * Sets the uniform density of this collider.
213
+ * If this is set, other mass-properties like the angular inertia tensor are computed
214
+ * automatically from the collider's shape.
215
+ * Cannot be used at the same time as the mass or massProperties values.
216
+ * More info https://rapier.rs/docs/user_guides/javascript/colliders#mass-properties
217
+ */
218
+ density?: number;
219
+ /**
220
+ * The mass of this collider.
221
+ * Generally, it's not recommended to adjust the mass properties as it could lead to
222
+ * unexpected behaviors.
223
+ * Cannot be used at the same time as the density or massProperties values.
224
+ * More info https://rapier.rs/docs/user_guides/javascript/colliders#mass-properties
225
+ */
226
+ mass?: number;
227
+ /**
228
+ * The mass properties of this rigid body.
229
+ * Cannot be used at the same time as the density or mass values.
230
+ */
231
+ massProperties?: {
232
+ mass: number;
233
+ centerOfMass: Vector;
234
+ principalAngularInertia: Vector;
235
+ angularInertiaLocalFrame: Rotation;
236
+ };
237
+ /**
238
+ * The contact skin of the collider.
239
+ *
240
+ * The contact skin acts as if the collider was enlarged with a skin of width contactSkin around it, keeping objects further apart when colliding.
241
+ *
242
+ * A non-zero contact skin can increase performance, and in some cases, stability.
243
+ * However it creates a small gap between colliding object (equal to the sum of their skin).
244
+ * If the skin is sufficiently small, this might not be visually significant or can be hidden by the rendering assets.
245
+ *
246
+ * @defaultValue 0
247
+ */
248
+ contactSkin?: number;
249
+ /**
250
+ * Sets whether or not this collider is a sensor.
251
+ */
252
+ sensor?: boolean;
253
+ }
254
+
255
+ export declare type ColliderOptionsRequiredArgs<T extends unknown[]> = Omit<ColliderOptions<T>, "args"> & {
256
+ args: T;
257
+ children?: ReactNode;
258
+ };
259
+
260
+ export declare interface ColliderProps extends ColliderOptions<any> {
261
+ children?: ReactNode;
262
+ ref?: Ref<RapierCollider>;
263
+ }
264
+
265
+ export declare type ColliderShape = "cuboid" | "trimesh" | "ball" | "capsule" | "convexHull" | "heightfield" | "polyline" | "roundCuboid" | "cylinder" | "roundCylinder" | "cone" | "roundCone" | "convexMesh" | "roundConvexHull" | "roundConvexMesh";
266
+
267
+ declare interface ColliderState {
268
+ collider: RapierCollider;
269
+ object: Object3D;
270
+ /**
271
+ * The parent of which this collider needs to base its
272
+ * world position on, can be empty
273
+ */
274
+ worldParent?: Object3D;
275
+ }
276
+
277
+ declare type ColliderStateMap = Map<RapierCollider["handle"], ColliderState>;
278
+
279
+ export declare type CollisionEnterHandler = (payload: CollisionEnterPayload) => void;
280
+
281
+ export declare type CollisionEnterPayload = CollisionPayload & {
282
+ manifold: TempContactManifold;
283
+ flipped: boolean;
284
+ };
285
+
286
+ export declare type CollisionExitHandler = (payload: CollisionExitPayload) => void;
287
+
288
+ export declare type CollisionExitPayload = CollisionPayload;
289
+
290
+ export declare type CollisionPayload = {
291
+ /** the object firing the event */
292
+ target: CollisionTarget;
293
+ /** the other object involved in the event */
294
+ other: CollisionTarget;
295
+ /** deprecated use `payload.other.rigidBody` instead */
296
+ rigidBody?: RapierRigidBody;
297
+ /** deprecated use `payload.other.collider` instead */
298
+ collider: RapierCollider;
299
+ /** deprecated use `payload.other.rigidBodyObject` instead */
300
+ rigidBodyObject?: Object3D;
301
+ /** deprecated use `payload.other.colliderObject` instead */
302
+ colliderObject?: Object3D;
303
+ };
304
+
305
+ export declare type CollisionTarget = {
306
+ rigidBody?: RapierRigidBody;
307
+ collider: RapierCollider;
308
+ rigidBodyObject?: Object3D;
309
+ colliderObject?: Object3D;
310
+ };
311
+
312
+ export declare type ConeArgs = [halfHeight: number, radius: number];
313
+
314
+ /**
315
+ * A cone collider shape
316
+ * @category Colliders
317
+ */
318
+ export declare const ConeCollider: default_2.ForwardRefExoticComponent<Omit<ColliderOptions<ConeArgs>, "args"> & {
319
+ args: ConeArgs;
320
+ children?: ReactNode;
321
+ } & default_2.RefAttributes<RapierCollider>>;
322
+
323
+ export declare type ConeColliderProps = ColliderOptionsRequiredArgs<ConeArgs>;
324
+
325
+ export declare type ContactForceHandler = (payload: ContactForcePayload) => void;
326
+
327
+ export declare type ContactForcePayload = CollisionPayload & {
328
+ totalForce: Vector;
329
+ totalForceMagnitude: number;
330
+ maxForceDirection: Vector;
331
+ maxForceMagnitude: number;
332
+ };
333
+
334
+ export declare type ConvexHullArgs = [vertices: ArrayLike<number>];
335
+
336
+ /**
337
+ * A convex hull collider shape
338
+ * @category Colliders
339
+ */
340
+ export declare const ConvexHullCollider: default_2.ForwardRefExoticComponent<Omit<ColliderOptions<ConvexHullArgs>, "args"> & {
341
+ args: ConvexHullArgs;
342
+ children?: ReactNode;
343
+ } & default_2.RefAttributes<RapierCollider>>;
344
+
345
+ export declare type ConvexHullColliderProps = ColliderOptionsRequiredArgs<ConvexHullArgs>;
346
+
347
+ export declare type ConvexMeshArgs = [
348
+ vertices: ArrayLike<number>,
349
+ indices: ArrayLike<number>
350
+ ];
351
+
352
+ export declare type CuboidArgs = [
353
+ halfWidth: number,
354
+ halfHeight: number,
355
+ halfDepth: number
356
+ ];
357
+
358
+ /**
359
+ * A cuboid collider shape
360
+ * @category Colliders
361
+ */
362
+ export declare const CuboidCollider: default_2.ForwardRefExoticComponent<Omit<ColliderOptions<CuboidArgs>, "args"> & {
363
+ args: CuboidArgs;
364
+ children?: ReactNode;
365
+ } & default_2.RefAttributes<RapierCollider>>;
366
+
367
+ export declare type CuboidColliderProps = ColliderOptionsRequiredArgs<CuboidArgs>;
368
+
369
+ export declare type CylinderArgs = [halfHeight: number, radius: number];
370
+
371
+ /**
372
+ * A cylinder collider shape
373
+ * @category Colliders
374
+ */
375
+ export declare const CylinderCollider: default_2.ForwardRefExoticComponent<Omit<ColliderOptions<CylinderArgs>, "args"> & {
376
+ args: CylinderArgs;
377
+ children?: ReactNode;
378
+ } & default_2.RefAttributes<RapierCollider>>;
379
+
380
+ export declare type CylinderColliderProps = ColliderOptionsRequiredArgs<CylinderArgs>;
381
+
382
+ /**
383
+ * Takes an object resembling an Euler and returs a Three.Euler
384
+ * @category Math helpers
385
+ */
386
+ export declare const euler: ({ x, y, z }?: {
387
+ x: number;
388
+ y: number;
389
+ z: number;
390
+ }) => Euler;
391
+
392
+ declare type EventMap = Map<ColliderHandle | RigidBodyHandle, EventMapValue>;
393
+
394
+ declare type EventMapValue = {
395
+ onSleep?(): void;
396
+ onWake?(): void;
397
+ onCollisionEnter?: CollisionEnterHandler;
398
+ onCollisionExit?: CollisionExitHandler;
399
+ onIntersectionEnter?: IntersectionEnterHandler;
400
+ onIntersectionExit?: IntersectionExitHandler;
401
+ onContactForce?: ContactForceHandler;
402
+ };
403
+
404
+ export declare type FilterContactPairCallback = (collider1: ColliderHandle, collider2: ColliderHandle, body1: RigidBodyHandle, body2: RigidBodyHandle) => SolverFlags | null;
405
+
406
+ declare type FilterContactPairCallbackSet = Set<{
407
+ current: FilterContactPairCallback;
408
+ }>;
409
+
410
+ export declare type FilterIntersectionPairCallback = (collider1: ColliderHandle, collider2: ColliderHandle, body1: RigidBodyHandle, body2: RigidBodyHandle) => boolean;
411
+
412
+ declare type FilterIntersectionPairCallbackSet = Set<{
413
+ current: FilterIntersectionPairCallback;
414
+ }>;
415
+
416
+ export declare type FixedJointParams = [
417
+ body1Anchor: Vector3_2,
418
+ body1LocalFrame: Quaternion,
419
+ body2Anchor: Vector3_2,
420
+ body2LocalFrame: Quaternion
421
+ ];
422
+
423
+ export declare type HeightfieldArgs = [
424
+ width: number,
425
+ height: number,
426
+ heights: number[],
427
+ scale: {
428
+ x: number;
429
+ y: number;
430
+ z: number;
431
+ }
432
+ ];
433
+
434
+ /**
435
+ * A heightfield collider shape
436
+ * @category Colliders
437
+ */
438
+ export declare const HeightfieldCollider: default_2.ForwardRefExoticComponent<Omit<ColliderOptions<HeightfieldArgs>, "args"> & {
439
+ args: HeightfieldArgs;
440
+ children?: ReactNode;
441
+ } & default_2.RefAttributes<RapierCollider>>;
442
+
443
+ export declare type HeightfieldColliderProps = ColliderOptionsRequiredArgs<HeightfieldArgs>;
444
+
445
+ export declare const InstancedRigidBodies: default_2.MemoExoticComponent<({ ref, ...props }: InstancedRigidBodiesProps) => JSX.Element>;
446
+
447
+ export declare interface InstancedRigidBodiesProps extends Omit<RigidBodyProps, "ref"> {
448
+ instances: InstancedRigidBodyProps[];
449
+ colliderNodes?: ReactNode[];
450
+ children: ReactNode;
451
+ ref?: default_2.Ref<(RapierRigidBody | null)[] | null>;
452
+ }
453
+
454
+ export declare type InstancedRigidBodyProps = RigidBodyProps & {
455
+ key: string | number;
456
+ };
457
+
458
+ /**
459
+ * Calculates an InteractionGroup bitmask for use in the `collisionGroups` or `solverGroups`
460
+ * properties of RigidBody or Collider components. The first argument represents a list of
461
+ * groups the entity is in (expressed as numbers from 0 to 15). The second argument is a list
462
+ * of groups that will be filtered against. When it is omitted, all groups are filtered against.
463
+ *
464
+ * @example
465
+ * A RigidBody that is member of group 0 and will collide with everything from groups 0 and 1:
466
+ *
467
+ * ```tsx
468
+ * <RigidBody collisionGroups={interactionGroups([0], [0, 1])} />
469
+ * ```
470
+ *
471
+ * A RigidBody that is member of groups 0 and 1 and will collide with everything else:
472
+ *
473
+ * ```tsx
474
+ * <RigidBody collisionGroups={interactionGroups([0, 1])} />
475
+ * ```
476
+ *
477
+ * A RigidBody that is member of groups 0 and 1 and will not collide with anything:
478
+ *
479
+ * ```tsx
480
+ * <RigidBody collisionGroups={interactionGroups([0, 1], [])} />
481
+ * ```
482
+ *
483
+ * Please note that Rapier needs interaction filters to evaluate to true between _both_ colliding
484
+ * entities for collision events to trigger.
485
+ *
486
+ * @param memberships Groups the collider is a member of. (Values can range from 0 to 15.)
487
+ * @param filters Groups the interaction group should filter against. (Values can range from 0 to 15.)
488
+ * @returns An InteractionGroup bitmask.
489
+ */
490
+ export declare const interactionGroups: (memberships: number | number[], filters?: number | number[]) => InteractionGroups;
491
+
492
+ export declare type IntersectionEnterHandler = (payload: IntersectionEnterPayload) => void;
493
+
494
+ export declare type IntersectionEnterPayload = CollisionPayload;
495
+
496
+ export declare type IntersectionExitHandler = (payload: IntersectionExitPayload) => void;
497
+
498
+ export declare type IntersectionExitPayload = CollisionPayload;
499
+
500
+ /**
501
+ * A mesh collider is a collider that is automatically generated from the geometry of the children.
502
+ * @category Colliders
503
+ */
504
+ export declare const MeshCollider: default_2.MemoExoticComponent<(props: MeshColliderProps) => JSX.Element>;
505
+
506
+ export declare interface MeshColliderProps {
507
+ children: ReactNode;
508
+ type: RigidBodyAutoCollider;
509
+ }
510
+
511
+ declare type Object3DProps = ThreeElements["object3D"];
512
+
513
+ /**
514
+ * The main physics component used to create a physics world.
515
+ * @category Components
516
+ */
517
+ export declare const Physics: FC<PhysicsProps>;
518
+
519
+ export declare interface PhysicsProps {
520
+ children: ReactNode;
521
+ /**
522
+ * Set the gravity of the physics world
523
+ * @defaultValue [0, -9.81, 0]
524
+ */
525
+ gravity?: Vector3Tuple;
526
+ /**
527
+ * Amount of penetration the engine wont attempt to correct
528
+ * @defaultValue 0.001
529
+ */
530
+ allowedLinearError?: number;
531
+ /**
532
+ * The number of solver iterations run by the constraints solver for calculating forces.
533
+ * The greater this value is, the most rigid and realistic the physics simulation will be.
534
+ * However a greater number of iterations is more computationally intensive.
535
+ *
536
+ * @defaultValue 4
537
+ */
538
+ numSolverIterations?: number;
539
+ /**
540
+ * Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration.
541
+ * Increasing this parameter will improve stability of the simulation. It will have a lesser effect than
542
+ * increasing `numSolverIterations` but is also less computationally expensive.
543
+ *
544
+ * @defaultValue 1
545
+ */
546
+ numInternalPgsIterations?: number;
547
+ /**
548
+ * The maximal distance separating two objects that will generate predictive contacts
549
+ *
550
+ * @defaultValue 0.002
551
+ *
552
+ */
553
+ predictionDistance?: number;
554
+ /**
555
+ * Minimum number of dynamic bodies in each active island
556
+ *
557
+ * @defaultValue 128
558
+ */
559
+ minIslandSize?: number;
560
+ /**
561
+ * Maximum number of substeps performed by the solver
562
+ *
563
+ * @defaultValue 1
564
+ */
565
+ maxCcdSubsteps?: number;
566
+ /**
567
+ * Directly affects the `erp` (Error Reduction Parameter) which is the proportion (0 to 1) of the positional error to be corrected at each time step.
568
+ * The higher this value is, the more the physics engine will try to correct errors.
569
+ *
570
+ * This prop is currently undocumented in the Rapier documentation.
571
+ *
572
+ * @see https://github.com/dimforge/rapier/pull/651 where this change was made to Rapier
573
+ * @defaultValue 30
574
+ */
575
+ contactNaturalFrequency?: number;
576
+ /**
577
+ * The approximate size of most dynamic objects in the scene.
578
+ *
579
+ * This value is used internally to estimate some length-based tolerance.
580
+ * This value can be understood as the number of units-per-meter in your physical world compared to a human-sized world in meter.
581
+ *
582
+ * @defaultValue 1
583
+ */
584
+ lengthUnit?: number;
585
+ /**
586
+ * Set the base automatic colliders for this physics world
587
+ * All Meshes inside RigidBodies will generate a collider
588
+ * based on this value, if not overridden.
589
+ */
590
+ colliders?: RigidBodyAutoCollider;
591
+ /**
592
+ * Set the timestep for the simulation.
593
+ * Setting this to a number (eg. 1/60) will run the
594
+ * simulation at that framerate. Alternatively, you can set this to
595
+ * "vary", which will cause the simulation to always synchronize with
596
+ * the current frame delta times.
597
+ *
598
+ * @defaultValue 1/60
599
+ */
600
+ timeStep?: number | "vary";
601
+ /**
602
+ * Pause the physics simulation
603
+ *
604
+ * @defaultValue false
605
+ */
606
+ paused?: boolean;
607
+ /**
608
+ * Interpolate the world transform using the frame delta times.
609
+ * Has no effect if timeStep is set to "vary".
610
+ *
611
+ * @defaultValue true
612
+ **/
613
+ interpolate?: boolean;
614
+ /**
615
+ * The update priority at which the physics simulation should run.
616
+ * Only used when `updateLoop` is set to "follow".
617
+ *
618
+ * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#taking-over-the-render-loop
619
+ * @defaultValue undefined
620
+ */
621
+ updatePriority?: number;
622
+ /**
623
+ * Set the update loop strategy for the physics world.
624
+ *
625
+ * If set to "follow", the physics world will be stepped
626
+ * in a `useFrame` callback, managed by @react-three/fiber.
627
+ * You can use `updatePriority` prop to manage the scheduling.
628
+ *
629
+ * If set to "independent", the physics world will be stepped
630
+ * in a separate loop, not tied to the render loop.
631
+ * This is useful when using the "demand" `frameloop` strategy for the
632
+ * @react-three/fiber `<Canvas />`.
633
+ *
634
+ * @see https://docs.pmnd.rs/react-three-fiber/advanced/scaling-performance#on-demand-rendering
635
+ * @defaultValue "follow"
636
+ */
637
+ updateLoop?: "follow" | "independent";
638
+ /**
639
+ * Enable debug rendering of the physics world.
640
+ * @defaultValue false
641
+ */
642
+ debug?: boolean;
643
+ }
644
+
645
+ export declare type PolylineArgs = [vertices: Float32Array, indices: Uint32Array];
646
+
647
+ export declare type PrismaticJointParams = [
648
+ body1Anchor: Vector3_2,
649
+ body2Anchor: Vector3_2,
650
+ axis: Vector3_2,
651
+ limits?: [min: number, max: number]
652
+ ];
653
+
654
+ /**
655
+ * Takes an object resembling a Quaternion and returs a Three.Quaternion
656
+ * @category Math helpers
657
+ */
658
+ export declare const quat: ({ x, y, z, w }?: {
659
+ x: number;
660
+ y: number;
661
+ z: number;
662
+ w: number;
663
+ }) => Quaternion_2;
664
+
665
+ export { RapierCollider }
666
+
667
+ export declare interface RapierContext {
668
+ /* Excluded from this release type: rigidBodyStates */
669
+ /* Excluded from this release type: colliderStates */
670
+ /* Excluded from this release type: rigidBodyEvents */
671
+ /* Excluded from this release type: colliderEvents */
672
+ /* Excluded from this release type: physicsOptions */
673
+ /* Excluded from this release type: beforeStepCallbacks */
674
+ /* Excluded from this release type: afterStepCallbacks */
675
+ /* Excluded from this release type: filterContactPairHooks */
676
+ /* Excluded from this release type: filterIntersectionPairHooks */
677
+ /**
678
+ * Direct access to the Rapier instance
679
+ */
680
+ rapier: typeof default_3;
681
+ /**
682
+ * The Rapier physics world
683
+ */
684
+ world: World;
685
+ /**
686
+ * Can be used to overwrite the current World. Useful when working with snapshots.
687
+ *
688
+ * @example
689
+ * ```tsx
690
+ * import { useRapier } from '@react-three/rapier';
691
+ *
692
+ * const SnapshottingComponent = () => {
693
+ * const { world, setWorld, rapier } = useRapier();
694
+ * const worldSnapshot = useRef<Uint8Array>();
695
+ *
696
+ * // Store the snapshot
697
+ * const takeSnapshot = () => {
698
+ * const snapshot = world.takeSnapshot()
699
+ * worldSnapshot.current = snapshot
700
+ * }
701
+ *
702
+ * // Create a new World from the snapshot, and replace the current one
703
+ * const restoreSnapshot = () => {
704
+ * setWorld(rapier.World.restoreSnapshot(worldSnapshot.current))
705
+ * }
706
+ *
707
+ * return <>
708
+ * <Rigidbody>...</RigidBody>
709
+ * <Rigidbody>...</RigidBody>
710
+ * <Rigidbody>...</RigidBody>
711
+ * <Rigidbody>...</RigidBody>
712
+ * <Rigidbody>...</RigidBody>
713
+ * </>
714
+ * }
715
+ * ```
716
+ */
717
+ setWorld: (world: World) => void;
718
+ /**
719
+ * If the physics simulation is paused
720
+ */
721
+ isPaused: boolean;
722
+ /**
723
+ * Step the physics world one step
724
+ *
725
+ * @param deltaTime The delta time to step the world with
726
+ *
727
+ * @example
728
+ * ```
729
+ * step(1/60)
730
+ * ```
731
+ */
732
+ step: (deltaTime: number) => void;
733
+ /**
734
+ * Is debug mode enabled
735
+ */
736
+ isDebug: boolean;
737
+ }
738
+
739
+ export { RapierRigidBody }
740
+
741
+ export declare type RefGetter<T> = RefObject<() => T | undefined>;
742
+
743
+ export declare type RevoluteJointParams = [
744
+ body1Anchor: Vector3_2,
745
+ body2Anchor: Vector3_2,
746
+ axis: Vector3_2,
747
+ limits?: [min: number, max: number]
748
+ ];
749
+
750
+ /**
751
+ * A rigid body is a physical object that can be simulated by the physics engine.
752
+ * @category Components
753
+ */
754
+ export declare const RigidBody: default_2.MemoExoticComponent<(props: RigidBodyProps) => JSX.Element>;
755
+
756
+ export declare type RigidBodyAutoCollider = "ball" | "cuboid" | "hull" | "trimesh" | false;
757
+
758
+ export declare interface RigidBodyOptions extends Omit<ColliderProps, "ref"> {
759
+ /**
760
+ * Specify the type of this rigid body
761
+ */
762
+ type?: RigidBodyTypeString;
763
+ /**
764
+ * Whether or not this body can sleep.
765
+ * @defaultValue true
766
+ */
767
+ canSleep?: boolean;
768
+ /** The linear damping coefficient of this rigid-body.*/
769
+ linearDamping?: number;
770
+ /** The angular damping coefficient of this rigid-body.*/
771
+ angularDamping?: number;
772
+ /**
773
+ * The initial linear velocity of this body.
774
+ * @defaultValue [0,0,0]
775
+ */
776
+ linearVelocity?: Vector3Tuple;
777
+ /**
778
+ * The initial angular velocity of this body.
779
+ * @defaultValue [0,0,0]
780
+ */
781
+ angularVelocity?: Vector3Tuple;
782
+ /**
783
+ * The scaling factor applied to the gravity affecting the rigid-body.
784
+ * @defaultValue 1.0
785
+ */
786
+ gravityScale?: number;
787
+ /**
788
+ * The dominance group of this RigidBody. If a rigid body has a higher domiance group,
789
+ * on collision it will be immune to forces originating from the other bodies.
790
+ * https://rapier.rs/docs/user_guides/javascript/rigid_bodies#dominance
791
+ * Default: 0
792
+ */
793
+ dominanceGroup?: number;
794
+ /**
795
+ * Whether or not Continous Collision Detection is enabled for this rigid-body.
796
+ * https://rapier.rs/docs/user_guides/javascript/rigid_bodies#continuous-collision-detection
797
+ * @defaultValue false
798
+ */
799
+ ccd?: boolean;
800
+ /**
801
+ * The maximum prediction distance Soft Continuous Collision-Detection.
802
+ *
803
+ * When set to 0, soft-CCD is disabled.
804
+ *
805
+ * Soft-CCD helps prevent tunneling especially of slow-but-thin to moderately fast objects.
806
+ * The soft CCD prediction distance indicates how far in the object’s path the CCD algorithm is allowed to inspect.
807
+ * Large values can impact performance badly by increasing the work needed from the broad-phase.
808
+ *
809
+ * It is a generally cheaper variant of regular CCD since it relies on predictive constraints instead of shape-cast and substeps.
810
+ *
811
+ * @defaultValue 0
812
+ */
813
+ softCcdPrediction?: number;
814
+ /**
815
+ * Initial position of the RigidBody
816
+ */
817
+ position?: ThreeElements["object3D"]["position"];
818
+ /**
819
+ * Initial rotation of the RigidBody
820
+ */
821
+ rotation?: ThreeElements["object3D"]["rotation"];
822
+ /**
823
+ * Automatically generate colliders based on meshes inside this
824
+ * rigid body.
825
+ *
826
+ * You can change the default setting globally by setting the colliders
827
+ * prop on the <Physics /> component.
828
+ *
829
+ * Setting this to false will disable automatic colliders.
830
+ */
831
+ colliders?: RigidBodyAutoCollider | false;
832
+ /**
833
+ * Set the friction of auto-generated colliders.
834
+ * This does not affect any non-automatic child collider-components.
835
+ */
836
+ friction?: number;
837
+ /**
838
+ * Set the restitution (bounciness) of auto-generated colliders.
839
+ * This does not affect any non-automatic child collider-components.
840
+ */
841
+ restitution?: number;
842
+ /**
843
+ * Sets the number of additional solver iterations that will be run for this
844
+ * rigid-body and everything that interacts with it directly or indirectly
845
+ * through contacts or joints.
846
+ *
847
+ * Compared to increasing the global `World.numSolverIteration`, setting this
848
+ * value lets you increase accuracy on only a subset of the scene, resulting in reduced
849
+ * performance loss.
850
+ */
851
+ additionalSolverIterations?: number;
852
+ /**
853
+ * The default collision groups bitmask for all colliders in this rigid body.
854
+ * Can be customized per-collider.
855
+ */
856
+ collisionGroups?: InteractionGroups;
857
+ /**
858
+ * The default solver groups bitmask for all colliders in this rigid body.
859
+ * Can be customized per-collider.
860
+ */
861
+ solverGroups?: InteractionGroups;
862
+ /**
863
+ * The default active collision types for all colliders in this rigid body.
864
+ * Can be customized per-collider.
865
+ *
866
+ * Use `ActiveCollisionTypes` to specify which collision types should be active for this collider.
867
+ *
868
+ * @see https://rapier.rs/javascript3d/classes/Collider.html#setActiveCollisionTypes
869
+ * @see https://rapier.rs/javascript3d/enums/ActiveCollisionTypes.html
870
+ */
871
+ activeCollisionTypes?: ActiveCollisionTypes;
872
+ onSleep?(): void;
873
+ onWake?(): void;
874
+ /**
875
+ * Locks all rotations that would have resulted from forces on the created rigid-body.
876
+ */
877
+ lockRotations?: boolean;
878
+ /**
879
+ * Locks all translations that would have resulted from forces on the created rigid-body.
880
+ */
881
+ lockTranslations?: boolean;
882
+ /**
883
+ * Allow rotation of this rigid-body only along specific axes.
884
+ */
885
+ enabledRotations?: Boolean3Tuple;
886
+ /**
887
+ * Allow translation of this rigid-body only along specific axes.
888
+ */
889
+ enabledTranslations?: Boolean3Tuple;
890
+ /**
891
+ * Passed down to the object3d representing this collider.
892
+ */
893
+ userData?: ThreeElements["object3D"]["userData"];
894
+ /**
895
+ * Include invisible objects on the collider creation estimation.
896
+ */
897
+ includeInvisible?: boolean;
898
+ /* Excluded from this release type: transformState */
899
+ }
900
+
901
+ export declare interface RigidBodyProps extends RigidBodyOptions {
902
+ children?: ReactNode;
903
+ ref?: Ref<RapierRigidBody>;
904
+ }
905
+
906
+ declare interface RigidBodyState {
907
+ meshType: "instancedMesh" | "mesh";
908
+ rigidBody: RapierRigidBody;
909
+ object: Object3D;
910
+ invertedWorldMatrix: Matrix4;
911
+ setMatrix: (matrix: Matrix4) => void;
912
+ getMatrix: (matrix: Matrix4) => Matrix4;
913
+ /**
914
+ * Required for instanced rigid bodies.
915
+ */
916
+ scale: Vector3;
917
+ isSleeping: boolean;
918
+ }
919
+
920
+ declare type RigidBodyStateMap = Map<RapierRigidBody["handle"], RigidBodyState>;
921
+
922
+ export declare type RigidBodyTypeString = "fixed" | "dynamic" | "kinematicPosition" | "kinematicVelocity";
923
+
924
+ export declare type RopeJointParams = [
925
+ body1Anchor: Vector3_2,
926
+ body2Anchor: Vector3_2,
927
+ length: number
928
+ ];
929
+
930
+ export declare type RoundConeArgs = [
931
+ halfHeight: number,
932
+ radius: number,
933
+ borderRadius: number
934
+ ];
935
+
936
+ /**
937
+ * A round cylinder collider shape
938
+ * @category Colliders
939
+ */
940
+ export declare const RoundConeCollider: default_2.ForwardRefExoticComponent<Omit<ColliderOptions<RoundConeArgs>, "args"> & {
941
+ args: RoundConeArgs;
942
+ children?: ReactNode;
943
+ } & default_2.RefAttributes<RapierCollider>>;
944
+
945
+ export declare type RoundConeColliderProps = ColliderOptionsRequiredArgs<RoundConeArgs>;
946
+
947
+ export declare type RoundConvexHullArgs = [
948
+ vertices: ArrayLike<number>,
949
+ indices: ArrayLike<number>,
950
+ borderRadius: number
951
+ ];
952
+
953
+ export declare type RoundConvexMeshArgs = [
954
+ vertices: ArrayLike<number>,
955
+ indices: ArrayLike<number>,
956
+ borderRadius: number
957
+ ];
958
+
959
+ export declare type RoundCuboidArgs = [
960
+ halfWidth: number,
961
+ halfHeight: number,
962
+ halfDepth: number,
963
+ borderRadius: number
964
+ ];
965
+
966
+ /**
967
+ * A round cuboid collider shape
968
+ * @category Colliders
969
+ */
970
+ export declare const RoundCuboidCollider: default_2.ForwardRefExoticComponent<Omit<ColliderOptions<RoundCuboidArgs>, "args"> & {
971
+ args: RoundCuboidArgs;
972
+ children?: ReactNode;
973
+ } & default_2.RefAttributes<RapierCollider>>;
974
+
975
+ export declare type RoundCuboidColliderProps = ColliderOptionsRequiredArgs<RoundCuboidArgs>;
976
+
977
+ export declare type RoundCylinderArgs = [
978
+ halfHeight: number,
979
+ radius: number,
980
+ borderRadius: number
981
+ ];
982
+
983
+ /**
984
+ * A round cylinder collider shape
985
+ * @category Colliders
986
+ */
987
+ export declare const RoundCylinderCollider: default_2.ForwardRefExoticComponent<Omit<ColliderOptions<RoundConeArgs>, "args"> & {
988
+ args: RoundConeArgs;
989
+ children?: ReactNode;
990
+ } & default_2.RefAttributes<RapierCollider>>;
991
+
992
+ export declare type RoundCylinderColliderProps = ColliderOptionsRequiredArgs<RoundCylinderArgs>;
993
+
994
+ export declare type SphericalJointParams = [body1Anchor: Vector3_2, body2Anchor: Vector3_2];
995
+
996
+ export declare type SpringJointParams = [
997
+ body1Anchor: Vector3_2,
998
+ body2Anchor: Vector3_2,
999
+ restLength: number,
1000
+ stiffness: number,
1001
+ damping: number
1002
+ ];
1003
+
1004
+ export declare type TrimeshArgs = [
1005
+ vertices: ArrayLike<number>,
1006
+ indices: ArrayLike<number>
1007
+ ];
1008
+
1009
+ /**
1010
+ * A trimesh collider shape
1011
+ * @category Colliders
1012
+ */
1013
+ export declare const TrimeshCollider: default_2.ForwardRefExoticComponent<Omit<ColliderOptions<TrimeshArgs>, "args"> & {
1014
+ args: TrimeshArgs;
1015
+ children?: ReactNode;
1016
+ } & default_2.RefAttributes<RapierCollider>>;
1017
+
1018
+ export declare type TrimeshColliderProps = ColliderOptionsRequiredArgs<TrimeshArgs>;
1019
+
1020
+ /**
1021
+ * Registers a callback to be called after the physics step
1022
+ * @category Hooks
1023
+ */
1024
+ export declare const useAfterPhysicsStep: (callback: WorldStepCallback) => void;
1025
+
1026
+ /**
1027
+ * Registers a callback to be called before the physics step
1028
+ * @category Hooks
1029
+ */
1030
+ export declare const useBeforePhysicsStep: (callback: WorldStepCallback) => void;
1031
+
1032
+ export declare type UseBodyOptions = Omit<RigidBodyOptions, "shape">;
1033
+
1034
+ /**
1035
+ * Registers a callback to filter contact pairs.
1036
+ *
1037
+ * The callback determines if contact computation should happen between two colliders,
1038
+ * and how the constraints solver should behave for these contacts.
1039
+ *
1040
+ * This will only be executed if at least one of the involved colliders contains the
1041
+ * `ActiveHooks.FILTER_CONTACT_PAIR` flag in its active hooks.
1042
+ *
1043
+ * @param callback - Function that returns:
1044
+ * - `SolverFlags.COMPUTE_IMPULSE` (1) - Process the collision normally (compute impulses and resolve penetration)
1045
+ * - `SolverFlags.EMPTY` (0) - Skip computing impulses for this collision pair (colliders pass through each other)
1046
+ * - `null` - Skip this hook; let the next registered hook decide, or use Rapier's default behavior if no hook handles it
1047
+ *
1048
+ * When multiple hooks are registered, they are called in order until one returns a non-null value.
1049
+ * That value is then passed to Rapier's physics engine.
1050
+ *
1051
+ * @category Hooks
1052
+ *
1053
+ * @example
1054
+ * ```tsx
1055
+ * import { useFilterContactPair } from '@react-three/rapier';
1056
+ * import { SolverFlags } from '@dimforge/rapier3d-compat';
1057
+ *
1058
+ * useFilterContactPair((collider1, collider2, body1, body2) => {
1059
+ * // Only process collisions for specific bodies
1060
+ * if (body1 === myBodyHandle) {
1061
+ * return SolverFlags.COMPUTE_IMPULSE;
1062
+ * }
1063
+ * // Let other hooks or default behavior handle it
1064
+ * return null;
1065
+ * });
1066
+ * ```
1067
+ */
1068
+ export declare const useFilterContactPair: (callback: (collider1: number, collider2: number, body1: number, body2: number) => number | null) => void;
1069
+
1070
+ /**
1071
+ * Registers a callback to filter intersection pairs.
1072
+ *
1073
+ * The callback determines if intersection computation should happen between two colliders
1074
+ * (where at least one is a sensor).
1075
+ *
1076
+ * This will only be executed if at least one of the involved colliders contains the
1077
+ * `ActiveHooks.FILTER_INTERSECTION_PAIR` flag in its active hooks.
1078
+ *
1079
+ * @param callback - Function that returns:
1080
+ * - `true` - Allow the intersection to be detected (trigger intersection events)
1081
+ * - `false` - Block the intersection (no intersection events will fire)
1082
+ *
1083
+ * When multiple hooks are registered, the **first hook that returns `false` blocks** the intersection.
1084
+ * If all hooks return `true`, the intersection is allowed.
1085
+ *
1086
+ * @category Hooks
1087
+ *
1088
+ * @example
1089
+ * ```tsx
1090
+ * import { useFilterIntersectionPair } from '@react-three/rapier';
1091
+ *
1092
+ * useFilterIntersectionPair((collider1, collider2, body1, body2) => {
1093
+ * // Block intersections for specific body pairs
1094
+ * if (body1 === myBodyHandle && body2 === otherBodyHandle) {
1095
+ * return false;
1096
+ * }
1097
+ * // Allow all other intersections
1098
+ * return true;
1099
+ * });
1100
+ * ```
1101
+ */
1102
+ export declare const useFilterIntersectionPair: (callback: (collider1: number, collider2: number, body1: number, body2: number) => boolean) => void;
1103
+
1104
+ /**
1105
+ * A fixed joint ensures that two rigid-bodies don't move relative to each other.
1106
+ * Fixed joints are characterized by one local frame (represented by an isometry) on each rigid-body.
1107
+ * The fixed-joint makes these frames coincide in world-space.
1108
+ *
1109
+ * @category Hooks - Joints
1110
+ */
1111
+ export declare const useFixedJoint: UseImpulseJoint<FixedJointParams, FixedImpulseJoint>;
1112
+
1113
+ export declare interface UseImpulseJoint<JointParams, JointType extends ImpulseJoint> {
1114
+ (body1: RefObject<RapierRigidBody>, body2: RefObject<RapierRigidBody>, params: JointParams): RefObject<JointType | undefined>;
1115
+ }
1116
+
1117
+ /* Excluded from this release type: useImpulseJoint */
1118
+
1119
+ /**
1120
+ * The prismatic joint prevents any relative movement between two rigid-bodies, except for relative translations along one axis.
1121
+ * It is characterized by one local anchor as well as one local axis on each rigid-body. In 3D, an optional
1122
+ * local tangent axis can be specified for each rigid-body.
1123
+ *
1124
+ * @category Hooks - Joints
1125
+ */
1126
+ export declare const usePrismaticJoint: UseImpulseJoint<PrismaticJointParams, PrismaticImpulseJoint>;
1127
+
1128
+ /**
1129
+ * Exposes the Rapier context, and world
1130
+ * @category Hooks
1131
+ */
1132
+ export declare const useRapier: () => RapierContext;
1133
+
1134
+ /**
1135
+ * The revolute joint prevents any relative movement between two rigid-bodies, except for relative
1136
+ * rotations along one axis. This is typically used to simulate wheels, fans, etc.
1137
+ * They are characterized by one local anchor as well as one local axis on each rigid-body.
1138
+ *
1139
+ * @category Hooks - Joints
1140
+ */
1141
+ export declare const useRevoluteJoint: UseImpulseJoint<RevoluteJointParams, RevoluteImpulseJoint>;
1142
+
1143
+ /**
1144
+ * The rope joint limits the max distance between two bodies.
1145
+ * @category Hooks - Joints
1146
+ */
1147
+ export declare const useRopeJoint: UseImpulseJoint<RopeJointParams, RopeImpulseJoint>;
1148
+
1149
+ /**
1150
+ * The spherical joint ensures that two points on the local-spaces of two rigid-bodies always coincide (it prevents any relative
1151
+ * translational motion at this points). This is typically used to simulate ragdolls arms, pendulums, etc.
1152
+ * They are characterized by one local anchor on each rigid-body. Each anchor represents the location of the
1153
+ * points that need to coincide on the local-space of each rigid-body.
1154
+ *
1155
+ * @category Hooks - Joints
1156
+ */
1157
+ export declare const useSphericalJoint: UseImpulseJoint<SphericalJointParams, SphericalImpulseJoint>;
1158
+
1159
+ /**
1160
+ * The spring joint applies a force proportional to the distance between two objects.
1161
+ * @category Hooks - Joints
1162
+ */
1163
+ export declare const useSpringJoint: UseImpulseJoint<SpringJointParams, SpringImpulseJoint>;
1164
+
1165
+ /**
1166
+ * Takes an object resembling a Vector3 and returs a Three.Vector3
1167
+ * @category Math helpers
1168
+ */
1169
+ export declare const vec3: ({ x, y, z }?: {
1170
+ x: number;
1171
+ y: number;
1172
+ z: number;
1173
+ }) => Vector3;
1174
+
1175
+ export declare type Vector3Object = {
1176
+ x: number;
1177
+ y: number;
1178
+ z: number;
1179
+ };
1180
+
1181
+ export declare type Vector3Tuple = [x: number, y: number, z: number];
1182
+
1183
+ export declare type Vector4Tuple = [x: number, y: number, z: number, w: number];
1184
+
1185
+ export declare type WorldStepCallback = (world: World) => void;
1186
+
1187
+ declare type WorldStepCallbackSet = Set<{
1188
+ current: WorldStepCallback;
1189
+ }>;
1190
+
1191
+ export { }