Interactive Continuous Collision Detection between Deformable ...

12
Interactive Continuous Collision Detection between Deformable Models using Connectivity-Based Culling Min Tang * Sean Curtis * Sung-Eui Yoon http://gamma.cs.unc.edu/CBC/ Dinesh Manocha * Abstract We present an interactive algorithm for continuous collision detec- tion between deformable models. We introduce two techniques to improve the culling efficiency and reduce the number of potentially colliding triangle candidate pairs. First, we present a novel formu- lation for continuous normal cones and use these normal cones to efficiently cull large regions of the mesh from self-collision tests. Second, we exploit the mesh connectivity and introduce the con- cept of “orphan sets” to eliminate almost all redundant elementary tests between adjacent triangles. In particular, we can reduce the number of elementary tests by many orders of magnitude. These culling techniques have been combined with bounding volume hi- erarchies and can result in one order of magnitude performance im- provement as compared to prior algorithms for deformable models. We highlight the performance of our algorithm on several bench- marks, including cloth simulations, N-body simulations and break- ing objects. CR Categories: I.3.5 [Computing Methodologies]: Compu- tational Geometry and Object Modeling—Geometric algorithms; I.3.7 [Computing Methodologies]: Three-Dimensional Graphics and Realism—Visible surface algorithms, animation, virtual real- ity; Keywords: Continuous collision detection, deformable models, continuous normal cone, orphan set, self-collision 1 Introduction Interactive simulations with deforming or non-rigid objects are widely used in physically-based simulations, CAD/CAM, computer graphics and robotics. In order to generate physically realistic or plausible motions, these systems enforce non-penetration con- straints and need to detect all collisions between the primitives. The collision queries on deformable models can be classified into inter- object collisions between disjoint objects and self-collisions on a single object. Most of the prior work in deformable collision detection has been limited to discrete collision detection. These algorithms check for overlaps at a given time step in the simulation, and may miss col- lisions between the time steps. In order to resolve these prob- lems, many researchers have proposed algorithms for continuous collision detection (CCD) [Redon et al. 2002; Redon et al. 2004]. * University of North Carolina at Chapel Hill, USA Zhejiang University, China Korea Advanced Institute of Science and Technology (KAIST), South Korea CCD techniques model the motion between the discrete time in- stances using continuous paths and check these paths for colli- sions. The continuous algorithms are also used to perform time-of- contact computations for dynamic simulation and haptic rendering as well as local planning for sample-based motion planning algo- rithms [Foskey et al. 2001; Zhang and Manocha 2008]. In this paper, we address the problem of fast and accurate CCD between deformable models. Accuracy is very important feature for various applications including cloth simulation, where a single missed collision can result in an invalid simulation or noticeable artifacts [Bridson et al. 2002; Baraff et al. 2003]. However, per- forming CCD between complex deformable models at interactive rates still remains a major challenge [Hutter and Fuhrmann 2007]. Prior algorithms for interactive CCD are mainly limited to rigid and articulated models. Many fast algorithms based on bounding vol- ume hierarchies and GPU-based accelerations have been proposed for deformable models, but they are not fast enough for interactive applications. Main Results: We present an interactive algorithm for CCD com- putation between complex deformable models including breaking objects. Our approach is applicable to all triangulated models and exploits the connectivity information between adjacent triangles in a mesh-based representation. We utilize this connectivity informa- tion to perform high-level and low-level culling to significantly re- duce the number of elementary tests between triangle primitives. Specifically, we introduce two novel concepts: 1. Continuous Normal Cone test for self-collisions: We extend the well-known normal cone test for discrete collision detection [Volino and Thalmann 1994; Provot 1997] to CCD. Our formu- lation computes a tight bound on the range of normals for triangles under a wide variety of continuous motions. We represent con- tinuous normal cones using Bernstein basis functions. We use the convexity properties to construct normal cone efficiently. Further- more, we also present a fast continuous contour test method along with the Continuous Normal Cone. 2. Orphan Set: We decompose potentially colliding triangle pairs into two sets: non-adjacent and adjacent, to perform the elementary tests between the primitives. We provide an optimal bound on the maximum number of elementary tests required between adjacent triangle pairs. We introduce the notion of an orphan set of a mesh based on the connectivity between the triangles and show that only the primitives in the orphan sets need to be checked for exact col- lision detection among all adjacent pairs. In our benchmarks, the ”Orphan Set” formulation reduces the number of elementary tests between adjacent triangle primitives by almost three orders of mag- nitude. We use a two-level bounding volume hierarchy (BVH) and use it to handle multiple-object simulations (including breaking objects) as well as self-collisions. We have applied the algorithm to many complex deformable models composed of tens or hundreds of thou- sands of triangles. Our algorithm can compute either the first time- of-contact or the full set of collisions during the continuous time domain in tens or hundreds of milliseconds. As compared to prior approaches, our algorithm offers the following benefits:

Transcript of Interactive Continuous Collision Detection between Deformable ...

Interactive Continuous Collision Detection between Deformable Models usi ngConnectivity-Based Culling

Min Tang†∗ Sean Curtis∗ Sung-Eui Yoon‡http://gamma.cs.unc.edu/CBC/

Dinesh Manocha∗

Abstract

We present an interactive algorithm for continuous collision detec-tion between deformable models. We introduce two techniques toimprove the culling efficiency and reduce the number of potentiallycolliding triangle candidate pairs. First, we present a novel formu-lation for continuous normal cones and use these normal cones toefficiently cull large regions of the mesh from self-collision tests.Second, we exploit the mesh connectivity and introduce the con-cept of “orphan sets” to eliminate almost all redundant elementarytests between adjacent triangles. In particular, we can reduce thenumber of elementary tests by many orders of magnitude. Theseculling techniques have been combined with bounding volume hi-erarchies and can result in one order of magnitude performance im-provement as compared to prior algorithms for deformable models.We highlight the performance of our algorithm on several bench-marks, including cloth simulations, N-body simulations and break-ing objects.

CR Categories: I.3.5 [Computing Methodologies]: Compu-tational Geometry and Object Modeling—Geometric algorithms;I.3.7 [Computing Methodologies]: Three-Dimensional Graphicsand Realism—Visible surface algorithms, animation, virtual real-ity;

Keywords: Continuous collision detection, deformable models,continuous normal cone, orphan set, self-collision

1 Introduction

Interactive simulations with deforming or non-rigid objects arewidely used in physically-based simulations, CAD/CAM, computergraphics and robotics. In order to generate physically realisticor plausible motions, these systems enforce non-penetration con-straints and need to detect all collisions between the primitives. Thecollision queries on deformable models can be classified into inter-object collisions between disjoint objects and self-collisions on asingle object.

Most of the prior work in deformable collision detection has beenlimited to discrete collision detection. These algorithms check foroverlaps at a given time step in the simulation, and may miss col-lisions between the time steps. In order to resolve these prob-lems, many researchers have proposed algorithms forcontinuouscollision detection(CCD) [Redon et al. 2002; Redon et al. 2004].

∗University of North Carolina at Chapel Hill, USA† Zhejiang University, China‡ Korea Advanced Institute of Science and Technology (KAIST), South

Korea

CCD techniques model the motion between the discrete time in-stances using continuous paths and check these paths for colli-sions. The continuous algorithms are also used to perform time-of-contact computations for dynamic simulation and haptic renderingas well as local planning for sample-based motion planning algo-rithms [Foskey et al. 2001; Zhang and Manocha 2008].

In this paper, we address the problem of fast and accurate CCDbetween deformable models. Accuracy is very important featurefor various applications including cloth simulation, where a singlemissed collision can result in an invalid simulation or noticeableartifacts [Bridson et al. 2002; Baraff et al. 2003]. However, per-forming CCD between complex deformable models at interactiverates still remains a major challenge [Hutter and Fuhrmann 2007].Prior algorithms for interactive CCD are mainly limited to rigid andarticulated models. Many fast algorithms based on bounding vol-ume hierarchies and GPU-based accelerations have been proposedfor deformable models, but they are not fast enough for interactiveapplications.

Main Results: We present an interactive algorithm for CCD com-putation between complex deformable models including breakingobjects. Our approach is applicable to all triangulated models andexploits the connectivity information between adjacent triangles ina mesh-based representation. We utilize this connectivity informa-tion to perform high-level and low-level culling to significantly re-duce the number of elementary tests between triangle primitives.Specifically, we introduce two novel concepts:

