Christer Ericson — «Real Time Collision Detection

Total Page:16

File Type:pdf, Size:1020Kb

Christer Ericson — «Real Time Collision Detection Accurate and efficient collision detection in complex environments is one of the foundations of today’s cutting-edge computer games. Yet collision detection is notoriously difficult to implement robustly and takes up an increasingly large fraction of compute cycles in current game engines as increasingly detailed environments are becoming the norm. Real-time Collision Detection is a comprehensive reference on this topic,covering it with both breadth and depth. Not only are the fundamental algorithms explained clearly and in detail, but Ericson’s book covers crucial implementation issues, including geometric and numeric robustness and cache-efficient implementations of the algorithms. Together, these make this book a“must have”practical reference for anyone interested in developing interactive applications with complex environments. –Matt Pharr, Senior Software Developer, NVIDIA Christer Ericson’s Real-time Collision Detection is an excellent resource that covers the fundamentals as well as a broad array of techniques applicable to game development. –Jay Stelly, Senior Engineer,Valve Christer Ericson provides a practical and very accessible treatment of real-time collision detection.This includes a comprehensive set of C++ implementations of a very large number of routines necessary to build such applications in a context which is much broader than just game programming. The programs are well-thought out and the accompanying discussion reveals a deep understanding of the graphics, algorithms, and ease of implementation issues. It will find a welcome home on any graphics programmer’s bookshelf although it will most likely not stay there long as others will be constantly borrowing it. –Hanan Samet, Professor of Computer Science, University of Maryland Real-Time Collision Detection is an excellent resource that every serious engine programmer should have on his bookshelf. Christer Ericson covers an impressive range of techniques and presents them using concise mathematics, insightful figures, and practical code. –Eric Lengyel, Senior Programmer, Naughty Dog If you think you already know everything about collision detection, you’re in for a surprise! This book not only does an excellent job at presenting all the collision detection methods known to date, it also goes way beyond the standard material thanks to a plethora of juicy, down-to-earth, hard-learned implementation tips and tricks. This produces a perfect blend between theory and practice, illustrated by the right amount of source code in appropriate places. Basically the book just oozes with experience. Christer doesn’t forget all the alternative topics that, despite not directly related to collision detection, can ruin your implementation if you don’t include them in your design. The chapters on robustness and optimization are priceless in this respect. Its carefully crafted compact kd-tree implementation beautifully concludes a unique book full of luminous gems. –Pierre Terdiman, Principal Software Engineer, NovodeX AG (author of the OPCODE collision detection library) ThisPageIntentionallyLeftBlank Real-Time Collision Detection The Morgan Kaufmann Series in Interactive 3D Technology Series Editor: David H. Eberly, Magic Software, Inc. The game industry is a powerful and driving force in the evolution of computer technology. As the capabilities of personal computers, peripheral hardware, and game consoles have grown, so has the demand for quality information about the algorithms, tools, and descriptions needed to take advantage of this new technology. To satisfy this demand and establish a new level of professional reference for the game developer, we created the Morgan Kaufmann Series in Interactive 3D Technology. Books in the series are written for developers by leading industry professionals and academic researchers, and cover the state of the art in real-time 3D. The series emphasizes practical, working solutions and solid software-engineering principles. The goal is for the developer to be able to implement real systems from the fundamental ideas, whether it be for games or other applications. Real-Time Collision Detection Christer Ericson 3D Game Engine Architecture: Engineering Real-Time Applications with Wild Magic David H. Eberly Physically Based Rendering: From Theory to Implementation Matt Pharr and Greg Humphreys Essential Mathematics for Game and Interactive Applications: A Programmer’s Guide James M.VanVerth and Lars M. Bishop Game Physics David H. Eberly Collision Detection in Interactive 3D Environments Gino van den Bergen 3D Game Engine Design: A Practical Approach to Real-Time Computer Graphics David H. Eberly Forthcoming Artificial Intelligence for Computer Games Ian Millington Visualizing Quaternions Andrew J. Hanson Better Video Game Characters by Design: Using Psychology to Make Better Games Katherine Isbister Real-Time Collision Detection Christer Ericson Sony Computer Entertainment America AMSTERDAM • BOSTON • HEIDELBERG • LONDON NEW YORK • OXFORD • PARIS • SAN DIEGO SAN FRANCISCO • SINGAPORE • SYDNEY • TOKYO Morgan Kaufmann Publishers is an imprint of Elsevier Senior Editor Tim Cox Publishing Services Manager Simon Crump Senior Project Manager Angela Dooley Assistant Editor Richard Camp Cover Design Chen Design Associates Cover Image Text Design Composition CEPHA Technical Illustration Dartmouth Publishing, Inc. Copyeditor Betty Pessagno Proofreader Phyllis Coyne et al. Indexer Northwind Editorial Interior Printer The Maple-Vail Book Manufacturing Group Cover Printer Phoenix Color, Inc. Morgan Kaufmann Publishers is an imprint of Elsevier. 500 Sansome Street, Suite 400, San Francisco, CA 94111 This book is printed on acid-free paper. © 2005 by Elsevier Inc. All rights reserved. Designations used by companies to distinguish their products are often claimed as trademarks or registered trademarks. In all instances in which Morgan Kaufmann Publishers is aware of a claim, the product names appear in initial capital or all capital letters. Readers, however, should contact the appropriate companies for more complete information regarding trademarks and registration. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means—electronic, mechanical, photocopying, scanning, or otherwise—without prior written permission of the publisher. Permissions may be sought directly from Elsevier’s Science & Technology Rights Department in Oxford, UK: phone: (+44) 1865 843830, fax: (+44) 1865 853333, e-mail: permissions@elsevier. com.uk.You may also complete your request on-line via the Elsevier homepage (http://elsevier.com) by selecting “Customer Support”and then “Obtaining Permissions.” Library of Congress Cataloging-in-Publication Data Application submitted ISBN: 1-55860-732-3 For information on all Morgan Kaufmann publications, visit our Web site at www.mkp.com Printed in the United States of America 0807060504 54321 To mom About the Author Christer Ericson is a senior principal programmer and the tools and technology lead at Sony Computer Entertainment America in Santa Monica. Before joining Sony in 1999, he was a senior programmer at Neversoft Entertainment. Christer received his Masters degree in computer science from Umeå University, Sweden, where he also lectured for several years before moving to the US in 1996. Christer has served on the advisory board for Full Sail’s Game Design and Development degree program since 2002. His interests are varied, but he takes a particular interest in program optimization, a topic he has spoken on at the Game Developers Conference. Contents List of Figures xxi Preface xxxvii Chapter 1 Introduction 1 1.1 Content Overview 2 1.1.1 Chapter 2: Collision Detection Design Issues 2 1.1.2 Chapter 3: A Math and Geometry Primer 2 1.1.3 Chapter 4: BoundingVolumes 3 1.1.4 Chapter 5: Basic Primitive Tests 3 1.1.5 Chapter 6: BoundingVolume Hierarchies 3 1.1.6 Chapter 7: Spatial Partitioning 3 1.1.7 Chapter 8: BSP Tree Hierarchies 4 1.1.8 Chapter 9: Convexity-based Methods 4 1.1.9 Chapter 10: GPU-assisted Collision Detection 4 1.1.10 Chapter 11: Numerical Robustness 4 1.1.11 Chapter 12: Geometrical Robustness 4 1.1.12 Chapter 13: Optimization 5 1.2 About the Code 5 Chapter 2 Collision Detection Design Issues 7 2.1 Collision Algorithm Design Factors 7 2.2 Application Domain Representation 8 2.2.1 Object Representations 8 2.2.2 CollisionVersus Rendering Geometry 11 2.2.3 Collision Algorithm Specialization 12 2.3 Types of Queries 13 2.4 Environment Simulation Parameters 14 ix x Contents 2.4.1 Number of Objects 14 2.4.2 SequentialVersus Simultaneous Motion 15 2.4.3 DiscreteVersus Continuous Motion 16 2.5 Performance 17 2.5.1 Optimization Overview 18 2.6 Robustness 19 2.7 Ease of Implementation and Use 19 2.7.1 Debugging a Collision Detection System 20 2.8 Summary 21 Chapter 3 A Math and Geometry Primer 23 3.1 Matrices 23 3.1.1 Matrix Arithmetic 25 3.1.2 Algebraic Identities Involving Matrices 26 3.1.3 Determinants 27 3.1.4 Solving Small Systems of Linear Equation Using Cramer’s Rule 29 3.1.5 Matrix Inverses for 2 × 2 and 3 × 3 Matrices 31 3.1.6 Determinant Predicates 32 3.1.6.1 ORIENT2D(A, B, C )32 3.1.6.2 ORIENT3D(A, B, C, D)33 3.1.6.3 INCIRCLE2D(A, B, C, D)34 3.1.6.4 INSPHERE(A, B, C, D, E )34 3.2 Coordinate Systems and Points 35 3.3 Vectors 35 3.3.1 Vector Arithmetic 37 3.3.2 Algebraic Identities InvolvingVectors 38 3.3.3 The Dot Product 39 3.3.4 Algebraic Identities Involving Dot Products 40 3.3.5 The Cross Product 41 3.3.6 Algebraic Identities Involving Cross Products 44 3.3.7
Recommended publications
  • Tree Code for Collision Detection of Large Numbers of Particles
    Tree Code for Collision Detection of Large Numbers of Particles Application for the Breit-Wheeler Process [preprint] O. Jansen, E. d’Humi`eres, X. Ribeyre, S. Jequier, V.T. Tikhonchuk Univ. Bordeaux/CNRS/CEA, Centre Lasers Intenses et Applications [email protected] August 4, 2016 Abstract Collision detection of a large number N of particles can be challenging. Directly testing N particles for 2 collision among each other leads to N queries. Especially in scenarios, where fast, densely packed particles interact, challenges arise for classical methods like Particle-in-Cell or Monte-Carlo. Modern collision detec- tion methods utilising bounding volume hierarchies are suitable to overcome these challenges and allow a detailed analysis of the interaction of large number of particles. This approach is applied to the analysis of the collision of two photon beams leading to the creation of electron-positron pairs. Keywords tree code; collision detection; QED; Breit-Wheeler process; pair creation; astronomy 1 Introduction Modelling a large number of particles often is a challenge in physics. Many-body problems are well known in astronomy, plasma physics, solid state physics and other disciplines. In astronomy a common way to overcome the challenge of simulating a many-body problem, like the movement of stars of one galaxy under each others gravitational force, is to use the Barnes-Hut (BH) method [1]. In a BH simulation space is partitioned in an hierarchic octree structure. The tree branches grow towards successive smaller volumes of space in such way as to include at maximum one particle (star) in each leaf node, while still covering the entirety of the simulation domain.
    [Show full text]
  • Efficient Algorithms for Two-Phase Collision Detection
    MERL { A MITSUBISHI ELECTRIC RESEARCH LABORATORY http://www.merl.com Ecient Algorithms for Two-Phase Collision Detection Brian Mirtich TR-97-23 Decemb er 1997 Abstract This article describ es practical collision detection algorithms for rob ot motion planning. Attention is restricted to algorithms that handle rigid, p olyhedral ge- ometries. Both broad phase and narrow phase detection strategies are discussed. For the broad phase, an algorithm using axes-aligned b ounding b oxes and a hi- erarchical spatial hash table is describ ed. For the narrow-phase, the Lin-Canny algorithm is presented. Alternatives to these algorithms are also discussed. Fi- nally, the article describ es a scheduling paradigm for managing collision checks that can further reduce computation time. Pointers to downloadable software are included. To appear in Practical Motion Planning in Rob otics: Current Approaches and Future Directions, K. Gupta and A.P. del Pobil, editors. This work may not b e copied or repro duced in whole or in part for any commercial purp ose. Permission to copy in whole or in part without payment of fee is granted for nonpro t educational and research purp oses provided that all such whole or partial copies include the following: a notice that such copying is by p er- mission of Mitsubishi Electric Information Technology Center America; an acknowledgment of the authors and individual contributions to the work; and all applicable p ortions of the copyright notice. Copying, repro duction, or republishing for any other purp ose shall require a license with payment of fee to Mitsubishi Electric Information Technology Center America.
    [Show full text]
  • An Optimal Solution for Implementing a Specific 3D Web Application
    IT 16 060 Examensarbete 30 hp Augusti 2016 An optimal solution for implementing a specific 3D web application Mathias Nordin Institutionen för informationsteknologi Department of Information Technology Abstract An optimal solution for implementing a specific 3D web application Mathias Nordin Teknisk- naturvetenskaplig fakultet UTH-enheten WebGL equips web browsers with the ability to access graphic cards for extra processing Besöksadress: power. WebGL uses GLSL ES to communicate with graphics cards, which uses Ångströmlaboratoriet Lägerhyddsvägen 1 different Hus 4, Plan 0 instructions compared with common web development languages. In order to simplify the development process there are JavaScript libraries handles the Postadress: Box 536 751 21 Uppsala communication with WebGL. On the Khronos website there is a listing of 35 different Telefon: JavaScript libraries that access WebGL. 018 – 471 30 03 It is time consuming for developers to compare the benefits and disadvantages of all Telefax: these 018 – 471 30 00 libraries to find the best WebGL library for their need. This thesis sets up requirements of a Hemsida: specific WebGL application and investigates which libraries that are best for http://www.teknat.uu.se/student implmeneting its requirements. The procedure is done in different steps. Firstly is the requirements for the 3D web application defined. Then are all the libraries analyzed and mapped against these requirements. The two libraries that best fulfilled the requirments is Three.js with Physi.js and Babylon.js. The libraries is used in two seperate implementations of the intitial game. Three.js with Physi.js is the best libraries for implementig the requirements of the game.
    [Show full text]
  • Mathematical Approaches for Collision Detection in Fundamental Game Objects
    Mathematical Approaches for Collision Detection in Fundamental Game Objects Weihu Hong1 , Junfeng Qu2, Mingshen Wu3 1 Department of Mathematics, Clayton State University, Morrow, GA, 30260 2 Department of Information Technology, Clayton State University, Morrow, GA, 30260 3Department of Mathematics, Statistics, and Computer Science, University of Wisconsin-Stout, Menomonie, WI 54751 Otherwise, a lot of false alarm will be introduced in collision Abstract – This paper presents mathematical solutions for detection as show in Figure 1, where two objects, one circle computing whether or not fundamental objects in game and one pentagon, are not collided at all even the represented development collide with each other. In game development, sprites collide each other. detection of collision of two or more objects is often brought up. By categorizing most fundamental boundaries in game object, this paper will provide some mathematical fundamental methods for detection of collisions between objects identified. The approached methods provide more precise and efficient solutions to detect collisions between most game objects with mathematical formula proposed. Keywords: Collision detection, algorithm, sprite, game object, game development. 1 Introduction Figure 1. Collision detection based on Boundary The goal of collision detection is to automatically report a geometric contact when it is about to occur or has actually occurred. It is very common in game development that objects in the game science controlled by game player might collide each other. Collision detection is an essential component in video game implementation because it delivers events in the game world and drives game moving though game paths designed. In most game developing environment, game developers relies on written APIs to detect collisions in the game, for example, XNA Game Studio from Microsoft, Cocoa from (a) (b) Apple, and some other software packages developed by other parties.
    [Show full text]
  • Opencl Accelerated Rigid Body and Collision Detection
    OpenCL accelerated rigid body and collision detection Erwin Coumans Advanced Micro Devices Robotics: Science and Systems Conference 2011 Overview • Intro • GPU broadphase acceleration structures • GPU convex contact generation and reduction • GPU BVH acceleration for concave shapes • GPU constraint solver Robotics: Science and Systems Conference 2011 Industry view PS3, Xbox 360, x86, PowerPC, PC, iPhone, Android Havok, PhysX Cell, ARM Bullet, ODE, Newton, PhysBAM, Box2D OpenCL, CUDA Hardware Platform C++ APIs and Implementations Custom in-house Rockstar, Epic physics engines EA, Disney Games Industry Content Creation Maya, 3ds Max, Houdini, LW, Game and Film Tools Cinema 4D Sony Imageworks physics Simulation Movie Industry Blender Data PDI Dreamworks representation Academia, Universities Conferences, binary .hkx, ILM, Disney Presentations .bullet format Stanford, UNC FBX, COLLADA GDC, SIGGRAPH etc. Robotics: Science and Systems Conference 2011 Our open source work • Bullet Physics SDK, http://bulletphysics.org • Sony Computer Entertainment Physics Effects • OpenCL/DirectX11 GPU physics research Robotics: Science and Systems Conference 2011 OpenCL™ • Open development platform for multi-vendor heterogeneous architectures • The power of AMD Fusion: Leverages CPUs and GPUs for balanced system approach • Broad industry support: Created by architects from AMD, Apple, IBM, Intel, NVIDIA, Sony, etc. AMD is the first company to provide a complete OpenCL solution • Kernels written in subset of C99 Robotics: Science and Systems Conference 2011 Particle
    [Show full text]
  • Bounding Volume Hierarchies
    Simulation in Computer Graphics Bounding Volume Hierarchies Matthias Teschner Outline Introduction Bounding volumes BV Hierarchies of bounding volumes BVH Generation and update of BVs Design issues of BVHs Performance University of Freiburg – Computer Science Department – 2 Motivation Detection of interpenetrating objects Object representations in simulation environments do not consider impenetrability Aspects Polygonal, non-polygonal surface Convex, non-convex Rigid, deformable Collision information University of Freiburg – Computer Science Department – 3 Example Collision detection is an essential part of physically realistic dynamic simulations In each time step Detect collisions Resolve collisions [UNC, Univ of Iowa] Compute dynamics University of Freiburg – Computer Science Department – 4 Outline Introduction Bounding volumes BV Hierarchies of bounding volumes BVH Generation and update of BVs Design issues of BVHs Performance University of Freiburg – Computer Science Department – 5 Motivation Collision detection for polygonal models is in Simple bounding volumes – encapsulating geometrically complex objects – can accelerate the detection of collisions No overlapping bounding volumes Overlapping bounding volumes → No collision → Objects could interfere University of Freiburg – Computer Science Department – 6 Examples and Characteristics Discrete- Axis-aligned Oriented Sphere orientation bounding box bounding box polytope Desired characteristics Efficient intersection test, memory efficient Efficient generation
    [Show full text]
  • Covered Objects∗
    The Complexity of the Union of (α, β)-Covered Objects∗ Alon Efrat† January 28, 2000 Abstract An (α, β)-covered object is a simply connected planar region c with the property that for each point p ∈ ∂c there exists a triangle contained in c and having p as a vertex, such that all its angles are at least α and all its edges are at least β · diam(c)- long. This notion extends that of fat convex objects. We show that the combinatorial complexity of the union of n (α, β)-covered objects of ‘constant description complexity’ 2 is O(λs+2(n)log n log log n), where s is the maximum number of intersections between the boundaries of any pair of the given objects. 1 Introduction A planar object c is (α, β)-covered if the following conditions are satisfied. 1. c is simply-connected; 2. For each point p ∈ ∂c we can place a triangle ∆ fully inside c, such that p is a vertex of ∆, each angle of ∆ is at least α, and the length of each edge of ∆ is at least β ·diam(c). We call such a triangle ∆ a good triangle for c. The notion of (α, β)-covered objects generalizes the notion of convex fat objects. A planar convex object c is α-fat if the ratio between the radii of the balls s+ and s− is at most α, where s+ is the smallest ball containing c and s− is a largest ball that is contained in c. It is easy to show that an α-fat convex object is an (α′, β′)-covered object, for appropriate constants α′, β′ that depend on α.
    [Show full text]
  • Efficient Collision Detection Using Bounding Volume Hierarchies of K
    Efficient Collision Detection Using Bounding Volume £ Hierarchies of k -DOPs Þ Ü ß James T. Klosowski Ý Martin Held Joseph S.B. Mitchell Henry Sowizral Karel Zikan k Abstract – Collision detection is of paramount importance for many applications in computer graphics and visual- ization. Typically, the input to a collision detection algorithm is a large number of geometric objects comprising an environment, together with a set of objects moving within the environment. In addition to determining accurately the contacts that occur between pairs of objects, one needs also to do so at real-time rates. Applications such as haptic force-feedback can require over 1000 collision queries per second. In this paper, we develop and analyze a method, based on bounding-volume hierarchies, for efficient collision detection for objects moving within highly complex environments. Our choice of bounding volume is to use a “discrete orientation polytope” (“k -dop”), a convex polytope whose facets are determined by halfspaces whose outward normals come from a small fixed set of k orientations. We compare a variety of methods for constructing hierarchies (“BV- k trees”) of bounding k -dops. Further, we propose algorithms for maintaining an effective BV-tree of -dops for moving objects, as they rotate, and for performing fast collision detection using BV-trees of the moving objects and of the environment. Our algorithms have been implemented and tested. We provide experimental evidence showing that our approach yields substantially faster collision detection than previous methods. Index Terms – Collision detection, intersection searching, bounding volume hierarchies, discrete orientation poly- topes, bounding boxes, virtual reality, virtual environments.
    [Show full text]
  • On the Theoretical Complexity of the Silhouette of a Polyhedron
    On the theoretical complexity of the silhouette of a polyhedron M´emoire soutenu le vendredi 5 septembre 2003 par Marc Glisse 1 pour l'obtention du dipl^ome d'´etudes approfondies sous la direction de Sylvain Lazard 2 1Ecole´ Normale Sup´erieure, 45, rue d'Ulm, 75005 Paris, France. Email: [email protected] 2Inria Lorraine, Nancy. Email: [email protected] Abstract We study conditions under which the silhouette of a polyhedron is guaranted to be sublinear, either on average or in the worst case, and give some counter-examples when not. Contents 1 Introduction 2 2 Definitions and general remarks 2 2.1 View, silhouette . 2 2.2 Projective invariance . 2 2.3 kD-fatness . 2 2.4 Duality . 3 3 Polytopes 3 3.1 First examples . 3 3.2 Apparent length of a polytope . 4 3.3 Worst-case complexity for polytopes . 5 3.3.1 The cylinder example . 5 3.3.2 Local theorem . 6 3.3.3 Global theorem . 6 3.3.4 Existence of such polytopes . 7 3.4 Average complexity for polytopes . 7 3.5 Lower bound for polytopes . 8 4 Approximation of a surface 9 4.1 Kettner and Welzl . 9 4.2 Average case . 9 4.2.1 Smooth surface . 9 4.2.2 Generalization . 10 4.2.3 Shadow . 10 4.3 Worst case . 10 4.3.1 The sphere . 10 4.3.2 Other surfaces . 10 5 Conclusion 11 1 1 Introduction Given a viewpoint, the apparent boundary of a polyhedron (in 3D), or silhouette, is the set of edges incident to a visible face and an invisible one, and in the neighbourhood of which one can see infinity; a face whose supporting plane contains the viewpoint is considered invisible.
    [Show full text]
  • A New Fast and Robust Collision Detection and Force Computation Algorithm Applied to the Physics Engine Bullet: Method, Integration, and Evaluation
    Conference and Exhibition of the European Association of Virtual and Augmented Reality (2014) G. Zachmann, J. Perret, and A. Amditis (Editors) A New Fast and Robust Collision Detection and Force Computation Algorithm Applied to the Physics Engine Bullet: Method, Integration, and Evaluation Mikel Sagardia †, Theodoros Stouraitis‡, and João Lopes e Silva§ German Aerospace Center (DLR), Institute of Robotics and Mechatronics, Germany Abstract We present a collision detection and force computation algorithm based on the Voxelmap-Pointshell Algorithm which was integrated and evaluated in the physics engine Bullet. Our algorithm uses signed distance fields and point-sphere trees and it is able to compute collision forces between arbitrary complex shapes at simulation frequencies smaller than 1 msec. Utilizing sphere hierarchies, we are able to rapidly detect likely colliding areas, while the point trees can be used for processing colliding regions in a level-of-detail manner. The integration into the physics engine Bullet was performed inheriting interface classes provided in that framework. We compared our algorithm with Bullet’s native GJK, GJK with convex decomposition, and GImpact, varying the resolution and the scenarios. Our experiments show that our integrated algorithm performs with similar computation times as the standard collision detection algorithms in Bullet if low resolutions are chosen. With high resolutions, our algorithm outperforms Bullet’s native implementations and objects behave realistically. Categories and Subject Descriptors (according to ACM CCS): Computing Methodologies [I.3.5]: Computational Geometry and Object Modeling—Geometric algorithms, Object hierarchies; Computing Methodologies [I.3.7]: Three-Dimensional Graphics and Realism—Animation, Virtual reality. 1. Introduction The physics library Bullet [Cou14] provides with several collision detection implementations able to handle simple Methods that perform collision detection and force compu- geometries and a powerful rigid body dynamics framework.
    [Show full text]
  • Approximation Algorithms for Polynomial-Expansion and Low-Density Graphs∗
    Approximation Algorithms for Polynomial-Expansion and Low-Density Graphs∗ Sariel Har-Peledy Kent Quanrudz September 23, 2015 Abstract We investigate the family of intersection graphs of low density objects in low dimensional Eu- clidean space. This family is quite general, includes planar graphs, and in particular is a subset of the family of graphs that have polynomial expansion. We present efficient (1 + ")-approximation algorithms for polynomial expansion graphs, for Independent Set, Set Cover, and Dominating Set problems, among others, and these results seem to be new. Naturally, PTAS's for these problems are known for subclasses of this graph family. These results have immediate interesting applications in the geometric domain. For example, the new algorithms yield the only PTAS known for covering points by fat triangles (that are shallow). We also prove corresponding hardness of approximation for some of these optimization problems, characterizing their intractability with respect to density. For example, we show that there is no PTAS for covering points by fat triangles if they are not shallow, thus matching our PTAS for this problem with respect to depth. 1. Introduction Many classical optimization problems are intractable to approximate, let alone solve. Motivated by the discrepancy between the worst-case analysis and real-world success of algorithms, more realistic models of input have been developed, alongside algorithms that take advantage of their properties. In this paper, we investigate approximability of some classical optimization problems (e.g., set cover and independent set, among others) for two closely-related families of graphs: Graphs with polynomially- bounded expansion, and intersection graphs of geometric objects with low-density.
    [Show full text]
  • Continuous Collision Principle Software Engineer, Blizzard
    Erin Catto, @erin_catto Continuous Collision Principle Software Engineer, Blizzard Expert Lego Set Number 952, 315 pieces, 1978 Games are fancy flipbooks Games are just fancy flip books. We draw discrete frames that are snapshots of a moving world. Of course the difference is that in a game, the player can influence what is drawn in each frame. Physics engines usually operate in the same way. The engine executes discrete time steps, usually of a fixed size, that march the simulation forward in time. When we do this, the physics engine can miss events that happen in between frames. Discrete steps lead to missed events Consider a bouncing ball. Discrete time steps are good enough for most of the simulation. However, suppose the discrete time steps skip over the time where the ball hits the floor. How can the ball bounce if it never touches the floor? Well it won't and this is a big problem for physics engines. Solution #1: Ignore the bug Bye! If you ignore the missed collision you can get tunneling. In this case the ball falls out of the world. Many physics engines don’t address this problem and leave it up to the game to fix (or ignore the problem). In some cases this is a reasonable choice. For example, if two pieces of debris pass through each other quickly in a game, you may never notice and it doesn’t effect the outcome of the game. Solution #2: Make the floor thicker You can prevent missed collisions by using more forgiving geometry. In this case I made the floor thicker to catch the ball.
    [Show full text]