Collision Detection 1 2 Many Different Situations Many Different - - PDF document

collision detection
SMART_READER_LITE
LIVE PREVIEW

Collision Detection 1 2 Many Different Situations Many Different - - PDF document

2/12/2012 Many Different Situations Few moving objects, but complex geometry Collision Detection 1 2 Many Different Situations Many Different Situations Thin moving objects, with simple geometry Many simple objects 3 4 Many Different


slide-1
SLIDE 1

2/12/2012 1

Collision Detection

1

Many Different Situations

Few moving objects, but complex geometry

2

Many Different Situations

Thin moving objects, with simple geometry

3

Many Different Situations

Many simple objects

4

Many Different Situations

Many simple objects

5

Many Different Situations

Many contacts, deformable objects, ...

6

slide-2
SLIDE 2

2/12/2012 2

Many Different Situations

Real-time detection

7

Collision Detection Methods

Many different methods We will focus on two of them:

– Grid method: good for many simple moving

8

  • bjects of about the same size (e.g., many

moving discs with similar radii) – Bounding Volume Hierarchy (BVH) method: good for few moving objects with complex geometry

Grid Method

d

9

Subdivide space into a regular grid of cubic or square bins Index each object in a bin

Grid Method

d

10

Running time is proportional to number of moving objects

Enclose objects into bounding volumes (spheres or boxes) Check the bounding volumes first

Bounding Volume Hierarchy Method

11

Enclose objects into bounding volumes (spheres or boxes) Check the bounding volumes first Decompose an object into two

Bounding Volume Hierarchy Method

12

slide-3
SLIDE 3

2/12/2012 3

Enclose objects into bounding volumes (spheres or boxes) Check the bounding volumes first Decompose an object into two Proceed hierarchically

Bounding Volume Hierarchy Method

13

Enclose objects into bounding volumes (spheres or boxes) Check the bounding volumes first Decompose an object into two Proceed hierarchically

Bounding Volume Hierarchy Method

14

  • BVH is pre-computed for each object

Bounding Volume Hierarchy Method

15

BVH in 3D

16

Collision Detection

A B C A B C

17

Two objects described by their precomputed BVHs

D E F G D E F G

Collision Detection

AA

Search tree

18

A A

pruning

slide-4
SLIDE 4

2/12/2012 4 Collision Detection

AA

Search tree

A B C D E F G

19

CC CB BC BB A A

Collision Detection

AA

Search tree

A B C D E F G

20

CC CB BC BB

pruning

Collision Detection

AA

Search tree

A B C D E F G

21

CC CB BC BB GE GD FE FD G D

If the pieces contained in G and D

  • verlap collision

Collision Detection

Pruning discards subsets of the two

  • bjects that are separated by the BVs

Each path is followed until pruning or Each path is followed until pruning or until two leaves overlap When two leaves overlap, their contents are tested for overlap

Search Strategy

  • If there is no collision, all paths must eventually

be followed down to pruning or a leaf node

  • But if there is collision, it is desirable to detect

it as quickly as possible q y p

  • Greedy best-first search strategy with

f(N) = d/(rX+rY) [Expand the node XY with largest relative

  • verlap (most likely to

contain a collision)]

rX rY d

X Y

Performance

Several thousand collision checks per second for 2 three-dimensional

  • bjects each described by 500,000

triangles, on a 1-GHz PC

24

Faster when objects are well separated or have much overlap. Slower when objects barely overlap or are very close. Why?

slide-5
SLIDE 5

2/12/2012 5 Bad Case for BVH Desirable Properties of BVs and BVHs

BVs: Tightness BVH: Separation B l d t

26

Efficient testing Invariance Balanced tree

?

Desirable Properties of BVs and BVHs

BVs: Tightness BVH: Separation B l d t

27

Efficient testing Invariance Balanced tree

Spheres

Invariant Efficient to test But tight?

28

Axis-Aligned Bounding Box (AABB)

29

Axis-Aligned Bounding Box (AABB)

Not invariant Efficient to test Not tight

30

slide-6
SLIDE 6

2/12/2012 6

Oriented Bounding Box (OBB)

31

Invariant Less efficient to test Tight

Oriented Bounding Box (OBB)

32

Comparison of BVs

Sphere AABB OBB Tightness

  • +

33

Testing + +

  • Invariance yes

no yes

No type of BV is optimal for all situations

Desirable Properties of BVs and BVHs

BVs: Tightness BVH: Separation B l d t

?

34

Efficient testing Invariance Balanced tree

?

Desirable Properties of BVs and BVHs

BVs: Tightness BVH: Separation B l d t

35

Efficient testing Invariance Balanced tree

Construction of a BVH

Top-down construction At each step, create the two children of a BV Example: For OBB, split longest side at midpoint

36

p g p

slide-7
SLIDE 7

2/12/2012 7 Static vs. Dynamic Collision Detection

Static checks Dynamic checks

Usual Approach to Dynamic Checking (in PRM Planning)

2 3

1) Discretize path at some fine resolution ε 2) Test statically each intermediate configuration

< ε

ε too large collisions are missed ε too small slow test of local paths

1 2 3 2 3 3

ε too large collisions are missed ε too small slow test of local paths

Examples of Difficult Dynamic Collision Checking

Adaptive Bisection

Ideas: a) Relate configuration changes to path lengths in workspace b) Use distance computation rather than pure collision checking c) Bisect adaptively

Greedy Distance Computation

(same recursion as collision detection) Greedy-Distance(A,B)

1. If dist(A,B) > 0, then return dist(A,B) 2. If A and B are both leaves, then return distance between their contents 3. Switch A and B if A is a leaf, or if B is bigger and 3. Switch A and B if A is a leaf, or if B is bigger and not a leaf 4. Set A1 and A2 to be A’s children 5. d1 Greedy-Distance(A1,B) 6. If d1 > 0 then

  • a. d2 Greedy-Distance(A2,B)
  • b. If d2 > 0 then return Min(d1,d2)

7. Return 0

slide-8
SLIDE 8

2/12/2012 8 What about deformable objects?

43