Contact Manifolds Erin Catto Blizzard Entertainment.

Slides:



Advertisements
Similar presentations
Computer Graphics - Rasterization -
Advertisements

Everything you ever wanted to know about collision detection
The Gilbert-Johnson-Keerthi (GJK) Algorithm
2.4. Primitive Tests - Closest point
2.5. B ASIC P RIMITIVE I NTERSECTION Details of common forms of primitive intersection test.
Physics for Game Programmers Contacts or “How (Not) To Make It Stick” Gino van den Bergen
Intersection Testing Chapter 13 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
Collision Detection CSCE /60 What is Collision Detection?  Given two geometric objects, determine if they overlap.  Typically, at least one of.
Collision Detection and Resolution Zhi Yuan Course: Introduction to Game Development 11/28/
Geometry Primer Lines and rays Planes Spheres Frustums Triangles Polygon Polyhedron.
2.1. C OLLISION D ETECTION Overview. Collision detection is used within many types of application, e.g. from robotics, through engineering simulations,
CSE 380 – Computer Game Programming Collision Detection & Response Erin Catto’s Box2D.
Continuous Collision Detection: Progress and Challenges Gino van den Bergen dtecta
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Basic 3D collision detection We want to know if objects have touched Objects are considered to.
Chapter 6: Vertices to Fragments Part 2 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
UNC Chapel Hill M. C. Lin References Collision Detection between Geometric Models: A Survey, by M. Lin and S. Gottschalk, Proc. of IMA Conference on Mathematics.
1 Geometry A line in 3D space is represented by  S is a point on the line, and V is the direction along which the line runs  Any point P on the line.
CS CS 175 – Week 2 Processing Point Clouds Registration.
Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection  Essential for many games –Shooting –Kicking, punching,
CS 326 A: Motion Planning robotics.stanford.edu/~latombe/cs326/2004/index.htm Collision Detection and Distance Computation.
OBBTree: A Hierarchical Structure for Rapid Interference Detection Gottschalk, M. C. Lin and D. ManochaM. C. LinD. Manocha Department of Computer Science,
Oct 3, Fall 2005Game Design1 Collision Detection.
Visualization and graphics research group CIPIC January 21, 2003Multiresolution (ECS 289L) - Winter Surface Simplification Using Quadric Error Metrics.
Providing Haptic ‘Hints’ to Automatic Motion Planners Providing Haptic ‘Hints’ to Automatic Motion Planners by Burchan Bayazit Department of Computer Science.
Computer graphics & visualization Collision Detection – Narrow Phase.
12/4/2001CS 638, Fall 2001 Today Using separating planes/axes for collision testing Collision detection packages.
Fast and Simple Physics using Sequential Impulses
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012.
Haptic rendering Part 1 4/CY/B3 Part 1. Collision detection and response Nic Melder Part 2. Manipulation and polygon transitions (T.B.A.)
CSE 380 – Computer Game Programming Box2D Box2D TestBed.
CSE 381 – Advanced Game Programming Quickhull and GJK.
Human interface Section, P&I Lab, Titech Real-time Rigid Body Simulation for Haptic Interactions Based on Contact Volume of Polygonal Objects Shoichi Hasegawa,
Collision handling: detection and response
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Collisions & Contact.
3.4. C ONTACT G ENERATION Generating contacts between rigid bodies.
 d.s. wu 1 Penalty Methods for Contact Resolution interactive contact resolution that usually works pi david s wu.
1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 6, 2002 Day 10.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
1Computer Graphics Implementation II Lecture 16 John Shearer Culture Lab – space 2
Implementation II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
A Computationally Efficient Framework for Modeling Soft Body Impact Sarah F. Frisken and Ronald N. Perry Mitsubishi Electric Research Laboratories.
Implementation II.
Chipmunk Physics Remember that we talked about this a bit when we did collision handlers for the space ship integration task (SpritesActionsPhysicsSound).
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Computer Graphics I, Fall 2010 Implementation II.
Visible-Surface Detection Methods. To identify those parts of a scene that are visible from a chosen viewing position. Surfaces which are obscured by.
Minkowski Sums and Distance Computation Eric Larsen COMP
1 Haptic Systems Mohsen Mahvash Lecture 6 17/1/06.
The point opposite the base of the pyramid
2D Simulation of Rigid Bodies
Computer Graphics Implementation II
Distance Computation “Efficient Distance Computation Between Non-Convex Objects” Sean Quinlan Stanford, 1994 Presentation by Julie Letchner.
2.1. Collision Detection Overview.
Parts of these slides are based on
References Additional lecture notes for 2/18/02.
Chapter 4.2 Collision Detection and Resolution
Physics for Games Programmers: Crash Course in Collision Detection
Implementation II Ed Angel Professor Emeritus of Computer Science
2.5. Basic Primitive Intersection
Young J. Kim Ming C. Lin Dinesh Manocha
References Collision Detection between Geometric Models: A Survey, by M. Lin and S. Gottschalk, Proc. of IMA Conference on Mathematics of Surfaces 1998.
Computer Animation Algorithms and Techniques
Introduction to Computer Graphics with WebGL
Implementation II Ed Angel Professor Emeritus of Computer Science
Separating Axis Theorem (SAT)
Presentation transcript:

