Examples
import { generatePairID } from '@wimaengine/narrowphase'
generatePairID(12, 3) === generatePairID(3, 12) // true
generatePairID(12, 3) // "12 3"Function
generatePairID(idA: number, idB: number): stringCreates the stable string key used for an unordered entity pair.
Numeric IDs are written with the larger value first and separated by a
space, so swapping the arguments produces the same key. Callers can use
this key to track an unordered entity pair without depending on argument
order.
Equal IDs are allowed and produce a repeated value, such as "4 4".
Inputs are interpolated into a string without validation or entity lookup;
callers should pass the numeric entity indices used by the engine.
import { generatePairID } from '@wimaengine/narrowphase'
generatePairID(12, 3) === generatePairID(3, 12) // true
generatePairID(12, 3) // "12 3"