Physics · interface

ColliderBytes

What a collider set costs, in bytes, split so a streaming budget can act on it.

Explained in Your first game, Rigid bodies.

interface ColliderBytes
import type { ColliderBytes } from '@driftengine/physics';

In depth

A single number would not answer the question a budget asks, which is what to drop.

Properties

NameTypeDescription
slotsreadonlynumberThe packed bounds, the query stamps and the owners. Exact.
More

What was allocated, not what is used. The arrays double as they grow and a free list recycles slots without ever shrinking them, so this is the memory actually held — which is what a budget needs and what count would misreport.

shapesreadonlynumberThe distinct shape payloads reachable from live slots. Exact.
indexreadonlynumberThe spatial hash: its buckets and their entries. Part measured, part estimated.
totalreadonlynumberThe three above.