Collision & spatial queries · 7 / 10

Spatial Hashing / Hash Grid

セル座標から大量の粒子の近傍を探す。

Compare in motion

密集する粒子

Synchronized comparison
AReference
すべての粒子を候補にする

すべての粒子を候補にする

BSpatial Hashing / Hash Grid100%
大量の粒子の近接判定を絞れる

大量の粒子の近接判定を絞れる

Loading demo…

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. 1. Start

    粒子が広く散る

  2. 2. Change

    セル座標で近傍を引く

  3. 3. Result

    近い粒子だけ比較

大量の粒子の近接判定を絞れる。時間変化を示す模式図です。実際の描画結果や処理速度を再現したものではありません。

How it works

  1. 1. Input

    粒子の位置

  2. 2. Process

    セル座標をハッシュ化

  3. 3. Result

    近傍セルの候補

A schematic of Spatial Hashing / Hash Grid. It shows the relationship between input, process, and result; exact values and rendering depend on the implementation.

Further reading

Box2D Collision ↗

A general reference for this subcategory.