dcd3765e193def7a5374c410f31b38b4.ppt
- Количество слайдов: 81
Kinetic Data Structures and their Application in Collision Detection Sean Curtis COMP 768 Oct. 16, 2007 Kinetic Data Structures -- COMP 768
Kinetic Data Structures 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 -- COMP 768 2
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 3
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 4
Kinetic Data Structures Motivation What happens to the CH when they start moving? Kinetic Data Structures -- COMP 768 5
Kinetic Data Structures Motivation What happens to the CH when they start moving? Kinetic Data Structures -- COMP 768 6
Kinetic Data Structures Motivation What happens to the CH when they start moving? Kinetic Data Structures -- COMP 768 7
Kinetic Data Structures Motivation What happens to the CH when they start moving? Kinetic Data Structures -- COMP 768 8
Kinetic Data Structures Motivation What happens to the CH when they start moving? Kinetic Data Structures -- COMP 768 9
Kinetic Data Structures Motivation What happens to the CH when they start moving? Kinetic Data Structures -- COMP 768 10
Kinetic Data Structures Motivation What happens to the CH when they start moving? Kinetic Data Structures -- COMP 768 11
Kinetic Data Structures Motivation What happens to the CH when they start moving? Kinetic Data Structures -- COMP 768 12
Kinetic Data Structures Motivation What happens to the CH when they start moving? Kinetic Data Structures -- COMP 768 13
Kinetic Data Structures Motivation What happens to the CH when they start moving? Kinetic Data Structures -- COMP 768 14
Kinetic Data Structures Motivation • Simple solution – Take small time steps and recalculate the CH for each configuration of points. Kinetic Data Structures -- COMP 768 15
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 16
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 17
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 18
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 19
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 20
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 21
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 22
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 23
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 24
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 25
Kinetic Data Structures 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 -- COMP 768 26
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 27
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 28
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 29
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 30
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 31
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 32
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 33
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 34
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 35
Kinetic Data Structures Motivation Kinetic Data Structures -- COMP 768 36
Kinetic Data Structures 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 Structures -- COMP 768 37
Kinetic Data Structures 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 -- COMP 768 38
Kinetic Data Structures 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 -- COMP 768 39
Kinetic Data Structures Concepts • Kinetization – The process of transforming an algorithm on static data into a data structure appropriate for continuously changing data. Kinetic Data Structures -- COMP 768 40
Kinetic Data Structures 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 -- COMP 768 41
Kinetic Data Structures Concepts • Global Event Queue – Means through which the object’s motion is connected to the data structure. – Narrow interface. Kinetic Data Structures -- COMP 768 42
Kinetic Data Structures 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 -- COMP 768 43
Kinetic Data Structures 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 -- COMP 768 44
Kinetic Data Structures 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 -- COMP 768 45
Kinetic Data Structures 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 -- COMP 768 46
Kinetic Data Structures 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 -- COMP 768 47
Kinetic Data Structures 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 -- COMP 768 48
Kinetic Data Structures Simple Example Points on a line What is the right-most point? 0 1 2 3 4 5 6 7 8 x Kinetic Data Structures -- COMP 768 49
Kinetic Data Structures Simple Example Points on a line What is the right-most point? 0 1 2 3 4 5 6 7 8 x Kinetic Data Structures -- COMP 768 50
Kinetic Data Structures Simple Example Points on a line What is the right-most point? position 8 6 4 2 0 1 2 3 4 5 6 time Kinetic Data Structures -- COMP 768 51
Kinetic Data Structures Simple Example Points on a line What is the right-most point? Proposed KDS 8 position 6 - Maintain sorted list. 4 - Every time two points cross we have an event. 2 0 1 2 3 time 4 5 6 - Swap two elements in sorted order. Kinetic Data Structures -- COMP 768 52
Kinetic Data Structures Simple Example Points on a line What is the right-most point? Proposed KDS 8 position 6 - Responsive! 4 - Efficient! 2 - Not compact! 0 1 2 3 time 4 5 6 - Not localized! Kinetic Data Structures -- COMP 768 53
Kinetic Data Structures Simple Example Points on a line Worst case – Not compact and not local position 8 6 4 2 0 1 2 3 4 5 6 time Kinetic Data Structures -- COMP 768 54
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. Kinetic Data Structures -- COMP 768 55
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. Kinetic Data Structures -- COMP 768 56
Kinetic Data Structures Kinetic Bounding Volume Hierarchy • The idea Kinetic Data Structures -- COMP 768 57
Kinetic Data Structures Kinetic Bounding Volume Hierarchy • The idea Kinetic Data Structures -- COMP 768 58
Kinetic Data Structures Kinetic Bounding Volume Hierarchy • The idea (xmax, ymax) (xmin, ymin) Kinetic Data Structures -- COMP 768 59
Kinetic Data Structures Kinetic Bounding Volume Hierarchy • The idea ymax xmin xmax Kinetic Data Structures -- COMP 768 ymin 60
Kinetic Data Structures Kinetic Bounding Volume Hierarchy • The idea ymax xmin xmax Kinetic Data Structures -- COMP 768 ymin 61
Kinetic Data Structures Kinetic Bounding Volume Hierarchy • The idea ymax xmin xmax ymin Kinetic Data Structures -- COMP 768 62
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. Kinetic Data Structures -- COMP 768 63
Kinetic Data Structures Kinetic Bounding Volume Hierarchy • Events – Leaf-event – Occurs when one vertex in the polygon overtakes an extreme vertex. Kinetic Data Structures -- COMP 768 64
Kinetic Data Structures Kinetic Bounding Volume Hierarchy • Events – Leaf-event – Occurs when one vertex in the polygon overtakes an extreme vertex. Kinetic Data Structures -- COMP 768 65
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. Kinetic Data Structures -- COMP 768 66
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. Kinetic Data Structures -- COMP 768 67
Kinetic Data Structures Kinetic Bounding Volume Hierarchy • Events – Flightplan-update – Occurs when the flightplan of a vertex changes. Kinetic Data Structures -- COMP 768 68
Kinetic Data Structures Kinetic Bounding Volume Hierarchy • Is this a “good” KDS? – Compact? – Efficient? – Responsive? – Localized? Kinetic Data Structures -- COMP 768 69
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. Kinetic Data Structures -- COMP 768 70
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. Flightplanchange-events would not necessarily change the configuration function and should be considered “internal”. Kinetic Data Structures -- COMP 768 71
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) Kinetic Data Structures -- COMP 768 72
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. Kinetic Data Structures -- COMP 768 73
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 ). Kinetic Data Structures -- COMP 768 74
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 ). Kinetic Data Structures -- COMP 768 75
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. ) Kinetic Data Structures -- COMP 768 76
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 ). Kinetic Data Structures -- COMP 768 77
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. Kinetic Data Structures -- COMP 768 78
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. ) Kinetic Data Structures -- COMP 768 79
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. Kinetic Data Structures -- COMP 768 80
Kinetic Data Structures 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 -- COMP 768 81


