babylon-box3d 0.8.0 → 0.9.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
@@ -1,11 +1,26 @@
1
1
  # babylon-box3d
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/babylon-box3d)](https://www.npmjs.com/package/babylon-box3d)
4
+ [![license](https://img.shields.io/npm/l/babylon-box3d)](LICENSE)
5
+
3
6
  [Box3D](https://github.com/erincatto/box3d) physics for Babylon.js. Box3D is Erin Catto's 3D successor to Box2D v3:
4
7
  an MIT licensed rigid body engine with a soft step solver, continuous collision, cross platform determinism and
5
8
  SIMD. This extension ships the engine compiled to WebAssembly plus `Box3DPlugin`, an implementation of Babylon's
6
9
  physics v2 plugin interface. It supports most of the Physics V2 API, so scenes written for the Havok plugin generally
7
10
  run on it unchanged; [What is covered](#what-is-covered) lists where it differs.
8
11
 
12
+ Live demos: https://pryme8.github.io/babylon-box3d/
13
+
14
+ ## Install
15
+
16
+ The package is [`babylon-box3d` on npm](https://www.npmjs.com/package/babylon-box3d). It carries the plugin, its
17
+ typings and every build of the WebAssembly engine (single threaded, threaded, double precision), so nothing else needs
18
+ installing besides Babylon:
19
+
20
+ ```
21
+ npm install babylon-box3d @babylonjs/core
22
+ ```
23
+
9
24
  ```ts
10
25
  import { Vector3 } from "@babylonjs/core/Maths/math.vector";
11
26
  import "@babylonjs/core/Physics/joinedPhysicsEngineComponent"; // adds scene.enablePhysics
@@ -15,8 +30,8 @@ const box3d = await Box3D();
15
30
  scene.enablePhysics(new Vector3(0, -9.81, 0), new Box3DPlugin(true, box3d));
16
31
  ```
17
32
 
18
- Script tags (Playground, plain HTML). A complete Playground scene is in
19
- [the documentation page](docs/communityExtensions/box3dPhysics.md#playground):
33
+ Script tags (Playground, plain HTML) load the same package from unpkg, no install needed. A complete Playground scene
34
+ is in [the documentation page](docs/communityExtensions/box3dPhysics.md#playground):
20
35
 
21
36
  ```html
22
37
  <script src="https://cdn.babylonjs.com/babylon.js"></script>
@@ -36,9 +51,9 @@ Script tags (Playground, plain HTML). A complete Playground scene is in
36
51
 
37
52
  Like Havok's UMD build, this runs from plain files in a folder. Download these three and put them next to your page:
38
53
 
39
- - [box3d.umd.js](https://unpkg.com/babylon-box3d@0.4.0/lib/umd/box3d.umd.js), the WebAssembly loader (global `Box3D`)
40
- - [box3d.umd.wasm](https://unpkg.com/babylon-box3d@0.4.0/lib/umd/box3d.umd.wasm), the engine, found next to the loader
41
- - [babylon.box3d.min.js](https://unpkg.com/babylon-box3d@0.4.0/umd/babylon.box3d.min.js), the plugin (global `BABYLONBOX3D`)
54
+ - [box3d.umd.js](https://unpkg.com/babylon-box3d/lib/umd/box3d.umd.js), the WebAssembly loader (global `Box3D`)
55
+ - [box3d.umd.wasm](https://unpkg.com/babylon-box3d/lib/umd/box3d.umd.wasm), the engine, found next to the loader
56
+ - [babylon.box3d.min.js](https://unpkg.com/babylon-box3d/umd/babylon.box3d.min.js), the plugin (global `BABYLONBOX3D`)
42
57
 
43
58
  Then load them after `babylon.js` with the same three script tags as above, pointing at the local files. The folder
44
59
  has to be opened through a web server rather than by double clicking the page: browsers refuse to load a `.wasm` from
@@ -331,6 +346,8 @@ their velocity turned once their centre crosses, and the rim built from boxes on
331
346
  | `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 |
332
347
  | `bx_IsDoublePrecision`, `bx_ScratchF64`, `bx_RayHitPointsF64Ptr`, `bx_BodyContactPointsF64Ptr` | positions in doubles, see [Double precision](#double-precision) |
333
348
  | `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 |
349
+ | `bx_World_EnableTimer`, `bx_World_IsTimerEnabled` | Box3D's clock for one world's steps, on by default, see [Patches to Box3D](#patches-to-box3d) |
350
+ | `bx_Body_SetAabbMargin`, `bx_Body_GetAabbMargin` | the fat AABB margin of a body's shapes, see [Patches to Box3D](#patches-to-box3d) |
334
351
 
335
352
  Box3D creates shapes on bodies while Babylon creates shapes standalone, so a `PhysicsShape` is a description that
336
353
  is instantiated on every body it is set on. Changing its filter masks, material or density is applied to the live
@@ -443,9 +460,11 @@ stays exactly upstream's commit, and a change to the patch set rebuilds every ob
443
460
  | `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. |
444
461
  | `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. |
445
462
  | `0006-manifold-callback.patch` | `b3World_SetManifoldCallback(world, fcn, context)`: a `b3ManifoldFcn` called with all of a contact's manifolds after they are computed, mesh and height field contacts included, when either shape has pre-solve events on. It may remove points and manifolds and returns how many manifolds are left; a manifold left with no points is dropped and zero disables the contact for the step. Box3D's own pre-solve callback only sees the first point of the first manifold and is never called for meshes or height fields. While the callback is set it replaces the pre-solve callback for these contacts, which still runs for continuous collision, and these contacts are not recycled, so the callback sees every step. The shim uses it for clip planes (`bx_Body_SetClipPlane`); shapes without pre-solve events are untouched, bit for bit. |
463
+ | `0007-timer-can-be-turned-off.patch` | `b3EnableTimer` and `b3IsTimerEnabled` (shim: `bx_World_EnableTimer(world, flag)` and `bx_World_IsTimerEnabled`, which set it around each of that world's steps): Box3D's clock, on by default. A step reads it dozens of times, only to time itself for the profile and to log stalls, and in WebAssembly each read is a call out to JavaScript that allocates. Off, `b3GetTicks` and the `b3GetMilliseconds` functions return zero without reading it: a step makes no call out, its timings (`getStats`) read zero and no stall is logged. Nothing in the simulation reads the clock, so a world steps the same, bit for bit, either way. |
464
+ | `0008-body-aabb-margin.patch` | `b3Body_SetAabbMargin(body, margin)` and `b3Body_GetAabbMargin` (shim: `bx_Body_SetAabbMargin`, `bx_Body_GetAabbMargin`): how far each of a body's shapes may move past its bounds before the broad phase moves its proxy, in meters. Zero, the default, leaves each shape its own margin, an eighth of its extent up to `B3_MAX_AABB_MARGIN` (5 cm). A fast body of many small shapes, such as a car of a hundred crush chunks at 25 m/s and 480 Hz, leaves every shape's bounds every step, and each proxy moved queries the trees again and the dynamic tree is rebuilt round it: about a third of such a step. A wider margin moves the proxies seldom and finds pairs sooner. A body that touches nothing steps the same, bit for bit; one that meets something can touch a step sooner, since a shape within its speculative reach of another touches as soon as their pair is there, and at the shape's own margin the pair is found the step after its bounds reach the other's. A shape's fat AABB takes a new margin the next time the shape leaves it. |
446
465
 
447
466
  `test/wasm.patches.test.ts` covers 0001 and 0002, `test/wasm.crush.test.ts` covers 0003, `test/wasm.hulls.test.ts` covers 0004,
448
- `test/wasm.canonicalPairs.test.ts` covers 0005 and `test/wasm.clipPlane.test.ts` covers 0006.
467
+ `test/wasm.canonicalPairs.test.ts` covers 0005, `test/wasm.clipPlane.test.ts` covers 0006, `test/wasm.timer.test.ts` covers 0007 and `test/wasm.aabbMargin.test.ts` covers 0008.
449
468
  None has been offered upstream.
450
469
 
451
470
  **Crush accuracy.** Against a constant limit the crush depth lands within 1.5% of the continuous answer at 480 Hz
@@ -57,6 +57,9 @@ export interface Box3DExports {
57
57
  _bx_World_GetMaximumLinearSpeed(world: number): number;
58
58
  _bx_World_EnableSleeping(world: number, flag: number): void;
59
59
  _bx_World_EnableContinuous(world: number, flag: number): void;
60
+ /** Box3D's clock while this world steps (wasm/patches/0007), on by default: off, a step reads no clock and the stats' timings are 0. */
61
+ _bx_World_EnableTimer(world: number, flag: number): void;
62
+ _bx_World_IsTimerEnabled(world: number): number;
60
63
  _bx_World_SetContactTuning(world: number, hertz: number, dampingRatio: number, contactSpeed: number): void;
61
64
  _bx_World_Explode(world: number, px: number, py: number, pz: number, radius: number, falloff: number, impulsePerArea: number): void;
62
65
  _bx_World_GetAwakeBodyCount(world: number): number;
@@ -109,6 +112,9 @@ export interface Box3DExports {
109
112
  /** Continuous collision for this body alone, on by default; the world's switch still applies. */
110
113
  _bx_Body_EnableContinuous(body: number, flag: number): void;
111
114
  _bx_Body_IsContinuousEnabled(body: number): number;
115
+ /** The fat AABB margin of the body's shapes, m (wasm/patches/0008): 0, the default, leaves each shape its own. */
116
+ _bx_Body_SetAabbMargin(body: number, margin: number): void;
117
+ _bx_Body_GetAabbMargin(body: number): number;
112
118
  /**
113
119
  * Crushable contacts for the body's shape `index`: each of its contacts pushes with at most `maxForce` newtons,
114
120
  * and a plastic one (1) keeps its overlap instead of pushing out. A `maxForce` of zero or less makes it rigid.
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);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_Body_SetClipPlane,_bx_Body_GetClipPlane,_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_Body_SetClipPlane=Module["_bx_Body_SetClipPlane"]=wasmExports["bx_Body_SetClipPlane"];_bx_Body_GetClipPlane=Module["_bx_Body_GetClipPlane"]=wasmExports["bx_Body_GetClipPlane"];_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;
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_Body_SetClipPlane,_bx_Body_GetClipPlane,_bx_GetMaxWorkers,_bx_CreateWorld,_bx_World_GetWorkerCount,_bx_DestroyWorld,_bx_ShapeDesc_Destroy,_bx_World_Step,_bx_World_EnableTimer,_bx_World_IsTimerEnabled,_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_SetAabbMargin,_bx_Body_GetAabbMargin,_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_Body_SetClipPlane=Module["_bx_Body_SetClipPlane"]=wasmExports["bx_Body_SetClipPlane"];_bx_Body_GetClipPlane=Module["_bx_Body_GetClipPlane"]=wasmExports["bx_Body_GetClipPlane"];_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_EnableTimer=Module["_bx_World_EnableTimer"]=wasmExports["bx_World_EnableTimer"];_bx_World_IsTimerEnabled=Module["_bx_World_IsTimerEnabled"]=wasmExports["bx_World_IsTimerEnabled"];_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_SetAabbMargin=Module["_bx_Body_SetAabbMargin"]=wasmExports["bx_Body_SetAabbMargin"];_bx_Body_GetAabbMargin=Module["_bx_Body_GetAabbMargin"]=wasmExports["bx_Body_GetAabbMargin"];_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
@@ -57,6 +57,9 @@ export interface Box3DExports {
57
57
  _bx_World_GetMaximumLinearSpeed(world: number): number;
58
58
  _bx_World_EnableSleeping(world: number, flag: number): void;
59
59
  _bx_World_EnableContinuous(world: number, flag: number): void;
60
+ /** Box3D's clock while this world steps (wasm/patches/0007), on by default: off, a step reads no clock and the stats' timings are 0. */
61
+ _bx_World_EnableTimer(world: number, flag: number): void;
62
+ _bx_World_IsTimerEnabled(world: number): number;
60
63
  _bx_World_SetContactTuning(world: number, hertz: number, dampingRatio: number, contactSpeed: number): void;
61
64
  _bx_World_Explode(world: number, px: number, py: number, pz: number, radius: number, falloff: number, impulsePerArea: number): void;
62
65
  _bx_World_GetAwakeBodyCount(world: number): number;
@@ -109,6 +112,9 @@ export interface Box3DExports {
109
112
  /** Continuous collision for this body alone, on by default; the world's switch still applies. */
110
113
  _bx_Body_EnableContinuous(body: number, flag: number): void;
111
114
  _bx_Body_IsContinuousEnabled(body: number): number;
115
+ /** The fat AABB margin of the body's shapes, m (wasm/patches/0008): 0, the default, leaves each shape its own. */
116
+ _bx_Body_SetAabbMargin(body: number, margin: number): void;
117
+ _bx_Body_GetAabbMargin(body: number): number;
112
118
  /**
113
119
  * Crushable contacts for the body's shape `index`: each of its contacts pushes with at most `maxForce` newtons,
114
120
  * and a plastic one (1) keeps its overlap instead of pushing out. A `maxForce` of zero or less makes it rigid.
@@ -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);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_Body_SetClipPlane,_bx_Body_GetClipPlane,_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_Body_SetClipPlane=Module["_bx_Body_SetClipPlane"]=wasmExports["bx_Body_SetClipPlane"];_bx_Body_GetClipPlane=Module["_bx_Body_GetClipPlane"]=wasmExports["bx_Body_GetClipPlane"];_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;
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_Body_SetClipPlane,_bx_Body_GetClipPlane,_bx_GetMaxWorkers,_bx_CreateWorld,_bx_World_GetWorkerCount,_bx_DestroyWorld,_bx_ShapeDesc_Destroy,_bx_World_Step,_bx_World_EnableTimer,_bx_World_IsTimerEnabled,_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_SetAabbMargin,_bx_Body_GetAabbMargin,_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_Body_SetClipPlane=Module["_bx_Body_SetClipPlane"]=wasmExports["bx_Body_SetClipPlane"];_bx_Body_GetClipPlane=Module["_bx_Body_GetClipPlane"]=wasmExports["bx_Body_GetClipPlane"];_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_EnableTimer=Module["_bx_World_EnableTimer"]=wasmExports["bx_World_EnableTimer"];_bx_World_IsTimerEnabled=Module["_bx_World_IsTimerEnabled"]=wasmExports["bx_World_IsTimerEnabled"];_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_SetAabbMargin=Module["_bx_Body_SetAabbMargin"]=wasmExports["bx_Body_SetAabbMargin"];_bx_Body_GetAabbMargin=Module["_bx_Body_GetAabbMargin"]=wasmExports["bx_Body_GetAabbMargin"];_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
@@ -57,6 +57,9 @@ export interface Box3DExports {
57
57
  _bx_World_GetMaximumLinearSpeed(world: number): number;
58
58
  _bx_World_EnableSleeping(world: number, flag: number): void;
59
59
  _bx_World_EnableContinuous(world: number, flag: number): void;
60
+ /** Box3D's clock while this world steps (wasm/patches/0007), on by default: off, a step reads no clock and the stats' timings are 0. */
61
+ _bx_World_EnableTimer(world: number, flag: number): void;
62
+ _bx_World_IsTimerEnabled(world: number): number;
60
63
  _bx_World_SetContactTuning(world: number, hertz: number, dampingRatio: number, contactSpeed: number): void;
61
64
  _bx_World_Explode(world: number, px: number, py: number, pz: number, radius: number, falloff: number, impulsePerArea: number): void;
62
65
  _bx_World_GetAwakeBodyCount(world: number): number;
@@ -109,6 +112,9 @@ export interface Box3DExports {
109
112
  /** Continuous collision for this body alone, on by default; the world's switch still applies. */
110
113
  _bx_Body_EnableContinuous(body: number, flag: number): void;
111
114
  _bx_Body_IsContinuousEnabled(body: number): number;
115
+ /** The fat AABB margin of the body's shapes, m (wasm/patches/0008): 0, the default, leaves each shape its own. */
116
+ _bx_Body_SetAabbMargin(body: number, margin: number): void;
117
+ _bx_Body_GetAabbMargin(body: number): number;
112
118
  /**
113
119
  * Crushable contacts for the body's shape `index`: each of its contacts pushes with at most `maxForce` newtons,
114
120
  * and a plastic one (1) keeps its overlap instead of pushing out. A `maxForce` of zero or less makes it rigid.