@perplexdotgg/bounce 1.3.1 → 1.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.
package/README.md CHANGED
@@ -21,13 +21,14 @@ Bounce is a fast and determinstic 3D physics library for Typescript and Javascri
21
21
 
22
22
  ## Community Examples
23
23
 
24
- - Bounce + Three.js, vanilla JS example by Mameson: https://mameson.com/experiment/glsl/bounce_example/bounce_example.html (for code just [view source](view-source:https://mameson.com/experiment/glsl/bounce_example/bounce_example.html))
24
+ - Bounce + Three.js, vanilla JS example by Mameson: https://mameson.com/experiment/glsl/bounce_example/bounce_example.html (for code, just view source, it's very readable)
25
25
 
26
26
  ## Credits and Acknowledgments
27
27
 
28
28
  Bounce was created by:
29
- - Durai Ziyaee - 95% of the code, physics R&D
30
- - Hamza Kubba - 5% of the code, funding, direction, project management, QA, website
29
+ - Durai Ziyaee - 90% of the code, physics R&D
30
+ - Hamza Kubba - 10% of the code, funding, direction, project management, QA, website
31
+ - Your name here? - Contributions are welcome!
31
32
 
32
33
  Although Bounce is mostly original code, it is inspired by and draws heavily from:
33
34
  - Jolt
package/build/bounce.d.ts CHANGED
@@ -25,10 +25,10 @@ export declare class Aabb extends Aabb_base {
25
25
  transformAabb(aabb: Aabb, transform: Isometry): this;
26
26
  intersectsAabb(aabb: Aabb): boolean;
27
27
  unionAabb(aabb: Aabb): this;
28
- unionAabbs(boxA: Aabb, boxB: Aabb): void;
28
+ unionAabbs(boxA: Aabb, boxB: Aabb): this;
29
29
  expand(value: number): void;
30
30
  expandAabb(aabb: Aabb, value: number): this;
31
- setExtents(min: Vec3Like, max: Vec3Like): this;
31
+ setExtents(min: InputType<Vec3>, max: InputType<Vec3>): this;
32
32
  computeSurfaceArea(): number;
33
33
  computeExtents(out: Vec3): void;
34
34
  computeLargestAxis(): 0 | 1 | 2;
@@ -273,6 +273,7 @@ declare class Body_2 extends Body_base {
273
273
  world: World | null;
274
274
  get shape(): Shape | null;
275
275
  set shape(newShape: Shape);
276
+ setShape(newShape: Shape, updateBroadphase?: boolean): void;
276
277
  /**
277
278
  * integrates the linear velocity of a body
278
279
  */
@@ -338,6 +339,15 @@ y?: number;
338
339
  z?: number;
339
340
  } | undefined>, true, typeof Vec3>;
340
341
  }>> | undefined>, true, typeof Aabb>;
342
+ readonly computedExpandedBounds: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap<{
343
+ readonly min: typeof Vec3;
344
+ readonly max: typeof Vec3;
345
+ readonly centroid: PropertyDefinition_2<NoInfer<number[] | {
346
+ x?: number;
347
+ y?: number;
348
+ z?: number;
349
+ } | undefined>, true, typeof Vec3>;
350
+ }>> | undefined>, true, typeof Aabb>;
341
351
  readonly previousPosition: PropertyDefinition_2<NoInfer<number[] | {
342
352
  x?: number;
343
353
  y?: number;
@@ -431,6 +441,15 @@ y?: number;
431
441
  z?: number;
432
442
  } | undefined>, true, typeof Vec3>;
433
443
  }>> | undefined>, true, typeof Aabb>;
444
+ readonly computedExpandedBounds: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap<{
445
+ readonly min: typeof Vec3;
446
+ readonly max: typeof Vec3;
447
+ readonly centroid: PropertyDefinition_2<NoInfer<number[] | {
448
+ x?: number;
449
+ y?: number;
450
+ z?: number;
451
+ } | undefined>, true, typeof Vec3>;
452
+ }>> | undefined>, true, typeof Aabb>;
434
453
  readonly previousPosition: PropertyDefinition_2<NoInfer<number[] | {
435
454
  x?: number;
436
455
  y?: number;
@@ -505,6 +524,7 @@ readonly angularDamping: -1;
505
524
  readonly firstPotentialConstraintPairEdge: PropertyDefinitionReference<ConstraintPairEdge | null, true>;
506
525
  readonly visitGeneration: PropertyDefinitionNumber<true>;
507
526
  }>> & {
527
+ shape: Shape;
508
528
  world?: World | null;
509
529
  }>;
