Collision & spatial queries · 8 / 10

Sweep and Prune

軸上で重なる区間から衝突候補を選ぶ。

Compare in motion

動く物体の候補

Synchronized comparison
AReference
すべての区間を比較する

すべての区間を比較する

BSweep and Prune100%
衝突判定の前段を軽くできる

衝突判定の前段を軽くできる

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 Sweep and Prune. 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.