1. Continuous Normal Cone test for self-collisions:We extendthe well-known normal cone test for discrete collision detection[Volino and Thalmann 1994; Provot 1997] to CCD. Our formu-lation computes a tight bound on the range of normals for trianglesunder a wide variety of continuous motions. We represent con-tinuous normal cones using Bernstein basis functions. We use theconvexity properties to construct normal cone efficiently. Further-more, we also present a fast continuous contour test method alongwith the Continuous Normal Cone.

2. Orphan Set: We decompose potentially colliding triangle pairsinto two sets: non-adjacent and adjacent, to perform the elementarytests between the primitives. We provide an optimal bound on themaximum number of elementary tests required between adjacenttriangle pairs. We introduce the notion of anorphan setof a meshbased on the connectivity between the triangles and show that onlythe primitives in the orphan sets need to be checked for exact col-lision detection among all adjacent pairs. In our benchmarks, the”Orphan Set” formulation reduces the number of elementary testsbetween adjacent triangle primitives by almost three orders of mag-nitude.

We use a two-level bounding volume hierarchy (BVH) and use itto handle multiple-object simulations (including breaking objects)as well as self-collisions. We have applied the algorithm to manycomplex deformable models composed of tens or hundreds of thou-sands of triangles. Our algorithm can compute either the first time-of-contact or the full set of collisions during the continuous timedomain in tens or hundreds of milliseconds. As compared to priorapproaches, our algorithm offers the following benefits:

• Generality: Our approach is applicable to various kindsof models and deformable simulations. These include self-collisions, inter-object collisions between multiple objects(i.e. N-body collisions), and breaking objects.

• High culling efficiency: We are able to achieve high cullingefficiency and reduce the number of false positives by almosttwo orders of magnitude in complex simulations.

• Interactive performance: Our hierarchy update and traver-sal algorithms have small overhead. As compared to priorCCD algorithms, we observe considerable performance im-provement in our benchmarks.

Organization: The rest of the paper is organized as follows: Sec. 2gives a brief survey of prior work in collision detections. We intro-duce our notation and give an overview of our approach in Sec. 3.The culling techniques are described in Sec. 4 and Sec. 5. Wepresent a two-level hierarchy, overall algorithm, and the resultsfrom our implementation in Sec. 6. We compare its performancewith prior approaches in Sec. 7.

2 Related Work

Collision detection has been widely studied in computer graph-ics, robotics, and computational geometry literature [Ericson 2004;Teschner et al. 2005]. In this section, we give a brief overview ofprior work on collision detection between deformable models.

2.1 Bounding Volume Hierarchies

Bounding volume hierarchies (BVHs) have been widely used to ac-celerate the performance of collision detection algorithms betweenrigid and deformable models. Examples of BVHs include spheretrees [Hubbard 1993; Bradshaw and O’Sullivan 2004], axis-alignedbounding box (AABB) trees [van den Bergen 1997], hierarchiesbased on tight fitting bounding volumes (BVs) such as orientedbounding boxes [Gottschalk et al. 1996], discretely oriented poly-topes (k-DOPs) [Klosowski et al. 1998], or hybrid combination ofBVs [Sanna and Milani 2004].

Most algorithms for deformable models typically use simple BVssuch as spheres or AABBs and recompute the BVH during eachframe [Teschner et al. 2005]. Approaches to compute dynamicBVHs include refitting algorithms to update these hierarchies [Lars-son and Akenine-Moller 2006; Lauterbach et al. 2006; James andPai 2004; Zachmann and Weller 2006], and performing dynamic orselective restructuring [Otaduy et al. 2007; Yoon et al. 2007].

2.2 Deformable Models

There is considerable literature on efficient collision checking be-tween deformable models. These include efficient algorithms basedon normal cone culling and GPU-based approaches. [van denBergen 1997] presents an early approach using refitting for de-formable models.

Normal Cone Culling: Volino and Thalmann [Volino and Thal-mann 1994] proposed a culling technique for efficient self-collisiondetection at discrete time steps using bounds on the normals. Thismethod takes advantage of the topology and connectivity of themesh and checks for self-collision by using normal cones and twodimensional contour tests. They can be combined with hierarchicalapproaches to handle highly tessellated models [Mezger et al. 2003;Provot 1997; Volino and Thalmann 2000]. We extend this normalcone culling method to continuous collision detection.

GPU-based Algorithms: The rasterization capabilities of com-modity GPUs have been used for fast collision detection betweendeformable models [Heidelberger et al. 2003; Knott and Pai 2003;Govindaraju et al. 2004]. These include many specialized algo-rithms for self-collision detection [Heidelberger et al. 2004; Govin-daraju et al. 2005; Sud et al. 2004; Sud et al. 2006]. Some of theseapproaches are limited in terms of handling the type of input models(e.g. closed objects or fixed mesh connectivity). Furthermore, theirperformance can vary based on the support of occlusion queries orread-backs from GPUs. We perform a detailed comparison withthese approaches in Section 7.

2.3 Continuous Collision Detection

CCD algorithms check for collisions in the continuous time inter-val between two discrete time steps. These include interactive al-gorithms for rigid models [Redon et al. 2002] and articulated mod-els [Redon et al. 2004; Zhang et al. 2007] that are based on tight-fitting pre-computed hierarchies. CCD techniques for deformablemodels [Govindaraju et al. 2005; Wong and Baciu 2005; Hutterand Fuhrmann 2007] are mostly limited to models with fixed con-nectivity. We compare the performance of our algorithm with theseapproaches in Section 7.

3 Overview

In this section, we introduce the notation used in the rest of thepaper and give an overview of our approach.

3.1 Notation and Definitions

We use the symbolsV , E, F , andT to represent vertices, edges,faces, and triangles, respectively. We use lower-case symbolsv,e, f , and t to denote a specific vertex, edge, face, and triangle,respectively. The vector quantities are written in bold face, e.g.,n for the normal of a triangle. Also, we use{vi, fj} to denote apairwise relationship between two mesh elements, in this case,vi

andfj .

Our CCD algorithm is applicable to triangulated meshes. We re-fer to each connected mesh as anobject and the simulation mayconsists of one or more objects. We do not make any assumptionsabout the motion of any object or its deformation. Furthermore,the number of objects can change due to topological changes, suchas breakage. We use the symbolOi to represent an object and letM i represent its mesh. EachM i is represented as triangles withthe connectivity and adjacency information, i.e., its vertices, edges,and adjacent triangles. We denote the time interval, in which weperform CCD, to be[0, 1]. Let M i

t denote the configuration of amesh at timet ∈ [0, 1]. Let M i

0 andM i1 represent the configura-

tion of meshi at the two discrete time steps ,0 and1. As a result,the motion of each triangle during this time interval sweeps out atriangular prism1.

3.2 Continuous Collision Detection

In order to compute the first time-of-contact or the set of all col-lisions, we perform continuous collision detection, including self-intersection, on the meshes. We assume that we know the positionof each vertex in the meshes at every discrete time step. We alsoassume the position of each vertex, between time steps, is defined

1It is not strictly a prism. Here we just use the term for the volumeformed by a swept triangle.

