Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kinetic Data Structures and their Application in Collision Detection Sean Curtis COMP 768 Oct. 16, 2007.

Similar presentations


Presentation on theme: "Kinetic Data Structures and their Application in Collision Detection Sean Curtis COMP 768 Oct. 16, 2007."— Presentation transcript:

1 Kinetic Data Structures and their Application in Collision Detection Sean Curtis COMP 768 Oct. 16, 2007

2 Kinetic Data Structures -- COMP 7682 Motivation Convex hull –Points move with time –Recalculate hull at each point –O(n lg n) work at each time step –Instead, define convex hull based on the points used –Only update hull when necessary Kinetic Data Structures

3 Kinetic Data Structures -- COMP 7683 Motivation Kinetic Data Structures

4 Kinetic Data Structures -- COMP 7684 Motivation Kinetic Data Structures

5 Kinetic Data Structures -- COMP 7685 Motivation Kinetic Data Structures What happens to the CH when they start moving?

6 Kinetic Data Structures -- COMP 7686 Motivation Kinetic Data Structures What happens to the CH when they start moving?

7 Kinetic Data Structures -- COMP 7687 Motivation Kinetic Data Structures What happens to the CH when they start moving?

8 Kinetic Data Structures -- COMP 7688 Motivation Kinetic Data Structures What happens to the CH when they start moving?

9 Kinetic Data Structures -- COMP 7689 Motivation Kinetic Data Structures What happens to the CH when they start moving?

10 Kinetic Data Structures -- COMP 76810 Motivation Kinetic Data Structures What happens to the CH when they start moving?

11 Kinetic Data Structures -- COMP 76811 Motivation Kinetic Data Structures What happens to the CH when they start moving?

12 Kinetic Data Structures -- COMP 76812 Motivation Kinetic Data Structures What happens to the CH when they start moving?

13 Kinetic Data Structures -- COMP 76813 Motivation Kinetic Data Structures What happens to the CH when they start moving?

14 Kinetic Data Structures -- COMP 76814 Motivation Kinetic Data Structures What happens to the CH when they start moving?

15 Kinetic Data Structures -- COMP 76815 Motivation Simple solution –Take small time steps and recalculate the CH for each configuration of points. Kinetic Data Structures

16 Kinetic Data Structures -- COMP 76816 Motivation Kinetic Data Structures

17 Kinetic Data Structures -- COMP 76817 Motivation Kinetic Data Structures

18 Kinetic Data Structures -- COMP 76818 Motivation Kinetic Data Structures

19 Kinetic Data Structures -- COMP 76819 Motivation Kinetic Data Structures

20 Kinetic Data Structures -- COMP 76820 Motivation Kinetic Data Structures

21 Kinetic Data Structures -- COMP 76821 Motivation Kinetic Data Structures

22 Kinetic Data Structures -- COMP 76822 Motivation Kinetic Data Structures

23 Kinetic Data Structures -- COMP 76823 Motivation Kinetic Data Structures

24 Kinetic Data Structures -- COMP 76824 Motivation Kinetic Data Structures

25 Kinetic Data Structures -- COMP 76825 Motivation Kinetic Data Structures

26 Kinetic Data Structures -- COMP 76826 Motivation Simple solution –Take small time steps and recalculate the CH for each configuration of points. –Takes O(n log n) work at each time step. An alternative – observe the nodes that form the CH. Kinetic Data Structures

27 Kinetic Data Structures -- COMP 76827 Motivation Kinetic Data Structures

28 Kinetic Data Structures -- COMP 76828 Motivation Kinetic Data Structures

29 Kinetic Data Structures -- COMP 76829 Motivation Kinetic Data Structures

30 Kinetic Data Structures -- COMP 76830 Motivation Kinetic Data Structures

31 Kinetic Data Structures -- COMP 76831 Motivation Kinetic Data Structures

32 Kinetic Data Structures -- COMP 76832 Motivation Kinetic Data Structures

33 Kinetic Data Structures -- COMP 76833 Motivation Kinetic Data Structures

34 Kinetic Data Structures -- COMP 76834 Motivation Kinetic Data Structures

35 Kinetic Data Structures -- COMP 76835 Motivation Kinetic Data Structures

36 Kinetic Data Structures -- COMP 76836 Motivation Kinetic Data Structures

37 Kinetic Data Structures -- COMP 76837 Motivation Create a data structure that associated the convex hull directly with the vertices that form it. Use the trajectories of the nodes to determine when they enter or leave the CH list. This is a Kinetic Data Structure. Kinetic Data Structures

38 Kinetic Data Structures -- COMP 76838 Concepts Moving objects –Continuous motion. –Could maintain some property about the set by sampling over time and modifying the data structure supporting the property. –Danger of over- or under-sampling. Kinetic Data Structures

