고려대학교 그래픽스 연구실 chapter 6 collision detection 6.1~6.4 고려대학교...

29
고고고고고 고고고고 고고고 Chapter 6 Collision Detection 6.1~6.4 고고고고고 고고고고고고고 고고고

Upload: theodore-mills

Post on 17-Dec-2015

223 views

Category:

Documents


1 download

TRANSCRIPT

고려대학교 그래픽스 연구실

Chapter 6 Collision Detection

6.1~6.4

고려대학교 그래픽스연구실

민성환

19 September 2001 Sunghwan Min

The Type of Intersection

Three categories Linear component versus object (picking)

Chapter 5 already described

Object versus plane (culling) Chapter 4 described

Object versus object (general collision)

19 September 2001 Sunghwan Min

Design Issues

Hierarchical representation of objects for

collision purposes

Should the hierarchy be built top-down or

bottom-up? Top-down : decomposition of complex object

Bottom-up : construction the world from small models

Should the bounding volumes be built manually

or automatically? Automatic : not always generate a good set of volumes

Manual : can be time consuming

The best approach : mixture of the two

19 September 2001 Sunghwan Min

Design Issues (cont.)

How should the intersection information be

reported? To use callbacks

How should the propagation of the test collision

calls be controlled?

How much information should be retained about

the current collision state to support future test

collision calls?

19 September 2001 Sunghwan Min

Dynamic Objects and Lines

The line

The Object constant linear velocity

time interval

If Moving parallel to the line (Static test)

Presented here Determine only if the line and object will intersect on the time interval

DsP

W

],0[ maxtt0

WD

19 September 2001 Sunghwan Min

Spheres

The moving sphere has center

The distance C to the line is , where

If , then the line intersects the sphere

WtC

2

)()()(

DDD

PCDPCtD

DD

WDWtQ

2)( rtQ

cbtat 2: 2

|)(| 0DtPC

DD

PCDt

)(

0

19 September 2001 Sunghwan Min

Spheres

The problem is now one of determining the minimum of

Q on the interval Solve T=-b/a

If : the minimum is Q(T)

If T<0 : the minimum is Q(0)

If T>tmax: the minimum is Q(tmax)

Then compared to

0)( TQ],0[ maxtT

2r

19 September 2001 Sunghwan Min

Oriented Boxes

Static oriented box Rd>Rb+Rs : non intersection

Rb

Rs

LR

19 September 2001 Sunghwan Min

Oriented Boxes (cont.)

line the only potential separating axes for i=

0,1,2

For the motion case , is replaced by

If any of these tests are true do not intersect

12210 )( UDeUDePCDU

02201 )( UDeUDePCDU

01102 )( UDeUDePCDU

WtC

C

iUD

19 September 2001 Sunghwan Min

Capsules

The moving capsule is WtEuC

2

),( tutuQ

DDD

WDW

DDD

EDE

DDD

PCDPC

)(

)(

E

19 September 2001 Sunghwan Min

Lozenges

The moving lozenges is WtEuEuC

10

2),,( tvutvuQ

DDD

WDW

DDD

EDE

00

DDD

PCDPC

)(

)(DDD

EDE

11

E0

E1

19 September 2001 Sunghwan Min

Cylinders

An extremely complicated and some what expensive Not recommended for use as bounding volumes

19 September 2001 Sunghwan Min

Ellipsoids

Static ellipsoid

The line

The quadratic equation has a real

-valued root

1)()( CXMCX T

DsP

022 cbsas042 acb

1,,),(

McPCMDbDMDa TTT

19 September 2001 Sunghwan Min

Ellipsoids (cont.)

For a moving ellipsoid

The center is

01 btbb

0)2()()( 012

22

01 ctctcabtbtQ

WMWcWMcMc

WMDbMDbTTT

TT

210

10

,,1

,

WtC

012

2 2 ctctcc

19 September 2001 Sunghwan Min

Triangles

The plane of the triangles at time t

The line be

100 ,)( EEwhereNWNtVXN

DsP

19 September 2001 Sunghwan Min

Dynamic Objects and Planes

The Plane

The Object constant linear velocity

time interval

Presented here Determine only report an intersection time of t=0 when the object and plane

are initially intersecting

W

],0[ maxtt

dXN

19 September 2001 Sunghwan Min

Spheres

The moving center

The distance between center and plane

If initially intersecting

Else

The first time of contact T of the sphere

WtCtC

)(dtCN )(

rdCN 0

rdTCN )(

19 September 2001 Sunghwan Min

Oriented Boxes

The radius of the interval of the projected

box

Computation of the first time of contact T

is identical to that of a sphere versus a

plane

If initially intersecting

Else The first time of contact T of the sphere

2

0iii ANar

rdCN 0

rdTCN )(

19 September 2001 Sunghwan Min

Capsules

Line segment

And where

Define the signed distances

If initially intersecting

DstP

)(

DPP

01

dPN 00

dPN 11

010

P0 P1

D

19 September 2001 Sunghwan Min

Capsules (cont.)

The sign of decide which of

and is closer

Apply the intersection testing algorithm

between a sphere and a plane

DN

0P

1P

19 September 2001 Sunghwan Min

Lozenges

Lozenges is

The four corners

The signed distance

Not all positive or not all negative initially

intersecting

Applied to the sphere corresponding to

that corner

10 EvEuP

1011101

01000

,

,,

EEPPEPP

EPPPP

dPN ijij

P00 P10 E0

E1

P01 P11

19 September 2001 Sunghwan Min

Triangles

Let the three vertices be

Three signed distances for 0<= i <=2

Initially intersecting Not all positive or not all negative

The closest vertex use signed distance

iV

dVN ii

19 September 2001 Sunghwan Min

Static Object-Object

In this section determine if two of the same type or stati

onary objects

19 September 2001 Sunghwan Min

Spheres, Capsules, And Lozenges

Intersection dist < rsum*rsum

Sphere Capsule Lozenge

Sphere Dist(pnt,pnt) Dist(pnt,seg) Dist(pnt,rct)

Capsule Dist(seg,pnt) Dist(seg,seg) Dist(seg,rct)

Lozenge Dist(rct,pnt) Dist(rct,seg) Dist(rct,rct)

19 September 2001 Sunghwan Min

Oriented Boxes

Let first box have axes and extents

second box have axes and extents

The potential separating axe

2,1,0 AAA

2,1,0 aaa

2,1,0 BBB

2,1,0 bbb

L

19 September 2001 Sunghwan Min

Oriented Boxes (cont.)

15 separating axis

D

R0

R1

LR

a1A1a2A2

b1B1

b2B2

2

0

2

010

iii

iii BLbALaRRRDL

19 September 2001 Sunghwan Min

Oriented Boxes and Triangles

Let Box have axes and extents

Triangles have vertices and the edges of the triangles

are

2,1,0 AAA

2,1,0 aaa

2,1,0 UUU

012,021,100 EEEUUEUUE

19 September 2001 Sunghwan Min

Oriented Boxes and Triangles (cont.)

Non-intersection test

Min(p0,p1,p2) > R , max(p0,p1,p2)<-R

D

L

-R

a1A1a2A2

R

E1

E0p0

p1

p2

Min(ui) Max(ui)

19 September 2001 Sunghwan Min

Triangles

Non-intersection test

or

LMin(vi)

D

E0

E1 F1

F0

Max(vi)

Min(ui)

Max(ui)

p0

p1

p2 q0q1

q2

)(max)(min jjii qp )(min)(max jjii qp