Real-Time Game Physics

Slides:



Advertisements
Similar presentations
Kinetics of Particles Impulse and Momentum.
Advertisements

Conservative vs. Non-conservative Forces
Chapter 11 Angular Momentum
Kinetics of Particles: Energy and Momentum Methods
Chapter 9 Linear Momentum and Collisions. Linear momentum Linear momentum (or, simply momentum) of a point-like object (particle) is SI unit of linear.
Chapter 15: Kinetics of a Particle: Impulse and MomentumTextbook: Engineering Mechanics- STATICS and DYNAMICS- 11th Ed., R. C. Hibbeler and A. Gupta Course.
IMPACT Today’s Objectives: Students will be able to:
MAE 242 Dynamics – Section I Dr. Kostas Sierros.
Momentum Impulse, Linear Momentum, Collisions Linear Momentum Product of mass and linear velocity Symbol is p; units are kgm/s p = mv Vector whose direction.
Chapter 11 Angular Momentum.
Department of Physics and Applied Physics , F2010, Lecture 20 Physics I LECTURE 20 11/21/10.
UNC Chapel Hill S. Redon - M. C. Lin Rigid body dynamics II Solving the dynamics problems.
Linear Impulse & Linear Momentum
EGR 280 Mechanics 13 – Impulse and Momentum of Particles.
Linear Momentum and Collisions
PHY131H1S - Class 17 Today: Review for Test 2!.
CS 4730 Physical Simulation CS 4730 – Computer Game Design.
Angular Kinetics Explaining the Causes of Angular Motion
Reference Book is. NEWTON’S LAW OF UNIVERSAL GRAVITATION Before 1687, clear under- standing of the forces causing plants and moon motions was not available.
Newton’s Third Law of Motion
Ch.11 Energy I: Work and kinetic energy Ch. 11 Energy I: Work and kinetic energy.
Spring Topic Outline for Physics 1 Spring 2011.
Chapter 12 Linear Kinematics of Human Movement
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Linear momentum and Collisions
Momentum, Impulse, And Collisions
CHAPTER 13 Kinetics of Particles: Energy and Momentum Methods.
ESS 303 – Biomechanics Linear Kinetics. Kinetics The study of the forces that act on or influence movement Force = Mass * Acceleration: F = M * a Force.
MA4248 Weeks 1-3. Topics Coordinate Systems, Kinematics, Newton’s Laws, Inertial Mass, Force, Momentum, Energy, Harmonic Oscillations (Springs and Pendulums)
DYNAMICS The motion of a body is affected by other bodies present in the universe. This influence is called an interaction. vectors: force torque impulse.
ENGR 214 Chapter 17 Plane Motion of Rigid Bodies:
AP Physics C: Mechanics Chapter 11
Questions From Reading Activity? Big Idea(s):  The interactions of an object with other objects can be described by forces.  Interactions between.
Momentum and Its Conservation
Resistance of an object to a change in its motion inertia.
Chapter 6 Circular Motion and Other Applications of Newton’s Laws.
Linear Impulse & Linear Momentum Lecture VIII. Introduction From Newton ’ s 2 nd Law:  F = m a = m v. = d/dt (m v) The term m v is known as the linear.
Chapter 4 The Laws of Motion. Classes of Forces Contact forces involve physical contact between two objects Field forces act through empty space No physical.
Introduction to Simple Harmonic Motion Unit 12, Presentation 1.
Dynamics: Newton’s Laws of Motion. Concepts Force Newton’s First Law of Motion Mass Newton’s Second Law of Motion Newton’s Third Law of Motion Weight.
KINETICS OF PARTICLES: ENERGY AND MOMENTUM METHODS s2s2 A1A1 A2A2 A s1s1 s drdr F  ds Consider a force F acting on a particle A. The work of F.
Linear Momentum Impulse & Collisions. What is momentum?  Momentum is a measure of how hard it is to stop or turn a moving object.  What characteristics.
Dynamics: Newton’s Laws of Motion
Exam 2 Review 8.02 W08D1. Announcements Test Two Next Week Thursday Oct 27 7:30-9:30 Section Room Assignments on Announcements Page Test Two Topics: Circular.
DYNAMICS VECTOR MECHANICS FOR ENGINEERS: DYNAMICS Tenth Edition Ferdinand P. Beer E. Russell Johnston, Jr. Phillip J. Cornwell Lecture Notes: Brian P.
Chapter 11 Angular Momentum. Angular momentum plays a key role in rotational dynamics. There is a principle of conservation of angular momentum.  In.
Moment Of Inertia.
Chapter 6 Linear Momentum. Units of Chapter 6 Momentum and Its Relation to Force Conservation of Momentum Collisions and Impulse Conservation of Energy.
Computer Game Design and Development
Physics 211 Force and Equilibrium Hookes Law Newtons Laws Weight Friction Free Body Diagrams Force Problems 4: Classical Mechanics - Newtons Laws.
Circular Motion and Other Applications of Newton’s Laws
Chapter 5 The Laws of Motion.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Unit 2 Momentum and Impulse An Introduction to Momentum.
Dynamics: Newton’s Laws of Motion. Force A force is a push or pull. An object at rest needs a force to get it moving; a moving object needs a force to.
MECHANICS Ms. Peace Introduction. Sequence 1.1 What is Mechanics? 1.1 What is Mechanics? 1.2 Fundamental Concepts and Principles 1.2 Fundamental Concepts.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Particle Kinematics Direction of velocity vector is parallel to path Magnitude of velocity vector is distance traveled / time Inertial frame – non accelerating,
PHY 151: Lecture 7A 7.1 System and Environments 7.2 Work Done by a Constant Force 7.3 Scalar Product of Two Vectors 7.4 Work Done by a Varying Force 7.5.
Dynamics: Newton’s Laws of Motion
Kinetics of Particles: Newton’s Second Law
CHAPTER 4: Systems of Particles
Chapter 4 Dynamics: Newton’s Laws of Motion
Chapter 5 The Laws of Motion.
Dynamics: Newton’s Laws of Motion (Ch. 12)
ENGINEERING MECHANICS
Chapter 4 Dynamics: Newton’s Laws of Motion
AS-Level Maths: Mechanics 1 for Edexcel
Presentation transcript:

Real-Time Game Physics Approaches to create realistic motion for a game: For artists to author keyframe animations that give the appearance of being physically based. 2. Use motion capture technology to record real-life motions and then apply those recorded motions to game models. Both of approaches 1 & 2 are extremely labor intensive, and expensive. 3. Simulation of physics represents a third approach to generating realistic motion for games. Benefits: a cost savings to developers and publishers. Physics simulation has the potential to be far less expensive than keyframe or motion capture animation. By simulating physics at runtime, the game engine can create emergent behavior, leading to a richer game experience for the game player.

Real-Time Game Physics Rewind: A Fresh Look at Basic Physics The importance of consistent units It is necessary that you use consistent units in your equations. Equations will produce the wrong results if you use values with inconsistent units! Particle kinematics Particle kinematics are the basis for everything that follows. A particle to be a perfectly smooth, frictionless sphere with a finite radius. At any moment in time, t, the particle is located at a position, p, measured in an inertial reference frame. Position is measured in units of type distance or length. The SI units for position are meters (m). If the particle is moving, its position is a function of time, p(t).

Real-Time Game Physics Rewind: A Fresh Look at Basic Physics Particle kinematics At any moment in time, t, the particle is located at a position, p, measured in an inertial reference frame. Position is measured in units of type distance or length. The SI units for position are meters (m). If the particle is moving, its position is a function of time, p(t). The quantity, Δt, indicates an incremental change in time. The SI units for time are seconds. The vector quantity, velocity, is defined to be the change in position over time. The magnitude of velocity is the particle’s speed. Velocity and speed are measured in units of type distance over time. The SI units for velocity and speed are meters per second (m/s).

Real-Time Game Physics Rewind: A Fresh Look at Basic Physics Particle kinematics The vector quantity, velocity, is defined to be the change in position over time. The magnitude of velocity is the particle’s speed. Velocity and speed are measured in units of type distance over time. The SI units for velocity and speed are meters per second (m/s). Given the position of a particle at two different times, the average velocity between the start and end time can be computed as Instantaneous velocity at time t is the time derivative of position:

Real-Time Game Physics Rewind: A Fresh Look at Basic Physics Particle kinematics Acceleration is measured in units of type distance over the square of time. The SI units for acceleration are meters per second squared (m/s2).

Real-Time Game Physics Rewind: A Fresh Look at Basic Physics Newton’s famous laws Newton’s First Law of Motion states that an object will move at a constant velocity until compelled to change its velocity by forces imposed upon the object. Newton’s Second Law of Motion states that an object’s change in velocity is proportional to an applied force: F(t) = ma(t) The quantity, m, is called the mass of the object. The SI units for mass are kilograms (kg). Force is measured in units of type mass times distance over the square of time. The SI units for force are called Newton’s (N). The cycle of motion Force -> Acceleration -> a change in velocity -> a change in the position of a particle. By integrating the equations in reverse order, we can determine the motion of the particle. This is what physics simulation is all about. The effect of a constant force on particle motion

Real-Time Game Physics Rewind: A Fresh Look at Basic Physics Newton’s famous laws The effect of a constant force on particle motion Consistency of units, still important

Real-Time Game Physics Rewind: A Fresh Look at Basic Physics Newton’s famous laws The effect of a constant force on particle motion Projectile motion Here, we’ve chosen the up direction to be the positive z-axis in world space