39 Kinetic Data Structures -- COMP 76839 Concepts Configuration Function –A collection of continuous or discrete attributes for “mobile” data. –Ex. 1 For a convex hull, it is the ordered list of points on the hull. –Ex. 2 For the closest pair, it is,simply, the pair of nodes. Kinetic Data Structures

40 Kinetic Data Structures -- COMP 76840 Concepts Kinetization –The process of transforming an algorithm on static data into a data structure appropriate for continuously changing data. Kinetic Data Structures

41 Kinetic Data Structures -- COMP 76841 Concepts Flight plan –Information about a moving objects current motion. –The information need not be complete – no complete a priori knowledge necessary. –Flight plans can update based on interactions within the environment or with a user. Kinetic Data Structures

42 Kinetic Data Structures -- COMP 76842 Concepts Global Event Queue –Means through which the object’s motion is connected to the data structure. –Narrow interface. Kinetic Data Structures

43 Kinetic Data Structures -- COMP 76843 Concepts Certificates –A set of conditions which prove the configuration function. –The configuration function can only be invalidated when certificates change. –The change of the state of certificates are the events in the queue – certificate failure. Kinetic Data Structures

44 Kinetic Data Structures -- COMP 76844 Concepts Quality –Ultimately, a KDS is “good” if the cost of processing a certificate failure is low. –How do we quantify this? Kinetic Data Structures

45 Kinetic Data Structures -- COMP 76845 Concepts Responsive –A low worst-case cost for processing a certificate failure. –This could include updating the proof, the configuration function, de-scheduling events and scheduling new events. Kinetic Data Structures

46 Kinetic Data Structures -- COMP 76846 Concepts Efficient –The ratio between total events to external events is “small”. –“External” events affect the configuration function. –“Internal” events are events required to fix KDS internal structures. –External events represent a lower-bound on the amount of work. Kinetic Data Structures

47 Kinetic Data Structures -- COMP 76847 Concepts Compact –The maximum number of events in the queue at any one time is roughly linear in the number of moving objects. Kinetic Data Structures

48 Kinetic Data Structures -- COMP 76848 Concepts Localized –The maximum number of events in the queue dependent on a single object is “small”. –Being “local” implies being “compact”. Kinetic Data Structures

49 Kinetic Data Structures -- COMP 76849 Kinetic Data Structures Simple Example Points on a line 0 1 2 3 4 5 6 7 8 What is the right-most point? x

50 Kinetic Data Structures -- COMP 76850 Kinetic Data Structures Simple Example Points on a line 0 1 2 3 4 5 6 7 8 What is the right-most point? x

51 Kinetic Data Structures -- COMP 76851 Kinetic Data Structures Simple Example Points on a line What is the right-most point? 0 1 2 3 4 5 6 time 8 6 4 2 position

52 Kinetic Data Structures -- COMP 76852 Kinetic Data Structures Simple Example Points on a line What is the right-most point? 0 1 2 3 4 5 6 time 8 6 4 2 position Proposed KDS - Maintain sorted list. - Every time two points cross we have an event. - Swap two elements in sorted order.

53 Kinetic Data Structures -- COMP 76853 Kinetic Data Structures Simple Example Points on a line What is the right-most point? 0 1 2 3 4 5 6 time 8 6 4 2 position Proposed KDS - Responsive! - Efficient! - Not compact! - Not localized!

54 Kinetic Data Structures -- COMP 76854 Kinetic Data Structures Simple Example Points on a line Worst case – Not compact and not local 0 1 2 3 4 5 6 time 8 6 4 2 position

55 Kinetic Data Structures -- COMP 76855 Kinetic Data Structures Simple Example Points on a line Better solution would be to maintain a max-heap. An object would only create an event with its parent (when it passes its parent.) Events would cause children to swap with their parent in the binary-tree heap structure.

56 Kinetic Data Structures -- COMP 76856 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Apply the principles of KDS to a bounding volume hierarchy. We use this to make the cost of updating a BVH cheaper.

57 Kinetic Data Structures -- COMP 76857 Kinetic Data Structures Kinetic Bounding Volume Hierarchy The idea

58 Kinetic Data Structures -- COMP 76858 Kinetic Data Structures Kinetic Bounding Volume Hierarchy The idea

59 Kinetic Data Structures -- COMP 76859 Kinetic Data Structures Kinetic Bounding Volume Hierarchy The idea (x min, y min ) (x max, y max )

60 Kinetic Data Structures -- COMP 76860 Kinetic Data Structures Kinetic Bounding Volume Hierarchy x min y max x max y min The idea

61 Kinetic Data Structures -- COMP 76861 Kinetic Data Structures Kinetic Bounding Volume Hierarchy The idea x min y max x max y min

62 Kinetic Data Structures -- COMP 76862 Kinetic Data Structures Kinetic Bounding Volume Hierarchy The idea x min y max x max y min

