normalizeLayerMasks static method
masks as a world takes them: 16 rows, a missing row 0xFFFF (that
layer collides with every layer), bits past the 16 layers dropped.
Unmodifiable.
Implementation
static List<int> normalizeLayerMasks(List<int>? masks) => List.unmodifiable(
List.generate(
16,
(i) => masks != null && i < masks.length ? masks[i] & 0xFFFF : 0xFFFF,
),
);