Kinetic Collision Detection for Convex Fat Objects Mohammad Abam Mark de Berg Sheung-Hung Poon Bettina Speckmann
Kinetic Data Structures Simulate system of continuously moving objects. Efficiently maintain discrete attributes of objects: closest pair of objectst convex hull minimum spanning tree binary space partition ...
Example: convex hull
Example: convex hull
Dynamic data structures Allow insertions and deletions of objects at discrete times. Not suitable for handling moving objects.
Time sampling approach Choose fixed time step. Update the positions of moving objects at each time step. Update the data structure with the new positions of objects.
Time sampling approach How to choose the proper time step? Oversampling Undersampling t t
Time sampling approach Combinatorial changes occur in irregular patterns. t
Kinetic Data Structures (Basch, Guibas, and Hershberger, 1998) Use any static algorithm to compute the configuration function (i.e. the discrete attribute). Turn the algorithm into a proof that this attribute is correct. Animate this proof through time.
Example: convex hull Proof: a is to the left of bc d is to the left of bc b is to the right of ad c is to the left of ad c d a b c b d a a c d b d a b c
Example: convex hull t1 Certificate Failure time d t1 Certificate Failure time a is to the left of bc d is to the left of bc b is to the right of ad c is to the left of ad t2 b never d is to the right of bc t1 b is to the left of ad t2 never
Kinetic Data Structures Proof of correctness of attribute (certificates) Priority queue (event queue) Assumptions A simple model for motion: each object follows a known flight plan with rational parameters. Certificates are algebraic; failure is next largest root.
Kinetic Data Structures Efficient KDS exist for 2d convex hull Closest pair Delaunay triangulation Diameter, width of point sets Collision detection between simple polygons in the plane, between two convex polyhedra in 3D, between multiple convex fat objects of similar sizes in 3D …
Kinetic Data Structures Collision detection Set of geometric tests (elementary certificates) that certify that the input objects are disjoint.
Balls rolling on a plane Arbitrary sizes
Convex fat constant-complexity objects free-flying in 3D
Kinetic data structure properties A KDS is called compact if it uses little space in addition to the input. responsive if the data structure invariants can be restored quickly after the failure of a certificate. local if it can be updated easily if the flight plan for an object changes. efficient if the worst-case number of events handled by the data structure is small compared to some worst case number of external events.
Locality
Related work Same-size convex fat objects [Basch, Guibas, and Zhang, 1997] Compactness O(n log2 n) certificates Responsiveness each event can be handled in O(log3 n) time Efficiency O(n2) events in the worst case Two convex polyhedra [Erickson, Guibas, Stolfi, and Zhang, 1999] [Guibas, Xie, and Zhang, 2001] We do arbitrary sizes!
Balls rolling on a plane Balls Bi with center ci and radius ri. Certificate of non-collision: dist(ci,cj) – ri – rj > 0 Bi Bj
Collision tree
Threshold disks Smallest blue ball with radius = rmin
Threshold disks
Threshold disks
Threshold disks
Threshold disks Threshold disk of radius Bi
Threshold disks
Threshold disks
Threshold disks
Threshold disks
Non-collision certificates Lemma: Each point in the plane is contained in at most a constant number of threshold disks. The number of non-collision certificates is O(n).
Kinetic maintenance
Kinetic maintenance Replace threshold disks by threshold boxes.
Kinetic maintenance Replace threshold disks by threshold boxes. Maintain two sorted lists on x- and y-coordinates of tangency points and threshold boxes. O(n) certificates.
Kinetic maintenance Lemma: Each point in the plane is contained in at most a constant number of threshold boxes. The number of non-collision certificates is O(n).
Kinetic data structure properties Balls rolling on a plane Compactness O(n log n) certificates Responsiveness each event can be handled in logarithmic time. Efficiency O(n2) events in the worst case, assuming that the balls follow constant-degree algebraic trajectories.
Convex fat constant-complexity objects free-flying in 3D
Fat objects
Fat objects
Fat objects
Fat objects ri ro Definition: An object is called ρ-fat if ro/ri < ρ.
Convex fat constant-complexity objects free-flying in 3D Balls rolling on a plane: threshold disks of radius Balls free flying: threshold disks of radius ri + rmin
Guarding fat objects
Guarding fat objects Lemma For any ρ-fat object K, there is a set G(K) of O(ρ6) guarding points such that any ρ-fat object K’ that collides with K and is at least as large as K contains a point from G(K).
Guarding fat objects Lemma For any ρ-fat object K, there is a set G(K) of O(ρ6) guarding points such that any ρ-fat object K’ that collides with K and is at least as large as K contains a point from G(K).
Problem: Hard to do efficiently Guarding fat objects Lemma For any ρ-fat object K, there is a set G(K) of O(ρ6) guarding points such that any ρ-fat object K’ that collides with K and is at least as large as K contains a point from G(K). Approach For each g ∈ G(K) maintain the object K(g) containing g Solution Replace objects by their bounding boxes Problem: Hard to do efficiently
maintain the smallest k objects whose bounding box contains g Bounding boxes A guard g can be contained in many bounding boxes but only the smaller objects can actually contain g maintain the smallest k objects whose bounding box contains g
Making it work … A guard g.
Making it work … The unit cube centered at g.
Making it work … A grid whose cells have edge length . O(ρ2) grid cells.
Making it work … Triangulate the grid.
Making it work … Every triangle …
Making it work … Every triangle defines an infinite cone.
Making it work … object K bb(K) = axis-aligned bounding box of K guard g Γ(g) = set of all cones for g Lemma Let K(γ) be the set of all objects K whose centers lie in a cone γ and such that bb(K) contains the apex g of the cone. Suppose that one of these objects, K(g), contains g. Then K(g) must be among the smallest objects in K(γ).
Summary For each object K compute a set of O(ρ6) guards G(K). For each guard g ∈ G(K) construct the set Γ(g) of O(ρ2) infinite cones with apex g. For each cone γ∈Γ(g) maintain the smallest objects K*(γ) whose center lies inside γ and whose bounding box contains g. Certify disjointness for K and all objects in the K*.
Maintenance Need to maintain for each γ∈Γ(g) the collection K*(γ) of smallest objects whose centers are inside γ and whose bounding boxes contain g. Box event a bounding box starts or stops to contain a guard Center event a center moves into or out of a cone 3 level range tree, three level segment tree, sorted lists, kinetic variants of range and segment trees
Kinetic data structure properties Convex fat constant complexity objects free-flying in 3D Compactness O(ρ2 n log6 n + ρ7n) certificates Responsiveness each event can be handled in O(log6 n + ρ6) time. Efficiency O(ρ13 n2) events in the worst case, assuming that the balls follow constant- degree algebraic trajectories. linear number of candidate pairs
Kinetic data structure properties Convex fat constant complexity objects free-flying in 3D Compactness O(n log6 n) certificates Responsiveness each event can be handled in O(log6 n) time. Efficiency O(n2) events in the worst case, assuming that the balls follow constant- degree algebraic trajectories. linear number of candidate pairs
Conclusions First KDS for collision detection between multiple convex fat 3D objects of arbitrary sizes with a near-linear number of certificates. Dependence on fatness parameter ρ is large. Good bounds are possible in theory … Is there a simple solution that achieves these bounds in practice?