babylon-box3d 0.6.0 → 0.7.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
@@ -153,6 +153,46 @@ reach that. The shim hands box3d its own task system instead (`wasm/box3d_shim.c
153
153
  - Contact events cross into JavaScript one record per contact per step. A body nothing listens to should not be
154
154
  asking for them: `body.setCollisionCallbackEnabled(false)`, which is the default.
155
155
 
156
+ ## Double precision
157
+
158
+ Box3D keeps a body's position in floats, which are 2 mm apart 30 km from the origin, so a large world steps
159
+ differently far out than near the origin. Box3D's large world mode (`BOX3D_DOUBLE_PRECISION`) keeps positions and
160
+ transforms in doubles, while velocities, shapes and contacts stay floats, and the package ships it as builds of their
161
+ own, single threaded and threaded:
162
+
163
+ ```ts
164
+ const box3d = await LoadBox3D({ threads: "auto", doublePrecision: true });
165
+ // or the modules themselves: babylon-box3d/wasm/f64 and babylon-box3d/wasm/f64-threads, and in node
166
+ // babylon-box3d/wasm/node-f64 and babylon-box3d/wasm/node-f64-threads
167
+ ```
168
+
169
+ Both builds have the same entry points, and both take positions in doubles: a body's position and target transform,
170
+ the point a force or impulse is applied at, a ray's or shape cast's origin and an explosion's centre. The float build
171
+ rounds each to the float it keeps, as the call did when it took floats, so its results have not changed. Positions
172
+ come back in floats where they always did, and in doubles beside them:
173
+
174
+ | floats | doubles |
175
+ | --- | --- |
176
+ | `bx_Body_GetTransform`: the scratch buffer's first three | `bx_ScratchF64()`: the position, as the build holds it |
177
+ | `bx_RayHitsPtr`: each hit's point | `bx_RayHitPointsF64Ptr()`: three a hit, for rays and shape casts |
178
+ | `bx_BodyContactsPtr`: each contact point's position | `bx_BodyContactPointsF64Ptr()`: twelve a manifold, three a point |
179
+
180
+ `bx_IsDoublePrecision()` says which build is loaded. Move and contact events stay floats.
181
+
182
+ What it buys (`test/wasm.largeWorld.test.ts`): a car settling and coasting along a road 30 km from the origin stays
183
+ within 3e-11 m of its run at the origin, where the float build's is 5.5 cm off. What it does not: Box3D's broad phase
184
+ keeps its bounds in float world space, rounded outward, so far out a new pair can be made a step earlier or later than
185
+ at the origin, and from where the car first meets another shape the two runs part (by 0.18 mm a third of a second
186
+ later, in the test). A run at the same coordinates still repeats bit for bit. A mesh or height field block
187
+ (`bx_ShapeDesc_GetGeometryBytes`) is the same bytes in either build, so one built by the float build loads in the
188
+ double precision build, to the same contacts.
189
+
190
+ What it costs: on R3's rate probe cases (a car of 20 to 160 hulls riding, sliding and pushed into a wall over a height
191
+ field and a road mesh, at 480 and 240 Hz), with the two builds taking turns of 1,000 steps in one process, a step took
192
+ 6.3% longer in the double precision build summed over the cases with Box3D's defaults, and 6.6% with the car's hulls
193
+ filtered against each other and the car unswept. Case by case the difference ran from 17% less to 17% more, on a
194
+ machine half busy with other work, and the median case took 6.6% and 8.5% longer.
195
+
156
196
  ## What is covered
157
197
 
158
198
  | Babylon v2 | Box3D |
@@ -263,6 +303,10 @@ is not supported yet, it depends on Havok internals.
263
303
  | `bx_Body_SetShapeCrush`, `bx_Body_GetShapeCrush` | crushable contacts, see [Patches to Box3D](#patches-to-box3d) |
264
304
  | `bx_World_CastShape`, `bx_World_OverlapShape`, `bx_OverlapsPtr` | a convex point cloud with a radius, from an origin given in doubles, cast along a translation or tested for overlap. The cast's fraction is where the surfaces touch: Box3D stops its own casts a linear slop short of that, and the shim moves the fraction on |
265
305
  | `bx_Body_GetShapeGeometry`, `bx_GeometryPtr` | a shape's sphere, capsule or hull points, in the body's frame |
306
+ | `bx_Body_SetFeatureKey`, `bx_Body_GetFeatureKey`, `bx_Body_GetShapeFeatureKey` | canonical pairs, see [Patches to Box3D](#patches-to-box3d): a body's key (1 to 2^44 - 1, as a double) gives each of its shapes the key `(key << 20) \| index`, by which new contacts are made, continuous collision sweeps, and a closest ray or shape cast breaks a tie (then by body slot and shape index) |
307
+ | `bx_ShapeDesc_GetGeometryBytes`, `bx_ShapeDesc_GetGeometryByteCount`, `bx_ShapeDesc_CreateMeshFromBytes`, `bx_ShapeDesc_CreateHeightFieldFromBytes` | a mesh's or height field's data as bytes, and a description made from a copy of them. Box3D keeps either as one block addressed by offsets, with no pointer in it, so an instance with no world (a worker's) can build the geometry and another instance of the same build copies the block in as it is: nothing in it needs fixing up. The import checks the version, the byte count and that every array lies inside the block, and costs a copy |
308
+ | `bx_IsDoublePrecision`, `bx_ScratchF64`, `bx_RayHitPointsF64Ptr`, `bx_BodyContactPointsF64Ptr` | positions in doubles, see [Double precision](#double-precision) |
309
+ | `bx_ShapeDesc_SetInvokeContactCreation`, `bx_ShapeDesc_GetInvokeContactCreation`, `bx_World_GetStackUsed` | Box3D's `invokeContactCreation` per description, on by default. Off, a static shape never enters the broad phase's move buffer: the first step reserves no pair slots for it (486 bytes a static, which the step stack then keeps for good) and it is paired when a moving shape finds it, so a static made late pairs on the same step as one made at the start. Off on a container, it is off for every shape made from its children. `bx_World_GetStackUsed` says the most the step stack has held |
266
310
 
267
311
  Box3D creates shapes on bodies while Babylon creates shapes standalone, so a `PhysicsShape` is a description that
268
312
  is instantiated on every body it is set on. Changing its filter masks, material or density is applied to the live
@@ -279,10 +323,11 @@ and mesh winding is flipped, exactly like the Havok plugin.
279
323
  | `src/index.ts` | package entry: `Box3DPlugin`, `Box3DWheelJoint`, `Box3D` (wasm factory), `LoadBox3D` |
280
324
  | `src/loadBox3D.ts` | picks the single threaded or threaded wasm build for the page |
281
325
  | `wasm/box3d_shim.c` | C shim: flat, handle based API over box3d (`bx_*` functions) |
282
- | `wasm/build.mjs` | emcc build for `lib/esm`, `lib/umd` (global `Box3D`), `lib/node` and the threaded pair |
326
+ | `wasm/build.mjs` | emcc build for `lib/esm`, `lib/umd` (global `Box3D`), `lib/node`, the threaded pair and the double precision builds |
283
327
  | `lib/` | committed wasm builds and typings, `UPSTREAM_COMMIT` is the box3d commit |
284
328
  | `wasm/patches/` | changes to Box3D itself, applied in name order to a copy of the box3d checkout at build time, see [Patches to Box3D](#patches-to-box3d) |
285
329
  | `lib/esm-threads`, `lib/node-threads` | the same module built with pthreads, see [Threads](#threads) |
330
+ | `lib/esm-f64`, `lib/node-f64` and their `-threads` twins | the same modules built with `BOX3D_DOUBLE_PRECISION`, see [Double precision](#double-precision) |
286
331
  | `umd/` | plugin bundle for script tags (global `BABYLONBOX3D`), built by `npm run build:umd` |
287
332
  | `demo/` | vite showcase: `npm run demo`, then `http://localhost:5178/?demo=pyramid` |
288
333
  | `docs/` | the community extension page for the Babylon.js documentation |
@@ -355,7 +400,10 @@ with Havok and compare, which is what pins the Havok compatible behaviour down.
355
400
  `npm run build:wasm` produces both builds: the single threaded one in `lib/esm`, `lib/umd` and `lib/node`, and the
356
401
  threaded one in `lib/esm-threads` and `lib/node-threads`. Add `--no-threads` to skip the second while iterating on the
357
402
  shim. Both are wasm SIMD128; the threaded one adds `-pthread` and a pool of 8 workers, which is the cap the shim
358
- clamps `workerCount` to. `npm run bench -- --workers 4` runs the benchmark on it.
403
+ clamps `workerCount` to. `npm run bench -- --workers 4` runs the benchmark on it. Each is built again with
404
+ `BOX3D_DOUBLE_PRECISION` from objects of its own, into `lib/esm-f64`, `lib/node-f64` and their `-threads` twins:
405
+ `--no-f64` skips them and `--f64-only` builds only them. `BOX3D_FLAVOUR=f64 npx vitest run` runs the tests on the
406
+ double precision builds (`vitest.config.ts` sends every import of a node loader to its twin).
359
407
 
360
408
  ## Patches to Box3D
361
409
 
@@ -368,8 +416,12 @@ stays exactly upstream's commit, and a change to the patch set rebuilds every ob
368
416
  | `0001-broad-phase-prunes-by-mask.patch` | A shape that moved queries the broad phase with its own mask bits instead of every category (unless it is in a positive group, which overrides masks). A body whose shapes are filtered against each other then skips its own subtree instead of visiting every sibling shape before rejecting it. Which pairs collide does not change. |
369
417
  | `0002-continuous-per-body.patch` | `b3Body_EnableContinuous` and `b3Body_IsContinuousEnabled` (shim: `bx_Body_EnableContinuous`, `bx_Body_IsContinuousEnabled`): continuous collision switched for one body. The world's switch still applies. A body made of many small shapes is swept shape by shape whenever its smallest shape moves fast enough, which can cost more than the rest of the step. |
370
418
  | `0003-crushable-contacts.patch` | `b3Shape_SetCrushLimit(shape, maxForce, plastic)`, `b3Shape_GetCrushLimit` and `b3Shape_IsCrushPlastic` (shim: `bx_Body_SetShapeCrush(body, i, maxForce, plastic)`, `bx_Body_GetShapeCrush`): each contact of a crushable shape pushes with at most `maxForce` newtons, the smaller of its two shapes' limits, shared between its points, so a body meeting something rigid decelerates over a distance instead of stopping within a step. A plastic contact gets no push-out and no restitution, so it keeps the overlap it reaches. Crushable contacts are routed to the scalar solver path, where each point's accumulated impulse is clamped; a point still apart pushes only for the part of the substep after the surfaces meet. Rigid contacts are untouched, bit for bit. The limit may change every step, and a shape turning crushable or rigid keeps its contacts. |
419
+ | `0004-hull-builder-fails-instead-of-spinning.patch` | `b3CreateHull` returns NULL where it used to loop forever. A flat or nearly flat point set a few metres from the origin (a crushed panel, a slab) can leave the builder's half-edge mesh inconsistent: a merge leaves two faces that share every edge and `b3HullBuilder_ConnectFaces` walks round them without end, or a face's ring stops closing and `b3NewellPlane` does. Such a call never returned and locked whatever made it. Now every walk over the mesh counts its steps against the edge pool, the merge loops count merges against the face pool, and the horizon's stack and edge list check their capacity, which only asserts guarded before. None of these limits can be reached by a consistent mesh, and a build that reaches one returns NULL (shim: `bx_ShapeDesc_CreateHull` and `bx_Body_SetShapeHull` return 0, and the plugin throws for a `CONVEX_HULL` shape). Hulls that were built before are built the same, bit for bit. |
420
+ | `0005-canonical-pairs.patch` | `b3ShapeDef::featureKey`, `b3Shape_SetFeatureKey` and `b3Shape_GetFeatureKey` (shim: `bx_Body_SetFeatureKey`): a moved proxy's new pairs are sorted by the other shape's feature key, then child index, then shape id, before their contacts are made. Contact ids, and with them the order the solver meets contacts, came from the order the static tree gave pairs, which is a function of every insertion and removal it has seen, so the same statics in reach could collide differently depending on how and when the world was built. A moved proxy's pairs are no longer dropped past sixteen: if the step's pair slots run out, the pairs are found again with room for all of them. Continuous collision gathers its candidates, sorts them by key and sweeps them in that order, since each sweep is clipped by the ones before it. Shapes without a key fall back to their ids, so a world without keys behaves as before except where a step's new pairs came out of the tree in another order. |
371
421
 
372
- `test/wasm.patches.test.ts` covers 0001 and 0002, and `test/wasm.crush.test.ts` covers 0003. None has been offered upstream.
422
+ `test/wasm.patches.test.ts` covers 0001 and 0002, `test/wasm.crush.test.ts` covers 0003, `test/wasm.hulls.test.ts` covers 0004
423
+ and `test/wasm.canonicalPairs.test.ts` covers 0005.
424
+ None has been offered upstream.
373
425
 
374
426
  **Crush accuracy.** Against a constant limit the crush depth lands within 1.5% of the continuous answer at 480 Hz
375
427
  with two substeps, and within 2% on a height field. What remains is Box3D's, not the patch's: its semi-implicit
@@ -7,6 +7,13 @@ export interface ILoadBox3DOptions extends Box3DModuleOptions {
7
7
  * to the single threaded one everywhere else.
8
8
  */
9
9
  threads?: boolean | "auto";
10
+ /**
11
+ * Load the double precision build, whose bodies keep their positions in doubles, so that a world tens of
12
+ * kilometres across steps far from the origin as it does near it. Positions cross into the module in doubles in
13
+ * either build; `_bx_ScratchF64()` holds a body's full position after `_bx_Body_GetTransform`. false (the default)
14
+ * is the float build.
15
+ */
16
+ doublePrecision?: boolean;
10
17
  }
11
18
  /**
12
19
  * Whether the threaded Box3D build can run here: the page has to be cross origin isolated, which is what gives it
@@ -1 +1 @@
1
- {"version":3,"file":"loadBox3D.d.ts","sourceRoot":"","sources":["../src/loadBox3D.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,qFAAqF;AACrF,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IACzD;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAM5C;AAED;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC,CAgBrF"}
1
+ {"version":3,"file":"loadBox3D.d.ts","sourceRoot":"","sources":["../src/loadBox3D.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,qFAAqF;AACrF,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IACzD;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAM5C;AAED;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC,CAgBrF"}
package/dist/loadBox3D.js CHANGED
@@ -7,7 +7,8 @@
7
7
  // Cross-Origin-Opener-Policy: same-origin
8
8
  // Cross-Origin-Embedder-Policy: require-corp
9
9
  //
10
- // The threaded module is imported dynamically, so a page that never asks for threads never downloads it.
10
+ // The threaded module is imported dynamically, so a page that never asks for threads never downloads it. Each also
11
+ // comes in double precision (BOX3D_DOUBLE_PRECISION), for worlds too large for float positions.
11
12
  /**
12
13
  * Whether the threaded Box3D build can run here: the page has to be cross origin isolated, which is what gives it
13
14
  * SharedArrayBuffer. Node and bundler test environments have SharedArrayBuffer without the flag.
@@ -31,7 +32,7 @@ export function CanUseBox3DThreads() {
31
32
  * @returns the resolved module
32
33
  */
33
34
  export async function LoadBox3D(options = {}) {
34
- const { threads = false, ...moduleOptions } = options;
35
+ const { threads = false, doublePrecision = false, ...moduleOptions } = options;
35
36
  const wantsThreads = threads === "auto" ? CanUseBox3DThreads() : threads;
36
37
  if (wantsThreads) {
37
38
  if (threads === true && !CanUseBox3DThreads()) {
@@ -39,10 +40,10 @@ export async function LoadBox3D(options = {}) {
39
40
  "Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp headers, or use " +
40
41
  'LoadBox3D({ threads: "auto" }) to fall back to the single threaded build.');
41
42
  }
42
- const threaded = await import("babylon-box3d/wasm/threads");
43
+ const threaded = doublePrecision ? await import("babylon-box3d/wasm/f64-threads") : await import("babylon-box3d/wasm/threads");
43
44
  return threaded.default(moduleOptions);
44
45
  }
45
- const plain = await import("babylon-box3d/wasm");
46
+ const plain = doublePrecision ? await import("babylon-box3d/wasm/f64") : await import("babylon-box3d/wasm");
46
47
  return plain.default(moduleOptions);
47
48
  }
48
49
  //# sourceMappingURL=loadBox3D.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loadBox3D.js","sourceRoot":"","sources":["../src/loadBox3D.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,EAAE;AACF,sHAAsH;AACtH,qHAAqH;AACrH,4FAA4F;AAC5F,EAAE;AACF,4CAA4C;AAC5C,+CAA+C;AAC/C,EAAE;AACF,yGAAyG;AAczG;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAC9B,IAAI,OAAO,iBAAiB,KAAK,WAAW,EAAE,CAAC;QAC3C,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,MAAM,QAAQ,GAAI,UAAgD,CAAC,mBAAmB,CAAC;IACvF,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC;AAC9C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,UAA6B,EAAE;IAC3D,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC;IACtD,MAAM,YAAY,GAAG,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACzE,IAAI,YAAY,EAAE,CAAC;QACf,IAAI,OAAO,KAAK,IAAI,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CACX,8GAA8G;gBAC1G,yGAAyG;gBACzG,2EAA2E,CAClF,CAAC;QACN,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;QAC5D,OAAO,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACjD,OAAO,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AACxC,CAAC"}
1
+ {"version":3,"file":"loadBox3D.js","sourceRoot":"","sources":["../src/loadBox3D.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,EAAE;AACF,sHAAsH;AACtH,qHAAqH;AACrH,4FAA4F;AAC5F,EAAE;AACF,4CAA4C;AAC5C,+CAA+C;AAC/C,EAAE;AACF,mHAAmH;AACnH,gGAAgG;AAqBhG;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAC9B,IAAI,OAAO,iBAAiB,KAAK,WAAW,EAAE,CAAC;QAC3C,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,MAAM,QAAQ,GAAI,UAAgD,CAAC,mBAAmB,CAAC;IACvF,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC;AAC9C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,UAA6B,EAAE;IAC3D,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,eAAe,GAAG,KAAK,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC;IAC/E,MAAM,YAAY,GAAG,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACzE,IAAI,YAAY,EAAE,CAAC;QACf,IAAI,OAAO,KAAK,IAAI,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CACX,8GAA8G;gBAC1G,yGAAyG;gBACzG,2EAA2E,CAClF,CAAC;QACN,CAAC;QACD,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,gCAAgC,CAAC,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;QAC/H,OAAO,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,KAAK,GAAG,eAAe,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAC5G,OAAO,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AACxC,CAAC"}
@@ -4,6 +4,11 @@
4
4
  * The module exposes a flat, handle based C API (see src/box3d_shim.c). Bodies, shape descriptions and joints
5
5
  * are integer slots. Vectors and quaternions are passed as individual floats. Functions that return more than one
6
6
  * value write into the scratch buffer returned by `_bx_Scratch()` (64 floats), read it through `HEAPF32`.
7
+ *
8
+ * World positions cross in doubles: the entry points that take one take doubles, and those that give one back also
9
+ * write it as doubles, to `_bx_ScratchF64()` or to a double buffer beside their float records (read through
10
+ * `HEAPF64`). The `-f64` builds (BOX3D_DOUBLE_PRECISION) hold positions in doubles, so a body far from the origin moves
11
+ * as it does near it; the default builds hold floats, and their doubles are those floats widened.
7
12
  */
8
13
 
9
14
  export interface Box3DModuleOptions {
@@ -19,6 +24,7 @@ export interface Box3DModuleOptions {
19
24
  /** Emscripten heap views. Do not cache them: they are replaced when the memory grows. */
20
25
  export interface Box3DHeap {
21
26
  HEAPF32: Float32Array;
27
+ HEAPF64: Float64Array;
22
28
  HEAP32: Int32Array;
23
29
  HEAPU32: Uint32Array;
24
30
  HEAPU8: Uint8Array;
@@ -29,6 +35,10 @@ export interface Box3DExports {
29
35
  _malloc(bytes: number): number;
30
36
  _free(ptr: number): void;
31
37
  _bx_Scratch(): number;
38
+ /** 16 doubles: world positions given back, see `_bx_Body_GetTransform`. */
39
+ _bx_ScratchF64(): number;
40
+ /** 1 in an `-f64` build, which holds world positions in doubles. */
41
+ _bx_IsDoublePrecision(): number;
32
42
  _bx_Alloc(bytes: number): number;
33
43
  _bx_Free(ptr: number): void;
34
44
  /** major * 10000 + minor * 100 + revision */
@@ -52,6 +62,8 @@ export interface Box3DExports {
52
62
  _bx_World_GetAwakeBodyCount(world: number): number;
53
63
  /** Joint force/torque threshold events from the last step (0 with the default thresholds). */
54
64
  _bx_World_GetJointEventCount(world: number): number;
65
+ /** The most the world's step stack has held at once, in bytes. */
66
+ _bx_World_GetStackUsed(world: number): number;
55
67
  /** scratch: [bodyCount, shapeCount, contactCount, jointCount, islandCount, stepMs, collideMs, solveMs] */
56
68
  _bx_World_GetStats(world: number): void;
57
69
 
@@ -69,7 +81,7 @@ export interface Box3DExports {
69
81
  _bx_Body_SetType(body: number, type: number): void;
70
82
  _bx_Body_GetType(body: number): number;
71
83
  _bx_Body_SetTransform(body: number, px: number, py: number, pz: number, qx: number, qy: number, qz: number, qw: number): void;
72
- /** scratch: [px, py, pz, qx, qy, qz, qw] */
84
+ /** scratch: [px, py, pz, qx, qy, qz, qw] as floats; scratchF64: [px, py, pz] as the build holds them */
73
85
  _bx_Body_GetTransform(body: number): void;
74
86
  _bx_Body_SetTargetTransform(body: number, px: number, py: number, pz: number, qx: number, qy: number, qz: number, qw: number, dt: number): void;
75
87
  _bx_Body_SetLinearVelocity(body: number, x: number, y: number, z: number): void;
@@ -113,6 +125,8 @@ export interface Box3DExports {
113
125
  */
114
126
  _bx_Body_GetContacts(body: number): number;
115
127
  _bx_BodyContactsPtr(): number;
128
+ /** The points of the records `_bx_Body_GetContacts` wrote, as doubles: 12 a record, [x, y, z] for each of its 4. */
129
+ _bx_BodyContactPointsF64Ptr(): number;
116
130
  /** Per-shape handles: each changes one shape, resets only its contacts, and keeps every shape's index. */
117
131
  /** Replaces shape `index` with the hull of `pointCount` points (xyz floats at `points`) in the body's frame; 1 if done. */
118
132
  _bx_Body_SetShapeHull(body: number, index: number, points: number, pointCount: number): number;
@@ -151,6 +165,15 @@ export interface Box3DExports {
151
165
  _bx_Body_ComputeShapeMassData(body: number): void;
152
166
  _bx_Body_ApplyMassFromShapes(body: number): void;
153
167
  _bx_Body_GetShapeCount(body: number): number;
168
+ /**
169
+ * Gives the body a feature key (an integer from 1 to 2^44 - 1; 0 takes it off) and each of its shapes, now and when
170
+ * it is next shaped, (key << 20) | its index. New contacts are made, continuous collision sweeps and a closest
171
+ * cast's ties are broken in the order of these keys, so keyed statics pair the same whatever order they were made in.
172
+ */
173
+ _bx_Body_SetFeatureKey(body: number, key: number): void;
174
+ _bx_Body_GetFeatureKey(body: number): number;
175
+ /** Shape `index`'s own feature key, as Box3D orders by it (exact up to 2^53). */
176
+ _bx_Body_GetShapeFeatureKey(body: number, index: number): number;
154
177
  /** Begin/end touch events and hit events on the body's shapes, enabled separately. */
155
178
  _bx_Body_SetEventFlags(body: number, contactEvents: number, hitEvents: number): void;
156
179
  /** Bit 1: begin/end touch events, bit 2: hit events. */
@@ -181,6 +204,18 @@ export interface Box3DExports {
181
204
  /** heights: countX * countZ floats indexed [z * countX + x]; materials: one byte a cell, (countX - 1) * (countZ - 1),
182
205
  * or 0 for none; local offset (ox, oy, oz) */
183
206
  _bx_ShapeDesc_CreateHeightField(heights: number, materials: number, countX: number, countZ: number, sx: number, sy: number, sz: number, clockwise: number, ox: number, oy: number, oz: number): number;
207
+ /**
208
+ * Where a mesh or height field description's data starts, and how many bytes it has (0 for any other description).
209
+ * Box3D keeps either as one block addressed by offsets, with no pointers in it, so the bytes can be copied to another
210
+ * instance of the same build (one with no world, on a worker) and made into a shape there with
211
+ * `_bx_ShapeDesc_CreateMeshFromBytes` or `_bx_ShapeDesc_CreateHeightFieldFromBytes`.
212
+ */
213
+ _bx_ShapeDesc_GetGeometryBytes(desc: number): number;
214
+ _bx_ShapeDesc_GetGeometryByteCount(desc: number): number;
215
+ /** A mesh description from a copy of a mesh block put at `bytes`, with the description's scale. 0 if it is not one. */
216
+ _bx_ShapeDesc_CreateMeshFromBytes(bytes: number, byteCount: number, sx: number, sy: number, sz: number): number;
217
+ /** A height field description from a copy of a height field block put at `bytes`, with a local offset. 0 if it is not one. */
218
+ _bx_ShapeDesc_CreateHeightFieldFromBytes(bytes: number, byteCount: number, ox: number, oy: number, oz: number): number;
184
219
  _bx_ShapeDesc_CreateContainer(): number;
185
220
  _bx_ShapeDesc_AddChild(parent: number, child: number, px: number, py: number, pz: number, qx: number, qy: number, qz: number, qw: number, sx: number, sy: number, sz: number): void;
186
221
  _bx_ShapeDesc_RemoveChild(parent: number, index: number): void;
@@ -198,6 +233,14 @@ export interface Box3DExports {
198
233
  _bx_ShapeDesc_SetRollingResistance(desc: number, value: number): void;
199
234
  _bx_ShapeDesc_SetSensor(desc: number, flag: number): void;
200
235
  _bx_ShapeDesc_IsSensor(desc: number): number;
236
+ /**
237
+ * 1 (the default): a static shape made from this description looks for its own pairs on the next step. 0: it never
238
+ * enters the broad phase's move buffer and waits for a moving shape to find it, which saves the step stack it would
239
+ * reserve and pairs a static made late on the same step as one made at the start. Off on a container, it is off for
240
+ * every shape made from its children.
241
+ */
242
+ _bx_ShapeDesc_SetInvokeContactCreation(desc: number, flag: number): void;
243
+ _bx_ShapeDesc_GetInvokeContactCreation(desc: number): number;
201
244
  /** scratch: [minx, miny, minz, maxx, maxy, maxz] */
202
245
  _bx_ShapeDesc_GetAABB(desc: number): void;
203
246
  _bx_ShapeDesc_Destroy(desc: number): void;
@@ -240,6 +283,8 @@ export interface Box3DExports {
240
283
 
241
284
  // queries
242
285
  _bx_RayHitsPtr(): number;
286
+ /** The hit points of the last ray or shape cast, as doubles: [x, y, z] a hit, beside `_bx_RayHitsPtr`'s records. */
287
+ _bx_RayHitPointsF64Ptr(): number;
243
288
  /** Returns the hit count; hits are 11 floats each: [px, py, pz, nx, ny, nz, fraction, bodySlot, shapeDesc, triangleIndex, shapeIndex] */
244
289
  _bx_World_CastRay(world: number, ox: number, oy: number, oz: number, dx: number, dy: number, dz: number, categoryBits: number, maskBits: number, ignoreBody: number, hitSensors: number, closestOnly: number): number;
245
290
  /**
package/lib/esm/box3d.js CHANGED
@@ -1,2 +1,2 @@
1
- async function Box3D(moduleArg={}){var Module=moduleArg;var ENVIRONMENT_IS_WEB=!!globalThis.window;var ENVIRONMENT_IS_WORKER=!!globalThis.WorkerGlobalScope;var ENVIRONMENT_IS_NODE=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";var programArgs=[];var thisProgram="./this.program";var _scriptName=import.meta.url;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;class EmscriptenEH{}class EmscriptenSjLj extends EmscriptenEH{}var runtimeInitialized=false;function getMemoryBuffer(){return wasmMemory.buffer}function updateMemoryViews(){if(HEAP8?.buffer?.resizable)return;var b=getMemoryBuffer();HEAP8=new Int8Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);HEAP64=new BigInt64Array(b)}function preRun(){var preRun=Module["preRun"];if(preRun){if(typeof preRun=="function")preRun=[preRun];onPreRuns.push(...preRun)}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;wasmExports["__wasm_call_ctors"]()}function postRun(){var postRun=Module["postRun"];if(postRun){if(typeof postRun=="function")postRun=[postRun];onPostRuns.push(...postRun)}callRuntimeCallbacks(onPostRuns)}function abort(what){Module["onAbort"]?.(what);what=`Aborted(${what})`;err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var wasmBinaryFile;function findWasmBinary(){if(Module["locateFile"]){return locateFile("box3d.wasm")}return new URL("box3d.wasm",import.meta.url).href}function getBinarySync(file){if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){var imports={env:wasmImports,wasi_snapshot_preview1:wasmImports};return imports}async function createWasm(){function receiveInstance(instance){wasmExports=instance.exports;assignWasmExports(wasmExports);updateMemoryViews();return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result["instance"])}var info=getWasmImports();var instantiateWasm=Module["instantiateWasm"];if(instantiateWasm){return new Promise(resolve=>{instantiateWasm(info,inst=>resolve(receiveInstance(inst)))})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var HEAP8;var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var onPreRuns=[];var noExitRuntime=true;var _emscripten_get_now=()=>performance.now();var _emscripten_date_now=()=>Date.now();var nowIsMonotonic=1;var checkWasiClock=clock_id=>clock_id>=0&&clock_id<=3;var INT53_MAX=9007199254740992;var INT53_MIN=-9007199254740992;var bigintToI53Checked=num=>num<INT53_MIN||num>INT53_MAX?NaN:Number(num);var HEAP64;function _clock_time_get(clk_id,ignored_precision,ptime){ignored_precision=bigintToI53Checked(ignored_precision);if(!checkWasiClock(clk_id)){return 28}var now;if(clk_id===0){now=_emscripten_date_now()}else if(nowIsMonotonic){now=_emscripten_get_now()}else{return 52}var nsec=Math.round(now*1e3*1e3);HEAP64[ptime>>3]=BigInt(nsec);return 0}var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var HEAPU8;var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var printCharBuffers=[null,[],[]];var UTF8Decoder=globalThis.TextDecoder&&new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var printChar=(stream,curr)=>{var buffer=printCharBuffers[stream];if(!curr||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer));buffer.length=0}else{buffer.push(curr)}};var HEAPU32;var _fd_write=(fd,iov,iovcnt,pnum)=>{var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j])}num+=len}HEAPU32[pnum>>2]=num;return 0};var HEAPF32;var HEAP32;{if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["arguments"])programArgs=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];var preInit=Module["preInit"];if(preInit){if(typeof preInit=="function")Module["preInit"]=preInit=[preInit];while(preInit.length>0){preInit.shift()()}}}var _free,_bx_Scratch,_bx_Alloc,_malloc,_bx_Free,_bx_GetVersion,_bx_GetRejectedSlotCount,_bx_GetMaxWorkers,_bx_CreateWorld,_bx_World_GetWorkerCount,_bx_DestroyWorld,_bx_ShapeDesc_Destroy,_bx_World_Step,_bx_World_SetGravity,_bx_World_SetMaximumLinearSpeed,_bx_World_GetMaximumLinearSpeed,_bx_World_EnableSleeping,_bx_World_EnableContinuous,_bx_World_SetContactTuning,_bx_World_Explode,_bx_World_GetAwakeBodyCount,_bx_World_GetJointEventCount,_bx_World_GetStats,_bx_MoveEventsPtr,_bx_ContactEventsPtr,_bx_SensorEventsPtr,_bx_World_GetMoveEvents,_bx_World_GetContactEvents,_bx_World_GetSensorEvents,_bx_CreateBody,_bx_DestroyBody,_bx_Body_SetType,_bx_Body_GetType,_bx_Body_SetTransform,_bx_Body_GetTransform,_bx_Body_SetTargetTransform,_bx_Body_SetLinearVelocity,_bx_Body_GetLinearVelocity,_bx_Body_SetAngularVelocity,_bx_Body_GetAngularVelocity,_bx_Body_SetLinearDamping,_bx_Body_GetLinearDamping,_bx_Body_SetAngularDamping,_bx_Body_GetAngularDamping,_bx_Body_SetGravityScale,_bx_Body_GetGravityScale,_bx_Body_ApplyForce,_bx_Body_ApplyForceToCenter,_bx_Body_ApplyTorque,_bx_Body_ApplyLinearImpulse,_bx_Body_ApplyLinearImpulseToCenter,_bx_Body_ApplyAngularImpulse,_bx_Body_SetAwake,_bx_Body_IsAwake,_bx_Body_EnableSleep,_bx_Body_SetBullet,_bx_Body_EnableContinuous,_bx_Body_IsContinuousEnabled,_bx_Body_SetShapeCrush,_bx_Body_GetShapeCrush,_bx_BodyContactsPtr,_bx_Body_GetContacts,_bx_Body_AllowFastRotation,_bx_Body_SetMotionLocks,_bx_Body_GetAABB,_bx_Body_ComputeShapeMassData,_bx_Body_GetMassData,_bx_Body_SetMassDataFull,_bx_Body_SetMassData,_bx_Body_GetMotionLocks,_bx_Body_ApplyMassFromShapes,_bx_Body_GetShapeCount,_bx_Body_SetEventFlags,_bx_Body_GetEventFlags,_bx_Body_EnableContactEvents,_bx_ShapeDesc_CreateSphere,_bx_ShapeDesc_CreateCapsule,_bx_ShapeDesc_CreateBox,_bx_ShapeDesc_CreateCylinder,_bx_ShapeDesc_CreateHull,_bx_ShapeDesc_CreateMesh,_bx_ShapeDesc_CreateHeightField,_bx_ShapeDesc_CreateContainer,_bx_ShapeDesc_AddChild,_bx_ShapeDesc_RemoveChild,_bx_ShapeDesc_GetChildCount,_bx_ShapeDesc_GetKind,_bx_ShapeDesc_SetMaterial,_bx_ShapeDesc_GetFriction,_bx_ShapeDesc_GetRestitution,_bx_ShapeDesc_SetDensity,_bx_ShapeDesc_GetDensity,_bx_ShapeDesc_SetFilter,_bx_ShapeDesc_GetCategoryBits,_bx_ShapeDesc_GetMaskBits,_bx_ShapeDesc_SetGroup,_bx_ShapeDesc_SetRollingResistance,_bx_ShapeDesc_SetSensor,_bx_ShapeDesc_IsSensor,_bx_ShapeDesc_GetAABB,_bx_GetShapeBuildCount,_bx_GetShapeDescCount,_bx_Body_SetShape,_bx_Body_SetShapeHull,_bx_Body_TranslateShape,_bx_Body_SetShapeFilter,_bx_Body_RemoveShape,_bx_Body_HasShape,_bx_Body_GetShapeInfo,_bx_Body_SyncShapeDesc,_bx_Body_GetShapeDesc,_bx_ShapeDesc_BuildDebugGeometry,_bx_DebugPositionsPtr,_bx_DebugIndicesPtr,_bx_DebugIndexCount,_bx_CreateJoint,_bx_DestroyJoint,_bx_Joint_IsValid,_bx_Joint_SetCollideConnected,_bx_Joint_SetConstraintTuning,_bx_Joint_WakeBodies,_bx_Joint_EnableLimit,_bx_Joint_SetLimits,_bx_Joint_SetTwistLimits,_bx_Joint_EnableMotor,_bx_Joint_UpdateMotorFrame,_bx_Joint_SetSphericalMotor,_bx_Joint_SetSphericalTarget,_bx_Joint_SetMotorSpeed,_bx_Joint_SetMaxMotorForce,_bx_Joint_EnableSpring,_bx_Joint_SetSpring,_bx_Joint_SetTarget,_bx_Joint_GetPosition,_bx_ComputeAlignedFrameB,_bx_WheelJoint_SetSpinMotorSpeed,_bx_WheelJoint_SetMaxSpinTorque,_bx_WheelJoint_EnableSpinMotor,_bx_WheelJoint_SetTargetSteeringAngle,_bx_WheelJoint_SetSuspension,_bx_RayHitsPtr,_bx_World_CastRay,_bx_World_CastShape,_bx_OverlapsPtr,_bx_World_OverlapShape,_bx_GeometryPtr,_bx_Body_GetShapeGeometry,memory,__indirect_function_table,wasmMemory;function assignWasmExports(wasmExports){_free=Module["_free"]=wasmExports["free"];_bx_Scratch=Module["_bx_Scratch"]=wasmExports["bx_Scratch"];_bx_Alloc=Module["_bx_Alloc"]=wasmExports["bx_Alloc"];_malloc=Module["_malloc"]=wasmExports["malloc"];_bx_Free=Module["_bx_Free"]=wasmExports["bx_Free"];_bx_GetVersion=Module["_bx_GetVersion"]=wasmExports["bx_GetVersion"];_bx_GetRejectedSlotCount=Module["_bx_GetRejectedSlotCount"]=wasmExports["bx_GetRejectedSlotCount"];_bx_GetMaxWorkers=Module["_bx_GetMaxWorkers"]=wasmExports["bx_GetMaxWorkers"];_bx_CreateWorld=Module["_bx_CreateWorld"]=wasmExports["bx_CreateWorld"];_bx_World_GetWorkerCount=Module["_bx_World_GetWorkerCount"]=wasmExports["bx_World_GetWorkerCount"];_bx_DestroyWorld=Module["_bx_DestroyWorld"]=wasmExports["bx_DestroyWorld"];_bx_ShapeDesc_Destroy=Module["_bx_ShapeDesc_Destroy"]=wasmExports["bx_ShapeDesc_Destroy"];_bx_World_Step=Module["_bx_World_Step"]=wasmExports["bx_World_Step"];_bx_World_SetGravity=Module["_bx_World_SetGravity"]=wasmExports["bx_World_SetGravity"];_bx_World_SetMaximumLinearSpeed=Module["_bx_World_SetMaximumLinearSpeed"]=wasmExports["bx_World_SetMaximumLinearSpeed"];_bx_World_GetMaximumLinearSpeed=Module["_bx_World_GetMaximumLinearSpeed"]=wasmExports["bx_World_GetMaximumLinearSpeed"];_bx_World_EnableSleeping=Module["_bx_World_EnableSleeping"]=wasmExports["bx_World_EnableSleeping"];_bx_World_EnableContinuous=Module["_bx_World_EnableContinuous"]=wasmExports["bx_World_EnableContinuous"];_bx_World_SetContactTuning=Module["_bx_World_SetContactTuning"]=wasmExports["bx_World_SetContactTuning"];_bx_World_Explode=Module["_bx_World_Explode"]=wasmExports["bx_World_Explode"];_bx_World_GetAwakeBodyCount=Module["_bx_World_GetAwakeBodyCount"]=wasmExports["bx_World_GetAwakeBodyCount"];_bx_World_GetJointEventCount=Module["_bx_World_GetJointEventCount"]=wasmExports["bx_World_GetJointEventCount"];_bx_World_GetStats=Module["_bx_World_GetStats"]=wasmExports["bx_World_GetStats"];_bx_MoveEventsPtr=Module["_bx_MoveEventsPtr"]=wasmExports["bx_MoveEventsPtr"];_bx_ContactEventsPtr=Module["_bx_ContactEventsPtr"]=wasmExports["bx_ContactEventsPtr"];_bx_SensorEventsPtr=Module["_bx_SensorEventsPtr"]=wasmExports["bx_SensorEventsPtr"];_bx_World_GetMoveEvents=Module["_bx_World_GetMoveEvents"]=wasmExports["bx_World_GetMoveEvents"];_bx_World_GetContactEvents=Module["_bx_World_GetContactEvents"]=wasmExports["bx_World_GetContactEvents"];_bx_World_GetSensorEvents=Module["_bx_World_GetSensorEvents"]=wasmExports["bx_World_GetSensorEvents"];_bx_CreateBody=Module["_bx_CreateBody"]=wasmExports["bx_CreateBody"];_bx_DestroyBody=Module["_bx_DestroyBody"]=wasmExports["bx_DestroyBody"];_bx_Body_SetType=Module["_bx_Body_SetType"]=wasmExports["bx_Body_SetType"];_bx_Body_GetType=Module["_bx_Body_GetType"]=wasmExports["bx_Body_GetType"];_bx_Body_SetTransform=Module["_bx_Body_SetTransform"]=wasmExports["bx_Body_SetTransform"];_bx_Body_GetTransform=Module["_bx_Body_GetTransform"]=wasmExports["bx_Body_GetTransform"];_bx_Body_SetTargetTransform=Module["_bx_Body_SetTargetTransform"]=wasmExports["bx_Body_SetTargetTransform"];_bx_Body_SetLinearVelocity=Module["_bx_Body_SetLinearVelocity"]=wasmExports["bx_Body_SetLinearVelocity"];_bx_Body_GetLinearVelocity=Module["_bx_Body_GetLinearVelocity"]=wasmExports["bx_Body_GetLinearVelocity"];_bx_Body_SetAngularVelocity=Module["_bx_Body_SetAngularVelocity"]=wasmExports["bx_Body_SetAngularVelocity"];_bx_Body_GetAngularVelocity=Module["_bx_Body_GetAngularVelocity"]=wasmExports["bx_Body_GetAngularVelocity"];_bx_Body_SetLinearDamping=Module["_bx_Body_SetLinearDamping"]=wasmExports["bx_Body_SetLinearDamping"];_bx_Body_GetLinearDamping=Module["_bx_Body_GetLinearDamping"]=wasmExports["bx_Body_GetLinearDamping"];_bx_Body_SetAngularDamping=Module["_bx_Body_SetAngularDamping"]=wasmExports["bx_Body_SetAngularDamping"];_bx_Body_GetAngularDamping=Module["_bx_Body_GetAngularDamping"]=wasmExports["bx_Body_GetAngularDamping"];_bx_Body_SetGravityScale=Module["_bx_Body_SetGravityScale"]=wasmExports["bx_Body_SetGravityScale"];_bx_Body_GetGravityScale=Module["_bx_Body_GetGravityScale"]=wasmExports["bx_Body_GetGravityScale"];_bx_Body_ApplyForce=Module["_bx_Body_ApplyForce"]=wasmExports["bx_Body_ApplyForce"];_bx_Body_ApplyForceToCenter=Module["_bx_Body_ApplyForceToCenter"]=wasmExports["bx_Body_ApplyForceToCenter"];_bx_Body_ApplyTorque=Module["_bx_Body_ApplyTorque"]=wasmExports["bx_Body_ApplyTorque"];_bx_Body_ApplyLinearImpulse=Module["_bx_Body_ApplyLinearImpulse"]=wasmExports["bx_Body_ApplyLinearImpulse"];_bx_Body_ApplyLinearImpulseToCenter=Module["_bx_Body_ApplyLinearImpulseToCenter"]=wasmExports["bx_Body_ApplyLinearImpulseToCenter"];_bx_Body_ApplyAngularImpulse=Module["_bx_Body_ApplyAngularImpulse"]=wasmExports["bx_Body_ApplyAngularImpulse"];_bx_Body_SetAwake=Module["_bx_Body_SetAwake"]=wasmExports["bx_Body_SetAwake"];_bx_Body_IsAwake=Module["_bx_Body_IsAwake"]=wasmExports["bx_Body_IsAwake"];_bx_Body_EnableSleep=Module["_bx_Body_EnableSleep"]=wasmExports["bx_Body_EnableSleep"];_bx_Body_SetBullet=Module["_bx_Body_SetBullet"]=wasmExports["bx_Body_SetBullet"];_bx_Body_EnableContinuous=Module["_bx_Body_EnableContinuous"]=wasmExports["bx_Body_EnableContinuous"];_bx_Body_IsContinuousEnabled=Module["_bx_Body_IsContinuousEnabled"]=wasmExports["bx_Body_IsContinuousEnabled"];_bx_Body_SetShapeCrush=Module["_bx_Body_SetShapeCrush"]=wasmExports["bx_Body_SetShapeCrush"];_bx_Body_GetShapeCrush=Module["_bx_Body_GetShapeCrush"]=wasmExports["bx_Body_GetShapeCrush"];_bx_BodyContactsPtr=Module["_bx_BodyContactsPtr"]=wasmExports["bx_BodyContactsPtr"];_bx_Body_GetContacts=Module["_bx_Body_GetContacts"]=wasmExports["bx_Body_GetContacts"];_bx_Body_AllowFastRotation=Module["_bx_Body_AllowFastRotation"]=wasmExports["bx_Body_AllowFastRotation"];_bx_Body_SetMotionLocks=Module["_bx_Body_SetMotionLocks"]=wasmExports["bx_Body_SetMotionLocks"];_bx_Body_GetAABB=Module["_bx_Body_GetAABB"]=wasmExports["bx_Body_GetAABB"];_bx_Body_ComputeShapeMassData=Module["_bx_Body_ComputeShapeMassData"]=wasmExports["bx_Body_ComputeShapeMassData"];_bx_Body_GetMassData=Module["_bx_Body_GetMassData"]=wasmExports["bx_Body_GetMassData"];_bx_Body_SetMassDataFull=Module["_bx_Body_SetMassDataFull"]=wasmExports["bx_Body_SetMassDataFull"];_bx_Body_SetMassData=Module["_bx_Body_SetMassData"]=wasmExports["bx_Body_SetMassData"];_bx_Body_GetMotionLocks=Module["_bx_Body_GetMotionLocks"]=wasmExports["bx_Body_GetMotionLocks"];_bx_Body_ApplyMassFromShapes=Module["_bx_Body_ApplyMassFromShapes"]=wasmExports["bx_Body_ApplyMassFromShapes"];_bx_Body_GetShapeCount=Module["_bx_Body_GetShapeCount"]=wasmExports["bx_Body_GetShapeCount"];_bx_Body_SetEventFlags=Module["_bx_Body_SetEventFlags"]=wasmExports["bx_Body_SetEventFlags"];_bx_Body_GetEventFlags=Module["_bx_Body_GetEventFlags"]=wasmExports["bx_Body_GetEventFlags"];_bx_Body_EnableContactEvents=Module["_bx_Body_EnableContactEvents"]=wasmExports["bx_Body_EnableContactEvents"];_bx_ShapeDesc_CreateSphere=Module["_bx_ShapeDesc_CreateSphere"]=wasmExports["bx_ShapeDesc_CreateSphere"];_bx_ShapeDesc_CreateCapsule=Module["_bx_ShapeDesc_CreateCapsule"]=wasmExports["bx_ShapeDesc_CreateCapsule"];_bx_ShapeDesc_CreateBox=Module["_bx_ShapeDesc_CreateBox"]=wasmExports["bx_ShapeDesc_CreateBox"];_bx_ShapeDesc_CreateCylinder=Module["_bx_ShapeDesc_CreateCylinder"]=wasmExports["bx_ShapeDesc_CreateCylinder"];_bx_ShapeDesc_CreateHull=Module["_bx_ShapeDesc_CreateHull"]=wasmExports["bx_ShapeDesc_CreateHull"];_bx_ShapeDesc_CreateMesh=Module["_bx_ShapeDesc_CreateMesh"]=wasmExports["bx_ShapeDesc_CreateMesh"];_bx_ShapeDesc_CreateHeightField=Module["_bx_ShapeDesc_CreateHeightField"]=wasmExports["bx_ShapeDesc_CreateHeightField"];_bx_ShapeDesc_CreateContainer=Module["_bx_ShapeDesc_CreateContainer"]=wasmExports["bx_ShapeDesc_CreateContainer"];_bx_ShapeDesc_AddChild=Module["_bx_ShapeDesc_AddChild"]=wasmExports["bx_ShapeDesc_AddChild"];_bx_ShapeDesc_RemoveChild=Module["_bx_ShapeDesc_RemoveChild"]=wasmExports["bx_ShapeDesc_RemoveChild"];_bx_ShapeDesc_GetChildCount=Module["_bx_ShapeDesc_GetChildCount"]=wasmExports["bx_ShapeDesc_GetChildCount"];_bx_ShapeDesc_GetKind=Module["_bx_ShapeDesc_GetKind"]=wasmExports["bx_ShapeDesc_GetKind"];_bx_ShapeDesc_SetMaterial=Module["_bx_ShapeDesc_SetMaterial"]=wasmExports["bx_ShapeDesc_SetMaterial"];_bx_ShapeDesc_GetFriction=Module["_bx_ShapeDesc_GetFriction"]=wasmExports["bx_ShapeDesc_GetFriction"];_bx_ShapeDesc_GetRestitution=Module["_bx_ShapeDesc_GetRestitution"]=wasmExports["bx_ShapeDesc_GetRestitution"];_bx_ShapeDesc_SetDensity=Module["_bx_ShapeDesc_SetDensity"]=wasmExports["bx_ShapeDesc_SetDensity"];_bx_ShapeDesc_GetDensity=Module["_bx_ShapeDesc_GetDensity"]=wasmExports["bx_ShapeDesc_GetDensity"];_bx_ShapeDesc_SetFilter=Module["_bx_ShapeDesc_SetFilter"]=wasmExports["bx_ShapeDesc_SetFilter"];_bx_ShapeDesc_GetCategoryBits=Module["_bx_ShapeDesc_GetCategoryBits"]=wasmExports["bx_ShapeDesc_GetCategoryBits"];_bx_ShapeDesc_GetMaskBits=Module["_bx_ShapeDesc_GetMaskBits"]=wasmExports["bx_ShapeDesc_GetMaskBits"];_bx_ShapeDesc_SetGroup=Module["_bx_ShapeDesc_SetGroup"]=wasmExports["bx_ShapeDesc_SetGroup"];_bx_ShapeDesc_SetRollingResistance=Module["_bx_ShapeDesc_SetRollingResistance"]=wasmExports["bx_ShapeDesc_SetRollingResistance"];_bx_ShapeDesc_SetSensor=Module["_bx_ShapeDesc_SetSensor"]=wasmExports["bx_ShapeDesc_SetSensor"];_bx_ShapeDesc_IsSensor=Module["_bx_ShapeDesc_IsSensor"]=wasmExports["bx_ShapeDesc_IsSensor"];_bx_ShapeDesc_GetAABB=Module["_bx_ShapeDesc_GetAABB"]=wasmExports["bx_ShapeDesc_GetAABB"];_bx_GetShapeBuildCount=Module["_bx_GetShapeBuildCount"]=wasmExports["bx_GetShapeBuildCount"];_bx_GetShapeDescCount=Module["_bx_GetShapeDescCount"]=wasmExports["bx_GetShapeDescCount"];_bx_Body_SetShape=Module["_bx_Body_SetShape"]=wasmExports["bx_Body_SetShape"];_bx_Body_SetShapeHull=Module["_bx_Body_SetShapeHull"]=wasmExports["bx_Body_SetShapeHull"];_bx_Body_TranslateShape=Module["_bx_Body_TranslateShape"]=wasmExports["bx_Body_TranslateShape"];_bx_Body_SetShapeFilter=Module["_bx_Body_SetShapeFilter"]=wasmExports["bx_Body_SetShapeFilter"];_bx_Body_RemoveShape=Module["_bx_Body_RemoveShape"]=wasmExports["bx_Body_RemoveShape"];_bx_Body_HasShape=Module["_bx_Body_HasShape"]=wasmExports["bx_Body_HasShape"];_bx_Body_GetShapeInfo=Module["_bx_Body_GetShapeInfo"]=wasmExports["bx_Body_GetShapeInfo"];_bx_Body_SyncShapeDesc=Module["_bx_Body_SyncShapeDesc"]=wasmExports["bx_Body_SyncShapeDesc"];_bx_Body_GetShapeDesc=Module["_bx_Body_GetShapeDesc"]=wasmExports["bx_Body_GetShapeDesc"];_bx_ShapeDesc_BuildDebugGeometry=Module["_bx_ShapeDesc_BuildDebugGeometry"]=wasmExports["bx_ShapeDesc_BuildDebugGeometry"];_bx_DebugPositionsPtr=Module["_bx_DebugPositionsPtr"]=wasmExports["bx_DebugPositionsPtr"];_bx_DebugIndicesPtr=Module["_bx_DebugIndicesPtr"]=wasmExports["bx_DebugIndicesPtr"];_bx_DebugIndexCount=Module["_bx_DebugIndexCount"]=wasmExports["bx_DebugIndexCount"];_bx_CreateJoint=Module["_bx_CreateJoint"]=wasmExports["bx_CreateJoint"];_bx_DestroyJoint=Module["_bx_DestroyJoint"]=wasmExports["bx_DestroyJoint"];_bx_Joint_IsValid=Module["_bx_Joint_IsValid"]=wasmExports["bx_Joint_IsValid"];_bx_Joint_SetCollideConnected=Module["_bx_Joint_SetCollideConnected"]=wasmExports["bx_Joint_SetCollideConnected"];_bx_Joint_SetConstraintTuning=Module["_bx_Joint_SetConstraintTuning"]=wasmExports["bx_Joint_SetConstraintTuning"];_bx_Joint_WakeBodies=Module["_bx_Joint_WakeBodies"]=wasmExports["bx_Joint_WakeBodies"];_bx_Joint_EnableLimit=Module["_bx_Joint_EnableLimit"]=wasmExports["bx_Joint_EnableLimit"];_bx_Joint_SetLimits=Module["_bx_Joint_SetLimits"]=wasmExports["bx_Joint_SetLimits"];_bx_Joint_SetTwistLimits=Module["_bx_Joint_SetTwistLimits"]=wasmExports["bx_Joint_SetTwistLimits"];_bx_Joint_EnableMotor=Module["_bx_Joint_EnableMotor"]=wasmExports["bx_Joint_EnableMotor"];_bx_Joint_UpdateMotorFrame=Module["_bx_Joint_UpdateMotorFrame"]=wasmExports["bx_Joint_UpdateMotorFrame"];_bx_Joint_SetSphericalMotor=Module["_bx_Joint_SetSphericalMotor"]=wasmExports["bx_Joint_SetSphericalMotor"];_bx_Joint_SetSphericalTarget=Module["_bx_Joint_SetSphericalTarget"]=wasmExports["bx_Joint_SetSphericalTarget"];_bx_Joint_SetMotorSpeed=Module["_bx_Joint_SetMotorSpeed"]=wasmExports["bx_Joint_SetMotorSpeed"];_bx_Joint_SetMaxMotorForce=Module["_bx_Joint_SetMaxMotorForce"]=wasmExports["bx_Joint_SetMaxMotorForce"];_bx_Joint_EnableSpring=Module["_bx_Joint_EnableSpring"]=wasmExports["bx_Joint_EnableSpring"];_bx_Joint_SetSpring=Module["_bx_Joint_SetSpring"]=wasmExports["bx_Joint_SetSpring"];_bx_Joint_SetTarget=Module["_bx_Joint_SetTarget"]=wasmExports["bx_Joint_SetTarget"];_bx_Joint_GetPosition=Module["_bx_Joint_GetPosition"]=wasmExports["bx_Joint_GetPosition"];_bx_ComputeAlignedFrameB=Module["_bx_ComputeAlignedFrameB"]=wasmExports["bx_ComputeAlignedFrameB"];_bx_WheelJoint_SetSpinMotorSpeed=Module["_bx_WheelJoint_SetSpinMotorSpeed"]=wasmExports["bx_WheelJoint_SetSpinMotorSpeed"];_bx_WheelJoint_SetMaxSpinTorque=Module["_bx_WheelJoint_SetMaxSpinTorque"]=wasmExports["bx_WheelJoint_SetMaxSpinTorque"];_bx_WheelJoint_EnableSpinMotor=Module["_bx_WheelJoint_EnableSpinMotor"]=wasmExports["bx_WheelJoint_EnableSpinMotor"];_bx_WheelJoint_SetTargetSteeringAngle=Module["_bx_WheelJoint_SetTargetSteeringAngle"]=wasmExports["bx_WheelJoint_SetTargetSteeringAngle"];_bx_WheelJoint_SetSuspension=Module["_bx_WheelJoint_SetSuspension"]=wasmExports["bx_WheelJoint_SetSuspension"];_bx_RayHitsPtr=Module["_bx_RayHitsPtr"]=wasmExports["bx_RayHitsPtr"];_bx_World_CastRay=Module["_bx_World_CastRay"]=wasmExports["bx_World_CastRay"];_bx_World_CastShape=Module["_bx_World_CastShape"]=wasmExports["bx_World_CastShape"];_bx_OverlapsPtr=Module["_bx_OverlapsPtr"]=wasmExports["bx_OverlapsPtr"];_bx_World_OverlapShape=Module["_bx_World_OverlapShape"]=wasmExports["bx_World_OverlapShape"];_bx_GeometryPtr=Module["_bx_GeometryPtr"]=wasmExports["bx_GeometryPtr"];_bx_Body_GetShapeGeometry=Module["_bx_Body_GetShapeGeometry"]=wasmExports["bx_Body_GetShapeGeometry"];memory=wasmMemory=wasmExports["memory"];__indirect_function_table=wasmExports["__indirect_function_table"]}var wasmImports={clock_time_get:_clock_time_get,emscripten_get_now:_emscripten_get_now,emscripten_resize_heap:_emscripten_resize_heap,fd_write:_fd_write};async function run(){preRun();var setStatus=Module["setStatus"];if(setStatus){setStatus("Running...");await new Promise(resolve=>setTimeout(resolve,1));setTimeout(setStatus,1,"")}if(ABORT)return;initRuntime();Module["onRuntimeInitialized"]?.();postRun()}var wasmExports;wasmExports=await createWasm();await run();
2
- ;return Module}export default Box3D;
1
+ async function Box3D(moduleArg={}){var Module=moduleArg;var ENVIRONMENT_IS_WEB=!!globalThis.window;var ENVIRONMENT_IS_WORKER=!!globalThis.WorkerGlobalScope;var ENVIRONMENT_IS_NODE=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";var programArgs=[];var thisProgram="./this.program";var _scriptName=import.meta.url;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;class EmscriptenEH{}class EmscriptenSjLj extends EmscriptenEH{}var runtimeInitialized=false;function getMemoryBuffer(){return wasmMemory.buffer}function updateMemoryViews(){if(HEAP8?.buffer?.resizable)return;var b=getMemoryBuffer();HEAP8=new Int8Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b)}function preRun(){var preRun=Module["preRun"];if(preRun){if(typeof preRun=="function")preRun=[preRun];onPreRuns.push(...preRun)}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;wasmExports["__wasm_call_ctors"]()}function postRun(){var postRun=Module["postRun"];if(postRun){if(typeof postRun=="function")postRun=[postRun];onPostRuns.push(...postRun)}callRuntimeCallbacks(onPostRuns)}function abort(what){Module["onAbort"]?.(what);what=`Aborted(${what})`;err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var wasmBinaryFile;function findWasmBinary(){if(Module["locateFile"]){return locateFile("box3d.wasm")}return new URL("box3d.wasm",import.meta.url).href}function getBinarySync(file){if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){var imports={env:wasmImports,wasi_snapshot_preview1:wasmImports};return imports}async function createWasm(){function receiveInstance(instance){wasmExports=instance.exports;assignWasmExports(wasmExports);updateMemoryViews();return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result["instance"])}var info=getWasmImports();var instantiateWasm=Module["instantiateWasm"];if(instantiateWasm){return new Promise(resolve=>{instantiateWasm(info,inst=>resolve(receiveInstance(inst)))})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var HEAP8;var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var onPreRuns=[];var noExitRuntime=true;var _emscripten_get_now=()=>performance.now();var _emscripten_date_now=()=>Date.now();var nowIsMonotonic=1;var checkWasiClock=clock_id=>clock_id>=0&&clock_id<=3;var INT53_MAX=9007199254740992;var INT53_MIN=-9007199254740992;var bigintToI53Checked=num=>num<INT53_MIN||num>INT53_MAX?NaN:Number(num);var HEAP64;function _clock_time_get(clk_id,ignored_precision,ptime){ignored_precision=bigintToI53Checked(ignored_precision);if(!checkWasiClock(clk_id)){return 28}var now;if(clk_id===0){now=_emscripten_date_now()}else if(nowIsMonotonic){now=_emscripten_get_now()}else{return 52}var nsec=Math.round(now*1e3*1e3);HEAP64[ptime>>3]=BigInt(nsec);return 0}var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var HEAPU8;var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var printCharBuffers=[null,[],[]];var UTF8Decoder=globalThis.TextDecoder&&new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var printChar=(stream,curr)=>{var buffer=printCharBuffers[stream];if(!curr||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer));buffer.length=0}else{buffer.push(curr)}};var HEAPU32;var _fd_write=(fd,iov,iovcnt,pnum)=>{var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j])}num+=len}HEAPU32[pnum>>2]=num;return 0};var HEAPF32;var HEAPF64;var HEAP32;{if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["arguments"])programArgs=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];var preInit=Module["preInit"];if(preInit){if(typeof preInit=="function")Module["preInit"]=preInit=[preInit];while(preInit.length>0){preInit.shift()()}}}var _free,_bx_Scratch,_bx_Alloc,_malloc,_bx_Free,_bx_GetVersion,_bx_ScratchF64,_bx_IsDoublePrecision,_bx_GetRejectedSlotCount,_bx_GetMaxWorkers,_bx_CreateWorld,_bx_World_GetWorkerCount,_bx_DestroyWorld,_bx_ShapeDesc_Destroy,_bx_World_Step,_bx_World_SetGravity,_bx_World_SetMaximumLinearSpeed,_bx_World_GetMaximumLinearSpeed,_bx_World_EnableSleeping,_bx_World_EnableContinuous,_bx_World_SetContactTuning,_bx_World_Explode,_bx_World_GetAwakeBodyCount,_bx_World_GetJointEventCount,_bx_World_GetStackUsed,_bx_World_GetStats,_bx_MoveEventsPtr,_bx_ContactEventsPtr,_bx_SensorEventsPtr,_bx_World_GetMoveEvents,_bx_World_GetContactEvents,_bx_World_GetSensorEvents,_bx_CreateBody,_bx_DestroyBody,_bx_Body_SetType,_bx_Body_GetType,_bx_Body_SetTransform,_bx_Body_GetTransform,_bx_Body_SetTargetTransform,_bx_Body_SetLinearVelocity,_bx_Body_GetLinearVelocity,_bx_Body_SetAngularVelocity,_bx_Body_GetAngularVelocity,_bx_Body_SetLinearDamping,_bx_Body_GetLinearDamping,_bx_Body_SetAngularDamping,_bx_Body_GetAngularDamping,_bx_Body_SetGravityScale,_bx_Body_GetGravityScale,_bx_Body_ApplyForce,_bx_Body_ApplyForceToCenter,_bx_Body_ApplyTorque,_bx_Body_ApplyLinearImpulse,_bx_Body_ApplyLinearImpulseToCenter,_bx_Body_ApplyAngularImpulse,_bx_Body_SetAwake,_bx_Body_IsAwake,_bx_Body_EnableSleep,_bx_Body_SetBullet,_bx_Body_EnableContinuous,_bx_Body_IsContinuousEnabled,_bx_Body_SetShapeCrush,_bx_Body_GetShapeCrush,_bx_BodyContactsPtr,_bx_BodyContactPointsF64Ptr,_bx_Body_GetContacts,_bx_Body_AllowFastRotation,_bx_Body_SetMotionLocks,_bx_Body_GetAABB,_bx_Body_ComputeShapeMassData,_bx_Body_GetMassData,_bx_Body_SetMassDataFull,_bx_Body_SetMassData,_bx_Body_GetMotionLocks,_bx_Body_ApplyMassFromShapes,_bx_Body_GetShapeCount,_bx_Body_SetFeatureKey,_bx_Body_GetFeatureKey,_bx_Body_GetShapeFeatureKey,_bx_Body_SetEventFlags,_bx_Body_GetEventFlags,_bx_Body_EnableContactEvents,_bx_ShapeDesc_CreateSphere,_bx_ShapeDesc_CreateCapsule,_bx_ShapeDesc_CreateBox,_bx_ShapeDesc_CreateCylinder,_bx_ShapeDesc_CreateHull,_bx_ShapeDesc_CreateMesh,_bx_ShapeDesc_CreateHeightField,_bx_ShapeDesc_GetGeometryBytes,_bx_ShapeDesc_GetGeometryByteCount,_bx_ShapeDesc_CreateMeshFromBytes,_bx_ShapeDesc_CreateHeightFieldFromBytes,_bx_ShapeDesc_CreateContainer,_bx_ShapeDesc_AddChild,_bx_ShapeDesc_RemoveChild,_bx_ShapeDesc_GetChildCount,_bx_ShapeDesc_GetKind,_bx_ShapeDesc_SetMaterial,_bx_ShapeDesc_GetFriction,_bx_ShapeDesc_GetRestitution,_bx_ShapeDesc_SetDensity,_bx_ShapeDesc_GetDensity,_bx_ShapeDesc_SetFilter,_bx_ShapeDesc_GetCategoryBits,_bx_ShapeDesc_GetMaskBits,_bx_ShapeDesc_SetGroup,_bx_ShapeDesc_SetRollingResistance,_bx_ShapeDesc_SetSensor,_bx_ShapeDesc_IsSensor,_bx_ShapeDesc_SetInvokeContactCreation,_bx_ShapeDesc_GetInvokeContactCreation,_bx_ShapeDesc_GetAABB,_bx_GetShapeBuildCount,_bx_GetShapeDescCount,_bx_Body_SetShape,_bx_Body_SetShapeHull,_bx_Body_TranslateShape,_bx_Body_SetShapeFilter,_bx_Body_RemoveShape,_bx_Body_HasShape,_bx_Body_GetShapeInfo,_bx_Body_SyncShapeDesc,_bx_Body_GetShapeDesc,_bx_ShapeDesc_BuildDebugGeometry,_bx_DebugPositionsPtr,_bx_DebugIndicesPtr,_bx_DebugIndexCount,_bx_CreateJoint,_bx_DestroyJoint,_bx_Joint_IsValid,_bx_Joint_SetCollideConnected,_bx_Joint_SetConstraintTuning,_bx_Joint_WakeBodies,_bx_Joint_EnableLimit,_bx_Joint_SetLimits,_bx_Joint_SetTwistLimits,_bx_Joint_EnableMotor,_bx_Joint_UpdateMotorFrame,_bx_Joint_SetSphericalMotor,_bx_Joint_SetSphericalTarget,_bx_Joint_SetMotorSpeed,_bx_Joint_SetMaxMotorForce,_bx_Joint_EnableSpring,_bx_Joint_SetSpring,_bx_Joint_SetTarget,_bx_Joint_GetPosition,_bx_ComputeAlignedFrameB,_bx_WheelJoint_SetSpinMotorSpeed,_bx_WheelJoint_SetMaxSpinTorque,_bx_WheelJoint_EnableSpinMotor,_bx_WheelJoint_SetTargetSteeringAngle,_bx_WheelJoint_SetSuspension,_bx_RayHitsPtr,_bx_RayHitPointsF64Ptr,_bx_World_CastRay,_bx_World_CastShape,_bx_OverlapsPtr,_bx_World_OverlapShape,_bx_GeometryPtr,_bx_Body_GetShapeGeometry,memory,__indirect_function_table,wasmMemory;function assignWasmExports(wasmExports){_free=Module["_free"]=wasmExports["free"];_bx_Scratch=Module["_bx_Scratch"]=wasmExports["bx_Scratch"];_bx_Alloc=Module["_bx_Alloc"]=wasmExports["bx_Alloc"];_malloc=Module["_malloc"]=wasmExports["malloc"];_bx_Free=Module["_bx_Free"]=wasmExports["bx_Free"];_bx_GetVersion=Module["_bx_GetVersion"]=wasmExports["bx_GetVersion"];_bx_ScratchF64=Module["_bx_ScratchF64"]=wasmExports["bx_ScratchF64"];_bx_IsDoublePrecision=Module["_bx_IsDoublePrecision"]=wasmExports["bx_IsDoublePrecision"];_bx_GetRejectedSlotCount=Module["_bx_GetRejectedSlotCount"]=wasmExports["bx_GetRejectedSlotCount"];_bx_GetMaxWorkers=Module["_bx_GetMaxWorkers"]=wasmExports["bx_GetMaxWorkers"];_bx_CreateWorld=Module["_bx_CreateWorld"]=wasmExports["bx_CreateWorld"];_bx_World_GetWorkerCount=Module["_bx_World_GetWorkerCount"]=wasmExports["bx_World_GetWorkerCount"];_bx_DestroyWorld=Module["_bx_DestroyWorld"]=wasmExports["bx_DestroyWorld"];_bx_ShapeDesc_Destroy=Module["_bx_ShapeDesc_Destroy"]=wasmExports["bx_ShapeDesc_Destroy"];_bx_World_Step=Module["_bx_World_Step"]=wasmExports["bx_World_Step"];_bx_World_SetGravity=Module["_bx_World_SetGravity"]=wasmExports["bx_World_SetGravity"];_bx_World_SetMaximumLinearSpeed=Module["_bx_World_SetMaximumLinearSpeed"]=wasmExports["bx_World_SetMaximumLinearSpeed"];_bx_World_GetMaximumLinearSpeed=Module["_bx_World_GetMaximumLinearSpeed"]=wasmExports["bx_World_GetMaximumLinearSpeed"];_bx_World_EnableSleeping=Module["_bx_World_EnableSleeping"]=wasmExports["bx_World_EnableSleeping"];_bx_World_EnableContinuous=Module["_bx_World_EnableContinuous"]=wasmExports["bx_World_EnableContinuous"];_bx_World_SetContactTuning=Module["_bx_World_SetContactTuning"]=wasmExports["bx_World_SetContactTuning"];_bx_World_Explode=Module["_bx_World_Explode"]=wasmExports["bx_World_Explode"];_bx_World_GetAwakeBodyCount=Module["_bx_World_GetAwakeBodyCount"]=wasmExports["bx_World_GetAwakeBodyCount"];_bx_World_GetJointEventCount=Module["_bx_World_GetJointEventCount"]=wasmExports["bx_World_GetJointEventCount"];_bx_World_GetStackUsed=Module["_bx_World_GetStackUsed"]=wasmExports["bx_World_GetStackUsed"];_bx_World_GetStats=Module["_bx_World_GetStats"]=wasmExports["bx_World_GetStats"];_bx_MoveEventsPtr=Module["_bx_MoveEventsPtr"]=wasmExports["bx_MoveEventsPtr"];_bx_ContactEventsPtr=Module["_bx_ContactEventsPtr"]=wasmExports["bx_ContactEventsPtr"];_bx_SensorEventsPtr=Module["_bx_SensorEventsPtr"]=wasmExports["bx_SensorEventsPtr"];_bx_World_GetMoveEvents=Module["_bx_World_GetMoveEvents"]=wasmExports["bx_World_GetMoveEvents"];_bx_World_GetContactEvents=Module["_bx_World_GetContactEvents"]=wasmExports["bx_World_GetContactEvents"];_bx_World_GetSensorEvents=Module["_bx_World_GetSensorEvents"]=wasmExports["bx_World_GetSensorEvents"];_bx_CreateBody=Module["_bx_CreateBody"]=wasmExports["bx_CreateBody"];_bx_DestroyBody=Module["_bx_DestroyBody"]=wasmExports["bx_DestroyBody"];_bx_Body_SetType=Module["_bx_Body_SetType"]=wasmExports["bx_Body_SetType"];_bx_Body_GetType=Module["_bx_Body_GetType"]=wasmExports["bx_Body_GetType"];_bx_Body_SetTransform=Module["_bx_Body_SetTransform"]=wasmExports["bx_Body_SetTransform"];_bx_Body_GetTransform=Module["_bx_Body_GetTransform"]=wasmExports["bx_Body_GetTransform"];_bx_Body_SetTargetTransform=Module["_bx_Body_SetTargetTransform"]=wasmExports["bx_Body_SetTargetTransform"];_bx_Body_SetLinearVelocity=Module["_bx_Body_SetLinearVelocity"]=wasmExports["bx_Body_SetLinearVelocity"];_bx_Body_GetLinearVelocity=Module["_bx_Body_GetLinearVelocity"]=wasmExports["bx_Body_GetLinearVelocity"];_bx_Body_SetAngularVelocity=Module["_bx_Body_SetAngularVelocity"]=wasmExports["bx_Body_SetAngularVelocity"];_bx_Body_GetAngularVelocity=Module["_bx_Body_GetAngularVelocity"]=wasmExports["bx_Body_GetAngularVelocity"];_bx_Body_SetLinearDamping=Module["_bx_Body_SetLinearDamping"]=wasmExports["bx_Body_SetLinearDamping"];_bx_Body_GetLinearDamping=Module["_bx_Body_GetLinearDamping"]=wasmExports["bx_Body_GetLinearDamping"];_bx_Body_SetAngularDamping=Module["_bx_Body_SetAngularDamping"]=wasmExports["bx_Body_SetAngularDamping"];_bx_Body_GetAngularDamping=Module["_bx_Body_GetAngularDamping"]=wasmExports["bx_Body_GetAngularDamping"];_bx_Body_SetGravityScale=Module["_bx_Body_SetGravityScale"]=wasmExports["bx_Body_SetGravityScale"];_bx_Body_GetGravityScale=Module["_bx_Body_GetGravityScale"]=wasmExports["bx_Body_GetGravityScale"];_bx_Body_ApplyForce=Module["_bx_Body_ApplyForce"]=wasmExports["bx_Body_ApplyForce"];_bx_Body_ApplyForceToCenter=Module["_bx_Body_ApplyForceToCenter"]=wasmExports["bx_Body_ApplyForceToCenter"];_bx_Body_ApplyTorque=Module["_bx_Body_ApplyTorque"]=wasmExports["bx_Body_ApplyTorque"];_bx_Body_ApplyLinearImpulse=Module["_bx_Body_ApplyLinearImpulse"]=wasmExports["bx_Body_ApplyLinearImpulse"];_bx_Body_ApplyLinearImpulseToCenter=Module["_bx_Body_ApplyLinearImpulseToCenter"]=wasmExports["bx_Body_ApplyLinearImpulseToCenter"];_bx_Body_ApplyAngularImpulse=Module["_bx_Body_ApplyAngularImpulse"]=wasmExports["bx_Body_ApplyAngularImpulse"];_bx_Body_SetAwake=Module["_bx_Body_SetAwake"]=wasmExports["bx_Body_SetAwake"];_bx_Body_IsAwake=Module["_bx_Body_IsAwake"]=wasmExports["bx_Body_IsAwake"];_bx_Body_EnableSleep=Module["_bx_Body_EnableSleep"]=wasmExports["bx_Body_EnableSleep"];_bx_Body_SetBullet=Module["_bx_Body_SetBullet"]=wasmExports["bx_Body_SetBullet"];_bx_Body_EnableContinuous=Module["_bx_Body_EnableContinuous"]=wasmExports["bx_Body_EnableContinuous"];_bx_Body_IsContinuousEnabled=Module["_bx_Body_IsContinuousEnabled"]=wasmExports["bx_Body_IsContinuousEnabled"];_bx_Body_SetShapeCrush=Module["_bx_Body_SetShapeCrush"]=wasmExports["bx_Body_SetShapeCrush"];_bx_Body_GetShapeCrush=Module["_bx_Body_GetShapeCrush"]=wasmExports["bx_Body_GetShapeCrush"];_bx_BodyContactsPtr=Module["_bx_BodyContactsPtr"]=wasmExports["bx_BodyContactsPtr"];_bx_BodyContactPointsF64Ptr=Module["_bx_BodyContactPointsF64Ptr"]=wasmExports["bx_BodyContactPointsF64Ptr"];_bx_Body_GetContacts=Module["_bx_Body_GetContacts"]=wasmExports["bx_Body_GetContacts"];_bx_Body_AllowFastRotation=Module["_bx_Body_AllowFastRotation"]=wasmExports["bx_Body_AllowFastRotation"];_bx_Body_SetMotionLocks=Module["_bx_Body_SetMotionLocks"]=wasmExports["bx_Body_SetMotionLocks"];_bx_Body_GetAABB=Module["_bx_Body_GetAABB"]=wasmExports["bx_Body_GetAABB"];_bx_Body_ComputeShapeMassData=Module["_bx_Body_ComputeShapeMassData"]=wasmExports["bx_Body_ComputeShapeMassData"];_bx_Body_GetMassData=Module["_bx_Body_GetMassData"]=wasmExports["bx_Body_GetMassData"];_bx_Body_SetMassDataFull=Module["_bx_Body_SetMassDataFull"]=wasmExports["bx_Body_SetMassDataFull"];_bx_Body_SetMassData=Module["_bx_Body_SetMassData"]=wasmExports["bx_Body_SetMassData"];_bx_Body_GetMotionLocks=Module["_bx_Body_GetMotionLocks"]=wasmExports["bx_Body_GetMotionLocks"];_bx_Body_ApplyMassFromShapes=Module["_bx_Body_ApplyMassFromShapes"]=wasmExports["bx_Body_ApplyMassFromShapes"];_bx_Body_GetShapeCount=Module["_bx_Body_GetShapeCount"]=wasmExports["bx_Body_GetShapeCount"];_bx_Body_SetFeatureKey=Module["_bx_Body_SetFeatureKey"]=wasmExports["bx_Body_SetFeatureKey"];_bx_Body_GetFeatureKey=Module["_bx_Body_GetFeatureKey"]=wasmExports["bx_Body_GetFeatureKey"];_bx_Body_GetShapeFeatureKey=Module["_bx_Body_GetShapeFeatureKey"]=wasmExports["bx_Body_GetShapeFeatureKey"];_bx_Body_SetEventFlags=Module["_bx_Body_SetEventFlags"]=wasmExports["bx_Body_SetEventFlags"];_bx_Body_GetEventFlags=Module["_bx_Body_GetEventFlags"]=wasmExports["bx_Body_GetEventFlags"];_bx_Body_EnableContactEvents=Module["_bx_Body_EnableContactEvents"]=wasmExports["bx_Body_EnableContactEvents"];_bx_ShapeDesc_CreateSphere=Module["_bx_ShapeDesc_CreateSphere"]=wasmExports["bx_ShapeDesc_CreateSphere"];_bx_ShapeDesc_CreateCapsule=Module["_bx_ShapeDesc_CreateCapsule"]=wasmExports["bx_ShapeDesc_CreateCapsule"];_bx_ShapeDesc_CreateBox=Module["_bx_ShapeDesc_CreateBox"]=wasmExports["bx_ShapeDesc_CreateBox"];_bx_ShapeDesc_CreateCylinder=Module["_bx_ShapeDesc_CreateCylinder"]=wasmExports["bx_ShapeDesc_CreateCylinder"];_bx_ShapeDesc_CreateHull=Module["_bx_ShapeDesc_CreateHull"]=wasmExports["bx_ShapeDesc_CreateHull"];_bx_ShapeDesc_CreateMesh=Module["_bx_ShapeDesc_CreateMesh"]=wasmExports["bx_ShapeDesc_CreateMesh"];_bx_ShapeDesc_CreateHeightField=Module["_bx_ShapeDesc_CreateHeightField"]=wasmExports["bx_ShapeDesc_CreateHeightField"];_bx_ShapeDesc_GetGeometryBytes=Module["_bx_ShapeDesc_GetGeometryBytes"]=wasmExports["bx_ShapeDesc_GetGeometryBytes"];_bx_ShapeDesc_GetGeometryByteCount=Module["_bx_ShapeDesc_GetGeometryByteCount"]=wasmExports["bx_ShapeDesc_GetGeometryByteCount"];_bx_ShapeDesc_CreateMeshFromBytes=Module["_bx_ShapeDesc_CreateMeshFromBytes"]=wasmExports["bx_ShapeDesc_CreateMeshFromBytes"];_bx_ShapeDesc_CreateHeightFieldFromBytes=Module["_bx_ShapeDesc_CreateHeightFieldFromBytes"]=wasmExports["bx_ShapeDesc_CreateHeightFieldFromBytes"];_bx_ShapeDesc_CreateContainer=Module["_bx_ShapeDesc_CreateContainer"]=wasmExports["bx_ShapeDesc_CreateContainer"];_bx_ShapeDesc_AddChild=Module["_bx_ShapeDesc_AddChild"]=wasmExports["bx_ShapeDesc_AddChild"];_bx_ShapeDesc_RemoveChild=Module["_bx_ShapeDesc_RemoveChild"]=wasmExports["bx_ShapeDesc_RemoveChild"];_bx_ShapeDesc_GetChildCount=Module["_bx_ShapeDesc_GetChildCount"]=wasmExports["bx_ShapeDesc_GetChildCount"];_bx_ShapeDesc_GetKind=Module["_bx_ShapeDesc_GetKind"]=wasmExports["bx_ShapeDesc_GetKind"];_bx_ShapeDesc_SetMaterial=Module["_bx_ShapeDesc_SetMaterial"]=wasmExports["bx_ShapeDesc_SetMaterial"];_bx_ShapeDesc_GetFriction=Module["_bx_ShapeDesc_GetFriction"]=wasmExports["bx_ShapeDesc_GetFriction"];_bx_ShapeDesc_GetRestitution=Module["_bx_ShapeDesc_GetRestitution"]=wasmExports["bx_ShapeDesc_GetRestitution"];_bx_ShapeDesc_SetDensity=Module["_bx_ShapeDesc_SetDensity"]=wasmExports["bx_ShapeDesc_SetDensity"];_bx_ShapeDesc_GetDensity=Module["_bx_ShapeDesc_GetDensity"]=wasmExports["bx_ShapeDesc_GetDensity"];_bx_ShapeDesc_SetFilter=Module["_bx_ShapeDesc_SetFilter"]=wasmExports["bx_ShapeDesc_SetFilter"];_bx_ShapeDesc_GetCategoryBits=Module["_bx_ShapeDesc_GetCategoryBits"]=wasmExports["bx_ShapeDesc_GetCategoryBits"];_bx_ShapeDesc_GetMaskBits=Module["_bx_ShapeDesc_GetMaskBits"]=wasmExports["bx_ShapeDesc_GetMaskBits"];_bx_ShapeDesc_SetGroup=Module["_bx_ShapeDesc_SetGroup"]=wasmExports["bx_ShapeDesc_SetGroup"];_bx_ShapeDesc_SetRollingResistance=Module["_bx_ShapeDesc_SetRollingResistance"]=wasmExports["bx_ShapeDesc_SetRollingResistance"];_bx_ShapeDesc_SetSensor=Module["_bx_ShapeDesc_SetSensor"]=wasmExports["bx_ShapeDesc_SetSensor"];_bx_ShapeDesc_IsSensor=Module["_bx_ShapeDesc_IsSensor"]=wasmExports["bx_ShapeDesc_IsSensor"];_bx_ShapeDesc_SetInvokeContactCreation=Module["_bx_ShapeDesc_SetInvokeContactCreation"]=wasmExports["bx_ShapeDesc_SetInvokeContactCreation"];_bx_ShapeDesc_GetInvokeContactCreation=Module["_bx_ShapeDesc_GetInvokeContactCreation"]=wasmExports["bx_ShapeDesc_GetInvokeContactCreation"];_bx_ShapeDesc_GetAABB=Module["_bx_ShapeDesc_GetAABB"]=wasmExports["bx_ShapeDesc_GetAABB"];_bx_GetShapeBuildCount=Module["_bx_GetShapeBuildCount"]=wasmExports["bx_GetShapeBuildCount"];_bx_GetShapeDescCount=Module["_bx_GetShapeDescCount"]=wasmExports["bx_GetShapeDescCount"];_bx_Body_SetShape=Module["_bx_Body_SetShape"]=wasmExports["bx_Body_SetShape"];_bx_Body_SetShapeHull=Module["_bx_Body_SetShapeHull"]=wasmExports["bx_Body_SetShapeHull"];_bx_Body_TranslateShape=Module["_bx_Body_TranslateShape"]=wasmExports["bx_Body_TranslateShape"];_bx_Body_SetShapeFilter=Module["_bx_Body_SetShapeFilter"]=wasmExports["bx_Body_SetShapeFilter"];_bx_Body_RemoveShape=Module["_bx_Body_RemoveShape"]=wasmExports["bx_Body_RemoveShape"];_bx_Body_HasShape=Module["_bx_Body_HasShape"]=wasmExports["bx_Body_HasShape"];_bx_Body_GetShapeInfo=Module["_bx_Body_GetShapeInfo"]=wasmExports["bx_Body_GetShapeInfo"];_bx_Body_SyncShapeDesc=Module["_bx_Body_SyncShapeDesc"]=wasmExports["bx_Body_SyncShapeDesc"];_bx_Body_GetShapeDesc=Module["_bx_Body_GetShapeDesc"]=wasmExports["bx_Body_GetShapeDesc"];_bx_ShapeDesc_BuildDebugGeometry=Module["_bx_ShapeDesc_BuildDebugGeometry"]=wasmExports["bx_ShapeDesc_BuildDebugGeometry"];_bx_DebugPositionsPtr=Module["_bx_DebugPositionsPtr"]=wasmExports["bx_DebugPositionsPtr"];_bx_DebugIndicesPtr=Module["_bx_DebugIndicesPtr"]=wasmExports["bx_DebugIndicesPtr"];_bx_DebugIndexCount=Module["_bx_DebugIndexCount"]=wasmExports["bx_DebugIndexCount"];_bx_CreateJoint=Module["_bx_CreateJoint"]=wasmExports["bx_CreateJoint"];_bx_DestroyJoint=Module["_bx_DestroyJoint"]=wasmExports["bx_DestroyJoint"];_bx_Joint_IsValid=Module["_bx_Joint_IsValid"]=wasmExports["bx_Joint_IsValid"];_bx_Joint_SetCollideConnected=Module["_bx_Joint_SetCollideConnected"]=wasmExports["bx_Joint_SetCollideConnected"];_bx_Joint_SetConstraintTuning=Module["_bx_Joint_SetConstraintTuning"]=wasmExports["bx_Joint_SetConstraintTuning"];_bx_Joint_WakeBodies=Module["_bx_Joint_WakeBodies"]=wasmExports["bx_Joint_WakeBodies"];_bx_Joint_EnableLimit=Module["_bx_Joint_EnableLimit"]=wasmExports["bx_Joint_EnableLimit"];_bx_Joint_SetLimits=Module["_bx_Joint_SetLimits"]=wasmExports["bx_Joint_SetLimits"];_bx_Joint_SetTwistLimits=Module["_bx_Joint_SetTwistLimits"]=wasmExports["bx_Joint_SetTwistLimits"];_bx_Joint_EnableMotor=Module["_bx_Joint_EnableMotor"]=wasmExports["bx_Joint_EnableMotor"];_bx_Joint_UpdateMotorFrame=Module["_bx_Joint_UpdateMotorFrame"]=wasmExports["bx_Joint_UpdateMotorFrame"];_bx_Joint_SetSphericalMotor=Module["_bx_Joint_SetSphericalMotor"]=wasmExports["bx_Joint_SetSphericalMotor"];_bx_Joint_SetSphericalTarget=Module["_bx_Joint_SetSphericalTarget"]=wasmExports["bx_Joint_SetSphericalTarget"];_bx_Joint_SetMotorSpeed=Module["_bx_Joint_SetMotorSpeed"]=wasmExports["bx_Joint_SetMotorSpeed"];_bx_Joint_SetMaxMotorForce=Module["_bx_Joint_SetMaxMotorForce"]=wasmExports["bx_Joint_SetMaxMotorForce"];_bx_Joint_EnableSpring=Module["_bx_Joint_EnableSpring"]=wasmExports["bx_Joint_EnableSpring"];_bx_Joint_SetSpring=Module["_bx_Joint_SetSpring"]=wasmExports["bx_Joint_SetSpring"];_bx_Joint_SetTarget=Module["_bx_Joint_SetTarget"]=wasmExports["bx_Joint_SetTarget"];_bx_Joint_GetPosition=Module["_bx_Joint_GetPosition"]=wasmExports["bx_Joint_GetPosition"];_bx_ComputeAlignedFrameB=Module["_bx_ComputeAlignedFrameB"]=wasmExports["bx_ComputeAlignedFrameB"];_bx_WheelJoint_SetSpinMotorSpeed=Module["_bx_WheelJoint_SetSpinMotorSpeed"]=wasmExports["bx_WheelJoint_SetSpinMotorSpeed"];_bx_WheelJoint_SetMaxSpinTorque=Module["_bx_WheelJoint_SetMaxSpinTorque"]=wasmExports["bx_WheelJoint_SetMaxSpinTorque"];_bx_WheelJoint_EnableSpinMotor=Module["_bx_WheelJoint_EnableSpinMotor"]=wasmExports["bx_WheelJoint_EnableSpinMotor"];_bx_WheelJoint_SetTargetSteeringAngle=Module["_bx_WheelJoint_SetTargetSteeringAngle"]=wasmExports["bx_WheelJoint_SetTargetSteeringAngle"];_bx_WheelJoint_SetSuspension=Module["_bx_WheelJoint_SetSuspension"]=wasmExports["bx_WheelJoint_SetSuspension"];_bx_RayHitsPtr=Module["_bx_RayHitsPtr"]=wasmExports["bx_RayHitsPtr"];_bx_RayHitPointsF64Ptr=Module["_bx_RayHitPointsF64Ptr"]=wasmExports["bx_RayHitPointsF64Ptr"];_bx_World_CastRay=Module["_bx_World_CastRay"]=wasmExports["bx_World_CastRay"];_bx_World_CastShape=Module["_bx_World_CastShape"]=wasmExports["bx_World_CastShape"];_bx_OverlapsPtr=Module["_bx_OverlapsPtr"]=wasmExports["bx_OverlapsPtr"];_bx_World_OverlapShape=Module["_bx_World_OverlapShape"]=wasmExports["bx_World_OverlapShape"];_bx_GeometryPtr=Module["_bx_GeometryPtr"]=wasmExports["bx_GeometryPtr"];_bx_Body_GetShapeGeometry=Module["_bx_Body_GetShapeGeometry"]=wasmExports["bx_Body_GetShapeGeometry"];memory=wasmMemory=wasmExports["memory"];__indirect_function_table=wasmExports["__indirect_function_table"]}var wasmImports={clock_time_get:_clock_time_get,emscripten_get_now:_emscripten_get_now,emscripten_resize_heap:_emscripten_resize_heap,fd_write:_fd_write};async function run(){preRun();var setStatus=Module["setStatus"];if(setStatus){setStatus("Running...");await new Promise(resolve=>setTimeout(resolve,1));setTimeout(setStatus,1,"")}if(ABORT)return;initRuntime();Module["onRuntimeInitialized"]?.();postRun()}var wasmExports;wasmExports=await createWasm();await run();
2
+ ;return Module}export default Box3D;
Binary file