# @ferret/physics-friction: API

friction dialled by scope, rolling and pivot friction.

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

## Functions

### friction

*function* · `packages/physics-friction/src/index.ts:25`

```ts
function friction(): Capability
```

On a kernel without contact hooks (Havok) the same dials reach the solver another way: each body's surface is its material's friction
times the scale where the body is, and rolling resistance (which Havok lacks) is a torque μr·N·r against the roll, with N the normal
force the body's contacts carried in the last step. Anisotropy and pivot friction need the hooks.

### rollingRadius

*function* · `packages/physics-friction/src/kernels.ts:14`

```ts
function rollingRadius: (b: Body) => number
```

## Interfaces

### FrictionHookParams

*interface* · `packages/physics-friction/src/kernels.ts:5`

```ts
interface FrictionHookParams
```

- `scoped: ScopedSnapshot`
- `zones?: ZonesData`

### RollFieldParams

*interface* · `packages/physics-friction/src/kernels.ts:6`

```ts
interface RollFieldParams
```

- `scoped: ScopedSnapshot`
- `zones?: ZonesData`
- `rolling: Record<string, number>` — each material's rolling friction, by name
- `normals: { id: number; n: number; dir: Vec3 }[]` — the normal force and its direction each body's contacts carried in the last step, by body id

## Constants

### FRICTION_DEFAULTS

*const* · `packages/physics-friction/src/index.ts:18`

```ts
const FRICTION_DEFAULTS: { scale: number; rollingScale: number; pivot: number | undefined; anisotropy: { axis: Vec3; across: number; } | undefined; }
```

friction by scope. The kernel already applies Coulomb static and kinetic friction, rolling resistance and
(optionally) pivot friction from the materials of the two surfaces; this adds what a game dials per scope, so a patch of ice
can be a zone as well as a material:

  scale         multiplies static and kinetic friction                           (1)
  rollingScale  multiplies the rolling resistance                                (1)
  pivot         pivot (spinning) friction coefficient, overriding the material   (the material's)
  anisotropy    { axis: [x,y,z], across }: across the axis the coefficient is `across` times the one along it
                (an ice skate: across ≈ 20; a rail or a ski)

