Optimising the Computational Simulation of Mechanical Models: Designing a Real-Time Mass-Aggregate Physics Engine

Similar documents
Lecture V: The game-engine loop & Time Integration

PSE Game Physics. Session (6) Angular momentum, microcollisions, damping. Oliver Meister, Roland Wittmann

Simulation in Computer Graphics Elastic Solids. Matthias Teschner

Lecture IV: Time Discretization

Particle Systems. University of Texas at Austin CS384G - Computer Graphics

GAME PHYSICS ENGINE DEVELOPMENT

Applied Mathematics B Study Guide

Particle Systems. CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2017

41514 Dynamics of Machinery

PRINCIPLE OF LINEAR IMPULSE AND MOMENTUM (Section 15.1)

Physical Simulation. October 19, 2005

Chapter 13. Simple Harmonic Motion

Integral Section List for OCR Specification

Runga-Kutta Schemes. Exact evolution over a small time step: Expand both sides in a small time increment: d(δt) F (x(t + δt),t+ δt) Ft + FF x ( t)

Collision Resolution

Dynamics and control of mechanical systems

Review of Linear Momentum And Rotational Motion

AP Physics C Mechanics Objectives

Dynamics. Dynamics of mechanical particle and particle systems (many body systems)

APPLIED MATHEMATICS AM 02

Scientific Computing II

Physics Tutorial 6: Collision Response

Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion

Ordinary differential equations. Phys 420/580 Lecture 8

Projects. Assignments. Plan. Motivational Films. Motivational Film 1/6/09. Dynamics II. Forces, Collisions and Impulse

Kinematics (special case) Dynamics gravity, tension, elastic, normal, friction. Energy: kinetic, potential gravity, spring + work (friction)

Conservation of Linear Momentum : If a force F is acting on particle of mass m, then according to Newton s second law of motion, we have F = dp /dt =

2007 Problem Topic Comment 1 Kinematics Position-time equation Kinematics 7 2 Kinematics Velocity-time graph Dynamics 6 3 Kinematics Average velocity

Graphical Display of a Physics Simulation

Nov. 27, 2017 Momentum & Kinetic Energy in Collisions elastic collision inelastic collision. completely inelastic collision

Contents. Dynamics and control of mechanical systems. Focus on

Curriculum Map-- Kings School District Honors Physics

ENGI9496 Lecture Notes State-Space Equation Generation

Today s lecture. WEST VIRGINIA UNIVERSITY Physics

Ordinary Differential Equations II

Dynamical Systems. Mechanical Systems

Modeling and Solving Constraints. Erin Catto Blizzard Entertainment

Course syllabus Engineering Mechanics - Dynamics

PRINCIPLE OF LINEAR IMPULSE AND MOMENTUM

Lecture 41: Highlights

Passive Dynamics and Particle Systems COS 426

What make cloth hard to simulate?

SPRING SEMESTER AE 262 DYNAMICS. (02) Dr. Yavuz YAMAN

Virtual Reality & Physically-Based Simulation

Advanced Higher Mathematics of Mechanics

Game Physics. Game and Media Technology Master Program - Utrecht University. Dr. Nicolas Pronost

Rigid Body Dynamics and Beyond

Dynamics. Kinematics and Dynamics. Passive vs. Active Dynamics. Passive Dynamics. Passive Dynamics. Particle Systems

Time scales. Notes. Mixed Implicit/Explicit. Newmark Methods [ ] [ ] "!t = O 1 %

Distance travelled time taken and if the particle is a distance s(t) along the x-axis, then its instantaneous speed is:

Kinetics of Particles: Work and Energy

PSE Game Physics. Session (3) Springs, Ropes, Linear Momentum and Rotations. Atanas Atanasov, Philipp Neumann, Martin Schreiber

AP PHYSICS 1 Learning Objectives Arranged Topically

Fundamentals Physics

CS 480/680: GAME ENGINE PROGRAMMING

the gamedesigninitiative at cornell university Lecture 18 Box2D Physics

The dimensions of an object tend to change when forces are

Periodic Motion. Periodic motion is motion of an object that. regularly repeats

A Level Maths Notes: M2 Equations for Projectiles

Thomas Whitham Sixth Form Mechanics in Mathematics

Measurement p. 1 What Is Physics? p. 2 Measuring Things p. 2 The International System of Units p. 2 Changing Units p. 3 Length p. 4 Time p. 5 Mass p.

Physics 2101 S c e t c i cti n o 3 n 3 March 31st Announcements: Quiz today about Ch. 14 Class Website:

Lab/Demo 5 Periodic Motion and Momentum PHYS 1800

APPLIED MATHEMATICS IM 02

[ ] is a vector of size p.

Game Physics: Basic Concepts

Review of Linear Momentum And Rotational Motion

Momentum. Edexcel GCE. Core Mathematics M1

Thursday Simulation & Unity

Baccalieu Collegiate. Physics Course Outline

Collisions Impulse and Momentum

PHYSICS. Course Structure. Unit Topics Marks. Physical World and Measurement. 1 Physical World. 2 Units and Measurements.

Translational and Rotational Dynamics!

6.11 MECHANICS 3, M3 (4763) A2

2.004 Dynamics and Control II Spring 2008

PHYS 1114, Lecture 33, April 10 Contents:

IMPACT Today s Objectives: In-Class Activities:

A level Exam-style practice

Numerical Methods for the Solution of Differential Equations

Physics 231. Topic 7: Oscillations. Alex Brown October MSU Physics 231 Fall

Ordinary Differential Equations II

Assignment 4: Rigid Body Dynamics