63 Kinetic Data Structures -- COMP 76863 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Kinetization of BVH –Configuration function – a valid BVH for a set of moving polygons. –Data structure – hierarchy of BVs where the extents of each BV by pointers to the extreme vertices.

64 Kinetic Data Structures -- COMP 76864 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Events –Leaf-event – Occurs when one vertex in the polygon overtakes an extreme vertex.

65 Kinetic Data Structures -- COMP 76865 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Events –Leaf-event – Occurs when one vertex in the polygon overtakes an extreme vertex.

66 Kinetic Data Structures -- COMP 76866 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Events –Tree-event – Occurs when the extent of an internal node goes from being defined by a vertex of one child to a vertex of the other child.

67 Kinetic Data Structures -- COMP 76867 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Events –Tree-event – Occurs when the extent of an internal node goes from being defined by a vertex of one child to a vertex of the other child.

68 Kinetic Data Structures -- COMP 76868 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Events –Flightplan-update – Occurs when the flightplan of a vertex changes.

69 Kinetic Data Structures -- COMP 76869 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Is this a “good” KDS? –Compact? –Efficient? –Responsive? –Localized?

70 Kinetic Data Structures -- COMP 76870 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Compact? –Like any other BVH, for n polygons, the BVH requires O(n) BVs. –Each BV in the tree has at most six events (leaf- or tree-events.) –So, queue size is O(n). Flightplan-change-events are more like impulse functions and would not actually occupy the queue.

71 Kinetic Data Structures -- COMP 76871 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Efficient? –The authors claim there are no internal events. –This would imply perfect efficiency (as the ratio between total events and external events is 1.) –However, this is not strictly true. Flightplan- change-events would not necessarily change the configuration function and should be considered “internal”.

72 Kinetic Data Structures -- COMP 76872 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Responsive? –This is a function on the action to be taken for each event. –Furthermore, because insertion and deletion of events from the queue may take place, queue performance plays a role. –We’ll assume that all operations on a queue with k elements are O(log k)

73 Kinetic Data Structures -- COMP 76873 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Responsive? – Leaf-event –New events must be calculated for all of the triangles in the leaf. O(1) if number of vertices per polygon is bounded. –Change in leaf BV needs to be propagated up the tree. –If the parent tree used the supplanted vertex for its extreme value, new tree events need also be calculated.

74 Kinetic Data Structures -- COMP 76874 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Responsive? – Leaf-event –This continues up the tree until a parent is encountered which uses a different vertex for it’s extreme extent. –At each level we need to delete and create events. O( log n ). –We might need to propagate all the way up so total work for Leaf-event is O( log 2 n ).

75 Kinetic Data Structures -- COMP 76875 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Responsive? – Tree-event –Recalculate all of the tree events for this node – O(1). –Propagate up the tree like the Leaf-event, inserting and deleting events at each level. –So, Tree-events are similarly O( log 2 n ).

76 Kinetic Data Structures -- COMP 76876 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Responsive? – Flighpath-change-event –This is tightly coupled to the locality of the structure. –The cost of a flightpath change is directly linked to the number of events that the changing vertex is used. –Assume that the vertex forms the extent of a BV in every level of the BVH (worst case.)

77 Kinetic Data Structures -- COMP 76877 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Responsive? – Flighpath-change-event –Assume that the degree of a vertex is bounded. –Then a vertex participates in O( log n) events. –The work done is O( log 2 n ).

78 Kinetic Data Structures -- COMP 76878 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Compact? –As shown in the responsiveness of the flightpath-change-event, a single vertex is in O( log n ) events.

79 Kinetic Data Structures -- COMP 76879 Kinetic Data Structures Kinetic Bounding Volume Hierarchy Performance? –The proof is insanely complex. –You don’t want to see it. –Really. –Honestly. –But, the basic answer is it’s basically optimal. (The non-optimality is the difference between n and n log* n.)

80 Kinetic Data Structures -- COMP 76880 Kinetic Data Structures Continuous Collision Detection KDS deals with events in continuous time. Clearly amenable to continuous collision detection. Such an algorithm/KDS exists. See references.

81 Kinetic Data Structures -- COMP 76881 References Basch, Guibas, Hershberger: Data Structures for Mobile Data. In SODA: ACM-SIAM Symposium on Discrete Algorithms. (1997) Zachmann, Weller: Kinetic bounding volume hierarchies for deformable objects. In ACM International Conference on Virtual Reality Continuum and Its Applications. (2006) Weller, Zachmann: Kinetic Separation Lists for Continuous Collision Detection of Deformable Objects. 3 rd Workshop in Virtual Reality Interaction and Physical Simulation. (2006) Kinetic Data Structures


Download ppt "Kinetic Data Structures and their Application in Collision Detection Sean Curtis COMP 768 Oct. 16, 2007."

Similar presentations


Ads by Google