Game Physics Chris Miles. The Goal To learn how to create game objects with realistic physics models To learn how to simulate aspects of reality in order.

Slides:



Advertisements
Similar presentations
Chapter 9 Objectives Calculate the torque created by a force.
Advertisements

Rigid Body Dynamics Jim Van Verth
Manipulator Dynamics Amirkabir University of Technology Computer Engineering & Information Technology Department.
Rotation and Torque Lecture 09 Thursday: 12 February 2004.
Dynamics of Rotational Motion
Chapter 11 Angular Momentum.
Rotational Dynamics Chapter 9.
Chapter 11 Angular Momentum; General Rotation Introduction Recap from Chapter 10 –Used torque with axis fixed in an inertial frame –Used equivalent of.
Chapter 11 Angular Momentum.
Rotational Motion - refers to motion of a body about a fixed axis of rotation wherein, the particles have the same instantaneous angular velocity.
1Notes  Demetri Terzopoulos talk: Thursday, 4pm Dempster 310.
ME Robotics Dynamics of Robot Manipulators Purpose: This chapter introduces the dynamics of mechanisms. A robot can be treated as a set of linked.
Chapter 10: Rotation. Rotational Variables Radian Measure Angular Displacement Angular Velocity Angular Acceleration.
Ch. 7: Dynamics.
Euler Rotation. Angular Momentum  The angular momentum J is defined in terms of the inertia tensor and angular velocity. All rotations included  The.
Phy 211: General Physics I Chapter 10: Rotation Lecture Notes.
AAE 666 Final Presentation Spacecraft Attitude Control Justin Smith Chieh-Min Ooi April 30, 2005.
Rigid Bodies Rigid Body = Extended body that moves as a unit Internal forces maintain body shape Mass Shape (Internal forces keep constant) Volume Center.
Manipulator Dynamics Amirkabir University of Technology Computer Engineering & Information Technology Department.
Introduction to ROBOTICS
Computer graphics & visualization Rigid Body Simulation.
Velocities and Static Force
CS 4730 Physical Simulation CS 4730 – Computer Game Design.
Feature-length films: Games: Desktop Animations: Computer Animation.
Angular Kinetics Explaining the Causes of Angular Motion
Rotational Dynamics Angular Momentum. Collisions. o Rotational Dynamics  Basic Concepts Rotation Angular speed Torque Angular Acceleration  Nature of.
Rotation and angular momentum
Spring Topic Outline for Physics 1 Spring 2011.
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Game Physics – Part IV Moving to 3D
College of Physics Science & Technology YANGZHOU UNIVERSITYCHINA Chapter 11ROTATION 11.1 The Motion of Rigid Bodies Rigid bodies A rigid body is.
Chapter 11 Angular Momentum. The Vector Product There are instances where the product of two vectors is another vector Earlier we saw where the product.
Chapters 10, 11 Rotation and angular momentum. Rotation of a rigid body We consider rotational motion of a rigid body about a fixed axis Rigid body rotates.
Rotation Rotational Variables Angular Vectors Linear and Angular Variables Rotational Kinetic Energy Rotational Inertia Parallel Axis Theorem Newton’s.
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
Chapter 9: Rotational Dynamics
AP Physics C: Mechanics Chapter 11
Chapter 10 Rotation.
Lecture Fall 2001 Physically Based Animation Ordinary Differential Equations Particle Dynamics Rigid-Body Dynamics Collisions.
Rotational Mechanics. Rotary Motion Rotation about internal axis (spinning) Rate of rotation can be constant or variable Use angular variables to describe.
Advanced Computer Graphics Rigid Body Simulation Spring 2002 Professor Brogan.
Types of Motion Topic 4 – Movement Analysis
Rotational Kinetic Energy An object rotating about some axis with an angular speed, , has rotational kinetic energy even though it may not have.
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
Chapter 11 Angular Momentum. Introduction When studying angular motion, angular momentum plays a key role. Newton’s 2 nd for rotation can be expressed.
Geometric Algebra Dr Chris Doran ARM Research 3. Applications to 3D dynamics.
Angular Momentum Section 8.1 (Ewen et al. 2005) Objectives: Define and calculate moment of inertia. Define and calculate moment of inertia. Define and.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Rigid Body Dynamics CSE169: Computer Animation
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’
Dynamics. Motion with Regard to Mass Particle Dynamics Mass concentrated in point Newton’s Equation Governs Motion f = M x.
Rotational Dynamics Rode, Kiana, Tiana, and Celina.
1 7. Rotational motion In pure rotation every point of an object moves in a circle whose center lies on the axis of rotation (in translational motion the.
1 Angular Momentum Chapter 11 © 2012, 2016 A. Dzyubenko © 2004, 2012 Brooks/Cole © 2004, 2012 Brooks/Cole Phys 221
UNIT 6 Rotational Motion & Angular Momentum Rotational Dynamics, Inertia and Newton’s 2 nd Law for Rotation.
Advanced Computer Graphics Rigid Body Simulation
Manipulator Dynamics 1 Instructor: Jacob Rosen
7. Rotational motion In pure rotation every point of an object moves in a circle whose center lies on the axis of rotation (in translational motion the.
Lecture Rigid Body Dynamics.
Lecture 16 Newton Mechanics Inertial properties,Generalized Coordinates Ruzena Bajcsy EE
Manipulator Dynamics 2 Instructor: Jacob Rosen
Chapter Rotation In this chapter we will study the rotational motion of rigid bodies about a fixed axis. To describe this type of.
Rigid Body Dynamics (unconstrained)
Rigid Body Dynamics ~ f = p h g
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,
Advanced Games Development Game Physics
Physics 319 Classical Mechanics
Chapter 10 - Friday October 22nd
Presentation transcript:

Game Physics Chris Miles

The Goal To learn how to create game objects with realistic physics models To learn how to simulate aspects of reality in order to make them behave more realistically

Overview Newton’s laws Data types Particle implementation Rigid body implementation

Newton’s Laws of Motion 1. Inertia 2. F = ma 3. Equal and opposite

How They Apply Velocity remains constant unless acted on by a force. Objects accelerate via f = ma Interactions between objects should affect both similarly

How They Don’t Apply 1. Velocities that reduce over time give better numerical stability 2. Objects are often moved instantaneously 3. Many interactions are one-sided, there is no reason to simulate the other side.

An Object – Rigid Body An object that moves but does not change shape “Mass properties” define how these objects are affected by forces 1. Mass 2. Moment of inertia 3. Center of gravity

Simulation We want to write a simulation describing the motion of the object look at the universe after 1 second, 2 seconds, so on and so on. integrate the equations of motion between those steps

Data Types Scalar Vector Matrix Quaternion Euler Angles Rotation Matrix Tensor

Scalars Scalars are a single number They represent simple characteristics, such as mass

Vectors [2,5][1,5,17][-.14,5,-7] Vectors usually represent a location, both in world and local space

Quaternion Quaternion’s contain an orientation Explaining how they work is long and fruitless Know that they hold an orientation in some undecipherable way Can quickly rotate vectors, cumulate easily, and interpolate smoothly Used by virtually every modern game engine (Laura Croft gets points for pioneering)

Particles First we will look at particles, which are a reduced form of Rigid Bodies Particles differ in that they do not have orientation, they just have positions

Euler angles What quaternions were developed to replace Vector containing rotations around x,y,z Suffers from gimbal lock - makes it impossible to go from some orientations to others in a single step Interpolates poorly - very ugly animations / camera movement Understandable

Rotation matrixes Another alternative to quaternions Too large, requires 9 variables vs. 4 Numerically unstable – unnormalizes over time Slower

Tensor Don’t worry about them, math term Generalization of scalars/vectors/matrix’s Scalars are rank 0 tensor, vectors 1, matrix’s 2 Concerned with rank 2 tensors, for moment of inertia Can also accurately simulate drag

Particle Class Definition Class Particle – vector position – vector velocity – vector resultantForce – scalar mass – Function Integrate( dtime ) – Called every time step to update position

Function Integrate( dtime ) //dtime = how much time has passed in this time step position += velocity * dtime velocity += force / mass force = 0

Improvements Violate law #1, have velocities slowly decrease – greatly increases numerical stability Original: – velocity += force / mass * dtime New: – velocity += (force/mass – velocity*cf)* dtime cf should be a coefficient of on the order of.999 or so

Implicit Integration We are doing explicit (forward) euler integration so far in our modeling. If stability is an issue you can use implicit integration T/examples/Simulation_rep/node89.html is a good overview T/examples/Simulation_rep/node89.html

Runge-Kutta Precise integration technique Sample several times for each time step. t = 0, t =.25, t =.5, t =.75 to find value at t = 1 Provides very accurate results

Rigid Body Position and Orientation Linear and Angular movements are independent and analagous

Rigid Body Class Definition Class RigidBody – vector position – vector velocity – vector resultantForce – scalar mass – quaternion orientation – vector rotationalVelocity – vector resultantTorque – tensormomentOfInertia – Function Integrate( dtime )

Moments of Inertia The moment of inertia is the rotational equivalent to mass, it describes how hard an object is to rotate Depends on the axis of rotation so it is a tensor, mapping from a direction to a magnitude 3x3 matrix Just using a simple scalar in this example7

Calculating Moments of Inertia Producing the values that go inside the moment of inertia is non trivial. Assign point masses to the object, representing where things are distributed Then Σmr 2

Ideal Integrate function position += velocity * dtime velocity += force / mass * dtime force = 0 orientation += rotationalVelocity * dtime rotationalVelocity += torque / momentOfInertia * dtime torque = 0

Complications Quaternion operators are odd so to add rotationalVelocity from – orientation += rotationalVelocity * dtime to – o += (rv * o) / 2.0f * dtime;

Point Forces To calculate the torque caused by point forces Use the vector cross product force X position = torque Where position is the vector from the center of gravity to the point