# sortMortonInterleaved

Function

Source: https://github.com/playcanvas/splat-transform/blob/b6424a5b3b929695fbaafe738a995adb1240d675/src/lib/ops/morton-order.ts#L151

```ts
sortMortonInterleaved(positions: ArrayLike<number>, indices: Uint32Array, stride?: number): void
```

Sort `indices` in place into morton (Z-order) using interleaved positions
`[x, y, z, x, y, z, ...]` — the natural packing of the `position` layer.

`stride` lets the same call sort a wider record whose first three words are
xyz, e.g. a packed `[x, y, z, w]` GPU texture row viewed as floats, without
copying the positions out first.

**Parameters**

- `positions` (`ArrayLike<number>`): Interleaved xyz; gaussian `g` is at `positions[g*stride + {0,1,2}]`.
- `indices` (`Uint32Array`): Indices to sort in place.
- `stride` (`number`, optional, default `3`): Words per gaussian in `positions` (default 3).