0n 1n)( tF( b ) a “ p r i s m ” f o r m e d b y t h ed e f o r m i n g t r i a n g l e( a ) a d e f o r m i n g t r i a n g l ew i t h m o t i o n i n t e r p o l a t i o nd e f i n e d b y )( tF

Figure 1: Triangle under continuous motion through interpo-lation: For the triangle under the motion defined byF (t), its swepttrajectory forms a “prism”.

by some continuous interpolation function. Let a polynomial func-tion F (t), of time t, represent the interpolating function for vertexposition.

In the simplest case,F (t) is a linear function. Detecting colli-sions between two triangles in motion reduces to performing pair-wise vertex-face (VF) and edge-edge (EE) elementary tests [Provot1997; Bridson et al. 2002]. These VF and EE elementary tests re-quire solving cubic algebraic equations, which are derived from co-planarity conditions. For two arbitrary triangles, we would need toperform 15 tests: 6 VF and 9 EE tests. For a linear interpolatingfunction, these tests involve finding the roots of a cubic equation.

When F (t) is a polynomial function with degreed (d > 1), asshown in Figure 1, the resulting test becomes more complex. Westill need to perform 15 VF and EE elementary tests, but the equa-tions we need to have solved would have degree3d. For example,if we used cubic spline functions asF (t), we would need to findthe roots of an equation with degree 9. Solving these higher orderequations can be expensive and result in numerical inaccuracies. Asa result, most deformable applications use an linearly interpolatingmotion between the discrete instances.

3.3 BVHs for CCD

Most prior algorithms for CCD between complex models useBVHs. At each frame, these algorithms update the BVHs basedon the new position of the swept triangles and traverse the BVHsto check for overlaps. Eventually, they perform elementary tests onthe triangular prisms to check for exact collisions during the[0, 1]time interval. However, the performance of these algorithms is gov-erned by two factors:

1. Culling Efficiency of BVH: How well a BVH fits the meshit is supposed to approximate directly affects its culling efficiency.In scenes with extreme deformations, the BVH computed for oneframe may not provide good efficiency for the next frame and needsto be updated or recomputed. Many prior algorithms for collisiondetection between general deformable models use refitting algo-rithms [van den Bergen 1997; Larsson and Akenine-Moller 2006;Zachmann and Weller 2006; Govindaraju et al. 2005], and they maynot work well on scenes with changing topologies.

2. High number of false positives: Self-collision detection isperformed by recursively checking the BVs for overlap with otherBVs. Given that the BVs of adjacent (or nearby) triangle primitivesoverlap, the hierarchical traversal does not cull many primitives at

the lower level of the tree and reaches all the leaf nodes of the hi-erarchy. As a result, these algorithms perform exact collision testson a high number of triangle pairs, very few of which actually in-tersect, resulting in a very high number of false positives.

3.4 Our Approach

We improve the performance of CCD algorithm by using novelculling techniques and a hierarchical representation which maxi-mizes the effect of those culling techniques. Specifically, we intro-duce a novel two-level dynamic BVH based on k-DOPs that hasa low update cost and can provide high culling efficiency. Thetwo-level hierarchy is computed based on the connectivity of theprimitives, and we use a combination of refitting and selective re-structuring algorithms to update them.

During the traversal of our two-level dynamic BVH, we cull inter-section candidates at two-levels. We first performhigh-level cullingbased on a novel continuous normal cone (CNC) formulation. TheCNC test consists of the creation of a cone which bounds the direc-tion of all the normals of a surface in a time interval and a contin-uous contour test which detects collisions on the boundary of thesurface in the same interval. These two tests, taken together, aresufficient to eliminate large regions of the mesh from considerationfor self-intersection. The CNCs are associated with nodes in thehierarchy and are computed in a bottom-up manner. We use a com-pact representation of CNCs based on Bernstein basis functions,which have low storage and runtime overhead. These CNC testswork particularly well in culling the regions of the mesh with lowcurvature.

Our approach also performslow-level cullingby reducing the num-ber of elementary tests. Many authors have observed that there isno need to perform all of the 15 elementary tests between adjacenttriangles, i.e. a triangle pair that shares an edge or a vertex [Govin-daraju et al. 2005]. We introduce the concept of an orphan set toexploit the topological and connectivity relationships between ad-jacent triangles. The tests which belong to the orphan set represent,in some sense, the optimal number of elementary tests between ad-jacent triangles.

4 High-Level Culling

In this section, we present a novel high-level culling algorithm thatsignificantly reduces the number of false positives, leading to moreefficient execution of self-intersection queries.

One of the most expensive computations in deformable models isself-collision detection. Prior methods for self-collisions based onnormal cones are limited to discrete collision detection. We extendthem to CCD and present a compact representation to compute anormal cone and quickly check for collisions.

Given a continuous surface, S, bounded by a contour, C, Volino andThalmann [Volino and Thalmann 1994] presented a sufficient crite-rion for no self-intersection based on the following two conditions:

1. Bounds on the normals:There is a vector,V, such that (N ·V) > 0 for every point of the surface, S, whereN is the normalvector for a point of the surface.

2. No self-intersections on the boundary:The projection ofthe contour C along the vectorV does not have any self-intersections on the projected plane.

The second condition is also called thecontour test. Provot [Provot1997] presented an efficient method to implement the first conditionbased on normal cones.

0a 1a0b 0c0n 0ntn 1n 1n 2 )( .nn 10 !

( a ) a d e f o r m i n g t r i a n g l e ( b ) c o n t i n u o u s n o r m a lc o n e o f t h e t r i a n g l e1b 1cta tb tc

Figure 2: Continuous normal range of a deforming triangle:For a deforming triangle, we construct a CNC that containsn0,n1, and(n0 + n1 − δ)/2.

In order to extend these tests to CCD, we need to developcontinuous-versions of these tests over the range of normals andcontours in the intervalt ∈ [0, 1].

4.1 CNC: Continuous Normal Cone

In order to use the normal cone for CCD, we compute a normal conethat bounds the normals of the deforming triangles in the entire in-terval. Leta0,b0, c0 anda1,b1, c1 to be positions of the verticesof the triangles at the time frame0 and1, respectively, as shownin Figure 2(a). Also, let us define~va = a1 − a0, ~vb = b1 − b0,and ~vc = c1 − c0. Assuming the vertices of the triangles are un-der linearly interpolating motion, we use the following theorem tocompute normal cones:

CNC Theorem: Given the start and end positions of the verticesof a triangle during the interval[0, 1], whose positions are linearlyinterpolated in the interval with respect to the time variable,t, thenormal,nt, of the triangle, at timet, is given by the equation:

nt = n0·B2

0(t) + (n0 + n1 − δ)/2 · B2

1(t) + n1·B2

2(t),

where n0 = (b0 − a0) × (c0 − a0),n1 = (b1 − a1) × (c1 − a1), δ = (~vb − ~va) × (~vc − ~va),andB2

i (t) is theith basis function of the Bernstein polynomials ofdegree 2.

Proof We define the following terms: at = a0 + ~va · t,bt = b0 + ~vb · t, ct = c0 + ~vc · t. The normal vector of triangle△atbtct is given as:

nt = (bt − at) × (ct − at)

= [(b0 − a0) + ( ~vb − ~va) · t] × [(c0 − a0) + ( ~vc − ~va) · t]

= (b0 − a0) × (c0 − a0) + ( ~vb − ~va) × (c0 − a0) · t +

(b0 − a0) × ( ~vc − ~va) · t +

( ~vb − ~va) × ( ~vc − ~va) · t2. (1)

Let n0 andn1 be the normal vectors of triangle△a0b0c0 and△a1b1c1, respectively. Then:

n0 = (b0 − a0) × (c0 − a0), (2)

n1 = (b1 − a1) × (c1 − a1)

= (b0 + ~vb − a0 − ~va) × (c0 + ~vc − a0 − ~va)

= (b0 − a0) × (c0 − a0) + ( ~vb − ~va) × (c0 − a0)+

(b0 − a0) × ( ~vc − ~va) + ( ~vb − ~va) × ( ~vc − ~va).(3)

Based on above equations, we obtain:

n1 − n0 = ( ~vb − ~va) × (c0 − a0) + (b0 − a0) × ( ~vc − ~va)+

( ~vb − ~va) × ( ~vc − ~va). (4)

We define:δ = ( ~vb − ~va) × ( ~vc − ~va). (5)

Then from equations (4) and (5):

n1 − n0 − δ = ( ~vb − ~va) × (c0 − a0) + (b0 − a0) × ( ~vc − ~va).(6)

By plugging the equations (2),(5), and (6) into equation (1),nt canbe represented as:

nt = n0 + (n1 − n0 − δ) · t + δ · t2

= n0 · (1 − t)2 + (n0 + n1 − δ)/2 · 2t · (1 − t) + n1 · t2

= n0 · B2

0(t) + (n0 + n1 − δ)/2 · B2

1(t) + n1 · B2

2(t).

We take advantage of the convex hull property associated with con-trol points of Bernstein basis to compute a bound on CNCs. For agiven triangle, the range ofnt is bounded by thecontrol vertices; inour case, those control vertices aren0, n1, and(n0 + n1 − δ)/2.We use these three vectors to construct a CNC for each trianglein the interval, as shown in Figure 2(b). Particularly, we use themethod proposed in [Provot 1997] to construct an axis and an apexangle of a normal cone from three vectors. Then, the CNCs will bemerged as described in [Provot 1997] by traversing the hierarchy ina bottom-up manner while the BVH is refitting.

Extension to other interpolating functions: In our derivation, theCNC is defined with the assumption that the position of the deform-ing vertices are linearly interpolated (i.e.,F (t) is linear). But forhigher-order functions, e.g. quadratic, cubic, etc., the CNC equa-tion for other motions, e.g., polynomial interpolation, the CNCequation can be similarly derived. The result would produce alarger set of control points for the higher-order Bernstein functions.When theF (t) is a polynomial function with degreed, a Bernsteinbasis with degree2d will be used to perform the continuous normalcone test.

4.2 CCT: Continuous Contour Test

Computing the continuous normal cone covers the first conditionfor showing no self-intersections. We still require the second condi-tion: a collision-free boundary for a moving surface. This typicallyinvolves computing a projection of the contour ofS and checkingfor self-intersections. Even in the case of discrete collision detec-tion, the contour test can be an expensive operation. Some prior al-gorithms either omit it under standard geometrical contexts [Volinoand Thalmann 1994] or use some approximations [Provot 1997;Mezger et al. 2003]. In this section, we present an exact, but effi-cient contour tests method for CCD. At a high level, we transformthe contour tests into intersection tests between two edges that lieon the same plane. We refer to them asplanar (E,E) tests, in or-der to differentiate it from the EE elementary tests used in CCD tocheck whether two swept edges overlap.

Planar (E,E) Tests: Given a node in the BVH with a CNCC(α,ax), whereα is the apex angle, andax is the axis of thecone. We project the boundary edges of the connected mesh asso-ciated with the node to a plane defined byax and check for self-intersection among the projected edges.

We illustrate our approach with a simple example. Consider thetwo edgesab and cd in Figure 3(a). The vertices representingtheir positions area0,b0, c0,d0 at t = 0, anda1,b1, c1,d1, at

( a )0 1

0 10 11 0 ( b ) ( c )

0 1 0 100

00

0 1Figure 3: Planar (E,E) tests : Checking whether two co-planaredgesab and cd (shown in (a)) intersect during the interval re-duces to discrete line segment intersection test (b) and VE tests (c).

t = 1. In order to check whether any projection of these two edgesintersect duringt ∈ [0, 1], we preform the following tests:

1. Discrete line segment intersection test:A discrete line seg-ment intersection betweena0b0 andc0d0 at t = 0 is shownin Figure 3(b). If these discrete segments do not intersect, weneed to further test to ensure there is no intersection duringt ∈ (0, 1];

2. Vertex/edge(VE) elementary test: Suppose the two deform-ing edge segments intersect during the interval. Lett ∈ (0, 1]be the time of first contact between them. For two movingedges, there is only one case of elementary contact type: onevertex of an edge just touches another edge. Analogous to theelementary tests between the triangles, i.e. VF or EE tests,we need to perform the VE test in the plane. Take the case inFigure 3(c), and it boils down to 4 VE tests that are based onthe following combinations: vertexa with edgecd, vertexbwith edgecd, vertexc with edgeab, and vertexd with edgeab. If any of these four tests returns a true value, that impliesan intersection between deforming edgesab andcd.

We use the following theorem to perform a (V,E) test in a plane.

VE Test Theorem: Suppose that a vertexa and an edgecdundergo linear deformation in the time interval[0, 1]. Leta0,b0, c0,d0 be the positions of all the vertices att = 0, anda1,b1, c1,d1 be the positions att = 1, respectively, as shown inFigure 3(c). Also, let us define~va = a1 − a0, ~vc = c1 − c0, and~vd = d1 − d0. Then, the intersection between the edge and thevertex is governed by the root of the following equation:

(a0 − d0) × (c0 − d0) + [( ~va − ~vd) × (c0 − d0) + (a0 − d0)

×( ~vc − ~vd)] · t + ( ~va − ~vd) × ( ~vc − ~vd) · t2 = 0. (7)

Proof Suppose the deforming vertex overlaps with the deformingedge, then we get

(a − d) × (c − d) = 0.

Based on the equationsa = a0 + ~va · t, c = c0 + ~vc · t, andd = d0 + ~vd · t, we get the equation (7).

After computing the intersection, a trivial test is used to ensure itlies between the two ends of the edge. Based on the above theorem,the problem of planar (E, E) tests can be solved by solving fourquadratic equations. A naive implementation would perform pla-nar (E, E) tests among all pairs inO(N2) complexity, whereN isthe number of the edges in the contour. We use many accelerationtechniques to speed up the computation. Those include:

1. Bounding box culling: We compute a k-DOP for each de-forming edge swept over the time interval[0, 1]. If the k-DOPs of two boundary edges do not overlap, the edges cannotintersect.

2. Fewer projections: The projected boundary edges used forthe parent nodes can be directly reused for the children nodes.As a result, only a few additional boundary edges need to beprojected for successive child nodes. We maintain a cachethat contains the boundary edges used for the parent nodes.We store boundary edges in the cache only if the normal conetest is satisfied, but the contour tests fails. This is performedas part of the process of hierarchy traversal.

3. Fewer intersections: If two contour edges for a particularnode intersect, then any descendant node that has those edgesin its contour will also fail the continuous contour test. So, wedo not perform the test on children nodes.

These optimizations are easy to implement and can result in consid-erable speedups in many benchmarks. As an example, we are ableto improve the performance of continuous contour test by 93% forthe cloth-simulation benchmark (Fig. 11) based on these accelera-tions.

Robustness:As pointed out by Andersson et al. [Andersson et al.2006], there are several pitfalls to use the criterion of [Volino andThalmann 1994]. In our definition of CNC and CCT, thesimpleconnectednessis ensured by storing connected triangles at BVHnodes, andnon-selfintersection of projected contouris checked atCCT phase. All of these enhance the robustness of our algorithm.

5 Orphan Set

In the previous section, we present a test to cull potentially largeregions of the mesh from consideration for self-intersection. Ulti-mately, we must test for collisions in the remaining regions. To per-form these tests, we logically partition the candidate triangle pairsinto two sets: non-adjacent and adjacent pairs. The initial phaseculls the non-adjacent triangle pairs to find potentially colliding tri-angle pairs. We perform exact collision tests on those pairs. Thesecond phase uses the novel concept of anorphan setto performthe optimal number of tests between adjacent triangle pairs.

5.1 Non-adjacent Phase

The high-level culling produces non-adjacent triangle pairs whosebounding volumes overlap. For each of these pairs we exhaustivelyperform all 15 elementary tests. By virtue of their non-adjacency,we know that any intersection detected is meaningful. The samecan’t be said for adjacent pairs.

As we perform these tests between the non-adjacent triangle pairswe will inherently encounter redundant tests since an edge or vertexcan be shared by multiple triangles. We use an efficient databasestructure to record which(V, F ) and (E, E) pairs have alreadybeen tested. For a given non-adjacent triangle pair we examine eachof the 15 elementary tests and determine if that test has already beenperformed and stored in the database. If it has not, we add it to thedatabase and perform the test.

5.2 Adjacent Phase

Many researchers [Govindaraju et al. 2005; Hutter and Fuhrmann2007; Wong and Baciu 2006] have observed that for a given pair ofadjacent triangles, not all 15 elementary tests are necessary. If twotriangles are adjacent, then some subset of the 15 elementary testsoperate on adjacent elements. Adjacent elements trivially intersectand the results of tests on them would be meaningless.

Beyond that, some have recognized that the results of the non-adjacent phase could be used to further reduce the number of testsbetween adjacent pairs [Govindaraju et al. 2005]. Figure 4 shows

Figure 4: Elementary tests for adjacent triangles:Two adjacenttriangles (ta and tb) share a common edge. Only four elementarytests are necessary:{e1

b , e1

a}, {e2

b , e2

a}, {va, tb}, and{vb, ta}. Ofthose four tests, there is a non-adjacent triangle pair which wouldperform the same tests. They are:{te, tf}, {tc, td}, {tg, tb}, and{th, ta}, respectively.

Figure 5: OIS and OAS for a vertex and an edge:(a) showstheOIS andOAS for the vertexv. Vertexv forms an orphan pairwith facea5. (b) shows theOIS andOAS for the edgee. Edgee,likewise, forms an orphan pair with (but not limited to) edgeeo.

a typical example of two edge adjacent triangles:ta andtb. Onlyfour tests are actually meaningful:{va, tb}, {vb, ta}, {e1

b , e1

a}, and{e2

b , e2

a}.

Now consider the non-adjacent triangle pair (tb, tg). If, during thenon-adjacent phase,tb and tg have been tested and foundnot tointersect we can easily argue that the test{va, tb} cannot produce acollision. So, the test is unnecessary.

Directly exploiting this relationship requires that some form ofdatabase be maintained. The database would store the results ofthe non-adjacent phase. The adjacent phase would use the databaseto determine if a particular test on an adjacent pair is necessary. Forany particular element pair on an adjacent pair of triangles, the non-adjacent triangle pair, whose collision state could justify summarydismissal of the elementary test, is dependent on both the type ofelement pair and the nature of the adjacency between the adjacenttriangles. Each adjacent triangle pair could require multiple uniquedatabase queries (as seen in [Govindaraju et al. 2005].)

This idea can be taken much farther and made far more efficient.The cost (in both memory and query time) of the database is un-necessary because the adjacent tests that need to be evaluated arepurely dependent on the topology of the mesh. The concept of theorphan set formalizes this relationship and provides an optimal setof tests to perform without elaborate run-time data structures, com-plex algorithms or cache-antagonistic random memory accesses.

5.3 Orphan Pairs and Tests

Simply put, orphan tests are the elementary tests between adjacenttriangles thatdon’t get performed during the non-adjacent phase.More precisely, an orphan test is a test between an elementary pair(edge-edge or vertex-face) for which no pair of triangles exists such

Figure 6: Internal orphans: The element pair in (a), (v, a1), is aninternal orphan pair. The pyramids in (b) and (c) consist of nothingbut orphan pairs.

that each triangle is incident to one of the elements and both trian-gles are non-adjacent. Byincidenttriangles, we mean the trianglesthat include the element in its construction, e.g., the fan of trian-gles around a vertex. An orphan pair is the pair of elements in theorphan test. The collection of all orphan tests is the orphan set.

5.3.1 Orphan Classification

Conceptually, there are two types of orphans: boundary and inte-rior. Boundary orphans appear in open manifold meshes. In factevery edge and vertex on the boundary of a mesh will be part ofone or more orphan pairs. Figure 5 shows two such orphan pairs.Figure 5(a) shows a vertex,v, on the boundary of the mesh. Thetrianglea5 is adjacent to every triangle incident tov. There is nonon-adjacent triangle pair (includinga5) that would execute the test(v, a5). So, (v, a5) is an orphan pair. Similarly, in Figure 5(b), wesee one of the orphan pairs fore: (e, e0).

Orphans are also possible on the interior of the mesh. There aresome special cases, such as a tetrahedron (Figure 6(b)) or four-sided pyramid (Figure 6(c)), in which every triangle is adjacent toevery other triangle. Additionally, any tube with a circumferenceformed by three triangles will have interior orphans. There is amore general condition that can lead to interior orphans–if a trian-gle in the mesh has vertices on its interior, orphans can also arise(Figure 6(a)).

5.4 Orphan Set Computation

The number and location of orphans are strictly a function of topol-ogy. Deformations which don’t change connectivity in the meshwill leave the set of orphans unchanged. It is sufficient to identifyall orphans in a pre-processing step. The algorithms to identify or-phans use two concepts: the Orphan Incident Set (OIS) and theOrphan Adjacent Set (OAS). TheOIS of an element contains alltriangles that are incident to that element (e.g. the fan around a ver-tex.) TheOAS of an element is the set of all triangles adjacent tothe triangles inOIS but not inOIS. These sets are also known asthe one-ring and two-ring, respectively. These sets are illustrated inFigures 5(a) and (b).

With these concepts, we can test each edge and vertex to determinewhich orphan pairs, if any, it belongs in. Algorithms 1 and 2 showhow orphans are identified. We simply execute each function on allvertices and edges, respectively.

If we know a priori that there are no interior orphans, then we canlimit the search to the boundary of the mesh and reformulate thealgorithms above in a more optimized form. For example, a meshproduced through Delauney triangulation, won’t suffer from ver-tices on the interior of triangles. These meshes typically don’t haveinterior orphans and creation of the orphan set can be constrained tothe boundary elements. In the extreme, if the mesh is a closed man-ifold with none of the characteristics required for interior orphans,

Algorithm 1 FindVFOrphan: Find all orphan pairs built on the ver-texv

1: CreateOIS for v2: CreateOAS for v3: for all Triangleta ∈ OAS do4: adjacent = TRUE5: for all Triangleti ∈ OIS do6: if ta not adjacentti then7: adjacent = FALSE8: break9: end if

10: end for11: if adjacent == TRUE then12: Add orphan pair{v, ta}13: end if14: end for

Algorithm 2 FindEEOrphan: Find all orphan pairs built on the edgee

1: CreateOIS for e2: CreateOAS for e3: CreateES, the set of all edges inOAS4: for all Edgeea ∈ ES do5: if ea is incident toe then6: continue7: end if8: CreateOISa for ea

9: adjacent = TRUE10: for all Triangle pair{ti, ta}, ti ∈ OIS ∧ ta ∈ OISa do11: if ta not adjacentti then12: adjacent = FALSE13: break14: end if15: end for16: if adjacent == TRUE then17: Add orphan pair{e, ea}18: end if19: end for

the orphan set would be completely empty.

5.4.1 Topological changes

In the event of topological changes, such as fracturing or tearing,the orphan set can easily be updated. Changes to the orphan setare limited to the region of the fracture or tear. We form a set con-sisting of the triangles adjacent to the fracture (i.e. any triangle onthe fracture, and the triangles adjacent to those.) We eliminate anyorphan test in the orphan set which had an element eliminated bythe fracture. Finally, we perform Algorithms 1 and 2 on all of theedges and vertices in the fracture adjacent set.

5.5 Processing Orphan Set

The adjacent phase simplifies to evaluating all of the tests in theorphan set. It is possible to perform tests on only a subset of theorphan set. We require some external condition which indicatesthat a particular orphan pair can’t intersect. BV-overlap tests areinsufficient for this purpose. Because orphans lie on adjacent tri-angles, BV-overlap tests won’t cull the triangle pair and, therefore,can’t cull the orphan pair. However, any test which is immune tothis particular adjacency artifact would be sufficient to cull orphantests.

The CNC test is one such culling mechanism. If the CNC test shows

Model Tri# Adjacent Elementary tests Orphanpairs of [Govindaraju et al. 2005] Set

Cloth 92K 564K 4.4M 4.8K

Princess 40K 269K 2.1M 2K

N-body 34K 198K 1.5M 200

Letters 5K 29K 224K 114

Table 1: This table shows the number of elementary tests per-formed between adjacent triangles for various approaches. Thefourth column represents the work performed by [Govindarajuet al. 2005], in which 9 elementary tests are performed for vertex-adjacent pairs and 4 for edge-adjacent pairs. The orphan set is sig-nificantly smaller–roughly0.1% of the tests performed in [Govin-daraju et al. 2005].

that no self-intersection is possible in a region, any orphan pair en-tirely contained in that region can be summarily dismissed withouttesting.

Even without such a culling mechanism, the orphan set tends to bequite small relative to the number of possible tests between adjacenttriangles.

5.6 Completeness and Optimality

It is important to recognize that a system using orphan sets is bothcomplete and optimal with respect to tests between adjacent trian-gles.

Completeness:A collision detection algorithm is complete if nocollisions are missed. In CCD all intersection tests among the prim-itives are reduced to intersections between VF or EE pairs. If thespecific VF or EE pair is incident to non-adjacent triangles, it willbe checked for overlap in the non-adjacent phase. Otherwise thatpair corresponds to an orphan pair and will be evaluated during theadjacent phase. Any VF or EE test that results in a collision will beevaluated. As a result, the orphan set formulation will not miss anycollision.

Optimality: The orphan set is optimal in the sense that it containsonly those tests between adjacent triangles thatcannotbe evaluatedin the non-adjacent phase. No other tests between adjacent trianglesare necessary. But every pair in the orphan set must be accountedfor, whether through direct evaluation or elimination via some tech-nique similar to CNC.

Although the size of the orphan set represents an upper bound onthe number of elementary tests between adjacent triangles that needto be explicitly evaluated, the bound tends to be quite small. In ourbenchmarks, the number of orphan tests are three orders of mag-nitude smaller than the number of tests which would otherwise beperformed between the adjacent triangles (see Table 1).

6 Implementation and Performance

In this section, we describe our implementation and highlight theperformance of our algorithm on many benchmarks. We have im-plemented our algorithm on a standard Intel Pentium 4 with 2.66GHz and 2G RAM by using Microsoft Visual Studio 2005. All thetimings are generated using a single thread.

6.1 DT-BVH: Dynamic Two-Level BVH

In order to fully utilize our culling algorithms, we use a two-levelhierarchy, DT-BVH, and use it for interactive CCD.

iO iMjO jMiM( b ) )( ii MB V HH

c o n t a i n s k | D O Po n l y . B o u n d i n gb o x t e s t i s u s e df o r c u l l i n g . c o n t a i n s k | D O P , C N C , a n dc o n t o u r i n f o r m a t i o n . B o u n d i n gb o x t e s t , C N C t e s t , a n d c o n t o u rt e s t a r e u s e d f o r c u l l i n g .

( a ) k | D O P s h i e r a c h y : H W

Figure 7: An example of DT-BVH: The first-level is a k-DOPshierarchyHW shown on the left (a). The leaf node ofHW repre-sents a connected mesh. The second-level (shown on the right) hi-erarchy is build for each connected meshM i, Hi = BV H(M i).All the nodes inHi contain normal cones (CNC) and the contourof the mesh associated with that node.

The two-level hierarchy is built based on mesh connectivity andbounds on the normals of the triangles. We illustrate the two-levelhierarchy, DT-BVH, in Figure 7. The two-levels are:

• The first-level of the hierarchy,HW , is a k-DOP hierarchyand each of the leaf nodes represent one of the objectsOi andits meshM i.

• The second-level of DT-BVH represents a k-DOP hierarchyof each mesh,M i. We denote each of these hierarchies asHi = BV H(M i). We also maintain a CNC and contourinformation for each node in this hierarchy.

In dynamic scenes with changing topologies, the number of objectsin the scene may change and we update these hierarchies accord-ingly.

Please note that CNC is only associated with the nodes of thesecond-level hierarchy, which contains a connected subset of themeshM i.

6.1.1 DT-BVH Construction

Based on the definition of DT-BVH, we use a two-level construc-tion algorithm. We use the connectivity of each mesh,M i, to com-pute its BVH,Hi, in a bottom-up manner. Each node ofHi rep-resents a subset of the meshM i. We compute the CNCs and theboundary edges associated with each node ofHi in a bottom-upmanner. Next, we compute the first-level hierarchy, HW, based onthe root nodes of eachHi in a top down manner.

Updating DT-BVH As the models undergo deformation, we up-date the nodes of DT-BVH. Our goal is to perform the update oper-ation quickly and ensure that the resulting hierarchy provides tightculling efficiency. Again, we use a two-level approach to update thehierarchy.

• Refitting Hi’s: We use a simple, linear time refitting al-gorithm to update the k-DOPs and CNCs of eachHi in a

Algorithm 3 SelfCollide(NodeN i): Perform self-collision on anode ofHi

1: if IsLeaf(N i) then2: return // Skip leaf nodes.

3: end if4: // Continuous normal cone test.

5: if TestCNC() == truethen6: // Continuous contour test.

7: if CCT() == NoIntersectionthen8: return// This region can be skipped.

9: end if10: end if11: // Check the descendants.

12: SelfCollide(N i →left) AND SelfCollide(N i →right)13: Collide(N i →left, N i →right)

bottom-up manner. The refitting algorithm updates the ex-tents of each k-DOP associated with the nodes ofHi. Wealso compute CNCs of each leaf node as described in Section4.1. The CNCs of the intermediate nodes are computed in abottom-up manner, based on the CNCs of their child nodes.

• Restructuring HW: Given each updatedHi, we use a re-structuring algorithm to update HW. Our goal is to computea tight-fitting BVH. Given scenes with moving or breakingobjects, a simple refitting approach may result in a poor hi-erarchy in terms of culling efficiency. Instead we use a re-structuring approach, which regroups some of the primitivesin the tree. If the number of objects in the scene is small, weuse a simple, top-down rebuilding algorithm of complexityO(n log n), wheren is the number of objects. If the num-ber of objects is high, we perform selective restructuring, asdescribed below.

Selective Restructuring for Collision Detection: In order to re-duce the restructuring time, we use a selective restructuring algo-rithm, which restructures localized regions of the hierarchy. Par-ticularly, we identify regions with poor culling efficiency. We usea volumetric metric [Yoon et al. 2007] that measures the cullingefficiency of any sub-BVH within the hierarchy. We perform re-structuring operations on regions where the restructuring benefit interms of improved culling efficiency is greater than the cost of re-structuring. Each restructuring operation only affects a portion ofthe tree [Yoon et al. 2007]. This formulation works well in terms ofquickly computing a tree with good culling efficiency and can alsohandle breaking objects.

6.1.2 Continuous Collision Detection using DT-BVH

Our collision algorithm starts with updating DT-BVH, as describedabove. The collision checking process is started by performing self-collisions on the root node ofHW . As the recursive algorithmreaches the leaf nodesHi, then self-collision algorithm is invokedon the correspondingHi. For a node ofHi with CNC, we checkwhether the apex angle of the normal cone is less thanπ and alsoperform the continuous contour test. If these two tests are satisfied,then, we do not need to traverse deeper to check for self-collisions.The pseudo code description of the algorithm is given in Alg. 3.Then, elementary tests are used to check for collisions between theleaf nodes ofHi, as shown in Algorithm 4. Finally, we performorphan tests.

Algorithm 4 Collide(NodeN ia, N i

b): Checks for collision betweendescendants of two nodes ofHi.

1: if BoundingBoxTest(N ia, N i

b) == NoOverlapthen2: return3: end if4: // Perform elementary tests on leaf nodes.

5: if IsLeaf(N ia) AND IsLeaf(N i

b) then6: if N i

a not adjacent toN ib then

7: ElmTests(N ia, N i

b) // Perform elementary test.

8: return9: end if

10: end if11: // Check the descendants.

12: if IsLeaf(N ia ) then

13: Collide(N ia, N i

b →left) AND Collide(N ia, N i

b →right)14: else15: Collide(N i

a →left, N ib) AND Collide(N i

a →right, N ib)

16: end if

Model Tri # Query Speedup over: Speedup over(K) (timems) the base impl. GPU-based method

Cloth 92 290 9X 2.4X

Princess 40 45 8.8X 12X

N-body 34 89 14.6X NALetters 5 9.4 12.6X 10X

Dragon 253 878 21.4X NA

Table 2: Performance and Speedup:This table shows the aver-age query time of our method and performance improvement overthe base implementation and GPU-based technique of [Sud et al.2006]. Performance improvement over the base implementation ismainly due to our DT-BVH hierarchy representation and improvedculling methods. We observe significant improvement over the baseimplementation and the GPU-based method of [Sud et al. 2006]due to our improved culling algorithms.

6.2 Benchmarks

In order to test the performance of our algorithm, we used five dif-ferent benchmarks, arising from different simulations with differentcharacteristics.

• Folding cloth simulation: We drop a cloth on top of aball and it curls around resulting in a high number of self-collisions in this92K triangle model (Fig. 11).

• Princess: A dancer with flowing skirt (40K triangles) sitson the ground, resulting in inter- and intra-object collisions(Fig. 8).

• N-body collision: A scene with hundreds of balls (34K tri-angles) that are colliding with each other (Fig. 10). This se-quence is generated using a rigid-body simulator.

• Breaking and deforming letters: Multiple deforming mod-els of characters (5K triangles) fall into a bowl and break intopieces (Fig. 12).

• Bunny-Dragon breaking simulation: We drop a bunnymodel on top of a dragon model (total253K triangles) andthe dragon model decomposes into a high number of smallerpieces (Fig. 9).

All the benchmarks have multiple simulation steps. We performcontinuous collision detection between each discrete steps andcompute the first time-of-contact.

Model Base Ourimplementation algorithm

Letters 340K 8K

Princess 932K 14K

N-body 3, 359K 188K

Cloth 7, 522K 216K

Dragon 16, 199K 981K

Table 3: Improved culling efficiency: This table shows the num-ber of elementary tests performed per frame by the base methodand our improved algorithm. The combination of DT-BVH and im-proved culling algorithms reduces the number of false positives byalmost two orders of magnitude.

6.3 Performance

The running time of our algorithm is governed by three steps: up-dating DT-BVH (performing selective restructuring for breakingmodels and refitting for simple models, e.g., no drastic deforma-tions), traversing the DT-BVH, and performing elementary tests.

We assume that the triangles are deforming under linear continu-ous motion and implement the EE and VF elementary tests used tocheck triangular prisms for overlap by solving cubic equations. Inpractice, each such elementary tests takes about0.2 microsecondson average. Moreover, we perform a planar (E,E) test by perform-ing multiple VE elementary tests. Each VE elementary test reducesto solving a quadratic equation and takes about0.1 microsecondson average.

Bounding volume: We selected k-DOPs (specifically 18-DOPs) asbounding volumes over AABBs for their superior culling efficiency.Based on our experiments, k-DOPs offer better overall performancefor CCD than AABBs. The cost to update the hierarchy is a smallfraction of the overall collision query. But the improved cullingefficiency yields an overall gain. Please note that this is not the casein discrete collisions or ray tracing. The benefits in terms of fewerfalse positives with k-DOPs offer a slight net speedup (5%-18%).

Memory overhead: The storage overhead of DT-BVH is about500 bytes per triangle. The memory requirements of our two-levelBVH are not optimized in our current implementation and higher ascompared to maintaining a single BVH per object. Moreover, westore more information with the intermediate nodes of the second-level BVHs including CNCs, contour, etc.

Culling efficiency: In order to demonstrate the benefit of our hier-archical representation and culling techniques, we implemented a“base” version without any of these culling methods. The “base”version also uses an k-DOPs hierarchy computed using refitting al-gorithms (for models with fixed connectivity) and rebuilding algo-rithms (for models with changing topologies or breaking objects).We used the same implementation of the elementary tests, usingthe cubic equation solver from [Provot 1997] , in both of these im-plementations. Table 6.2 shows the average CCD time of our al-gorithm and performance improvement over the base method andGPU-based technique [Sud et al. 2006]. We observe almost oneorder of magnitude improvement due to the improved culling effi-ciency.

Table 3 shows the improvement in the number of elementary testsperformed per frame. The two orders of magnitude improvement isdue to our hierarchical representation and culling algorithms.

Figure 8: Princess benchmark: A dancer with a flowing skirt.This model has 60K vertices and 40K triangles. Our novel CCDalgorithm takes45ms per frame to compute all the collisions, andis about one order of magnitude faster than prior approaches.

Figure 9: Dragon benchmark:In this simulation, a bunny modelis dropped on top of the dragon model and the dragon model breaksinto many pieces. This model has 193K vertices and 253K trian-gles. In this scene with changing topologies, our algorithm obtainshigh culling efficiency and reduces the number of false positives by20 times, as compared to prior CCD algorithms. The average CCDquery time is about878ms, about an order of magnitude faster thanprior algorithms.

7 Analysis and Comparison

In this section, we analyze the performance of our algorithm. Themain benefits of our algorithm come from the high culling effi-ciency of the DT-BVH, along with the benefits of the high-leveland low-level culling methods. We observe significant reduction inthe number of elementary tests (in terms of false positives). More-over, the time to update the DT-BVH hierarchy is relatively small(at most5−10% of the total query time). This results in almost oneorder of magnitude improvement in our benchmarks. In the rest ofthis section, we compare some of the features and the performancewith prior methods.

GPU-based accelerations:The GPU-based algorithms use the ras-terization hardware to perform occlusion queries [Govindaraju et al.2005] or compute 3D distance fields [Sud et al. 2006], and readbackthese fields. Their performance can vary based on the specific GPUand driver implementation. They have been combined with AABBculling to improve the performance of CCD. We compare the per-formance with the implementation of [Sud et al. 2006] and observeconsiderable speedups on some of the benchmarks (up to 10X). Ascompared to occlusion queries or readbacks, our hierarchy traver-sal with CNC and contour tests appears to have a lower overhead.Furthermore, the low-level culling algorithms significantly reducethe number of elementary tests.

Kinetic BVHs and updates: [Zachmann and Weller 2006; Wellerand Zachmann 2006] used kinetic BVH and separation lists to re-duce the number of updates and tests on the BVH. This is an event-based approach and complementary to our work. We use a singletwo-level hierarchy for all the objects in the scene as well as newculling algorithms, which appear faster in practice. On the otherhand, it becomes harder to maintain the kinetic separation lists effi-ciently, especially in complex scenes with hundreds of thousands of

Figure 10: N-body benchmark: In this simulation, multiple ballsare colliding with each other. This scene has 18K vertices and 34Ktriangles. Our culling algorithms reduce the number of elementarytest by18 times and can find all collisions in about89ms per frame.

Figure 11: Cloth benchmark: We drop a cloth on top of a ro-tating ball. This model has 46K vertices and 92K triangles and thesimulation results in a high number of self-collision. Our algorithmtakes about290ms on average to perform continuous collision de-tection. Our culling techniques reduce the number of false positivesby38 times.

triangles. As a result, our approach could be faster on such complexscenes, especially with breaking objects.

Lower-level culling: Many other authors have also proposed meth-ods to reduce the number of elementary tests between adjacentprimitives [Govindaraju et al. 2005; Hutter and Fuhrmann 2007;Wong and Baciu 2006; Curtis et al. 2008]. Our formulation ismore general and achieves higher culling and fewer elementarytests as compared to the prior approaches. We also compared theculling efficiency of our algorithm with that presented in [Hutterand Fuhrmann 2007]. We observe that our method performs8.9times and7 times fewer elementary tests in the cloth and N-bodycollision benchmarks, respectively. Algorithms [Wong and Baciu2006; Curtis et al. 2008] can be classified as feature based cullingmethods. By making some sort of assignment at preprocessingstage, all the replication of elementary test can be naturally solved.In practice, these methods are limited to scenes with fixed connec-tivity. For breaking scenes with changing topology, it is inefficientto adjust the assignment dynamically. While our culling method ismore general and more robust to deal with all kinds for deformingscene.

Improved normal cone tests: Most prior work in use of normalcones has been limited to discrete collision detection. Recently,[Wong and Baciu 2005] presented a technique to bound the nor-mals of a mesh for continuous motion, using a ”canonical cone”.However, their formulation is rather conservative and inefficient ascompared to our fast culling test based on Bernstein basis represen-tation.

7.1 Limitations

Our approach has some limitations. First of all, the benefit of ourapproach is limited by the extent of connectivity in the model. As

Figure 12: Letters benchmark: Multiple characters interact witha bowl. This model has 3K vertices and 5K triangles.It takes9.4mson average for CCD, which is almost10 times faster than the run-ning time presented in [Sud et al. 2006].

the objects break into pieces and loses mesh connectivity, the ben-efit of high-level and low-level culling techniques decreases. Sec-ondly, our normal bounds CNC test can be quite conservative, espe-cially on models with highly varying curvature. We observe this incloth simulation benchmarks, after the cloth folds multiple times.Thirdly, our memory requirements can be high due to maintainingvarious lists.

8 Conclusion and Future Work

We present a novel algorithm for CCD between complex de-formable models. Our approach is based on a two-level hierarchyand applicable to models arising in different applications, includ-ing cloth simulation, breaking objects and N-body simulations. Weintroduce high-level and low-level culling techniques that signif-icantly reduce the number of false positives. We have tested theperformance on different benchmarks and observed considerableimprovement in performance over prior CCD algorithms.

There are many avenues for future work. Firstly, we would liketo address some of the limitations highlighted in Section 7.1. Sec-ondly, we want to further improve the performance, especially onscenes with breaking objects that reduce the mesh connectivity.One option would be to develop novel algorithms that can easilyutilize the multiple cores on current processors and ensure goodcache efficiency. Finally, we would like to integrate our collisiondetection algorithm into different simulators and use application-specific optimizations to improve the performance.

Acknowledgments

We would like to thank Stephane Redon for many useful discus-sions and his initial code for elementary tests. We also thank Ras-mus Tamstorf, Naga Govindaraju, Avneesh Sud, Russ Gayle andMing Lin for useful discussions and the benchmarks.

This research is supported in part by ARO Contracts DAAD19-02-1-0390 and W911NF-04-1-0088, NSF awards 0400134, 0429583and 0404088, DARPA/RDECOM Contract N61339-04-C-0043,Disney and Intel. Yoon is supported in part by a seed grantfrom KAIST, ETRI, and IT R&D program of MIC/IITA contractITAA1100070400010001000300200. Tang is supported in part byNational Basic Research Program of China (No. 2006CB303106),Natural Science Foundation of Zhejiang, China (No. Y107403),Doctoral subject special scientific research fund of Education Min-istry of China (No. 20070335074), and Future Academic Star fel-lowship from Zhejiang University.

References

ANDERSSON, L.-E., STEWART, N. F., AND ZIDANI , M. 2006.Conditions for use of a non-selfintersection conjecture.Comput.Aided Geom. Des. 23, 7, 599–611.

BARAFF, D., WITKIN , A., AND KASS, M. 2003. Untanglingcloth. Proc. of ACM SIGGRAPH, 862–870.

BRADSHAW, G., AND O’SULLIVAN , C. 2004. Adaptive medial-axis approximation for sphere-tree construction.ACM Trans. onGraphics 23, 1, 1–26.

BRIDSON, R., FEDKIW, R., AND ANDERSON, J. 2002. Robusttreament for collisions, contact and friction for cloth animation.Proc. of ACM SIGGRAPH, 594–603.

CURTIS, S., TAMSTORF, R., AND MANOCHA, D. 2008. Fastcollision detection for deformable models using representative-triangles. InSI3D ’08: Proceedings of the 2008 Symposium onInteractive 3D graphics and games, 61–69.

ERICSON, C. 2004.Real-Time Collision Detection. Morgan Kauf-mann.

FOSKEY, M., GARBER, M., L IN , M., AND MANOCHA, D. 2001.A voronoi-based hybrid planner.Proc. of IEEE/RSJ Int. Conf.on Intelligent Robots and Systems.

GOTTSCHALK, S., LIN , M., AND MANOCHA, D. 1996. OBB-Tree: A hierarchical structure for rapid interference detection.Proc. of ACM Siggraph’96, 171–180.

GOVINDARAJU, N., LIN , M., AND MANOCHA, D. 2004. Fastand reliable collision detection using graphics hardware.Proc.of ACM VRST.

GOVINDARAJU, N., KNOTT, D., JAIN , N., KABUL , I., TAM -STORF, R., GAYLE , R., LIN , M., AND MANOCHA, D. 2005.Collision detection between deformable models using chromaticdecomposition.ACM Trans. on Graphics (Proc. of ACM SIG-GRAPH) 24, 3, 991–999.

HEIDELBERGER, B., TESCHNER, M., AND GROSS, M. 2003.Real-time volumetric intersections of deforming objects.Proc.of Vision, Modeling and Visualization, 461–468.

HEIDELBERGER, B., TESCHNER, M., AND GROSS, M. 2004. De-tection of collisions and self-collisions using image-space tech-niques.Journal of WSCG 12, 3, 145–152.

HUBBARD, P. M. 1993. Interactive collision detection. InPro-ceedings of IEEE Symposium on Research Frontiers in VirtualReality.

HUTTER, M., AND FUHRMANN, A. 2007. Optimized continu-ous collision detection for deformable triangle meshes. InProc.WSCG ’07, 25–32.

JAMES, D. L., AND PAI , D. K. 2004. BD-Tree: Output-sensitivecollision detection for reduced deformable models.Proc. ofACM SIGGRAPH, 393–398.

K IM , Y., VARADHAN , G., LIN , M., AND MANOCHA, D. 2003.Efficient swept volume approximation of complex polyhedralmodels. Proc. of ACM Symposium on Solid Modeling and Ap-plications, 11–22.

KLOSOWSKI, J., HELD, M., M ITCHELL , J., SOWIZRAL , H., ANDZIKAN , K. 1998. Efficient collision detection using boundingvolume hierarchies of k-dops.IEEE Trans. on Visualization andComputer Graphics 4, 1, 21–37.

KNOTT, D., AND PAI , D. K. 2003. CInDeR: Collision and inter-ference detection in real-time using graphics hardware.Proc. ofGraphics Interface, 73–80.

LARSSON, T., AND AKENINE-M OLLER, T. 2006. A dynamicbounding volume hierarchy for generalized collision detection.Computers and Graphics 30, 3, 451–460.

LAUTERBACH, C., YOON, S., TUFT, D., AND MANOCHA, D.2006. RT-DEFORM: Interactive Ray Tracing of DynamicScenes using BVHs.IEEE Symposium on Interactive Ray Trac-ing, 39–46.

L IN , M., AND MANOCHA, D. 2003. Collision and proximityqueries. InHandbook of Discrete and Computational Geometry.

MEZGER, J., KIMMERLE, S.,AND ETZMUβ, O. 2003. Hierarchi-cal techniques in cloth detection for cloth animation.Journal ofWSCG 11, 1, 322–329.

OTADUY, M., CHASSOT, O., STEINEMANN , D., AND GROSS, M.2007. Balanced hierarchies for collision detection between frac-turing objects. InIEEE Virtual Reality, 83–90.

PROVOT, X. 1997. Collision and self-collision handling in clothmodel dedicated to design garment.Graphics Interface, 177–189.

REDON, S., KHEDDAR, A., AND COQUILLART, S. 2002. Fastcontinuous collision detection between rigid bodies.Proc. ofEurographics (Computer Graphics Forum) 21, 3, 279–288.

REDON, S., KIM , Y. J., LIN , M. C., AND MANOCHA, D. 2004.Fast continuous collision detection for articulated models. InProceedings of ACM Symposium on Solid Modeling and Appli-cations, 145–156.

SANNA , A., AND M ILANI , M. 2004. CDFast: an algorithm com-bining different bounding volume strategies for real time colli-sion detection.SCI Proceedings 2, 144–149.

SUD, A., OTADUY, M. A., AND MANOCHA, D. 2004. DiFi: Fast3D distance field computation using graphics hardware.Com-puter Graphics Forum (Proc. Eurographics) 23, 3, 557–566.

SUD, A., GOVINDARAJU, N., GAYLE , R., KABUL , I., ANDMANOCHA, D. 2006. Fast proximity computation among de-formable models using discrete voronoi diagrams.Proc. of ACMSIGGRAPH, 1144–1153.

TESCHNER, M., K IMMERLE, S., HEIDELBERGER, B., ZACH-MANN , G., RAGHUPATHI, L., FUHRMANN, A., CANI , M.-P., FAURE, F., MAGNENAT-THALMANN , N., STRASSER, W.,AND VOLINO, P. 2005. Collision detection for deformable ob-jects.Computer Graphics Forum 19, 1, 61–81.

VAN DEN BERGEN, G. 1997. Efficient collision detection of com-plex deformable models using AABB trees.Journal of GraphicsTools 2, 4, 1–14.

VOLINO, P., AND THALMANN , N. M. 1994. Efficient self-collision detection on smoothly discretized surface animationsusing geometrical shape regularity.Computer Graphics Forum(EuroGraphics Proc.) 13, 3, 155–166.

VOLINO, P., AND THALMANN , N. M. 2000. Accurate collisionresponse on polygon meshes. InProc. of Computer Animation,154–163.

WELLER, R., AND ZACHMANN , G. 2006. Kinetic separationlists for continuous collision detection of deformable objects. InVirtual Reality Interactions and Physical Simulation, 189–196.

WONG, W. S.-K.,AND BACIU , G. 2005. Dynamic interaction be-tween deformable surfaces and nonsmooth objects.IEEE Tran.on Visualization and Computer Graphics 11, 3, 329–340.

WONG, W. S.-K., AND BACIU , G. 2006. A randomized mark-ing scheme for continuous collision detection in simulation ofdeformable surfaces.Proc. of ACM VRCIA, 181–188.

YOON, S., CURTIS, S., AND MANOCHA, D. 2007. Ray trac-ing dynamic scenes using selective restructuring.Proc. of Euro-graphics Symposium on Rendering.

ZACHMANN , G., AND WELLER, R. 2006. Kinetic bounding vol-ume hierarchies for deforming objects. InACM Int’l Conf. onVirtual Reality Continuum and its Applications.

ZHANG, L., AND MANOCHA, D. 2008. Motion interpolationwith distance constraints. Tech. Rep. TR 08-001, Departmentof Computer Science, UNC Chapel Hill.

ZHANG, X., REDON, S., LEE, M., AND K IM , Y. J. 2007. Con-tinuous collision detection for articulated models using taylormodels and temporal culling.ACM Transactions on Graphics(Proceedings of SIGGRAPH 2007) 26, 3, 15.