2D Simulation of Rigid Bodies

Slides:



Advertisements
Similar presentations
AP Physics C Mechanics Review.
Advertisements

Collision Response Jim Van Verth
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
Collision Detection and Resolution Zhi Yuan Course: Introduction to Game Development 11/28/
Rotational Motion Chapter Opener. Caption: You too can experience rapid rotation—if your stomach can take the high angular velocity and centripetal acceleration.
Force vs. Torque Forces cause accelerations
Rotational Equilibrium and Rotational Dynamics
Angular Momentum (of a particle) O The angular momentum of a particle, about the reference point O, is defined as the vector product of the position, relative.
3.5. C ONTACT R ESOLUTION Resolving a set of contacts.
Color Problem Have a black-box function that returns a bright color in 24-bit RGB Want a paler version of the output What to do?
Chapter 5 Rotation of a Rigid Body. §5-5 Angular Momentum of a rigid Body Conservation of Angular Momentum §5-1 Motion of a Rigid body §5-2 Torque The.
Problem Solving For Conservation of Momentum problems: 1.BEFORE and AFTER 2.Do X and Y Separately.
Scenegraph. Scenegraph Nodes - all implement a run function Leaf/Geo Nodes - typedefs of sgNode superclass –Poly Mesh A geo node that stores a list of.
1cs533d-winter-2005 Notes  Assignment 2 going okay? Make sure you understand what needs to be done before the weekend  Read Guendelman et al, “Nonconvex.
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.
UNC Chapel Hill S. Redon - M. C. Lin Rigid body dynamics II Solving the dynamics problems.
Physics 101: Lecture 15, Pg 1 Physics 101: Lecture 15 Impulse and Momentum l Today’s lecture will be a review of Chapters and l New material:
Chapter 10 Rotational Motion
Rigid Bodies Rigid Body = Extended body that moves as a unit Internal forces maintain body shape Mass Shape (Internal forces keep constant) Volume Center.
Introduction What is this ? What is this ? This project is a part of a scientific research in machine learning, whose objective is to develop a system,
Computer graphics & visualization Collision Detection – Narrow Phase.
3.7. O THER G AME P HYSICS A PPROACHES Overview of other game engine physics approaches.
Work Let us examine the work done by a torque applied to a system. This is a small amount of the total work done by a torque to move an object a small.
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Theory of Machines Lecture 4 Position Analysis.
Give the expression for the velocity of an object rolling down an incline without slipping in terms of h (height), M(mass), g, I (Moment of inertia) and.
CSE 380 – Computer Game Programming Box2D Box2D TestBed.
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.
REVISION MOMENTUM. the product of an object's mass and its velocity a vector quantity with the same direction as the velocity of the object. MOMENTUM.
Concepts for Programming a Rigid Body Physics Engine Part 1 Presented by Scott Hawkins.
Chapter 11 General Rotation.
Evolving Virtual Creatures & Evolving 3D Morphology and Behavior by Competition Papers by Karl Sims Presented by Sarah Waziruddin.
Chapter 8 Rotational Motion.
Chapter 17 PLANE MOTION OF RIGID BODIES: ENERGY AND MOMENTUM METHODS
Developing An Educational Rigid Body Dynamics Physics Engine By Neal Milstein.
ME 115: Dynamics of Machinery Manuel Leija Christian Reyes.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
1 Frisbee Physics Simulation Charles George Advisor: Brian Postow 03/05/05.
ONLINE CONFERENCE DESIGN.BUILD.DELIVE R with WINDOWS PHONE THURSDAY 24 MARCH 2011.
9.4. Newton’s Second Law for Rotational Motion A model airplane on a guideline has a mass m and is flying on a circle of radius r (top view). A net tangential.
Chipmunk Physics Remember that we talked about this a bit when we did collision handlers for the space ship integration task (SpritesActionsPhysicsSound).
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
CSE 380 – Advanced Game Programming Sweep & Prune.
Impulse, Momentum and Collisions. Interactions and Impulse From –an expertly placed shot in a soccer match –to the violent tug-of- war between galaxies.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Rigid Body Dynamics: A Graphical Simulation Eugene Paik
Advanced Games Development Game Physics CO2301 Games Development 1 Week 19.
Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’
Havok Xtra Training
Concepts for Programming a Rigid Body Physics Engine Part 2 Presented by Scott Hawkins.
Fundamentals of Computer Animation Collision Detection and Response.
Chapter 6 Momentum. Linear Momentum Momentum = p Momentum = mass x velocity p = mv Units are kilogram-meters per second (kg·m/s)
Research and Development of a Physics Engine by Timmy Loffredo.
Graphical Display of a Physics Simulation
Done already for your convenience!
Rotational Kinetic Energy
ME 115: Dynamics of Materials
Rigid Body Dynamics Simulation
3.7. Other Game Physics Approaches
Chapter 8 Rotational Motion.
Physics 111 Practice Problem Solutions 09 Rotation, Moment of Inertia SJ 8th Ed.: Chap 10.1 – 10.5 Contents 11-4, 11-7, 11-8, 11-10, 11-17*, 11-22, 11-24,
Computer Animation Algorithms and Techniques
Advanced Games Development Game Physics
Rigid Body: Rotational and Translational Motion; Rolling without Slipping 8.01 W11D1 Today’s Reading Assignment Young and Freedman: 10.3.
TJHSST Systems Lab Rigid Body Dynamics Simulation
3.3: Rectangle Collisions
Separating Axis Theorem (SAT)
Presentation transcript:

2D Simulation of Rigid Bodies Alan Hazelden

Motivation Almost all games involve physics Pong, Mario Almost all game objects are rigid bodies Detailed representation not required

Project Goals Realistic looking behaviour Primitive objects: circles convex polygons Compound bodies union of two or more primitive shapes Friction

Choice of Language Written in C++ Using the Warwick Game Design C++ library Sets up the display window and graphics Internal database – DOSTE Easy saving/loading of objects and world state Event handlers In-game console

Implementation Creating and drawing objects Collision detection

Implementation Collision resolution Conservation of momentum Coefficient of restitution No angular movement Resting contacts

Implementation Rotation Must ensure that no energy is added to the system Resting contacts No longer stable Problems appear with many stacked objects Solution: more contact points More time spent processing

Implementation Friction Forces applied at right angles to the contact normal

The final result Every frame: All bodies are moved simultaneously The collision detection system is run Every pair of colliding bodies is detected and stored The collision resolver is run Velocities are updated Penetration is removed All bodies are drawn at their new positions

Collision Detection Information needed: Contact normal Contact point Penetration distance How to get this information? Separating Axis Theorem

Separating Axis Theorem

Conclusions What works well Collision detection Collision response What doesn't Not easily reusable Unstable with large numbers of contacts Changes from initial plan Resting contacts more complex than expected Compound bodies not implemented

Possible Extensions Compound bodies Joints/Springs/Rods Simultaneous calculation of collision points Smarter algorithms 3D

Demo & Questions