Physics · class

PairSet

Explained in Your first game, Rigid bodies.

class PairSet
import { PairSet } from '@driftengine/physics';

Constructor

new

constructor(capacity?: number)
ParameterTypeDescription
capacity?number

Properties

NameTypeDescription
keysUint32ArrayPacked (min, max) keys, sorted ascending. Read count of them.
countnumber

Methods

build

build(bodies: BodySet, tree: DynamicTree, leafOf: Int32Array, ignored?: ReadonlySet<number> | null): number

Collect every candidate pair among the tree's proxies, sorted.

ParameterTypeDescription
bodiesBodySet
treeDynamicTree
leafOfInt32Array
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.