Collision Detection: Algorithms and Applications
Total Page:16
File Type:pdf, Size:1020Kb
Collision Detection: Algorithms and Applications Ming C. Lin, U.S. Army Research Oce and University of North Carolina, Chapel Hil l, NC, USA Dinesh Mano cha, University of North Carolina, Chapel Hil l, NC, USA Jon Cohen, University of North Carolina, Chapel Hil l, NC, USA Stefan Gottschalk, University of North Carolina, Chapel Hil l, NC, USA http://www.cs.unc.edu/~geom/collide.html Fast and accurate col lision detection between general The most challenging problem in a simulation, geometric models is a fundamental problem in model- namely the collision phase, can b e separated into three ing, robotics, manufacturing and computer-simulated parts: collision detection, contact area determination, environments. Most of the earlier algorithm are either and collision resp onse. In this pap er, we address the restricted to a class of geometric models, say convex rst two elements by presenting general a purp ose col- polytopes, or are not fast enough for practical applica- lision detection and contact area determination algo- tions. We present an ecient and accurate algorithm rithm for simulations. The collision resp onse is appli- for col lision detection between general polygonal mod- cation dep endent. The algorithm rep orts the contact els in dynamic environments. The algorithm makes area and thus enables the application to compute an use of hierarchical representations along with frame to appropriate resp onse. frame coherencetorapid ly detect col lisions. It is ro- Our algorithm not only addresses interaction b e- bust and has been implementedaspart of public domain tween a pair of general p olygonal ob jects, but also large packages. In practice, it can accurately detect al l the environments consisting of hundreds of moving parts, contacts between large complex geometries composedof such as those encountered in the manufacturing plants. hundreds of thousands of polygons at interactive rates. Furthermore, we do not assume the motions of the ob- jects to b e expressed as a closed form function of time. 1 Intro duction Our collision detection scheme is ecient and accurate to the resolution of the mo dels. Collision detection is a fundamental problem in Given the geometric mo dels, the algorithm pre- rob otics, computer animation, physically-based mo d- computes the convex hull and a hierarchical representa- eling, molecular mo deling and computer simulated en- tion of each mo del in terms of oriented b ounding b oxes. vironments. In these applications, an ob ject's motion At runtime, it uses tight tting axis-aligned b ounding is constrained by collisions with other ob jects and by boxes to pair down the numb er of ob ject pair interac- other dynamic constraints. The problem has b een well tions to only those pairs within close proximity [12]. studied in the literature. For each pair of ob jects whose b ounding b oxes over- A realistic simulation system, which couples geomet- lap, the algorithm checks whether their convex hulls ric mo deling and physical prototyping, can provide a are intersecting based on the closest feature pairs [22]. useful to olset for applications in rob otics, CAD/CAM Finally for each ob ject pair whose convex hulls over- design, molecular mo deling, manufacturing design sim- lap, it makes use of oriented b ounding b ox hierarchy ulations, etc. Such systems create electronic represen- OBBTree to check for actual contact [18]. tations of mechanical parts, to ols, and machines, which need to b e tested for interconnectivity, functionality, and reliability. A fundamental comp onent of sucha Organization: The rest of the pap er is organized as system is to mo del ob ject interactions precisely. The follows: Section 2 reviews some of the previous work interactions mayinvolve ob jects in the simulation envi- in collision detection. Section 3 outlines the algorithm ronment pushing, striking, or smashing other ob jects. for pruning the numb er of ob ject pairs. We brie y Detecting col lisions and determining contact points is a describ e the closest feature and contact determination crucial step in p ortraying these interactions accurately. algorithms in Section 4. Finally,we describ e the imple- leftmark mentation and p erformance on di erent applications in at every time step can b ecome time consuming as N Section 5 and M get large. Toachieveinteractive rates, the total numb er of pairwise intersection tests must b e reduced b efore p erforming exact collision tests on the ob ject 2 Previous Work pairs, which are in the close vicinityofeach other. Sev- eral metho ds dealing with this situation are found in Collision detection has b een extensively studied in [7,12, 16]. Most metho ds use some typ e of a hierarchi- CAD, computer graphics, rob otics, and computational cal b ounding b oxscheme. Ob jects are surrounded by geometry. Since collision detection is needed in a wide b ounding b oxes. If the b ounding b oxes overlap, indi- variety of situations, many di erent metho ds have b een cating the ob jects are near each other, a more precise prop osed. Most of them make sp eci c assumptions collision test is applied. ab out the ob jects of interest and design a solution based on ob ject geometry or application domain. As for curved mo dels, algorithms based on inter- val arithmetic for collision detection are describ ed in Rob otics literature deals with collision detection in [15, 17]. These algorithms exp ect the motion of the the context of path planning. Using sophisticated ob jects to b e expressed as a closed form function of mathematical to ols, several algorithms have b een de- time. Moreover, the p erformance of interval arithmetic velop ed that plan collision-free paths for a rob ot in based algorithms is to o slow for interactive applica- restricted environments [8, 9]. However, in path plan- tions. Coherence based algorithms for curved mo dels ners based on p otential eld metho ds, collision detec- are presented in [24]. tion and distance computation are still considered as ma jor b ottlenecks [21,10]. In many CAD applications, the input mo dels are given as collections of p olygons with no top ology in- Most computational geometry literature deals with formation. Such mo dels are also known as `p olygon collision detection of ob jects in a static environment. soups' and their b oundaries mayhave cracks, T-joints, Ob jects are at a xed lo cation and orientation, and or mayhave non-manifold geometry. In general, no the algorithms determine whether they are intersecting robust techniques are known for cleaning such mo dels. [11, 13]. In most mo deling and graphics applications, Many of the algorithms describ ed are not applicable where many ob jects are in motion, such an approach to such mo dels. Rather techniques based on hierarchi- would b e inecient. Moreover, the ob jects move only cal b ounding volumes and and spatial decomp osition slightly from frame to frame and the collision detec- are used on such mo dels. Typical examples of b ound- tion scheme should take advantage of the information ing volumes include axis-aligned b oxes of which cub es from the previous frame to initialize the computation are a sp ecial case and spheres, and they are chosen for the current frame [3, 23]. Several solutions based for to the simplicity of nding collision b etween two on this idea of coherence have b een prop osed in [22]. suchvolumes. Hierarchical structures used for colli- Approaches that combine collision resp onse with de- sion detection include cone trees, k-d trees and o ctrees tection can b e found in [3, 33, 25]. The metho ds in [31], sphere trees [20,30], R-trees and their variants [32,33] make use of the b oundary representation to [5], trees based on S-b ounds [7] etc. Other spatial rep- detect collisions. resentations are based on BSP's [27] and its extensions Collision detection for multiple moving ob jects has to multi-space partitions [32], spatial representations recently b ecome a p opular research topic with the in- based on space-time b ounds or four-dimensional test- creased interest in large-scaled virtual prototyping en- ing [1,6,9, 20] and many more. All of these hierarchical vironments. For example, a vibratory parts feeder can metho ds do very well in p erforming \rejection tests", contain up to hundreds of mechanical parts moving si- whenever two ob jects are far apart. However, when the multaneously under p erio dical force impulses in a vi- two ob jects are in close proximity and can havemul- bratory b owl or tray. In a general simulation environ- tiple contacts, these algorithms either use sub division ment, there maybe N moving ob jects and M station- techniques or checkvery large numb er of b ounding vol- ary ob jects. EachoftheN moving ob jects can collide ume pairs for p otential contacts. In such cases, their with the other moving ob jects, as well as the stationary p erformance slows down considerably and they b ecome N ones. Keeping trackof +NM pairs of ob jects a ma jor b ottleneck in the simulation, as stated in [19]. 2 Collision Detection: Algorithms & Applications 3 Collision Detection b etween Multiple b ounding b oxes can overlap if and only if their inter- vals overlap in all three dimensions. Moving Ob jects We construct three lists, one for each dimension. We review our previous algorithm for multiple mov- Each list contains the values of the endp oints of the ing convex p olytop es in complex environments. Co- intervals in each corresp onding dimension.