# @ferret/physics-havok: API

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

3 exports. Generated from the source (`packages/physics-havok/src`), so it matches the code.

## Functions

### havokKernel

*function* · `packages/physics-havok/src/index.ts:9`

```ts
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.

### havokWasmUrl

*function* · `packages/physics-havok/src/loader.ts:23`

```ts
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)

### loadHavok

*function* · `packages/physics-havok/src/loader.ts:12`

```ts
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.

