Physics · class
PairSet
Explained in Your first game, Rigid bodies.
class PairSetimport { PairSet } from '@driftengine/physics';Constructor
new
constructor(capacity?: number)| Parameter | Type | Description |
|---|---|---|
capacity? | number |
Properties
| Name | Type | Description |
|---|---|---|
keys | Uint32Array | Packed (min, max) keys, sorted ascending. Read count of them. |
count | number |
Methods
build
build(bodies: BodySet, tree: DynamicTree, leafOf: Int32Array, ignored?: ReadonlySet<number> | null): numberCollect every candidate pair among the tree's proxies, sorted.
| Parameter | Type | Description |
|---|---|---|
bodies | BodySet | |
tree | DynamicTree | |
leafOf | Int32Array | |
ignored? | ReadonlySet<number> | null |
More
leafOf maps a body index to its tree leaf, because a query answers with proxy ids and the
tree needs the leaf to read a body's stored bounds back.