Real-Time Game Physics Rewind: A Fresh Look at Basic Physics Newton’s famous laws Frictionless collision response Linear momentum is defined to be the vector quantity mass times velocity, or mV. Linear momentum is measured in units of type mass times distance over time. The SI units of linear momentum are kilogram-meters per second (kg-m/s). Linear momentum is related to the force being applied to an object. Consider two colliding particles, 1 and 2. For the duration of the collision, each particle exerts a force on the other. The duration of most collisions is an extremely short period of time, and yet the change in velocity of the objects is often dramatic. Linear impulse-momentum equation:

Real-Time Game Physics Rewind: A Fresh Look at Basic Physics Newton’s famous laws Frictionless collision response Newton’s Third Law of Motion states that for every action there is an equal but opposite reaction. The (coserved) linear impulse-momentum equation for particle 2: The net change in momentum of the two objects together is zero. Without friction, the impulse will always act purely along the unit surface normal vector at the point of contact. Observe the behavior when two objects in real life collide During the initial impact, both objects experience a period of deformation in which their shapes compress and deform in response to the collision force.

Real-Time Game Physics Rewind: A Fresh Look at Basic Physics Newton’s famous laws Frictionless collision response After the initial impact, the objects experience a period of restitution, in which they are restored to their natural shapes and accelerate to their after-collision velocities. In real life, as objects rebound after a collision, they may also slide past one another, remaining in contact for a while. The scalar ε is called the coefficient of restitution. This coefficient is related to the conservation or loss of kinetic energy during a collision. If ε is equal to 1, the collision is perfectly elastic, representing objects that rebound fully so that the sum of the particles’ kinetic energies is the same before and after the collision. If ε is equal to 0, the collision is perfectly plastic, representing objects that experience no period of restitution and a maximum loss of kinetic energy. In real life, ε is a function of the material properties of the objects involved in the collision. Finally:

Real-Time Game Physics Introduction to Numerical Physics Simulation Numerical simulation to a series of techniques that allow us to approximate the motion of objects with non-constant acceleration for which there is no closed form solution, e.g. wind and spring forces. Numerical integration of the Newtonian equation of motion Finite difference equation/Taylor series expansion of a vector property: Truncated Taylor series: For one particle:

Real-Time Game Physics Introduction to Numerical Physics Simulation Using numerical integration to simulate a collection of particles For a collection of N particles: S(t) = <m1V1, … mnVn> dS(t)/dt=<<F1,V1>, … <Fn, Vn >>

Real-Time Game Physics Introduction to Numerical Physics Simulation Collision response in the simulation loop Assume collision at exact time t, before execute DoPhysicsSimulationStep , for each colliding pair, compute the impulse, and then compute the after-collision linear momentums. Subtle complexity in the collision response: Collision occurs between time t and t+Δt, i.e. between 2 time steps. Multiple object collisions at same or different times within Δt Alternative collision response method Penalty force methods with stiff spring between colliding objects

Real-Time Game Physics Introduction to Numerical Physics Simulation Numerical stability issues and alternatives in explicit Euler integration Truncation error is always present in numerical integration. Error at each step accumulates into a total error in the state vector that may grow or shrink over time. A critical goal in numerical simulation is to ensure that the total error is bounded;. A numerical simulation in which the total error is bounded for all time is said to be numerically stable. Numerical integration techniques are said to be conditionally stable if they can be made stable by reducing the time step, Δt, below some threshold, a stability bound. Velocity-less Verler integrator

Real-Time Game Physics Introduction to Numerical Physics Simulation The importance of frame-rate independence

Real-Time Game Physics Common Features of Third-Party Physics Engines Static and kinematic objects An example of a static object is the terrain or level geometry for a typical platformer game. A kinematic object is called kinematic because it moves (and therefore has kinematic properties that change over time) but is not simulated using physics. Rigid body dynamics Rigid body dynamics refers to the simulation of objects that move and rotate based on the equations of motion with real-time physics, but that never deform or change shape. Rigid body dynamics are probably the most common type of physics-based simulation seen in games today. Soft body dynamics Soft bodies have geometry that does deform based on applied forces and interaction with other objects. A soft body’s center-of-mass moves and rotates according to the equations of motion; however, in addition to this overall motion, the body’s shape deforms.

Real-Time Game Physics Common Features of Third-Party Physics Engines Constraints Constraints are used to limit the motion of physically simulated objects in games. Hinge joint constraint would generate forces or impulses to prevent the door from rotating except along the axis of the hinge. Joint limits can prevent the door from opening beyond, say, 90 degrees. Ball joints allow two rigid bodies to rotate freely but limit translation. Sliding joints allow translation only along a certain axis, and others. Ragdoll and character physics Ragdolls are basically versions of a character’s skeleton where the keyframe animated bones have been replaced by rigid bodies that have been linked together by joints. Fluid dynamics Authoring physics content Emerging trends To support game objects that can be damaged and destroyed. Transition toward using the GPU to perform some of the physics computations.