babylon-box3d 0.1.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/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Andrew Butt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ Box3D itself is Copyright (c) Erin Catto and distributed under the MIT license,
24
+ see LICENSE-box3d.txt.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Erin Catto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # babylon-box3d
2
+
3
+ [Box3D](https://github.com/erincatto/box3d), Erin Catto's 3D rigid body engine, compiled to WebAssembly for the
4
+ Babylon.js `Box3DPlugin`. This package is the Box3D counterpart of `@babylonjs/havok`: it ships the engine and a
5
+ thin C shim, the Babylon.js plugin lives in Babylon.js core.
6
+
7
+ ```ts
8
+ import Box3D from "babylon-box3d";
9
+ import { Box3DPlugin } from "@babylonjs/core/Physics/v2/Plugins/box3dPlugin";
10
+
11
+ const box3d = await Box3D();
12
+ scene.enablePhysics(new Vector3(0, -9.81, 0), new Box3DPlugin(true, box3d));
13
+ ```
14
+
15
+ From a script tag (UMD build, defines a global `Box3D` factory):
16
+
17
+ ```html
18
+ <script src="https://cdn.jsdelivr.net/npm/babylon-box3d/lib/umd/box3d.umd.js"></script>
19
+ <script>
20
+ const box3d = await Box3D({ locateFile: (f) => "https://cdn.jsdelivr.net/npm/babylon-box3d/lib/umd/" + f });
21
+ </script>
22
+ ```
23
+
24
+ The wasm is fetched next to the loader script by default. Pass `locateFile` when it is served from somewhere else.
25
+
26
+ ## Contents
27
+
28
+ | path | what |
29
+ | --- | --- |
30
+ | `lib/esm/box3d.js`, `box3d.wasm` | ES module for bundlers and browsers (default export is the factory) |
31
+ | `lib/umd/box3d.umd.js`, `box3d.umd.wasm` | script tag / CommonJS build, global `Box3D` |
32
+ | `lib/node/box3d.mjs`, `box3d.wasm` | ES module for node (`import Box3D from "babylon-box3d/node"`) |
33
+ | `box3d.d.ts` | typings for the shim API |
34
+ | `src/box3d_shim.c` | the C shim: flat, handle based API over box3d (`bx_*` functions) |
35
+ | `UPSTREAM_COMMIT` | the box3d commit that was built |
36
+
37
+ The shim keeps integer slots for bodies, shape descriptions and joints, returns multi-value results through a
38
+ scratch float buffer, and copies box3d's per step events (body moves, contacts, sensors) into flat buffers so the
39
+ plugin reads them with one typed array view. Hull data is copied into box3d's world database, mesh and height
40
+ field data are shared and reference counted.
41
+
42
+ ## Building
43
+
44
+ ```
45
+ node build.mjs # release, all three targets
46
+ node build.mjs --debug # assertions and symbols
47
+ npm test # node smoke test against lib/node
48
+ ```
49
+
50
+ Needs the [Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html) (`EMSDK` env var, or a
51
+ checkout at `../emsdk`) and a Box3D checkout (`BOX3D_DIR`, or `../box3d`). The build is single threaded with wasm
52
+ SIMD128. Box3D's task scheduler could run on wasm threads later, that needs `SharedArrayBuffer` and cross origin
53
+ isolation, so it is not the default. Outputs are committed so the package installs without a toolchain.
54
+
55
+ ## License
56
+
57
+ MIT. Box3D is MIT licensed by Erin Catto, see `LICENSE-box3d.txt`.
@@ -0,0 +1 @@
1
+ 47d7f7cc7e091142c08d11dc7d2e493c5d34f536
package/box3d.d.ts ADDED
@@ -0,0 +1,182 @@
1
+ /**
2
+ * Type definitions for the Box3D WebAssembly module used by the Babylon.js Box3DPlugin.
3
+ *
4
+ * The module exposes a flat, handle based C API (see src/box3d_shim.c). Bodies, shape descriptions and joints
5
+ * are integer slots. Vectors and quaternions are passed as individual floats. Functions that return more than one
6
+ * value write into the scratch buffer returned by `_bx_Scratch()` (64 floats), read it through `HEAPF32`.
7
+ */
8
+
9
+ export interface Box3DModuleOptions {
10
+ /** Resolves the location of box3d.wasm (and other runtime files). */
11
+ locateFile?: (file: string, prefix: string) => string;
12
+ /** Called with progress and error messages by the emscripten runtime. */
13
+ print?: (text: string) => void;
14
+ printErr?: (text: string) => void;
15
+ /** Supplies a pre-fetched wasm binary instead of fetching it. */
16
+ wasmBinary?: ArrayBuffer;
17
+ }
18
+
19
+ /** Emscripten heap views. Do not cache them: they are replaced when the memory grows. */
20
+ export interface Box3DHeap {
21
+ HEAPF32: Float32Array;
22
+ HEAP32: Int32Array;
23
+ HEAPU32: Uint32Array;
24
+ HEAPU8: Uint8Array;
25
+ }
26
+
27
+ /** All exported shim functions. Slots are integers, 0 is the null slot. */
28
+ export interface Box3DExports {
29
+ _malloc(bytes: number): number;
30
+ _free(ptr: number): void;
31
+ _bx_Scratch(): number;
32
+ _bx_Alloc(bytes: number): number;
33
+ _bx_Free(ptr: number): void;
34
+ /** major * 10000 + minor * 100 + revision */
35
+ _bx_GetVersion(): number;
36
+
37
+ // world
38
+ _bx_CreateWorld(gx: number, gy: number, gz: number): number;
39
+ _bx_DestroyWorld(world: number): void;
40
+ _bx_World_Step(world: number, dt: number, subSteps: number): void;
41
+ _bx_World_SetGravity(world: number, gx: number, gy: number, gz: number): void;
42
+ _bx_World_SetMaximumLinearSpeed(world: number, speed: number): void;
43
+ _bx_World_GetMaximumLinearSpeed(world: number): number;
44
+ _bx_World_EnableSleeping(world: number, flag: number): void;
45
+ _bx_World_EnableContinuous(world: number, flag: number): void;
46
+ _bx_World_SetContactTuning(world: number, hertz: number, dampingRatio: number, contactSpeed: number): void;
47
+ _bx_World_Explode(world: number, px: number, py: number, pz: number, radius: number, falloff: number, impulsePerArea: number): void;
48
+ _bx_World_GetAwakeBodyCount(world: number): number;
49
+ /** scratch: [bodyCount, shapeCount, contactCount, jointCount, islandCount, stepMs, collideMs, solveMs] */
50
+ _bx_World_GetStats(world: number): void;
51
+
52
+ // events (records are copied into flat float buffers, see the shim for the strides)
53
+ _bx_MoveEventsPtr(): number;
54
+ _bx_ContactEventsPtr(): number;
55
+ _bx_SensorEventsPtr(): number;
56
+ _bx_World_GetMoveEvents(world: number): number;
57
+ _bx_World_GetContactEvents(world: number): number;
58
+ _bx_World_GetSensorEvents(world: number): number;
59
+
60
+ // bodies (type: 0 static, 1 kinematic, 2 dynamic)
61
+ _bx_CreateBody(world: number, type: number, px: number, py: number, pz: number, qx: number, qy: number, qz: number, qw: number, isAwake: number): number;
62
+ _bx_DestroyBody(body: number): void;
63
+ _bx_Body_SetType(body: number, type: number): void;
64
+ _bx_Body_GetType(body: number): number;
65
+ _bx_Body_SetTransform(body: number, px: number, py: number, pz: number, qx: number, qy: number, qz: number, qw: number): void;
66
+ /** scratch: [px, py, pz, qx, qy, qz, qw] */
67
+ _bx_Body_GetTransform(body: number): void;
68
+ _bx_Body_SetTargetTransform(body: number, px: number, py: number, pz: number, qx: number, qy: number, qz: number, qw: number, dt: number): void;
69
+ _bx_Body_SetLinearVelocity(body: number, x: number, y: number, z: number): void;
70
+ /** scratch: [x, y, z] */
71
+ _bx_Body_GetLinearVelocity(body: number): void;
72
+ _bx_Body_SetAngularVelocity(body: number, x: number, y: number, z: number): void;
73
+ /** scratch: [x, y, z] */
74
+ _bx_Body_GetAngularVelocity(body: number): void;
75
+ _bx_Body_SetLinearDamping(body: number, damping: number): void;
76
+ _bx_Body_GetLinearDamping(body: number): number;
77
+ _bx_Body_SetAngularDamping(body: number, damping: number): void;
78
+ _bx_Body_GetAngularDamping(body: number): number;
79
+ _bx_Body_SetGravityScale(body: number, scale: number): void;
80
+ _bx_Body_GetGravityScale(body: number): number;
81
+ _bx_Body_ApplyForce(body: number, fx: number, fy: number, fz: number, px: number, py: number, pz: number): void;
82
+ _bx_Body_ApplyForceToCenter(body: number, fx: number, fy: number, fz: number): void;
83
+ _bx_Body_ApplyTorque(body: number, x: number, y: number, z: number): void;
84
+ _bx_Body_ApplyLinearImpulse(body: number, ix: number, iy: number, iz: number, px: number, py: number, pz: number): void;
85
+ _bx_Body_ApplyLinearImpulseToCenter(body: number, ix: number, iy: number, iz: number): void;
86
+ _bx_Body_ApplyAngularImpulse(body: number, x: number, y: number, z: number): void;
87
+ _bx_Body_SetAwake(body: number, awake: number): void;
88
+ _bx_Body_IsAwake(body: number): number;
89
+ _bx_Body_EnableSleep(body: number, flag: number): void;
90
+ _bx_Body_SetBullet(body: number, flag: number): void;
91
+ _bx_Body_AllowFastRotation(body: number, flag: number): void;
92
+ _bx_Body_SetMotionLocks(body: number, lx: number, ly: number, lz: number, ax: number, ay: number, az: number): void;
93
+ /** scratch: [minx, miny, minz, maxx, maxy, maxz] */
94
+ _bx_Body_GetAABB(body: number): void;
95
+ /** scratch: [mass, cx, cy, cz, ixx, iyy, izz] */
96
+ _bx_Body_GetMassData(body: number): void;
97
+ _bx_Body_SetMassData(body: number, mass: number, cx: number, cy: number, cz: number, ixx: number, iyy: number, izz: number): void;
98
+ _bx_Body_ApplyMassFromShapes(body: number): void;
99
+ _bx_Body_GetShapeCount(body: number): number;
100
+ _bx_Body_EnableContactEvents(body: number, flag: number): void;
101
+ /** Replaces every shape on the body with an instance of the description (0 removes all shapes). */
102
+ _bx_Body_SetShape(body: number, desc: number): void;
103
+ _bx_Body_GetShapeDesc(body: number): number;
104
+
105
+ // shape descriptions
106
+ _bx_ShapeDesc_CreateSphere(cx: number, cy: number, cz: number, radius: number): number;
107
+ _bx_ShapeDesc_CreateCapsule(ax: number, ay: number, az: number, bx: number, by: number, bz: number, radius: number): number;
108
+ _bx_ShapeDesc_CreateBox(hx: number, hy: number, hz: number, px: number, py: number, pz: number, qx: number, qy: number, qz: number, qw: number): number;
109
+ _bx_ShapeDesc_CreateCylinder(height: number, radius: number, sides: number, px: number, py: number, pz: number, qx: number, qy: number, qz: number, qw: number): number;
110
+ /** points: pointer to pointCount * 3 floats */
111
+ _bx_ShapeDesc_CreateHull(points: number, pointCount: number): number;
112
+ /** vertices: vertexCount * 3 floats, indices: triangleCount * 3 int32 */
113
+ _bx_ShapeDesc_CreateMesh(vertices: number, vertexCount: number, indices: number, triangleCount: number, sx: number, sy: number, sz: number, clockwise: number, weld: number): number;
114
+ /** heights: countX * countZ floats indexed [z * countX + x], local offset (ox, oy, oz) */
115
+ _bx_ShapeDesc_CreateHeightField(heights: number, countX: number, countZ: number, sx: number, sy: number, sz: number, clockwise: number, ox: number, oy: number, oz: number): number;
116
+ _bx_ShapeDesc_CreateContainer(): number;
117
+ _bx_ShapeDesc_AddChild(parent: number, child: number, px: number, py: number, pz: number, qx: number, qy: number, qz: number, qw: number, sx: number, sy: number, sz: number): void;
118
+ _bx_ShapeDesc_RemoveChild(parent: number, index: number): void;
119
+ _bx_ShapeDesc_GetChildCount(desc: number): number;
120
+ _bx_ShapeDesc_GetKind(desc: number): number;
121
+ _bx_ShapeDesc_SetMaterial(desc: number, friction: number, restitution: number): void;
122
+ _bx_ShapeDesc_GetFriction(desc: number): number;
123
+ _bx_ShapeDesc_GetRestitution(desc: number): number;
124
+ _bx_ShapeDesc_SetDensity(desc: number, density: number): void;
125
+ _bx_ShapeDesc_GetDensity(desc: number): number;
126
+ _bx_ShapeDesc_SetFilter(desc: number, categoryBits: number, maskBits: number): void;
127
+ _bx_ShapeDesc_GetCategoryBits(desc: number): number;
128
+ _bx_ShapeDesc_GetMaskBits(desc: number): number;
129
+ _bx_ShapeDesc_SetGroup(desc: number, groupIndex: number): void;
130
+ _bx_ShapeDesc_SetRollingResistance(desc: number, value: number): void;
131
+ _bx_ShapeDesc_SetSensor(desc: number, flag: number): void;
132
+ _bx_ShapeDesc_IsSensor(desc: number): number;
133
+ /** scratch: [minx, miny, minz, maxx, maxy, maxz] */
134
+ _bx_ShapeDesc_GetAABB(desc: number): void;
135
+ _bx_ShapeDesc_Destroy(desc: number): void;
136
+ _bx_ShapeDesc_BuildDebugGeometry(desc: number): number;
137
+ _bx_DebugPositionsPtr(): number;
138
+ _bx_DebugIndicesPtr(): number;
139
+ _bx_DebugIndexCount(): number;
140
+
141
+ // joints (type: 0 weld, 1 spherical, 2 revolute, 3 prismatic, 4 distance, 5 filter, 6 wheel, 7 parallel)
142
+ /** Frames are read from scratch[0..13], type specific parameters from scratch[14..]. */
143
+ _bx_CreateJoint(world: number, type: number, bodyA: number, bodyB: number, collideConnected: number, param: number): number;
144
+ _bx_DestroyJoint(joint: number): void;
145
+ _bx_Joint_IsValid(joint: number): number;
146
+ _bx_Joint_SetCollideConnected(joint: number, flag: number): void;
147
+ _bx_Joint_SetConstraintTuning(joint: number, hertz: number, dampingRatio: number): void;
148
+ _bx_Joint_WakeBodies(joint: number): void;
149
+ _bx_Joint_EnableLimit(joint: number, flag: number): void;
150
+ _bx_Joint_SetLimits(joint: number, lower: number, upper: number): void;
151
+ _bx_Joint_SetTwistLimits(joint: number, enable: number, lower: number, upper: number): void;
152
+ _bx_Joint_EnableMotor(joint: number, flag: number): void;
153
+ _bx_Joint_SetMotorSpeed(joint: number, speed: number): void;
154
+ _bx_Joint_SetMaxMotorForce(joint: number, force: number): void;
155
+ _bx_Joint_EnableSpring(joint: number, flag: number): void;
156
+ _bx_Joint_SetSpring(joint: number, hertz: number, dampingRatio: number): void;
157
+ _bx_Joint_SetTarget(joint: number, target: number): void;
158
+ _bx_Joint_GetPosition(joint: number): number;
159
+ /** Reads frame A from scratch[0..6] and pivot B from scratch[7..9], writes the frame B rotation to scratch[10..13]. */
160
+ _bx_ComputeAlignedFrameB(bodyA: number, bodyB: number): void;
161
+ _bx_WheelJoint_SetSpinMotorSpeed(joint: number, speed: number): void;
162
+ _bx_WheelJoint_SetMaxSpinTorque(joint: number, torque: number): void;
163
+ _bx_WheelJoint_EnableSpinMotor(joint: number, flag: number): void;
164
+ _bx_WheelJoint_SetTargetSteeringAngle(joint: number, radians: number): void;
165
+ _bx_WheelJoint_SetSuspension(joint: number, hertz: number, dampingRatio: number): void;
166
+
167
+ // queries
168
+ _bx_RayHitsPtr(): number;
169
+ /** Returns the hit count; hits are 11 floats each: [px, py, pz, nx, ny, nz, fraction, bodySlot, shapeDesc, triangleIndex, reserved] */
170
+ _bx_World_CastRay(world: number, ox: number, oy: number, oz: number, dx: number, dy: number, dz: number, categoryBits: number, maskBits: number, ignoreBody: number, hitSensors: number, closestOnly: number): number;
171
+ }
172
+
173
+ export type Box3DModule = Box3DExports & Box3DHeap;
174
+
175
+ /**
176
+ * Instantiates the Box3D WebAssembly module.
177
+ * @param options emscripten module options, `locateFile` is needed when the wasm is not next to the script
178
+ * @returns the resolved module, pass it to `new Box3DPlugin(true, module)`
179
+ */
180
+ declare function Box3D(options?: Box3DModuleOptions): Promise<Box3DModule>;
181
+
182
+ export default Box3D;
@@ -0,0 +1,2 @@
1
+ async function Box3D(moduleArg={}){var Module=moduleArg;var ENVIRONMENT_IS_WEB=!!globalThis.window;var ENVIRONMENT_IS_WORKER=!!globalThis.WorkerGlobalScope;var ENVIRONMENT_IS_NODE=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";var programArgs=[];var thisProgram="./this.program";var _scriptName=import.meta.url;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;class EmscriptenEH{}class EmscriptenSjLj extends EmscriptenEH{}var runtimeInitialized=false;function getMemoryBuffer(){return wasmMemory.buffer}function updateMemoryViews(){if(HEAP8?.buffer?.resizable)return;var b=getMemoryBuffer();HEAP8=new Int8Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);HEAP64=new BigInt64Array(b)}function preRun(){var preRun=Module["preRun"];if(preRun){if(typeof preRun=="function")preRun=[preRun];onPreRuns.push(...preRun)}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;wasmExports["f"]()}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={a:wasmImports};return imports}async function createWasm(){function receiveInstance(instance){wasmExports=instance.exports;assignWasmExports(wasmExports);updateMemoryViews();return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result["instance"])}var info=getWasmImports();var instantiateWasm=Module["instantiateWasm"];if(instantiateWasm){return new Promise(resolve=>{instantiateWasm(info,inst=>resolve(receiveInstance(inst)))})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var HEAP8;var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var onPreRuns=[];var noExitRuntime=true;var _emscripten_get_now=()=>performance.now();var _emscripten_date_now=()=>Date.now();var nowIsMonotonic=1;var checkWasiClock=clock_id=>clock_id>=0&&clock_id<=3;var INT53_MAX=9007199254740992;var INT53_MIN=-9007199254740992;var bigintToI53Checked=num=>num<INT53_MIN||num>INT53_MAX?NaN:Number(num);var HEAP64;function _clock_time_get(clk_id,ignored_precision,ptime){ignored_precision=bigintToI53Checked(ignored_precision);if(!checkWasiClock(clk_id)){return 28}var now;if(clk_id===0){now=_emscripten_date_now()}else if(nowIsMonotonic){now=_emscripten_get_now()}else{return 52}var nsec=Math.round(now*1e3*1e3);HEAP64[ptime>>3]=BigInt(nsec);return 0}var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var HEAPU8;var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var printCharBuffers=[null,[],[]];var UTF8Decoder=globalThis.TextDecoder&&new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var printChar=(stream,curr)=>{var buffer=printCharBuffers[stream];if(!curr||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer));buffer.length=0}else{buffer.push(curr)}};var HEAPU32;var _fd_write=(fd,iov,iovcnt,pnum)=>{var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j])}num+=len}HEAPU32[pnum>>2]=num;return 0};var HEAPF32;var HEAP32;{if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["arguments"])programArgs=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];var preInit=Module["preInit"];if(preInit){if(typeof preInit=="function")Module["preInit"]=preInit=[preInit];while(preInit.length>0){preInit.shift()()}}}var _free,_bx_Scratch,_bx_Alloc,_malloc,_bx_Free,_bx_GetVersion,_bx_CreateWorld,_bx_DestroyWorld,_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_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_AllowFastRotation,_bx_Body_SetMotionLocks,_bx_Body_GetAABB,_bx_Body_GetMassData,_bx_Body_SetMassData,_bx_Body_ApplyMassFromShapes,_bx_Body_GetShapeCount,_bx_Body_EnableContactEvents,_bx_ShapeDesc_CreateSphere,_bx_ShapeDesc_CreateCapsule,_bx_ShapeDesc_CreateBox,_bx_ShapeDesc_CreateCylinder,_bx_ShapeDesc_CreateHull,_bx_ShapeDesc_CreateMesh,_bx_ShapeDesc_CreateHeightField,_bx_ShapeDesc_CreateContainer,_bx_ShapeDesc_AddChild,_bx_ShapeDesc_RemoveChild,_bx_ShapeDesc_GetChildCount,_bx_ShapeDesc_GetKind,_bx_ShapeDesc_SetMaterial,_bx_ShapeDesc_GetFriction,_bx_ShapeDesc_GetRestitution,_bx_ShapeDesc_SetDensity,_bx_ShapeDesc_GetDensity,_bx_ShapeDesc_SetFilter,_bx_ShapeDesc_GetCategoryBits,_bx_ShapeDesc_GetMaskBits,_bx_ShapeDesc_SetGroup,_bx_ShapeDesc_SetRollingResistance,_bx_ShapeDesc_SetSensor,_bx_ShapeDesc_IsSensor,_bx_ShapeDesc_GetAABB,_bx_ShapeDesc_Destroy,_bx_Body_SetShape,_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_SetMotorSpeed,_bx_Joint_SetMaxMotorForce,_bx_Joint_EnableSpring,_bx_Joint_SetSpring,_bx_Joint_SetTarget,_bx_Joint_GetPosition,_bx_ComputeAlignedFrameB,_bx_WheelJoint_SetSpinMotorSpeed,_bx_WheelJoint_SetMaxSpinTorque,_bx_WheelJoint_EnableSpinMotor,_bx_WheelJoint_SetTargetSteeringAngle,_bx_WheelJoint_SetSuspension,_bx_RayHitsPtr,_bx_World_CastRay,memory,__indirect_function_table,wasmMemory;function assignWasmExports(wasmExports){_free=Module["_free"]=wasmExports["g"];_bx_Scratch=Module["_bx_Scratch"]=wasmExports["h"];_bx_Alloc=Module["_bx_Alloc"]=wasmExports["i"];_malloc=Module["_malloc"]=wasmExports["j"];_bx_Free=Module["_bx_Free"]=wasmExports["k"];_bx_GetVersion=Module["_bx_GetVersion"]=wasmExports["l"];_bx_CreateWorld=Module["_bx_CreateWorld"]=wasmExports["m"];_bx_DestroyWorld=Module["_bx_DestroyWorld"]=wasmExports["n"];_bx_World_Step=Module["_bx_World_Step"]=wasmExports["o"];_bx_World_SetGravity=Module["_bx_World_SetGravity"]=wasmExports["p"];_bx_World_SetMaximumLinearSpeed=Module["_bx_World_SetMaximumLinearSpeed"]=wasmExports["q"];_bx_World_GetMaximumLinearSpeed=Module["_bx_World_GetMaximumLinearSpeed"]=wasmExports["r"];_bx_World_EnableSleeping=Module["_bx_World_EnableSleeping"]=wasmExports["s"];_bx_World_EnableContinuous=Module["_bx_World_EnableContinuous"]=wasmExports["t"];_bx_World_SetContactTuning=Module["_bx_World_SetContactTuning"]=wasmExports["u"];_bx_World_Explode=Module["_bx_World_Explode"]=wasmExports["v"];_bx_World_GetAwakeBodyCount=Module["_bx_World_GetAwakeBodyCount"]=wasmExports["w"];_bx_World_GetStats=Module["_bx_World_GetStats"]=wasmExports["x"];_bx_MoveEventsPtr=Module["_bx_MoveEventsPtr"]=wasmExports["y"];_bx_ContactEventsPtr=Module["_bx_ContactEventsPtr"]=wasmExports["z"];_bx_SensorEventsPtr=Module["_bx_SensorEventsPtr"]=wasmExports["A"];_bx_World_GetMoveEvents=Module["_bx_World_GetMoveEvents"]=wasmExports["B"];_bx_World_GetContactEvents=Module["_bx_World_GetContactEvents"]=wasmExports["C"];_bx_World_GetSensorEvents=Module["_bx_World_GetSensorEvents"]=wasmExports["D"];_bx_CreateBody=Module["_bx_CreateBody"]=wasmExports["E"];_bx_DestroyBody=Module["_bx_DestroyBody"]=wasmExports["F"];_bx_Body_SetType=Module["_bx_Body_SetType"]=wasmExports["G"];_bx_Body_GetType=Module["_bx_Body_GetType"]=wasmExports["H"];_bx_Body_SetTransform=Module["_bx_Body_SetTransform"]=wasmExports["I"];_bx_Body_GetTransform=Module["_bx_Body_GetTransform"]=wasmExports["J"];_bx_Body_SetTargetTransform=Module["_bx_Body_SetTargetTransform"]=wasmExports["K"];_bx_Body_SetLinearVelocity=Module["_bx_Body_SetLinearVelocity"]=wasmExports["L"];_bx_Body_GetLinearVelocity=Module["_bx_Body_GetLinearVelocity"]=wasmExports["M"];_bx_Body_SetAngularVelocity=Module["_bx_Body_SetAngularVelocity"]=wasmExports["N"];_bx_Body_GetAngularVelocity=Module["_bx_Body_GetAngularVelocity"]=wasmExports["O"];_bx_Body_SetLinearDamping=Module["_bx_Body_SetLinearDamping"]=wasmExports["P"];_bx_Body_GetLinearDamping=Module["_bx_Body_GetLinearDamping"]=wasmExports["Q"];_bx_Body_SetAngularDamping=Module["_bx_Body_SetAngularDamping"]=wasmExports["R"];_bx_Body_GetAngularDamping=Module["_bx_Body_GetAngularDamping"]=wasmExports["S"];_bx_Body_SetGravityScale=Module["_bx_Body_SetGravityScale"]=wasmExports["T"];_bx_Body_GetGravityScale=Module["_bx_Body_GetGravityScale"]=wasmExports["U"];_bx_Body_ApplyForce=Module["_bx_Body_ApplyForce"]=wasmExports["V"];_bx_Body_ApplyForceToCenter=Module["_bx_Body_ApplyForceToCenter"]=wasmExports["W"];_bx_Body_ApplyTorque=Module["_bx_Body_ApplyTorque"]=wasmExports["X"];_bx_Body_ApplyLinearImpulse=Module["_bx_Body_ApplyLinearImpulse"]=wasmExports["Y"];_bx_Body_ApplyLinearImpulseToCenter=Module["_bx_Body_ApplyLinearImpulseToCenter"]=wasmExports["Z"];_bx_Body_ApplyAngularImpulse=Module["_bx_Body_ApplyAngularImpulse"]=wasmExports["_"];_bx_Body_SetAwake=Module["_bx_Body_SetAwake"]=wasmExports["$"];_bx_Body_IsAwake=Module["_bx_Body_IsAwake"]=wasmExports["aa"];_bx_Body_EnableSleep=Module["_bx_Body_EnableSleep"]=wasmExports["ba"];_bx_Body_SetBullet=Module["_bx_Body_SetBullet"]=wasmExports["ca"];_bx_Body_AllowFastRotation=Module["_bx_Body_AllowFastRotation"]=wasmExports["da"];_bx_Body_SetMotionLocks=Module["_bx_Body_SetMotionLocks"]=wasmExports["ea"];_bx_Body_GetAABB=Module["_bx_Body_GetAABB"]=wasmExports["fa"];_bx_Body_GetMassData=Module["_bx_Body_GetMassData"]=wasmExports["ga"];_bx_Body_SetMassData=Module["_bx_Body_SetMassData"]=wasmExports["ha"];_bx_Body_ApplyMassFromShapes=Module["_bx_Body_ApplyMassFromShapes"]=wasmExports["ia"];_bx_Body_GetShapeCount=Module["_bx_Body_GetShapeCount"]=wasmExports["ja"];_bx_Body_EnableContactEvents=Module["_bx_Body_EnableContactEvents"]=wasmExports["ka"];_bx_ShapeDesc_CreateSphere=Module["_bx_ShapeDesc_CreateSphere"]=wasmExports["la"];_bx_ShapeDesc_CreateCapsule=Module["_bx_ShapeDesc_CreateCapsule"]=wasmExports["ma"];_bx_ShapeDesc_CreateBox=Module["_bx_ShapeDesc_CreateBox"]=wasmExports["na"];_bx_ShapeDesc_CreateCylinder=Module["_bx_ShapeDesc_CreateCylinder"]=wasmExports["oa"];_bx_ShapeDesc_CreateHull=Module["_bx_ShapeDesc_CreateHull"]=wasmExports["pa"];_bx_ShapeDesc_CreateMesh=Module["_bx_ShapeDesc_CreateMesh"]=wasmExports["qa"];_bx_ShapeDesc_CreateHeightField=Module["_bx_ShapeDesc_CreateHeightField"]=wasmExports["ra"];_bx_ShapeDesc_CreateContainer=Module["_bx_ShapeDesc_CreateContainer"]=wasmExports["sa"];_bx_ShapeDesc_AddChild=Module["_bx_ShapeDesc_AddChild"]=wasmExports["ta"];_bx_ShapeDesc_RemoveChild=Module["_bx_ShapeDesc_RemoveChild"]=wasmExports["ua"];_bx_ShapeDesc_GetChildCount=Module["_bx_ShapeDesc_GetChildCount"]=wasmExports["va"];_bx_ShapeDesc_GetKind=Module["_bx_ShapeDesc_GetKind"]=wasmExports["wa"];_bx_ShapeDesc_SetMaterial=Module["_bx_ShapeDesc_SetMaterial"]=wasmExports["xa"];_bx_ShapeDesc_GetFriction=Module["_bx_ShapeDesc_GetFriction"]=wasmExports["ya"];_bx_ShapeDesc_GetRestitution=Module["_bx_ShapeDesc_GetRestitution"]=wasmExports["za"];_bx_ShapeDesc_SetDensity=Module["_bx_ShapeDesc_SetDensity"]=wasmExports["Aa"];_bx_ShapeDesc_GetDensity=Module["_bx_ShapeDesc_GetDensity"]=wasmExports["Ba"];_bx_ShapeDesc_SetFilter=Module["_bx_ShapeDesc_SetFilter"]=wasmExports["Ca"];_bx_ShapeDesc_GetCategoryBits=Module["_bx_ShapeDesc_GetCategoryBits"]=wasmExports["Da"];_bx_ShapeDesc_GetMaskBits=Module["_bx_ShapeDesc_GetMaskBits"]=wasmExports["Ea"];_bx_ShapeDesc_SetGroup=Module["_bx_ShapeDesc_SetGroup"]=wasmExports["Fa"];_bx_ShapeDesc_SetRollingResistance=Module["_bx_ShapeDesc_SetRollingResistance"]=wasmExports["Ga"];_bx_ShapeDesc_SetSensor=Module["_bx_ShapeDesc_SetSensor"]=wasmExports["Ha"];_bx_ShapeDesc_IsSensor=Module["_bx_ShapeDesc_IsSensor"]=wasmExports["Ia"];_bx_ShapeDesc_GetAABB=Module["_bx_ShapeDesc_GetAABB"]=wasmExports["Ja"];_bx_ShapeDesc_Destroy=Module["_bx_ShapeDesc_Destroy"]=wasmExports["Ka"];_bx_Body_SetShape=Module["_bx_Body_SetShape"]=wasmExports["La"];_bx_Body_GetShapeDesc=Module["_bx_Body_GetShapeDesc"]=wasmExports["Ma"];_bx_ShapeDesc_BuildDebugGeometry=Module["_bx_ShapeDesc_BuildDebugGeometry"]=wasmExports["Na"];_bx_DebugPositionsPtr=Module["_bx_DebugPositionsPtr"]=wasmExports["Oa"];_bx_DebugIndicesPtr=Module["_bx_DebugIndicesPtr"]=wasmExports["Pa"];_bx_DebugIndexCount=Module["_bx_DebugIndexCount"]=wasmExports["Qa"];_bx_CreateJoint=Module["_bx_CreateJoint"]=wasmExports["Ra"];_bx_DestroyJoint=Module["_bx_DestroyJoint"]=wasmExports["Sa"];_bx_Joint_IsValid=Module["_bx_Joint_IsValid"]=wasmExports["Ta"];_bx_Joint_SetCollideConnected=Module["_bx_Joint_SetCollideConnected"]=wasmExports["Ua"];_bx_Joint_SetConstraintTuning=Module["_bx_Joint_SetConstraintTuning"]=wasmExports["Va"];_bx_Joint_WakeBodies=Module["_bx_Joint_WakeBodies"]=wasmExports["Wa"];_bx_Joint_EnableLimit=Module["_bx_Joint_EnableLimit"]=wasmExports["Xa"];_bx_Joint_SetLimits=Module["_bx_Joint_SetLimits"]=wasmExports["Ya"];_bx_Joint_SetTwistLimits=Module["_bx_Joint_SetTwistLimits"]=wasmExports["Za"];_bx_Joint_EnableMotor=Module["_bx_Joint_EnableMotor"]=wasmExports["_a"];_bx_Joint_SetMotorSpeed=Module["_bx_Joint_SetMotorSpeed"]=wasmExports["$a"];_bx_Joint_SetMaxMotorForce=Module["_bx_Joint_SetMaxMotorForce"]=wasmExports["ab"];_bx_Joint_EnableSpring=Module["_bx_Joint_EnableSpring"]=wasmExports["bb"];_bx_Joint_SetSpring=Module["_bx_Joint_SetSpring"]=wasmExports["cb"];_bx_Joint_SetTarget=Module["_bx_Joint_SetTarget"]=wasmExports["db"];_bx_Joint_GetPosition=Module["_bx_Joint_GetPosition"]=wasmExports["eb"];_bx_ComputeAlignedFrameB=Module["_bx_ComputeAlignedFrameB"]=wasmExports["fb"];_bx_WheelJoint_SetSpinMotorSpeed=Module["_bx_WheelJoint_SetSpinMotorSpeed"]=wasmExports["gb"];_bx_WheelJoint_SetMaxSpinTorque=Module["_bx_WheelJoint_SetMaxSpinTorque"]=wasmExports["hb"];_bx_WheelJoint_EnableSpinMotor=Module["_bx_WheelJoint_EnableSpinMotor"]=wasmExports["ib"];_bx_WheelJoint_SetTargetSteeringAngle=Module["_bx_WheelJoint_SetTargetSteeringAngle"]=wasmExports["jb"];_bx_WheelJoint_SetSuspension=Module["_bx_WheelJoint_SetSuspension"]=wasmExports["kb"];_bx_RayHitsPtr=Module["_bx_RayHitsPtr"]=wasmExports["lb"];_bx_World_CastRay=Module["_bx_World_CastRay"]=wasmExports["mb"];memory=wasmMemory=wasmExports["e"];__indirect_function_table=wasmExports["__indirect_function_table"]}var wasmImports={d:_clock_time_get,a:_emscripten_get_now,c:_emscripten_resize_heap,b:_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
@@ -0,0 +1,2 @@
1
+ async function Box3D(moduleArg={}){var Module=moduleArg;var ENVIRONMENT_IS_NODE=true;if(ENVIRONMENT_IS_NODE){const{createRequire}=await import("node:module");var require=createRequire(import.meta.url)}var programArgs=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};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_NODE){var fs=require("node:fs");if(_scriptName.startsWith("file:")){scriptDirectory=require("node:path").dirname(require("node:url").fileURLToPath(_scriptName))+"/"}readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");return ret};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}programArgs=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;var isFileURI=filename=>filename.startsWith("file://");class EmscriptenEH{}class EmscriptenSjLj extends EmscriptenEH{}var runtimeInitialized=false;function getMemoryBuffer(){return wasmMemory.buffer}function updateMemoryViews(){if(HEAP8?.buffer?.resizable)return;var b=getMemoryBuffer();HEAP8=new Int8Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);HEAP64=new BigInt64Array(b)}function preRun(){var preRun=Module["preRun"];if(preRun){if(typeof preRun=="function")preRun=[preRun];onPreRuns.push(...preRun)}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;wasmExports["f"]()}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&&!ENVIRONMENT_IS_NODE){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={a:wasmImports};return imports}async function createWasm(){function receiveInstance(instance){wasmExports=instance.exports;assignWasmExports(wasmExports);updateMemoryViews();return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result["instance"])}var info=getWasmImports();var instantiateWasm=Module["instantiateWasm"];if(instantiateWasm){return new Promise(resolve=>{instantiateWasm(info,inst=>resolve(receiveInstance(inst)))})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var HEAP8;var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var onPreRuns=[];var noExitRuntime=true;var _emscripten_get_now=()=>performance.now();var _emscripten_date_now=()=>Date.now();var nowIsMonotonic=1;var checkWasiClock=clock_id=>clock_id>=0&&clock_id<=3;var INT53_MAX=9007199254740992;var INT53_MIN=-9007199254740992;var bigintToI53Checked=num=>num<INT53_MIN||num>INT53_MAX?NaN:Number(num);var HEAP64;function _clock_time_get(clk_id,ignored_precision,ptime){ignored_precision=bigintToI53Checked(ignored_precision);if(!checkWasiClock(clk_id)){return 28}var now;if(clk_id===0){now=_emscripten_date_now()}else if(nowIsMonotonic){now=_emscripten_get_now()}else{return 52}var nsec=Math.round(now*1e3*1e3);HEAP64[ptime>>3]=BigInt(nsec);return 0}var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var HEAPU8;var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var printCharBuffers=[null,[],[]];var UTF8Decoder=globalThis.TextDecoder&&new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var printChar=(stream,curr)=>{var buffer=printCharBuffers[stream];if(!curr||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer));buffer.length=0}else{buffer.push(curr)}};var HEAPU32;var _fd_write=(fd,iov,iovcnt,pnum)=>{var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j])}num+=len}HEAPU32[pnum>>2]=num;return 0};var HEAPF32;var HEAP32;{if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["arguments"])programArgs=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];var preInit=Module["preInit"];if(preInit){if(typeof preInit=="function")Module["preInit"]=preInit=[preInit];while(preInit.length>0){preInit.shift()()}}}var _free,_bx_Scratch,_bx_Alloc,_malloc,_bx_Free,_bx_GetVersion,_bx_CreateWorld,_bx_DestroyWorld,_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_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_AllowFastRotation,_bx_Body_SetMotionLocks,_bx_Body_GetAABB,_bx_Body_GetMassData,_bx_Body_SetMassData,_bx_Body_ApplyMassFromShapes,_bx_Body_GetShapeCount,_bx_Body_EnableContactEvents,_bx_ShapeDesc_CreateSphere,_bx_ShapeDesc_CreateCapsule,_bx_ShapeDesc_CreateBox,_bx_ShapeDesc_CreateCylinder,_bx_ShapeDesc_CreateHull,_bx_ShapeDesc_CreateMesh,_bx_ShapeDesc_CreateHeightField,_bx_ShapeDesc_CreateContainer,_bx_ShapeDesc_AddChild,_bx_ShapeDesc_RemoveChild,_bx_ShapeDesc_GetChildCount,_bx_ShapeDesc_GetKind,_bx_ShapeDesc_SetMaterial,_bx_ShapeDesc_GetFriction,_bx_ShapeDesc_GetRestitution,_bx_ShapeDesc_SetDensity,_bx_ShapeDesc_GetDensity,_bx_ShapeDesc_SetFilter,_bx_ShapeDesc_GetCategoryBits,_bx_ShapeDesc_GetMaskBits,_bx_ShapeDesc_SetGroup,_bx_ShapeDesc_SetRollingResistance,_bx_ShapeDesc_SetSensor,_bx_ShapeDesc_IsSensor,_bx_ShapeDesc_GetAABB,_bx_ShapeDesc_Destroy,_bx_Body_SetShape,_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_SetMotorSpeed,_bx_Joint_SetMaxMotorForce,_bx_Joint_EnableSpring,_bx_Joint_SetSpring,_bx_Joint_SetTarget,_bx_Joint_GetPosition,_bx_ComputeAlignedFrameB,_bx_WheelJoint_SetSpinMotorSpeed,_bx_WheelJoint_SetMaxSpinTorque,_bx_WheelJoint_EnableSpinMotor,_bx_WheelJoint_SetTargetSteeringAngle,_bx_WheelJoint_SetSuspension,_bx_RayHitsPtr,_bx_World_CastRay,memory,__indirect_function_table,wasmMemory;function assignWasmExports(wasmExports){_free=Module["_free"]=wasmExports["g"];_bx_Scratch=Module["_bx_Scratch"]=wasmExports["h"];_bx_Alloc=Module["_bx_Alloc"]=wasmExports["i"];_malloc=Module["_malloc"]=wasmExports["j"];_bx_Free=Module["_bx_Free"]=wasmExports["k"];_bx_GetVersion=Module["_bx_GetVersion"]=wasmExports["l"];_bx_CreateWorld=Module["_bx_CreateWorld"]=wasmExports["m"];_bx_DestroyWorld=Module["_bx_DestroyWorld"]=wasmExports["n"];_bx_World_Step=Module["_bx_World_Step"]=wasmExports["o"];_bx_World_SetGravity=Module["_bx_World_SetGravity"]=wasmExports["p"];_bx_World_SetMaximumLinearSpeed=Module["_bx_World_SetMaximumLinearSpeed"]=wasmExports["q"];_bx_World_GetMaximumLinearSpeed=Module["_bx_World_GetMaximumLinearSpeed"]=wasmExports["r"];_bx_World_EnableSleeping=Module["_bx_World_EnableSleeping"]=wasmExports["s"];_bx_World_EnableContinuous=Module["_bx_World_EnableContinuous"]=wasmExports["t"];_bx_World_SetContactTuning=Module["_bx_World_SetContactTuning"]=wasmExports["u"];_bx_World_Explode=Module["_bx_World_Explode"]=wasmExports["v"];_bx_World_GetAwakeBodyCount=Module["_bx_World_GetAwakeBodyCount"]=wasmExports["w"];_bx_World_GetStats=Module["_bx_World_GetStats"]=wasmExports["x"];_bx_MoveEventsPtr=Module["_bx_MoveEventsPtr"]=wasmExports["y"];_bx_ContactEventsPtr=Module["_bx_ContactEventsPtr"]=wasmExports["z"];_bx_SensorEventsPtr=Module["_bx_SensorEventsPtr"]=wasmExports["A"];_bx_World_GetMoveEvents=Module["_bx_World_GetMoveEvents"]=wasmExports["B"];_bx_World_GetContactEvents=Module["_bx_World_GetContactEvents"]=wasmExports["C"];_bx_World_GetSensorEvents=Module["_bx_World_GetSensorEvents"]=wasmExports["D"];_bx_CreateBody=Module["_bx_CreateBody"]=wasmExports["E"];_bx_DestroyBody=Module["_bx_DestroyBody"]=wasmExports["F"];_bx_Body_SetType=Module["_bx_Body_SetType"]=wasmExports["G"];_bx_Body_GetType=Module["_bx_Body_GetType"]=wasmExports["H"];_bx_Body_SetTransform=Module["_bx_Body_SetTransform"]=wasmExports["I"];_bx_Body_GetTransform=Module["_bx_Body_GetTransform"]=wasmExports["J"];_bx_Body_SetTargetTransform=Module["_bx_Body_SetTargetTransform"]=wasmExports["K"];_bx_Body_SetLinearVelocity=Module["_bx_Body_SetLinearVelocity"]=wasmExports["L"];_bx_Body_GetLinearVelocity=Module["_bx_Body_GetLinearVelocity"]=wasmExports["M"];_bx_Body_SetAngularVelocity=Module["_bx_Body_SetAngularVelocity"]=wasmExports["N"];_bx_Body_GetAngularVelocity=Module["_bx_Body_GetAngularVelocity"]=wasmExports["O"];_bx_Body_SetLinearDamping=Module["_bx_Body_SetLinearDamping"]=wasmExports["P"];_bx_Body_GetLinearDamping=Module["_bx_Body_GetLinearDamping"]=wasmExports["Q"];_bx_Body_SetAngularDamping=Module["_bx_Body_SetAngularDamping"]=wasmExports["R"];_bx_Body_GetAngularDamping=Module["_bx_Body_GetAngularDamping"]=wasmExports["S"];_bx_Body_SetGravityScale=Module["_bx_Body_SetGravityScale"]=wasmExports["T"];_bx_Body_GetGravityScale=Module["_bx_Body_GetGravityScale"]=wasmExports["U"];_bx_Body_ApplyForce=Module["_bx_Body_ApplyForce"]=wasmExports["V"];_bx_Body_ApplyForceToCenter=Module["_bx_Body_ApplyForceToCenter"]=wasmExports["W"];_bx_Body_ApplyTorque=Module["_bx_Body_ApplyTorque"]=wasmExports["X"];_bx_Body_ApplyLinearImpulse=Module["_bx_Body_ApplyLinearImpulse"]=wasmExports["Y"];_bx_Body_ApplyLinearImpulseToCenter=Module["_bx_Body_ApplyLinearImpulseToCenter"]=wasmExports["Z"];_bx_Body_ApplyAngularImpulse=Module["_bx_Body_ApplyAngularImpulse"]=wasmExports["_"];_bx_Body_SetAwake=Module["_bx_Body_SetAwake"]=wasmExports["$"];_bx_Body_IsAwake=Module["_bx_Body_IsAwake"]=wasmExports["aa"];_bx_Body_EnableSleep=Module["_bx_Body_EnableSleep"]=wasmExports["ba"];_bx_Body_SetBullet=Module["_bx_Body_SetBullet"]=wasmExports["ca"];_bx_Body_AllowFastRotation=Module["_bx_Body_AllowFastRotation"]=wasmExports["da"];_bx_Body_SetMotionLocks=Module["_bx_Body_SetMotionLocks"]=wasmExports["ea"];_bx_Body_GetAABB=Module["_bx_Body_GetAABB"]=wasmExports["fa"];_bx_Body_GetMassData=Module["_bx_Body_GetMassData"]=wasmExports["ga"];_bx_Body_SetMassData=Module["_bx_Body_SetMassData"]=wasmExports["ha"];_bx_Body_ApplyMassFromShapes=Module["_bx_Body_ApplyMassFromShapes"]=wasmExports["ia"];_bx_Body_GetShapeCount=Module["_bx_Body_GetShapeCount"]=wasmExports["ja"];_bx_Body_EnableContactEvents=Module["_bx_Body_EnableContactEvents"]=wasmExports["ka"];_bx_ShapeDesc_CreateSphere=Module["_bx_ShapeDesc_CreateSphere"]=wasmExports["la"];_bx_ShapeDesc_CreateCapsule=Module["_bx_ShapeDesc_CreateCapsule"]=wasmExports["ma"];_bx_ShapeDesc_CreateBox=Module["_bx_ShapeDesc_CreateBox"]=wasmExports["na"];_bx_ShapeDesc_CreateCylinder=Module["_bx_ShapeDesc_CreateCylinder"]=wasmExports["oa"];_bx_ShapeDesc_CreateHull=Module["_bx_ShapeDesc_CreateHull"]=wasmExports["pa"];_bx_ShapeDesc_CreateMesh=Module["_bx_ShapeDesc_CreateMesh"]=wasmExports["qa"];_bx_ShapeDesc_CreateHeightField=Module["_bx_ShapeDesc_CreateHeightField"]=wasmExports["ra"];_bx_ShapeDesc_CreateContainer=Module["_bx_ShapeDesc_CreateContainer"]=wasmExports["sa"];_bx_ShapeDesc_AddChild=Module["_bx_ShapeDesc_AddChild"]=wasmExports["ta"];_bx_ShapeDesc_RemoveChild=Module["_bx_ShapeDesc_RemoveChild"]=wasmExports["ua"];_bx_ShapeDesc_GetChildCount=Module["_bx_ShapeDesc_GetChildCount"]=wasmExports["va"];_bx_ShapeDesc_GetKind=Module["_bx_ShapeDesc_GetKind"]=wasmExports["wa"];_bx_ShapeDesc_SetMaterial=Module["_bx_ShapeDesc_SetMaterial"]=wasmExports["xa"];_bx_ShapeDesc_GetFriction=Module["_bx_ShapeDesc_GetFriction"]=wasmExports["ya"];_bx_ShapeDesc_GetRestitution=Module["_bx_ShapeDesc_GetRestitution"]=wasmExports["za"];_bx_ShapeDesc_SetDensity=Module["_bx_ShapeDesc_SetDensity"]=wasmExports["Aa"];_bx_ShapeDesc_GetDensity=Module["_bx_ShapeDesc_GetDensity"]=wasmExports["Ba"];_bx_ShapeDesc_SetFilter=Module["_bx_ShapeDesc_SetFilter"]=wasmExports["Ca"];_bx_ShapeDesc_GetCategoryBits=Module["_bx_ShapeDesc_GetCategoryBits"]=wasmExports["Da"];_bx_ShapeDesc_GetMaskBits=Module["_bx_ShapeDesc_GetMaskBits"]=wasmExports["Ea"];_bx_ShapeDesc_SetGroup=Module["_bx_ShapeDesc_SetGroup"]=wasmExports["Fa"];_bx_ShapeDesc_SetRollingResistance=Module["_bx_ShapeDesc_SetRollingResistance"]=wasmExports["Ga"];_bx_ShapeDesc_SetSensor=Module["_bx_ShapeDesc_SetSensor"]=wasmExports["Ha"];_bx_ShapeDesc_IsSensor=Module["_bx_ShapeDesc_IsSensor"]=wasmExports["Ia"];_bx_ShapeDesc_GetAABB=Module["_bx_ShapeDesc_GetAABB"]=wasmExports["Ja"];_bx_ShapeDesc_Destroy=Module["_bx_ShapeDesc_Destroy"]=wasmExports["Ka"];_bx_Body_SetShape=Module["_bx_Body_SetShape"]=wasmExports["La"];_bx_Body_GetShapeDesc=Module["_bx_Body_GetShapeDesc"]=wasmExports["Ma"];_bx_ShapeDesc_BuildDebugGeometry=Module["_bx_ShapeDesc_BuildDebugGeometry"]=wasmExports["Na"];_bx_DebugPositionsPtr=Module["_bx_DebugPositionsPtr"]=wasmExports["Oa"];_bx_DebugIndicesPtr=Module["_bx_DebugIndicesPtr"]=wasmExports["Pa"];_bx_DebugIndexCount=Module["_bx_DebugIndexCount"]=wasmExports["Qa"];_bx_CreateJoint=Module["_bx_CreateJoint"]=wasmExports["Ra"];_bx_DestroyJoint=Module["_bx_DestroyJoint"]=wasmExports["Sa"];_bx_Joint_IsValid=Module["_bx_Joint_IsValid"]=wasmExports["Ta"];_bx_Joint_SetCollideConnected=Module["_bx_Joint_SetCollideConnected"]=wasmExports["Ua"];_bx_Joint_SetConstraintTuning=Module["_bx_Joint_SetConstraintTuning"]=wasmExports["Va"];_bx_Joint_WakeBodies=Module["_bx_Joint_WakeBodies"]=wasmExports["Wa"];_bx_Joint_EnableLimit=Module["_bx_Joint_EnableLimit"]=wasmExports["Xa"];_bx_Joint_SetLimits=Module["_bx_Joint_SetLimits"]=wasmExports["Ya"];_bx_Joint_SetTwistLimits=Module["_bx_Joint_SetTwistLimits"]=wasmExports["Za"];_bx_Joint_EnableMotor=Module["_bx_Joint_EnableMotor"]=wasmExports["_a"];_bx_Joint_SetMotorSpeed=Module["_bx_Joint_SetMotorSpeed"]=wasmExports["$a"];_bx_Joint_SetMaxMotorForce=Module["_bx_Joint_SetMaxMotorForce"]=wasmExports["ab"];_bx_Joint_EnableSpring=Module["_bx_Joint_EnableSpring"]=wasmExports["bb"];_bx_Joint_SetSpring=Module["_bx_Joint_SetSpring"]=wasmExports["cb"];_bx_Joint_SetTarget=Module["_bx_Joint_SetTarget"]=wasmExports["db"];_bx_Joint_GetPosition=Module["_bx_Joint_GetPosition"]=wasmExports["eb"];_bx_ComputeAlignedFrameB=Module["_bx_ComputeAlignedFrameB"]=wasmExports["fb"];_bx_WheelJoint_SetSpinMotorSpeed=Module["_bx_WheelJoint_SetSpinMotorSpeed"]=wasmExports["gb"];_bx_WheelJoint_SetMaxSpinTorque=Module["_bx_WheelJoint_SetMaxSpinTorque"]=wasmExports["hb"];_bx_WheelJoint_EnableSpinMotor=Module["_bx_WheelJoint_EnableSpinMotor"]=wasmExports["ib"];_bx_WheelJoint_SetTargetSteeringAngle=Module["_bx_WheelJoint_SetTargetSteeringAngle"]=wasmExports["jb"];_bx_WheelJoint_SetSuspension=Module["_bx_WheelJoint_SetSuspension"]=wasmExports["kb"];_bx_RayHitsPtr=Module["_bx_RayHitsPtr"]=wasmExports["lb"];_bx_World_CastRay=Module["_bx_World_CastRay"]=wasmExports["mb"];memory=wasmMemory=wasmExports["e"];__indirect_function_table=wasmExports["__indirect_function_table"]}var wasmImports={d:_clock_time_get,a:_emscripten_get_now,c:_emscripten_resize_heap,b:_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
@@ -0,0 +1,2 @@
1
+ var Box3D=(()=>{var _scriptName=globalThis.document?.currentScript?.src;return async function(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";if(ENVIRONMENT_IS_WORKER){_scriptName=self.location.href}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;class EmscriptenEH{}class EmscriptenSjLj extends EmscriptenEH{}var runtimeInitialized=false;function getMemoryBuffer(){return wasmMemory.buffer}function updateMemoryViews(){if(HEAP8?.buffer?.resizable)return;var b=getMemoryBuffer();HEAP8=new Int8Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);HEAP64=new BigInt64Array(b)}function preRun(){var preRun=Module["preRun"];if(preRun){if(typeof preRun=="function")preRun=[preRun];onPreRuns.push(...preRun)}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;wasmExports["f"]()}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(){return locateFile("box3d.umd.wasm")}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={a:wasmImports};return imports}async function createWasm(){function receiveInstance(instance){wasmExports=instance.exports;assignWasmExports(wasmExports);updateMemoryViews();return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result["instance"])}var info=getWasmImports();var instantiateWasm=Module["instantiateWasm"];if(instantiateWasm){return new Promise(resolve=>{instantiateWasm(info,inst=>resolve(receiveInstance(inst)))})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var HEAP8;var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var onPreRuns=[];var noExitRuntime=true;var _emscripten_get_now=()=>performance.now();var _emscripten_date_now=()=>Date.now();var nowIsMonotonic=1;var checkWasiClock=clock_id=>clock_id>=0&&clock_id<=3;var INT53_MAX=9007199254740992;var INT53_MIN=-9007199254740992;var bigintToI53Checked=num=>num<INT53_MIN||num>INT53_MAX?NaN:Number(num);var HEAP64;function _clock_time_get(clk_id,ignored_precision,ptime){ignored_precision=bigintToI53Checked(ignored_precision);if(!checkWasiClock(clk_id)){return 28}var now;if(clk_id===0){now=_emscripten_date_now()}else if(nowIsMonotonic){now=_emscripten_get_now()}else{return 52}var nsec=Math.round(now*1e3*1e3);HEAP64[ptime>>3]=BigInt(nsec);return 0}var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var HEAPU8;var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var printCharBuffers=[null,[],[]];var UTF8Decoder=globalThis.TextDecoder&&new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var printChar=(stream,curr)=>{var buffer=printCharBuffers[stream];if(!curr||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer));buffer.length=0}else{buffer.push(curr)}};var HEAPU32;var _fd_write=(fd,iov,iovcnt,pnum)=>{var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j])}num+=len}HEAPU32[pnum>>2]=num;return 0};var HEAPF32;var HEAP32;{if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["arguments"])programArgs=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];var preInit=Module["preInit"];if(preInit){if(typeof preInit=="function")Module["preInit"]=preInit=[preInit];while(preInit.length>0){preInit.shift()()}}}var _free,_bx_Scratch,_bx_Alloc,_malloc,_bx_Free,_bx_GetVersion,_bx_CreateWorld,_bx_DestroyWorld,_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_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_AllowFastRotation,_bx_Body_SetMotionLocks,_bx_Body_GetAABB,_bx_Body_GetMassData,_bx_Body_SetMassData,_bx_Body_ApplyMassFromShapes,_bx_Body_GetShapeCount,_bx_Body_EnableContactEvents,_bx_ShapeDesc_CreateSphere,_bx_ShapeDesc_CreateCapsule,_bx_ShapeDesc_CreateBox,_bx_ShapeDesc_CreateCylinder,_bx_ShapeDesc_CreateHull,_bx_ShapeDesc_CreateMesh,_bx_ShapeDesc_CreateHeightField,_bx_ShapeDesc_CreateContainer,_bx_ShapeDesc_AddChild,_bx_ShapeDesc_RemoveChild,_bx_ShapeDesc_GetChildCount,_bx_ShapeDesc_GetKind,_bx_ShapeDesc_SetMaterial,_bx_ShapeDesc_GetFriction,_bx_ShapeDesc_GetRestitution,_bx_ShapeDesc_SetDensity,_bx_ShapeDesc_GetDensity,_bx_ShapeDesc_SetFilter,_bx_ShapeDesc_GetCategoryBits,_bx_ShapeDesc_GetMaskBits,_bx_ShapeDesc_SetGroup,_bx_ShapeDesc_SetRollingResistance,_bx_ShapeDesc_SetSensor,_bx_ShapeDesc_IsSensor,_bx_ShapeDesc_GetAABB,_bx_ShapeDesc_Destroy,_bx_Body_SetShape,_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_SetMotorSpeed,_bx_Joint_SetMaxMotorForce,_bx_Joint_EnableSpring,_bx_Joint_SetSpring,_bx_Joint_SetTarget,_bx_Joint_GetPosition,_bx_ComputeAlignedFrameB,_bx_WheelJoint_SetSpinMotorSpeed,_bx_WheelJoint_SetMaxSpinTorque,_bx_WheelJoint_EnableSpinMotor,_bx_WheelJoint_SetTargetSteeringAngle,_bx_WheelJoint_SetSuspension,_bx_RayHitsPtr,_bx_World_CastRay,memory,__indirect_function_table,wasmMemory;function assignWasmExports(wasmExports){_free=Module["_free"]=wasmExports["g"];_bx_Scratch=Module["_bx_Scratch"]=wasmExports["h"];_bx_Alloc=Module["_bx_Alloc"]=wasmExports["i"];_malloc=Module["_malloc"]=wasmExports["j"];_bx_Free=Module["_bx_Free"]=wasmExports["k"];_bx_GetVersion=Module["_bx_GetVersion"]=wasmExports["l"];_bx_CreateWorld=Module["_bx_CreateWorld"]=wasmExports["m"];_bx_DestroyWorld=Module["_bx_DestroyWorld"]=wasmExports["n"];_bx_World_Step=Module["_bx_World_Step"]=wasmExports["o"];_bx_World_SetGravity=Module["_bx_World_SetGravity"]=wasmExports["p"];_bx_World_SetMaximumLinearSpeed=Module["_bx_World_SetMaximumLinearSpeed"]=wasmExports["q"];_bx_World_GetMaximumLinearSpeed=Module["_bx_World_GetMaximumLinearSpeed"]=wasmExports["r"];_bx_World_EnableSleeping=Module["_bx_World_EnableSleeping"]=wasmExports["s"];_bx_World_EnableContinuous=Module["_bx_World_EnableContinuous"]=wasmExports["t"];_bx_World_SetContactTuning=Module["_bx_World_SetContactTuning"]=wasmExports["u"];_bx_World_Explode=Module["_bx_World_Explode"]=wasmExports["v"];_bx_World_GetAwakeBodyCount=Module["_bx_World_GetAwakeBodyCount"]=wasmExports["w"];_bx_World_GetStats=Module["_bx_World_GetStats"]=wasmExports["x"];_bx_MoveEventsPtr=Module["_bx_MoveEventsPtr"]=wasmExports["y"];_bx_ContactEventsPtr=Module["_bx_ContactEventsPtr"]=wasmExports["z"];_bx_SensorEventsPtr=Module["_bx_SensorEventsPtr"]=wasmExports["A"];_bx_World_GetMoveEvents=Module["_bx_World_GetMoveEvents"]=wasmExports["B"];_bx_World_GetContactEvents=Module["_bx_World_GetContactEvents"]=wasmExports["C"];_bx_World_GetSensorEvents=Module["_bx_World_GetSensorEvents"]=wasmExports["D"];_bx_CreateBody=Module["_bx_CreateBody"]=wasmExports["E"];_bx_DestroyBody=Module["_bx_DestroyBody"]=wasmExports["F"];_bx_Body_SetType=Module["_bx_Body_SetType"]=wasmExports["G"];_bx_Body_GetType=Module["_bx_Body_GetType"]=wasmExports["H"];_bx_Body_SetTransform=Module["_bx_Body_SetTransform"]=wasmExports["I"];_bx_Body_GetTransform=Module["_bx_Body_GetTransform"]=wasmExports["J"];_bx_Body_SetTargetTransform=Module["_bx_Body_SetTargetTransform"]=wasmExports["K"];_bx_Body_SetLinearVelocity=Module["_bx_Body_SetLinearVelocity"]=wasmExports["L"];_bx_Body_GetLinearVelocity=Module["_bx_Body_GetLinearVelocity"]=wasmExports["M"];_bx_Body_SetAngularVelocity=Module["_bx_Body_SetAngularVelocity"]=wasmExports["N"];_bx_Body_GetAngularVelocity=Module["_bx_Body_GetAngularVelocity"]=wasmExports["O"];_bx_Body_SetLinearDamping=Module["_bx_Body_SetLinearDamping"]=wasmExports["P"];_bx_Body_GetLinearDamping=Module["_bx_Body_GetLinearDamping"]=wasmExports["Q"];_bx_Body_SetAngularDamping=Module["_bx_Body_SetAngularDamping"]=wasmExports["R"];_bx_Body_GetAngularDamping=Module["_bx_Body_GetAngularDamping"]=wasmExports["S"];_bx_Body_SetGravityScale=Module["_bx_Body_SetGravityScale"]=wasmExports["T"];_bx_Body_GetGravityScale=Module["_bx_Body_GetGravityScale"]=wasmExports["U"];_bx_Body_ApplyForce=Module["_bx_Body_ApplyForce"]=wasmExports["V"];_bx_Body_ApplyForceToCenter=Module["_bx_Body_ApplyForceToCenter"]=wasmExports["W"];_bx_Body_ApplyTorque=Module["_bx_Body_ApplyTorque"]=wasmExports["X"];_bx_Body_ApplyLinearImpulse=Module["_bx_Body_ApplyLinearImpulse"]=wasmExports["Y"];_bx_Body_ApplyLinearImpulseToCenter=Module["_bx_Body_ApplyLinearImpulseToCenter"]=wasmExports["Z"];_bx_Body_ApplyAngularImpulse=Module["_bx_Body_ApplyAngularImpulse"]=wasmExports["_"];_bx_Body_SetAwake=Module["_bx_Body_SetAwake"]=wasmExports["$"];_bx_Body_IsAwake=Module["_bx_Body_IsAwake"]=wasmExports["aa"];_bx_Body_EnableSleep=Module["_bx_Body_EnableSleep"]=wasmExports["ba"];_bx_Body_SetBullet=Module["_bx_Body_SetBullet"]=wasmExports["ca"];_bx_Body_AllowFastRotation=Module["_bx_Body_AllowFastRotation"]=wasmExports["da"];_bx_Body_SetMotionLocks=Module["_bx_Body_SetMotionLocks"]=wasmExports["ea"];_bx_Body_GetAABB=Module["_bx_Body_GetAABB"]=wasmExports["fa"];_bx_Body_GetMassData=Module["_bx_Body_GetMassData"]=wasmExports["ga"];_bx_Body_SetMassData=Module["_bx_Body_SetMassData"]=wasmExports["ha"];_bx_Body_ApplyMassFromShapes=Module["_bx_Body_ApplyMassFromShapes"]=wasmExports["ia"];_bx_Body_GetShapeCount=Module["_bx_Body_GetShapeCount"]=wasmExports["ja"];_bx_Body_EnableContactEvents=Module["_bx_Body_EnableContactEvents"]=wasmExports["ka"];_bx_ShapeDesc_CreateSphere=Module["_bx_ShapeDesc_CreateSphere"]=wasmExports["la"];_bx_ShapeDesc_CreateCapsule=Module["_bx_ShapeDesc_CreateCapsule"]=wasmExports["ma"];_bx_ShapeDesc_CreateBox=Module["_bx_ShapeDesc_CreateBox"]=wasmExports["na"];_bx_ShapeDesc_CreateCylinder=Module["_bx_ShapeDesc_CreateCylinder"]=wasmExports["oa"];_bx_ShapeDesc_CreateHull=Module["_bx_ShapeDesc_CreateHull"]=wasmExports["pa"];_bx_ShapeDesc_CreateMesh=Module["_bx_ShapeDesc_CreateMesh"]=wasmExports["qa"];_bx_ShapeDesc_CreateHeightField=Module["_bx_ShapeDesc_CreateHeightField"]=wasmExports["ra"];_bx_ShapeDesc_CreateContainer=Module["_bx_ShapeDesc_CreateContainer"]=wasmExports["sa"];_bx_ShapeDesc_AddChild=Module["_bx_ShapeDesc_AddChild"]=wasmExports["ta"];_bx_ShapeDesc_RemoveChild=Module["_bx_ShapeDesc_RemoveChild"]=wasmExports["ua"];_bx_ShapeDesc_GetChildCount=Module["_bx_ShapeDesc_GetChildCount"]=wasmExports["va"];_bx_ShapeDesc_GetKind=Module["_bx_ShapeDesc_GetKind"]=wasmExports["wa"];_bx_ShapeDesc_SetMaterial=Module["_bx_ShapeDesc_SetMaterial"]=wasmExports["xa"];_bx_ShapeDesc_GetFriction=Module["_bx_ShapeDesc_GetFriction"]=wasmExports["ya"];_bx_ShapeDesc_GetRestitution=Module["_bx_ShapeDesc_GetRestitution"]=wasmExports["za"];_bx_ShapeDesc_SetDensity=Module["_bx_ShapeDesc_SetDensity"]=wasmExports["Aa"];_bx_ShapeDesc_GetDensity=Module["_bx_ShapeDesc_GetDensity"]=wasmExports["Ba"];_bx_ShapeDesc_SetFilter=Module["_bx_ShapeDesc_SetFilter"]=wasmExports["Ca"];_bx_ShapeDesc_GetCategoryBits=Module["_bx_ShapeDesc_GetCategoryBits"]=wasmExports["Da"];_bx_ShapeDesc_GetMaskBits=Module["_bx_ShapeDesc_GetMaskBits"]=wasmExports["Ea"];_bx_ShapeDesc_SetGroup=Module["_bx_ShapeDesc_SetGroup"]=wasmExports["Fa"];_bx_ShapeDesc_SetRollingResistance=Module["_bx_ShapeDesc_SetRollingResistance"]=wasmExports["Ga"];_bx_ShapeDesc_SetSensor=Module["_bx_ShapeDesc_SetSensor"]=wasmExports["Ha"];_bx_ShapeDesc_IsSensor=Module["_bx_ShapeDesc_IsSensor"]=wasmExports["Ia"];_bx_ShapeDesc_GetAABB=Module["_bx_ShapeDesc_GetAABB"]=wasmExports["Ja"];_bx_ShapeDesc_Destroy=Module["_bx_ShapeDesc_Destroy"]=wasmExports["Ka"];_bx_Body_SetShape=Module["_bx_Body_SetShape"]=wasmExports["La"];_bx_Body_GetShapeDesc=Module["_bx_Body_GetShapeDesc"]=wasmExports["Ma"];_bx_ShapeDesc_BuildDebugGeometry=Module["_bx_ShapeDesc_BuildDebugGeometry"]=wasmExports["Na"];_bx_DebugPositionsPtr=Module["_bx_DebugPositionsPtr"]=wasmExports["Oa"];_bx_DebugIndicesPtr=Module["_bx_DebugIndicesPtr"]=wasmExports["Pa"];_bx_DebugIndexCount=Module["_bx_DebugIndexCount"]=wasmExports["Qa"];_bx_CreateJoint=Module["_bx_CreateJoint"]=wasmExports["Ra"];_bx_DestroyJoint=Module["_bx_DestroyJoint"]=wasmExports["Sa"];_bx_Joint_IsValid=Module["_bx_Joint_IsValid"]=wasmExports["Ta"];_bx_Joint_SetCollideConnected=Module["_bx_Joint_SetCollideConnected"]=wasmExports["Ua"];_bx_Joint_SetConstraintTuning=Module["_bx_Joint_SetConstraintTuning"]=wasmExports["Va"];_bx_Joint_WakeBodies=Module["_bx_Joint_WakeBodies"]=wasmExports["Wa"];_bx_Joint_EnableLimit=Module["_bx_Joint_EnableLimit"]=wasmExports["Xa"];_bx_Joint_SetLimits=Module["_bx_Joint_SetLimits"]=wasmExports["Ya"];_bx_Joint_SetTwistLimits=Module["_bx_Joint_SetTwistLimits"]=wasmExports["Za"];_bx_Joint_EnableMotor=Module["_bx_Joint_EnableMotor"]=wasmExports["_a"];_bx_Joint_SetMotorSpeed=Module["_bx_Joint_SetMotorSpeed"]=wasmExports["$a"];_bx_Joint_SetMaxMotorForce=Module["_bx_Joint_SetMaxMotorForce"]=wasmExports["ab"];_bx_Joint_EnableSpring=Module["_bx_Joint_EnableSpring"]=wasmExports["bb"];_bx_Joint_SetSpring=Module["_bx_Joint_SetSpring"]=wasmExports["cb"];_bx_Joint_SetTarget=Module["_bx_Joint_SetTarget"]=wasmExports["db"];_bx_Joint_GetPosition=Module["_bx_Joint_GetPosition"]=wasmExports["eb"];_bx_ComputeAlignedFrameB=Module["_bx_ComputeAlignedFrameB"]=wasmExports["fb"];_bx_WheelJoint_SetSpinMotorSpeed=Module["_bx_WheelJoint_SetSpinMotorSpeed"]=wasmExports["gb"];_bx_WheelJoint_SetMaxSpinTorque=Module["_bx_WheelJoint_SetMaxSpinTorque"]=wasmExports["hb"];_bx_WheelJoint_EnableSpinMotor=Module["_bx_WheelJoint_EnableSpinMotor"]=wasmExports["ib"];_bx_WheelJoint_SetTargetSteeringAngle=Module["_bx_WheelJoint_SetTargetSteeringAngle"]=wasmExports["jb"];_bx_WheelJoint_SetSuspension=Module["_bx_WheelJoint_SetSuspension"]=wasmExports["kb"];_bx_RayHitsPtr=Module["_bx_RayHitsPtr"]=wasmExports["lb"];_bx_World_CastRay=Module["_bx_World_CastRay"]=wasmExports["mb"];memory=wasmMemory=wasmExports["e"];__indirect_function_table=wasmExports["__indirect_function_table"]}var wasmImports={d:_clock_time_get,a:_emscripten_get_now,c:_emscripten_resize_heap,b:_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}})();if(typeof exports==="object"&&typeof module==="object"){module.exports=Box3D;module.exports.default=Box3D}else if(typeof define==="function"&&define["amd"])define([],()=>Box3D);
Binary file
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "babylon-box3d",
3
+ "version": "0.1.0",
4
+ "description": "Box3D (Erin Catto's 3D physics engine) compiled to WebAssembly for the Babylon.js Box3DPlugin",
5
+ "license": "MIT",
6
+ "author": "Andrew Butt",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/Pryme8/babylon-box3d"
10
+ },
11
+ "keywords": ["babylon.js", "box3d", "physics", "wasm"],
12
+ "type": "module",
13
+ "main": "lib/umd/box3d.umd.js",
14
+ "module": "lib/esm/box3d.js",
15
+ "types": "box3d.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./box3d.d.ts",
19
+ "import": "./lib/esm/box3d.js",
20
+ "require": "./lib/umd/box3d.umd.js",
21
+ "default": "./lib/esm/box3d.js"
22
+ },
23
+ "./node": {
24
+ "types": "./box3d.d.ts",
25
+ "default": "./lib/node/box3d.mjs"
26
+ },
27
+ "./lib/*": "./lib/*"
28
+ },
29
+ "files": ["lib/**/*", "box3d.d.ts", "src/box3d_shim.c", "UPSTREAM_COMMIT", "LICENSE", "LICENSE-box3d.txt", "README.md"],
30
+ "scripts": {
31
+ "build": "node build.mjs",
32
+ "test": "node test/smoke.mjs"
33
+ },
34
+ "sideEffects": false
35
+ }