FERRETGame engine over Babylon.js
Ferret

@ferret/physics-havok

The loader for Havok's WASM, in a package of its own so a game without rigid bodies does not carry it.

3 exports · source in packages/physics-havok/src

Functions

havokKernel function

async function havokKernel(o: HavokKernelOptions = {}): Promise<HavokKernel>

A HavokKernel on the loaded module, ready for new PhysicsHost({ kernel }). It knows where the WASM is, so the host can give the islands of its world to workers.

packages/physics-havok/src/index.ts:9

havokWasmUrl function

function havokWasmUrl(o: { wasmUrl?: string } = {}): string | undefined

where Havok's WASM is, as a full address (a worker has no page to resolve a relative one against); undefined where there is no page (Node)

packages/physics-havok/src/loader.ts:23

loadHavok function

function loadHavok(o: { wasmUrl?: string } = {}): Promise<HavokPhysicsWithBindings>

Havok's WASM for a game in a page: from havok/ under the library folder (globalThis.FERRET_LIB, or lib/ferret/; the OS Beroun page sets it to /lib/ferret/), loaded once. A package of its own, so a game without rigid bodies does not carry the loader. A worker that steps islands of the world (kernels.ts) loads it the same way from wasmUrl, which the game's kernel hands it.

packages/physics-havok/src/loader.ts:12