510
530
 
@@ -791,6 +811,15 @@ y?: number;
791
811
  z?: number;
792
812
  } | undefined>, true, typeof Vec3>;
793
813
  }>> | undefined>, true, typeof Aabb>;
814
+ readonly computedExpandedBounds: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
815
+ readonly min: typeof Vec3;
816
+ readonly max: typeof Vec3;
817
+ readonly centroid: PropertyDefinition_2<NoInfer<number[] | {
818
+ x?: number;
819
+ y?: number;
820
+ z?: number;
821
+ } | undefined>, true, typeof Vec3>;
822
+ }>> | undefined>, true, typeof Aabb>;
794
823
  readonly previousPosition: PropertyDefinition_2<NoInfer<number[] | {
795
824
  x?: number;
796
825
  y?: number;
@@ -865,6 +894,7 @@ readonly angularDamping: -1;
865
894
  readonly firstPotentialConstraintPairEdge: PropertyDefinitionReference<ConstraintPairEdge | null, true>;
866
895
  readonly visitGeneration: PropertyDefinitionNumber<true>;
867
896
  }>> & {
897
+ shape: Shape;
868
898
  world?: World | null;
869
899
  })[] | undefined;
870
900
  maxLength?: number;
@@ -905,6 +935,15 @@ y?: number;
905
935
  z?: number;
906
936
  } | undefined>, true, typeof Vec3>;
907
937
  }>> | undefined>, true, typeof Aabb>;
938
+ readonly computedExpandedBounds: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
939
+ readonly min: typeof Vec3;
940
+ readonly max: typeof Vec3;
941
+ readonly centroid: PropertyDefinition_2<NoInfer<number[] | {
942
+ x?: number;
943
+ y?: number;
944
+ z?: number;
945
+ } | undefined>, true, typeof Vec3>;
946
+ }>> | undefined>, true, typeof Aabb>;
908
947
  readonly previousPosition: PropertyDefinition_2<NoInfer<number[] | {
909
948
  x?: number;
910
949
  y?: number;
@@ -979,6 +1018,7 @@ readonly angularDamping: -1;
979
1018
  readonly firstPotentialConstraintPairEdge: PropertyDefinitionReference<ConstraintPairEdge | null, true>;
980
1019
  readonly visitGeneration: PropertyDefinitionNumber<true>;
981
1020
  }>> & {
1021
+ shape: Shape;
982
1022
  world?: World | null;
983
1023
  })[] | undefined;
984
1024
  maxLength?: number;
@@ -1038,6 +1078,15 @@ export declare class BvhTree {
1038
1078
  z?: number;
1039
1079
  } | undefined>, true, typeof Vec3>;
1040
1080
  }>> | undefined>, true, typeof Aabb>;
1081
+ readonly computedExpandedBounds: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
1082
+ readonly min: typeof Vec3;
1083
+ readonly max: typeof Vec3;
1084
+ readonly centroid: PropertyDefinition_2<NoInfer<number[] | {
1085
+ x?: number;
1086
+ y?: number;
1087
+ z?: number;
1088
+ } | undefined>, true, typeof Vec3>;
1089
+ }>> | undefined>, true, typeof Aabb>;
1041
1090
  readonly previousPosition: PropertyDefinition_2<NoInfer<number[] | {
1042
1091
  x?: number;
1043
1092
  y?: number;
@@ -1112,6 +1161,7 @@ export declare class BvhTree {
1112
1161
  readonly firstPotentialConstraintPairEdge: PropertyDefinitionReference<ConstraintPairEdge | null, true>;
1113
1162
  readonly visitGeneration: PropertyDefinitionNumber<true>;
1114
1163
  }>> & {
1164
+ shape: Shape;
1115
1165
  world?: World | null;
1116
1166
  })[] | undefined;
1117
1167
  maxLength?: number;
