Collision & spatial queries · 9 / 10
Morton Code / Z-Order
空間座標を近さが保たれやすい一次元順序へ並べる。
Compare in motion
Interactive model
空間の点群
AReference
登録順で並べる
BMorton Code / Z-Order100%
空間的に近いデータをまとめやすい
Scrub to pause and inspect. At 0%, B matches A; at 100%, B shows the effect. The scene repeats every 8 seconds.
Look for: 座標ビットを交互に並べる → 一次元の順序になる。
This model simplifies the technique to show its use case and effect. Operation counts describe the model; they are not performance measurements.
Read the storyboard
例: 空間の点群
1. Start
点が二次元に並ぶ
2. Change
座標ビットを交互に並べる
3. Result
一次元の順序になる
How it works
1. Input
多次元の座標
2. Process
各軸のビットを交互に並べる
3. Result
局所性のある一次元順序
Further reading
Box2D Collision ↗A general reference for this subcategory.