Contact Manifolds Erin Catto Blizzard Entertainment

Executive Summary Constraint solvers need contact points to prevent penetration. We can use SAT to compute a contact manifold in one shot. We can use GJK to build up a contact manifold point-by-point.

Contact Contact occurs when two shapes touch. We model contact to prevent penetration and to simulate friction. Modeling contact requires some geometry and a lot of finesse.

Contact Manifolds For convex polyhedra, a contact manifold is ideally a single point, a line segment, or a convex polygon. For general convex 3D shapes, the contact manifold is a convex 2D shape. Did I mention overlap?

Overlap Happens What we want. What we get.

Approximate Manifolds We use a collection of contact points to approximate the contact manifold. Our goal is fast, stable, and plausible simulation. In this sense, computing good manifolds is an art.

Contact Points Position Normal Penetration Contact ID

Example Manifold Two points and a common normal

Contact Manifold Quality When objects penetrate significantly the contact manifold is fuzzy. Contact solvers like coherence. Be consistent from step-to-step.

Fuzziness manifold 1 manifold 2 manifold 3

Extreme Fuzziness manifold 2 manifold 1

Using the SAT Mainly useful for convex polyhedra (boxes, triangles, etc). Find the axis of minimum penetration. For edge-edge contact, find the midpoint. For face contact, use Sutherland-Hodgeman clipping.

Example: 2D Box-Box SAT First find the separating axis with the minimum penetration. In 2D the separating axis is a face normal.

Box-Box Clipping Setup Identify reference face Identify incident face incident reference

Box-Box Clipping clipping planes Clip incident face against reference face side planes (but not the reference face). Consider clip points with positive penetration.

Feature Flip-Flop Which normal is the min separating axis? Apply weightings to prefer one axis over another. Improved coherence.

Coherence Apply old force/impulse solution at the beginning of the step. Fewer iterations and greater stability. We need a way to match old and new contacts.

Feature-Based Contact Points Each contact point is the result of clipping. It is the junction of two different edges. An edge may come from either box. Store the two edge numbers with each contact point – this is the Contact ID.

Contact Point IDs 2 1 box 1 edge 2 box 2 edge 3 box 2 edge 3

GJK Contact Points Three cases: - No contact - Shallow contact - Deep contact

GJK Shallow Contact The support points are scaled up by a small margin to detect contact. Compute the closest points (no margin). This gives the position and normal. The penetration is the margin minus the true distance.

GJK Contact Margins Margin Core Shape Core Shape

GJK Contact Point normal point distance

GJK Deep Contact An awkward encounter …

Deep Contact Use some other algorithm. It will be slower than GJK, but it won’t last long. SAT, EPA, brute force. Read Gino’s book to learn EPA.

GJK Manifolds GJK only gives one contact point at a time. We hold on to and treasure each contact point. Build a manifold over several time steps. This automatically provides coherence.

Building the Manifold t = 0 t = 1 t = 2

Manifold Persistence Track the points in each body. If the points move too far apart, dismiss them. This is bad for sliding. Use Contact IDs?

Adding New Points Keep a minimal set of points per manifold (e.g. 4 points). Reject new points that are too close to old points.

Manifold Reduction This applies to one-shot and incremental manifolds. We want to keep the minimum number of contact points for a stable simulation. This improves performance drastically.

Example Reduction A Table Before After

Further Reading http://www.gphysics.com/downloads/ http://www.continuousphysics.com Collision Detection in Interactive 3D Environments by Gino van den Bergen Fast Contact Reduction for Dynamics Simulation by Adam Moravanszky and Pierre Terdiman in Game Programming Gems 4.