@@ -1152,6 +1202,15 @@ export declare class BvhTree {
1152
1202
  z?: number;
1153
1203
  } | undefined>, true, typeof Vec3>;
1154
1204
  }>> | undefined>, true, typeof Aabb>;
1205
+ readonly computedExpandedBounds: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
1206
+ readonly min: typeof Vec3;
1207
+ readonly max: typeof Vec3;
1208
+ readonly centroid: PropertyDefinition_2<NoInfer<number[] | {
1209
+ x?: number;
1210
+ y?: number;
1211
+ z?: number;
1212
+ } | undefined>, true, typeof Vec3>;
1213
+ }>> | undefined>, true, typeof Aabb>;
1155
1214
  readonly previousPosition: PropertyDefinition_2<NoInfer<number[] | {
1156
1215
  x?: number;
1157
1216
  y?: number;
@@ -1226,16 +1285,18 @@ export declare class BvhTree {
1226
1285
  readonly firstPotentialConstraintPairEdge: PropertyDefinitionReference<ConstraintPairEdge | null, true>;
1227
1286
  readonly visitGeneration: PropertyDefinitionNumber<true>;
1228
1287
  }>> & {
1288
+ shape: Shape;
1229
1289
  world?: World | null;
1230
1290
  })[] | undefined;
1231
1291
  maxLength?: number;
1232
1292
  }>;
1233
1293
  }>> | undefined, BvhNode>;
1234
1294
  destroyBvhNode(node: WithPool<BvhNode>): void;
1235
- insert(object: WithPool<Body_2>, shouldUpdateDirtyObjects?: boolean): boolean;
1295
+ insert(object: WithPool<Body_2>): boolean;
1236
1296
  remove(object: WithPool<Body_2>, shouldRemoveFromDirtyObjects?: boolean): boolean | undefined;
1237
1297
  update(object: WithPool<Body_2>, shouldUpdateDirtyObjects?: boolean): boolean;
1238
- intersectBody(onHit: (Body: Body_2) => boolean, body: Body_2, shouldUpdateDirtyObjects?: boolean): void;
1298
+ intersectBody(onHit: (Body: Body_2) => boolean | undefined, bodyToIntersect: Body_2, shouldUpdateDirtyObjects?: boolean): void;
1299
+ intersectAabb(onHit: (Body: Body_2) => boolean, bounds: Aabb, shouldUpdateDirtyObjects?: boolean): void;
1239
1300
  walk(onNode: (node: BvhNode) => boolean): void;
1240
1301
  isEmpty(): boolean;
1241
1302
  visitBodiesWithCollision(bodyVisitor: BodyVisitor, bounds: Aabb, belongsToGroups: number, collidesWithGroups: number, shouldUpdateDirtyObjects?: boolean): void;
