Game Development Reference

In-Depth Information

()

A ray

PSV
intersects an infinite cylinder of radius
r
representing the

edge with endpoints

t

=+

t

E
and

E
at the parameter value

2

bb c

−−

−

t

=

,

a

where

(

)

2

VA

⋅

2

aV

=−

2

A

(

)(

)

SAVA

⋅

⋅

0

b

=⋅

SV

−

0

2

A

(

)

2

SA

⋅

2

2

0

c

=−−

S

r

0

2

A

AEE

SSE

=−

=−

2

1

1
.

0

The intersection occurs between the edge's endpoints if

()

]

2

0

<

[

PEA
.

t

−

⋅

<

A

1

Sliding

If an object traveling from the point
P
to
P
collides with a surface at the point

Q
, then the point
P
to which it should slide is given by

(

)

]

PP

=−

[

PQNN
,

−⋅

3

2

2

where
N
is the unit normal vector at the point
Q
.

Collision of Two Spheres

A sphere of radius
r
moving from the point
P
at time

=

to the point
P
at time

t

0

=

1

collides with another sphere of radius
r
moving from the point

Q
to the

t

point

Q
at time

(

)

(

)

(

)

−⋅

AB

−

AB

⋅

2

−

BA

2

2

− +

r r

2

P

Q

t

=

,

B

2

where

AP Q

BPP QQ
.

=−

=−− −

1

1

(

)

(

)

2

1

2

1

Search Nedrilad ::

Custom Search