Curriculum Map-- Kings School District- Physics

Modeling Mechanical Systems

CS-184: Computer Graphics

EQUIVALENT SINGLE-DEGREE-OF-FREEDOM SYSTEM AND FREE VIBRATION

Dynamic Loads CE 543. Examples. Harmonic Loads

Leaving Cert Applied Maths: Some Notes

One-dimensional kinematics

, gives a coupled set of first order dt m differential equations.

GAME PHYSICS (INFOMGP) FINAL EXAM

CEE 271: Applied Mechanics II, Dynamics Lecture 17: Ch.15, Sec.2 4

Integration of the equation of motion with respect to time rather than displacement leads to the equations of impulse and momentum.

Visual Interactive Simulation, TDBD24, Spring 2006

1 Restatement of the Problem. 2 Terms and Ambiguous Words. 3 Ambiguous Words. 4 Assumptions. # 6654 Page 2 / 19

Numerical Methods for ODEs. Lectures for PSU Summer Programs Xiantao Li

Evaluation copy 10A. Impulse and Momentum. Experiment INTRODUCTION OBJECTIVES MATERIALS PRE-LAB QUESTIONS

Page 1 of 9. Curriculum Map: Physics/Lab Course: Physics Sub-topic: Physics. Unit: Language of Physics Timeline: 2 Weeks Unit Description:

Impulse and Momentum

Structural Dynamics Lecture 4. Outline of Lecture 4. Multi-Degree-of-Freedom Systems. Formulation of Equations of Motions. Undamped Eigenvibrations.

Transcription:

Optimising the Computational Simulation of Mechanical Models: Designing a Real-Time Mass-Aggregate Physics Engine Jordan Spoooner July 16, 2015

What is a Physics Engine? Engine: Computer software that performs a fundamental function, especially as part of a larger program Moves objects Detects collisions Resolves collisions

Moves Objects Newton s Laws of Motion A body will remain at rest or continue with constant velocity unless acted upon by an external force The acceleration of the body is proportional to the resultant force acting upon the body a = F m For every action there is an equal and opposite reaction

Storing the Data Particles - No volume, no angular motion Position, Velocity, and Acceleration - What about speed/ direction of motion? (a = dn) Mass Volume/ Any other variables? class Particle{ protected: Vector3 position; Vector3 velocity; Vector3 acceleration; real damping; real inversemass;}

Implementation: The Update Loop The integrator Separate to graphics Calculates change in position, p Damping

The Integrator Resolves forces a = F m v = a dt s = v dt, s = p

Algorithms for Numerical Integration Explicit Euler Integration vn+1 = v n + a n t sn+1 = s n + v n t Implicit Euler Integration v n+1 = v n + a n+1 t s n+1 = s n + v n+1 t Semi-Implicit Euler Integration v n+1 = v n + a n t s n+1 = s n + v n+1 t Verlet Integration sn+1 = s n + v n t + a n t 2 and v n = sn sn 1 t gives s n+1 = 2S n S n 1 + a n t 2

Runge-Kutta Methods By Solving Differential Equations: Figure: Runge-Kutta Method for Numerical Integration

Damping Why do we include damping? Issues caused by variable frame rate

Implementation Calculating the new position: Calculating the new velocity: p = p + vt v = vd t + at if (inversemass <= 0.0f) return; assert(duration > 0.0); position.addscaledvector(velocity, duration); velocity.addscaledvector(acceleration, duration); velocity *= real pow(damping, duration);

Testing: Projectiles Figure: Projectile Simulation projectilenumber->particle.setmass(200.0f); projectilenumber-> particle.setvelocity(projectilevelocity); projectilenumber-> particle.setacceleration(0.0f,-20.0f,0.0f); projectilenumber->particle.setdamping(0.99f); projectilenumber->particle.setposition(0.0f,1.5f,0.0f);

Forces D Alemberts Principle: F = i F i Figure: Geometrical Representation of Vector Addition Interfaces and Polymorphism

Implementation void PForceReg::updateForces(real duration){ Registry::iterator i = registrations.begin(); for(; i!= registrations.end(); i++){ i->fg->updateforce(i->particle, duration);}}

Springs Hooke s Law: f = kx Applications Stiff Springs Figure: Stiff Springs over Time

force.normalize(); force *= magnitude; particle->addforce(force);} Implementation void PSpring::updateForce(Particle *particle, real duration){ Vector3 force; particle->getposition(&force); force -= other->getposition(); real magnitude = force.magnitude(); magnitude = real abs(magnitude - restlength); magnitude *= springconstant;

Broadphase Collision Detection Methods BSP (Octrees/ Quadtrees) Figure: BSP Method for Broadphase Collision Detection

Sort and Sweep Figure: Sort and Sweep Method for Broadphase Collision Detection

Narrowphase Collision Detection and Resolving Interpenetration Figure: Resolving Interpenetration

Limitations High-Speed? Objects at Rest? Figure: Errors Caused by Objects at Rest

Dealing with Multiple Objects? Figure: Interpenetration Resolution with Multiple Objects p a = m b m a+m b dn and p b = ma m a+m b dn

Collision Resolution Figure: The Impulse Method for Collision Resolution Newton s Law of Restitution: v = eu Law of Conservation of Momentum: m a u a + m b u b = m a v a + m b v b Equating Impulses: j a = j b where j = mv mu Other Methods? Applications

Implementation Get approach speed v = eu v total = v u j total = m total v total v a = j total m a v b = j total m b

Limitations of the Real-Time Mass-Aggregate Physics Engine Rigid Bodies Soft Bodies