@@ -1434,7 +1495,7 @@ declare interface CastShapeResult {
1434
1495
  declare class CastShapesModule {
1435
1496
  penetrationDepthModule: PenetrationDepthModule;
1436
1497
  constructor(penetrationDepthModule: PenetrationDepthModule);
1437
- castRay(collector: CastCollector, ray: Ray, shapeB: Shape, isometryB: Isometry, scaleB: number, offset: Vec3, settings: RayCastSettings, bodyB?: Body_2 | null): void;
1498
+ castRay(collector: CastCollector, ray: Ray, shapeB: Shape, isometryB: Isometry, scaleB: number, offset: Vec3, bodyB?: Body_2 | null): void;
1438
1499
  castShapes(collector: CastCollector, shapeA: Shape, isometryA: Isometry, scaleA: number, shapeB: Shape, isometryB: Isometry, scaleB: number, displacement: Vec3, offset: Vec3, settings: CastSettings, bodyA?: Body_2 | null, bodyB?: Body_2 | null): void;
1439
1500
  }
1440
1501
 
@@ -1483,7 +1544,7 @@ declare class CollideBodiesModule {
1483
1544
  collideBodies(bodyA: Body_2, bodyB: Body_2, collideShapesSettings: CollisionSettings, collideBodiesSettings: CollideBodiesSettings, timeStepSizeSeconds: number, isWarmStartingEnabled: boolean, minVelocityForElasticContact: number): void;
1484
1545
  collideShape(inShape: Shape, inShapeScale: number, inCenterOfMassTransform: Isometry, ioCollector: CollisionCollector, inCollideShapeSettings: CollisionSettings, inbaseTranslation?: Vec3, mask?: number): void;
1485
1546
  castShape(inShape: Shape, inShapeScale: number, inCenterOfMassTransform: Isometry, inDisplacement: Vec3, inShapeCastSettings: CastSettings, inbaseTranslation: Vec3, ioCollector: CastCollector, mask?: number): void;
1486
- castRay(onHit: (result: CastRayResult) => boolean, ray: Ray, settings: RayCastSettings, belongsToGroups?: number, collidesWithGroups?: number): void;
1547
+ castRay(onHit: (result: CastRayResult) => boolean | undefined, ray: Ray, settings: RayCastSettings, belongsToGroups?: number, collidesWithGroups?: number): void;
1487
1548
  estimateCollisionResponse(result: EstimateCollisionResponseResult, bodyA: Body_2, bodyB: Body_2, timeStepSizeSeconds: number): void;
1488
1549
  }
1489
1550
 
@@ -2943,7 +3004,7 @@ declare class HeightMap extends HeightMap_base implements ShapeCollectionInterfa
2943
3004
  computeWorldBounds(out: Aabb, translation: Vec3, rotation: Quat): void;
2944
3005
  computeInterpolatedHeight(localPosition: Vec3): number;
2945
3006
  computeInterpolatedLocalPoint(out: Vec3, localPosition: Vec3): void;
2946
- castRay(onHit: (triangle: Triangle) => boolean, ray: Ray): void;
3007
+ castRay(onHit: (triangle: Triangle) => boolean | undefined, ray: Ray): void;
2947
3008
  walkHeightMap(visitor: HeightMapVisitor): void;
2948
3009
  /**
2949
3010
  * this function visits every block and triangle of the heightMap. take care when using it on high resolution heightMaps. it is intended to generate a debug visualization of the heightMap.
@@ -3932,8 +3993,8 @@ export declare class PolygonConvexSupport implements SupportShape {
3932
3993
  }
3933
3994
 
3934
3995
  export declare class Quat extends Quat_base {
3935
- constructor(data: ConstructorParameters<ReturnType<typeof createClass<Vec3, typeof quatProps, QuatInput>>>[0], index: ConstructorParameters<ReturnType<typeof createClass<Vec3, typeof quatProps, QuatInput>>>[1], pool: ConstructorParameters<ReturnType<typeof createClass<Vec3, typeof quatProps, QuatInput>>>[2]);
3936
- reset(data: QuatInput): this;
3996
+ constructor(data?: ConstructorParameters<ReturnType<typeof createClass<Vec3, typeof quatProps, QuatInput>>>[0], index?: ConstructorParameters<ReturnType<typeof createClass<Vec3, typeof quatProps, QuatInput>>>[1], pool?: ConstructorParameters<ReturnType<typeof createClass<Vec3, typeof quatProps, QuatInput>>>[2]);
3997
+ reset(data?: QuatInput): this;
3937
3998
  set(data: QuatInput): this;
3938
3999
  length(): number;
3939
4000
  normalize(): this;
@@ -4147,6 +4208,7 @@ declare interface ShapeCastSettings {
4147
4208
  precision?: QueryPrecision;
4148
4209
  returnClosestOnly?: boolean;
4149
4210
  treatAsDisplacement?: boolean;
4211
+ collisionMask?: number;
4150
4212
  }
4151
4213
 
4152
4214
  declare type ShapeCollection = CompoundShape | HeightMap | TriangleMesh;
@@ -4165,6 +4227,7 @@ declare type ShapeCollectionInterface = {
4165
4227
  declare interface ShapeIntersectSettings {
4166
4228
  precision?: QueryPrecision;
4167
4229
  returnClosestOnly?: boolean;
4230
+ collisionMask?: number;
4168
4231
  }
4169
4232
 
4170
4233
  export declare const enum ShapeType {
@@ -4560,8 +4623,8 @@ export declare class TriangleMesh extends TriangleMesh_base implements ShapeColl
4560
4623
  computeWorldBounds(out: Aabb, translation: Vec3, rotation: Quat): void;
4561
4624
  computeSupportingFace(out: Face, subShapeID: number, direction: Vec3, scale: number, centerOfMassTransform: Mat4): void;
4562
4625
  createTriangulatedVerticesAndNormalsArray(): [Float32Array, Float32Array, Float32Array];
4563
- iterateTriangles(onHit: (triangle: Triangle) => boolean): void;
4564
- iterateNearbyTriangles(shapeBounds: Aabb, onHit: (triangle: Triangle) => boolean): void;
4626
+ iterateTriangles(onHit: (triangle: Triangle) => boolean | undefined): void;
4627
+ iterateNearbyTriangles(shapeBounds: Aabb, onHit: (triangle: Triangle) => boolean | undefined): void;
4565
4628
  hasChanged(): boolean;
4566
4629
  commitChanges(): void;
4567
4630
  }
@@ -4893,11 +4956,11 @@ declare class TriangleMeshBvhTree extends TriangleMeshBvhTree_base {
4893
4956
  }>;
4894
4957
  }>> | undefined, TriangleMeshBvhNode> | null;
4895
4958
  _buildRecursive(objects: Triangle[], node: TriangleMeshBvhNode, parent: TriangleMeshBvhNode | null): void;
4896
- intersectAabb(onHit: (triangle: Triangle) => boolean, aabb: Aabb): void;
4959
+ intersectAabb(onHit: (triangle: Triangle) => boolean | undefined, aabb: Aabb): void;
4897
4960
  walk(onNode: (node: TriangleMeshBvhNode) => boolean): void;
4898
4961
  computeMaxDepth(): number;
4899
- castAabb(onHit: (triangle: Triangle) => boolean, bounds: Aabb, displacement: Vec3): void;
4900
- castRay(onHit: (triangle: Triangle) => boolean, ray: Ray): void;
4962
+ castAabb(onHit: (triangle: Triangle) => boolean | undefined, bounds: Aabb, displacement: Vec3): void;
4963
+ castRay(onHit: (triangle: Triangle) => boolean | undefined, ray: Ray): void;
4901
4964
  }
4902
4965
 
4903
4966
  declare const TriangleMeshBvhTree_base: Monomorph<TriangleMeshBvhTree, ConvertedInputPropertyDefinitionMap< {
@@ -5109,12 +5172,6 @@ declare type Vec3Input = {
5109
5172
  z?: number;
5110
5173
  } | number[] | undefined;
5111
5174
 
5112
- declare interface Vec3Like {
5113
- x: number;
5114
- y: number;
5115
- z: number;
5116
- }
5117
-
5118
5175
  declare const vec3Props: {
5119
5176
  readonly x: 0;
5120
5177
  readonly y: 0;
@@ -5229,13 +5286,13 @@ export declare class World {
5229
5286
  destroyShape(shape: Shape): void;
5230
5287
  createStaticBody(options: InputType<Body_2> & {
5231
5288
  shape: StaticShape;
5232
- }): Body_2;
5289
+ }): WithPool<Body_2>;
5233
5290
  createDynamicBody(options: InputType<Body_2> & {
5234
5291
  shape: DynamicShape;
5235
- }): Body_2;
5292
+ }): WithPool<Body_2>;
5236
5293
  createKinematicBody(options: InputType<Body_2> & {
5237
5294
  shape: KinematicShape;
5238
- }): Body_2;
5295
+ }): WithPool<Body_2>;
5239
5296
  createBody(options: InputType<Body_2> & ({
5240
5297
  type: BodyType.dynamic;
5241
5298
  shape: DynamicShape;
@@ -5245,12 +5302,219 @@ export declare class World {
5245
5302
  } | {
5246
5303
  type: BodyType.kinematic;
5247
5304
  shape: KinematicShape;
5248
- })): Body_2;
5305
+ })): MonomorphInstanceWithPool<ConvertedInputPropertyDefinitionMap< {
5306
+ readonly type: PropertyDefinition_2<BodyType, true>;
5307
+ readonly position: typeof Vec3;
5308
+ readonly orientation: Quat;
5309
+ readonly linearVelocity: typeof Vec3;
5310
+ readonly angularVelocity: typeof Vec3;
5311
+ readonly computedCenterOfMassPosition: PropertyDefinition_2<NoInfer<number[] | {
5312
+ x?: number;
5313
+ y?: number;
5314
+ z?: number;
5315
+ } | undefined>, true, typeof Vec3>;
5316
+ readonly computedBounds: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
5317
+ readonly min: typeof Vec3;
5318
+ readonly max: typeof Vec3;
5319
+ readonly centroid: PropertyDefinition_2<NoInfer<number[] | {
5320
+ x?: number;
5321
+ y?: number;
5322
+ z?: number;
5323
+ } | undefined>, true, typeof Vec3>;
5324
+ }>> | undefined>, true, Aabb>;
5325
+ readonly computedExpandedBounds: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
5326
+ readonly min: typeof Vec3;
5327
+ readonly max: typeof Vec3;
5328
+ readonly centroid: PropertyDefinition_2<NoInfer<number[] | {
5329
+ x?: number;
5330
+ y?: number;
5331
+ z?: number;
5332
+ } | undefined>, true, typeof Vec3>;
5333
+ }>> | undefined>, true, Aabb>;
5334
+ readonly previousPosition: PropertyDefinition_2<NoInfer<number[] | {
5335
+ x?: number;
5336
+ y?: number;
5337
+ z?: number;
5338
+ } | undefined>, true, typeof Vec3>;
5339
+ readonly previousOrientation: PropertyDefinition_2<NoInfer<{
5340
+ x?: number;
5341
+ y?: number;
5342
+ z?: number;
5343
+ w?: number;
5344
+ } | number[] | undefined>, true, Quat>;
5345
+ readonly isSleeping: PropertyDefinitionBoolean<true>;
5346
+ readonly timeWithoutMoving: PropertyDefinitionNumber<true>;
5347
+ readonly friction: 0;
5348
+ readonly restitution: 0;
5349
+ readonly frictionFunction: PropertyDefinition_2<CoefficientFunctionType, true>;
5350
+ readonly restitutionFunction: PropertyDefinition_2<CoefficientFunctionType, true>;
5351
+ readonly mass: 0;
5352
+ readonly density: 0;
5353
+ readonly inverseMass: PropertyDefinitionNumber<true>;
5354
+ readonly computedLocalInverseInertia: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
5355
+ readonly e0: 0;
5356
+ readonly e1: 0;
5357
+ readonly e2: 0;
5358
+ readonly e3: 0;
5359
+ readonly e4: 0;
5360
+ readonly e5: 0;
5361
+ readonly e6: 0;
5362
+ readonly e7: 0;
5363
+ readonly e8: 0;
5364
+ }>> | undefined>, true, Mat3>;
5365
+ readonly computedWorldInverseInertia: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
5366
+ readonly e0: 0;
5367
+ readonly e1: 0;
5368
+ readonly e2: 0;
5369
+ readonly e3: 0;
5370
+ readonly e4: 0;
5371
+ readonly e5: 0;
5372
+ readonly e6: 0;
5373
+ readonly e7: 0;
5374
+ readonly e8: 0;
5375
+ }>> | undefined>, true, Mat3>;
5376
+ readonly colliderType: PropertyDefinition_2<ColliderType, true>;
5377
+ readonly gravityScale: 1;
5378
+ readonly linearForces: PropertyDefinition_2<NoInfer<number[] | {
5379
+ x?: number;
5380
+ y?: number;
5381
+ z?: number;
5382
+ } | undefined>, true, typeof Vec3>;
5383
+ readonly angularForces: PropertyDefinition_2<NoInfer<number[] | {
5384
+ x?: number;
5385
+ y?: number;
5386
+ z?: number;
5387
+ } | undefined>, true, typeof Vec3>;
5388
+ readonly copyForDiff: PropertyDefinitionReference<Body_2 | null, true>;
5389
+ readonly firstPotentialPairEdge: PropertyDefinitionReference<BodyPairEdge | null, true>;
5390
+ readonly belongsToGroups: PropertyDefinitionNumber<true>;
5391
+ readonly collidesWithGroups: PropertyDefinitionNumber<true>;
5392
+ readonly node: PropertyDefinitionReference<BvhNode | null, true>;
5393
+ readonly shapeType: PropertyDefinition_2<ShapeType, true>;
5394
+ readonly shape0: PropertyDefinitionReference<Box | null, true>;
5395
+ readonly shape1: PropertyDefinitionReference<Capsule | null, true>;
5396
+ readonly shape2: PropertyDefinitionReference<CompoundShape | null, true>;
5397
+ readonly shape3: PropertyDefinitionReference<ConvexHull | null, true>;
5398
+ readonly shape4: PropertyDefinitionReference<Cylinder | null, true>;
5399
+ readonly shape5: PropertyDefinitionReference<HeightMap | null, true>;
5400
+ readonly shape6: PropertyDefinitionReference<Sphere | null, true>;
5401
+ readonly shape7: PropertyDefinitionReference<TriangleMesh | null, true>;
5402
+ readonly isSleepingEnabled: PropertyDefinitionBoolean<true>;
5403
+ readonly linearDamping: -1;
5404
+ readonly angularDamping: -1;
5405
+ readonly firstPotentialConstraintPairEdge: PropertyDefinitionReference<ConstraintPairEdge | null, true>;
5406
+ readonly visitGeneration: PropertyDefinitionNumber<true>;
5407
+ }>, PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
5408
+ readonly type: PropertyDefinition_2<BodyType, true>;
5409
+ readonly position: typeof Vec3;
5410
+ readonly orientation: Quat;
5411
+ readonly linearVelocity: typeof Vec3;
5412
+ readonly angularVelocity: typeof Vec3;
5413
+ readonly computedCenterOfMassPosition: PropertyDefinition_2<NoInfer<number[] | {
5414
+ x?: number;
5415
+ y?: number;
5416
+ z?: number;
5417
+ } | undefined>, true, typeof Vec3>;
5418
+ readonly computedBounds: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
5419
+ readonly min: typeof Vec3;
5420
+ readonly max: typeof Vec3;
5421
+ readonly centroid: PropertyDefinition_2<NoInfer<number[] | {
5422
+ x?: number;
5423
+ y?: number;
5424
+ z?: number;
5425
+ } | undefined>, true, typeof Vec3>;
5426
+ }>> | undefined>, true, Aabb>;
5427
+ readonly computedExpandedBounds: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
5428
+ readonly min: typeof Vec3;
5429
+ readonly max: typeof Vec3;
5430
+ readonly centroid: PropertyDefinition_2<NoInfer<number[] | {
5431
+ x?: number;
5432
+ y?: number;
5433
+ z?: number;
5434
+ } | undefined>, true, typeof Vec3>;
5435
+ }>> | undefined>, true, Aabb>;
5436
+ readonly previousPosition: PropertyDefinition_2<NoInfer<number[] | {
5437
+ x?: number;
5438
+ y?: number;
5439
+ z?: number;
5440
+ } | undefined>, true, typeof Vec3>;
5441
+ readonly previousOrientation: PropertyDefinition_2<NoInfer<{
5442
+ x?: number;
5443
+ y?: number;
5444
+ z?: number;
5445
+ w?: number;
5446
+ } | number[] | undefined>, true, Quat>;
5447
+ readonly isSleeping: PropertyDefinitionBoolean<true>;
5448
+ readonly timeWithoutMoving: PropertyDefinitionNumber<true>;
5449
+ readonly friction: 0;
5450
+ readonly restitution: 0;
5451
+ readonly frictionFunction: PropertyDefinition_2<CoefficientFunctionType, true>;
5452
+ readonly restitutionFunction: PropertyDefinition_2<CoefficientFunctionType, true>;
5453
+ readonly mass: 0;
5454
+ readonly density: 0;
5455
+ readonly inverseMass: PropertyDefinitionNumber<true>;
5456
+ readonly computedLocalInverseInertia: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
5457
+ readonly e0: 0;
5458
+ readonly e1: 0;
5459
+ readonly e2: 0;
5460
+ readonly e3: 0;
5461
+ readonly e4: 0;
5462
+ readonly e5: 0;
5463
+ readonly e6: 0;
5464
+ readonly e7: 0;
5465
+ readonly e8: 0;
5466
+ }>> | undefined>, true, Mat3>;
5467
+ readonly computedWorldInverseInertia: PropertyDefinition_2<NoInfer<PropertyDefinitionMapInput<ConvertedInputPropertyDefinitionMap< {
5468
+ readonly e0: 0;
5469
+ readonly e1: 0;
5470
+ readonly e2: 0;
5471
+ readonly e3: 0;
5472
+ readonly e4: 0;
5473
+ readonly e5: 0;
5474
+ readonly e6: 0;
5475
+ readonly e7: 0;
5476
+ readonly e8: 0;
5477
+ }>> | undefined>, true, Mat3>;
5478
+ readonly colliderType: PropertyDefinition_2<ColliderType, true>;
5479
+ readonly gravityScale: 1;
5480
+ readonly linearForces: PropertyDefinition_2<NoInfer<number[] | {
5481
+ x?: number;
5482
+ y?: number;
5483
+ z?: number;
5484
+ } | undefined>, true, typeof Vec3>;
5485
+ readonly angularForces: PropertyDefinition_2<NoInfer<number[] | {
5486
+ x?: number;
5487
+ y?: number;
5488
+ z?: number;
5489
+ } | undefined>, true, typeof Vec3>;
5490
+ readonly copyForDiff: PropertyDefinitionReference<Body_2 | null, true>;
5491
+ readonly firstPotentialPairEdge: PropertyDefinitionReference<BodyPairEdge | null, true>;
5492
+ readonly belongsToGroups: PropertyDefinitionNumber<true>;
5493
+ readonly collidesWithGroups: PropertyDefinitionNumber<true>;
5494
+ readonly node: PropertyDefinitionReference<BvhNode | null, true>;
5495
+ readonly shapeType: PropertyDefinition_2<ShapeType, true>;
5496
+ readonly shape0: PropertyDefinitionReference<Box | null, true>;
5497
+ readonly shape1: PropertyDefinitionReference<Capsule | null, true>;
5498
+ readonly shape2: PropertyDefinitionReference<CompoundShape | null, true>;
5499
+ readonly shape3: PropertyDefinitionReference<ConvexHull | null, true>;
5500
+ readonly shape4: PropertyDefinitionReference<Cylinder | null, true>;
5501
+ readonly shape5: PropertyDefinitionReference<HeightMap | null, true>;
5502
+ readonly shape6: PropertyDefinitionReference<Sphere | null, true>;
5503
+ readonly shape7: PropertyDefinitionReference<TriangleMesh | null, true>;
5504
+ readonly isSleepingEnabled: PropertyDefinitionBoolean<true>;
5505
+ readonly linearDamping: -1;
5506
+ readonly angularDamping: -1;
5507
+ readonly firstPotentialConstraintPairEdge: PropertyDefinitionReference<ConstraintPairEdge | null, true>;
5508
+ readonly visitGeneration: PropertyDefinitionNumber<true>;
5509
+ }>> & {
5510
+ shape: Shape;
5511
+ world?: World | null;
5512
+ }, Body_2>;
5249
5513
  destroyBody(body: Body_2): void;
5250
5514
  didBodiesCollide(bodyA: Body_2, bodyB: Body_2): boolean;
5251
5515
  iterateContactManifolds(bodyA?: Body_2, bodyB?: Body_2): Generator<ContactManifold, void, unknown>;
5252
- intersectShape(onHit: (result: CollisionResult) => boolean, shape: Shape, transform: BasicTransform, settings?: ShapeIntersectSettings): void;
5253
- castRay(onHit: (result: CastRayResult) => boolean, ray: Ray, settings?: RayCastSettings): void;
5516
+ intersectShape(onHit: (result: CollisionResult) => boolean | undefined, shape: Shape, transform: BasicTransform | InputType<BasicTransform>, settings?: ShapeIntersectSettings): void;
5517
+ castRay(onHit: (result: CastRayResult) => boolean | undefined, ray: Ray, settings?: RayCastSettings): void;
5254
5518
  castShape(onHit: (result: CastShapeResult) => boolean, shape: Shape, transform: BasicTransform, displacementOrEndPosition: Vec3, settings?: ShapeCastSettings): void;
5255
5519
  estimateCollisionResponse(result: EstimateCollisionResponseResult, bodyA: Body_2, bodyB: Body_2, settings?: Partial<EstimateCollisionResponseSettings>): void;
5256
5520
  toArray(array: number[] | Float32Array | Float64Array, startOffset?: number): number;