Real-Time Collision Detection and Response Using Sphere-Trees
Real-Time Collision Detection and Response Using Sphere-Trees
Using Sphere-Trees
O'Sullivan, Carol and Dingliana, John1
Image Synthesis Group, Trinity College Dublin.
Abstract
In this paper we address the problem of collision
detection and response in real-time animation systems.
We describe an approach, which approximates objects
using sphere-trees, and uses an interruptible detection
algorithm to approximately test for collisions between
them, trading accuracy for speed. A model of human
visual perception of collisions is used to decide which
collisions deserve more processing time. Collision
processing is then scheduled to minimise the perceived
inaccuracy within the time available. In response to such
approximate collisions, a new adaptive collision response
algorithm is presented, which also uses sphere-trees to
approximate the appropriate response for colliding
objects.
1 Introduction
Many interactive animation systems, such as games or
simulations, require large numbers of virtual entities
which are moving and interacting with each other, and/or
with one or more users. In these applications, we cannot
predict in advance how the user or the entities will
behave, so we must create the animation as we watch it,
i.e. in real-time. This means that the image must be redrawn at least 10 times per second, although for true realtime performance the generation of up to 60 frames per
second (f.p.s) may be required. Hence, there will be 100
milliseconds available, at the most, to update all entities
in the simulation, and then render the new scene.
A possible scenario could be a game where a user
must navigate his/her way through a rockfall without
being hit. As multiple rocks are falling, they hit off each
other and the edges of a ravine, either bouncing or
breaking into smaller rocks. In order to achieve this
effect, collisions between the rocks and with the ravine
edges must be detected. Many other application areas
exist: Large-scale Virtual Reality (VR) systems with
thousands of moving entities; Crowd simulations; Flocks
of birds or other organisms; Educational simulations with
chemical molecules or blood cells. Anything, in fact,
where you have large numbers of entities moving around
a virtual world in real-time.
There are many bottlenecks in such systems.
Depending on the level of realism required, rendering and
motion synthesis algorithms require a large amount of
processing power. In multi-user systems, network lag is a
major issue. Some solutions to these problems could be to
1
{Carol.Sullivan | [email protected]}
2 Background
In many interactive real-time animation systems, such as
those described above, the entities often need to be
viewed not as geometric shapes devoid of physical
properties, but as real entities having properties such as
mass, moment of inertia, elasticity, and friction. Their
motions are constrained not only by their own physical
properties, but also by collisions with other objects. If two
solid objects collide in the real world, they bounce off
each other, or break into pieces, and deform if their
surfaces are non-rigid. In a computer world, there is
nothing to stop geometrically modelled objects from
simply floating through each other like ghosts! A
Collision Handling system is necessary to enforce
solidness, and ensure that entities behave as expected
2.1
Collision Detection
2.2
Collision Response
2.3
3 The Application
To apply and test the concepts and algorithms described
above, a real-time animation system has been developed.
This allows implementation and testing of various
different collision scheduling and testing strategies.
3.1
Overall design
DO
- Update positions of all objects
- Update all-pairs table by testing object bounding
boxes for overlaps in all three dimensions
- Generate active collision list from the all-pairs table
- Process active collision list, removing collisions as
they are resolved, placing detected collisions on the
real collision list, and discarding those where the
objects are found not to be touching.
- Process real collision list, computing the appropriate
collision response for each colliding pair.
- Draw all objects
UNTIL animation is terminated.
3.2
Initialisation
Set initial properties, i.e. colour, position, etc...
Generate sphere tree, centred at origin.
Update
Render
Initialisation
Maintain the links to the previous and next collisions
in the list
Intersection test: Tests one level of one sphere tree
against one sphere on the other tree. Section 3.3
discusses the sphere-tree intersection algorithm in
more detail.
Set collision priority: This is where we will use the
perceptual model, which is based on the results of
psychophysical and physiological studies.
3.3
Sphere trees.
3.3.1
3.
r=
3
2
r=
x2 + y 2 + z 2
2
3.4
Adding Interruption
2.
3.
4.
3.4.2
1.0
10
20
f(e,g)
30
0.0
0
320
e
Scheduling
O2
3.5
Collision Response
r1
O1
4 Conclusions
6a
6b
6c
Bibliography
[Baraff 97] Baraff, D. Physically Based Modelling.
SIGGRAPH 97 Course Notes.
[Baraff & Witkin 98] Baraff, D. and Andrew Witkin.
Physically Based Modelling. SIGGRAPH 98 Course
Notes.
[Barzel et al. 1996] Barzel, R. Hughes, J.F. Wood, D.N.
(1996) Plausible Motion Simulation for Computer
Graphics Animation. Computer Animation and
Simulation '96. 183-197.
[Chenny 97] Chenny, S. Culling Dynamical Systems in
Virtual Environments. 1997 Symposium on Interactive
3D Graphics.
[Cohen et al. 1995] Cohen, J.D. Lin, M.C. Manocha, D.
Ponamgi, M.K.(1995) I-COLLIDE: An Interactive and
Exact Collision Detection System for Large-Scaled
Environments. Proceedings of ACM Int. 3D Graphics
Conference. 189-196.
[Funkhouser and Sequin 1993] Funkhouser,T.A. Sequin,
C.H. (1993) Adaptive Display Algorithm for Interactive
Frame Rates During Visualization of Complex Virtual
Environments. SIGGRAPH '93 247-254.
[Hubbard 1995] Hubbard, P.M. (1995) Collision
Detection for Interactive Graphics Applications. IEEE
Transactions on Visualization and Computer Graphics.
1(3) 218-230.
[Hubbard 1996] Hubbard, P.M. (1996) Approximating
Polyhedra with Spheres for Time-Critical Collision
Detection. ACM Trans. on Graphics, 15(3) 179-210.
[Klosowski et al. 1998] Klosowski, J.T. Held, M.
Mitchell, J.S.B. Sowizral, H. Zikan, K. (1998) Efficient
Collision Detection Using Bounding Volume Hierarchies