Lecture Notes for Chapter 12: Mechanics 2 - Game Math

68
Chapter 12: Mechanics 2: Linear & Rotational Dynamics Ian Parberry University of North Texas Fletcher Dunn Valve Software 3D Math Primer for Graphics & Game Development

Transcript of Lecture Notes for Chapter 12: Mechanics 2 - Game Math

Page 1: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

Chapter 12: Mechanics 2: Linear & Rotational Dynamics

Ian ParberryUniversity of North Texas

Fletcher DunnValve Software

3D Math Primer for Graphics & Game Development

Page 2: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 2

What You’ll See in This Chapter

This chapter considers the cause of motion, its orientation, and how we might go about simulating it on a computer. It is divided into six sections. • Section 12.1 gives an overview of Newton’s 3 laws. • Section 12.2 talks about the cause of motion: the force.• Section 12.3 introduces momentum.• Section 12.4 looks at collisions and impulse.• Section 12.5 is about rotational dynamics.• Section 12.6 discusses digital simulation of mechanics.

Chapter 12 Notes

Page 3: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 3

Word Cloud

Chapter 11 Notes

Page 4: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

Section 12.1:

Newton’s 3 Laws

Chapter 12 Notes 3D Math Primer for Graphics & Game Dev 4

Page 5: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 5

Sir Isaac Newton

• Sir Isaac Newton established three simple laws that provide a framework, which we call Newtonian or classical mechanics.

• It doesn’t hold at high speeds or small distances, but it’s good enough for everyday life, and video games.

• (Image from Wikimedia Commons.)

Chapter 12 Notes

Page 6: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 6

Newton’s First Law

Every body persists in its state of being at rest or of moving uniformly straight forward, except insofar as it is compelled to change its state by force impressed.

Chapter 12 Notes

Page 7: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 7

Newton’s Second Law

The acceleration of a body is proportional to (and in the same direction as) the net external force acting on the body, and inversely proportional to the mass of the body:

.

Chapter 12 Notes

Page 8: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 8

The Force

• Force is a vector. It has units like kg.m/sec2, also called a Newton.

• “Duct tape is like the force. It has a light side, a dark side, and it holds the universe together.” (Carl Zwanzig)

Chapter 12 Notes

Page 9: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 9

Free Body Diagram

Starting with a representation of the object.1. Draw and label all the forces acting on it.2. Sum those forces (using vector addition) to

compute the net force.3. Use Newton's 2nd law to compute the

acceleration of the object.4. Integrate the acceleration to determine the

motion of the object.

Chapter 12 Notes

Page 10: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 10

Differential Equations

When solving problems analytically, this means solving differential equations. We don't use any differential equations in this book because there are only a few simple cases that we will look at analytically. Numerical methods of integration must be used. Later, we examine Euler integration, which is the most simple method imaginable, but also the one used by most real-time rigid body simulators.Chapter 12 Notes

Page 11: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 11

Inertial Reference Frames

• This only works in a reference frame that is not accelerating.

• You have to invent fictional forces to explain why objects are not accelerating according to Newton’s 1st and 2nd laws.

• A robot in a falling elevator is in a noninertial frame. He must invent a fictitious upward force to counteract gravity to explain why his herring sandwich doesn’t fall.

Chapter 12 Notes

Page 12: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 12Chapter 12 Notes

To a passing alien who is not accelerating, Newton’s laws work just fine, and there is no need to invent a fictional force.

Page 13: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 13

Newton’s Third Law

To every action there is always an equal and opposite reaction. Or, the forces of two bodies on each other are always equal and are directed in opposite directions.

Chapter 12 Notes

Page 14: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 14Chapter 12 Notes

Page 15: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 15

Example

There are four forces here.1. Moe pushing the box.2. The box pushing Moe.3. Moe pushing the Earth.4. The Earth pushing Moe.Note that and cancel out.

Chapter 12 Notes

Page 16: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 16

Consequence of Newton’s 3rd Law

• As long as the internal forces cancel out, we are justified in representing a complex body by a single point or particle.

• This is called rigid body dynamics.

Chapter 12 Notes

Page 17: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

Section 12.2:

Some Simple Force Laws

Chapter 12 Notes 3D Math Primer for Graphics & Game Dev 17

Page 18: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 18

Gravity in the Real World

Newton’s Law of Universal Gravitation:

where is the magnitude of the force, and are the masses of the two objects, and is the distance between their centers of mass, and .

Chapter 12 Notes

Page 19: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 19

Video Game Gravity

, where .This is not physically accurate, but then again, neither is being able to jump two or three times your own height, steer in midair, or double jump. When it comes to jumping in video games, reality is not just overrated, it's completely ignored. It just doesn't feel right.

Chapter 12 Notes

Page 20: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 20

Video Game Gravity

• In most first-person shooters, when you jump, you are given an initial burst of upward velocity, and then your position is simulated just like every other airborne object in the world.

• In most third-person games your character will spring up almost instantaneously and reach a maximum height very quickly. In many games the character will hover there, then slam back down on the ground as quickly as it rose up, perhaps leaving a crater behind.

Chapter 12 Notes

Page 21: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 21

Video Game Gravity

• Simulating a jump mechanic using a value of may be even worse, because most players expect a jump to take a certain amount of time but also expect to be capable of jumping to unrealistic heights.

• When real-world gravity is used to attain these heights, the player is in the air too long, and it feels “floaty”.

• Many arcade racing games increase gravity to get the car back on the ground quickly. The player wants to be in full control again as quickly as possible, and waiting for real-world gravity to get them back down usually takes too long.

• There are other racing games that use a value of gravity that is less than the real world value, to facilitate unrealistic jumps at realistic vehicle speeds.

Chapter 12 Notes

Page 22: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 22

Video Game Gravity

• There are also reasons to fiddle with gravity for non-player-character objects as well. Sometimes real-world gravity can create an “objects made of styrofoam” feeling, so gravity is increased to get an object to tip over and come to rest more quickly.

• In other situations, an artificially low value of gravity can make a large object seem even more massive (especially when accompanied by the right sound effects), because acceleration on Earth is constant and is one of a few cues humans instinctively use to establish an absolute scale for objects in the distance.

Chapter 12 Notes

Page 23: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 23

Realism versus Entertainment

• What “feels right" is a subjective matter. It is based more on player expectation than physical reality.

• In the end, what matters most in a video game is not what's going on in the CPU or even on the screen, but what is going on in the player's mind. The human mind is highly susceptible to suggestion.

• The quest for realism should never be an end unto itself. A successful video game will harness realism only where it serves the ultimate goal, which is entertainment.

Chapter 12 Notes

Page 24: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 24

Friction

• The standard dry friction model is sometimes called Coulomb friction.

• Charles-Augustin de Coulomb (1736-1806).

• (Image from Wikimedia Commons.)

Chapter 12 Notes

Page 25: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 25

Static Friction

• When an object is at rest on top of another object, a certain amount of force is required to get it unstuck and set it in motion.

• If any less force is applied, the force of friction will push back with a counteracting force up to some maximum amount.

• This is called static friction.

Chapter 12 Notes

Page 26: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 26

Static Friction

• The following equation is a good approximation for the maximum magnitude of static friction: .

• is a constant called the coefficient of static friction that depends on the type of surfaces rubbing together. Just look it up in a table.

• is the magnitude of the normal force.

Chapter 12 Notes

Page 27: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 27Chapter 12 Notes

Page 28: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 28

The Normal Force

• The normal force is the force acting perpendicular to the surfaces that prevent them from overlapping.

• For example, when an object (such as a bowl of petunias) is resting on top of another object (such as a table), the normal force is the force required to counteract gravity.

• It is the force required to counteract the component of gravity that acts perpendicular to the surfaces.

Chapter 12 Notes

Page 29: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 29

Normal and Lateral Components

• If the table is at an incline, then we can separate gravity into a normal component and a lateral component.

• Inside a computer, we describe the orientation of the table with a normal vector, and use the dot product to separate gravity into the relative and normal components.

• Since the bowl and the table do not accelerate relative to each other, we know that the normal force of the table pushing against the bowl must be exactly equal to the normal component of the force of gravity pulling the bowl towards the table.

Chapter 12 Notes

Page 30: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 30Chapter 12 Notes

Not Sliding On the Brink Sliding

Page 31: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 31

Kinetic Friction

• Once static friction is overcome and the object is moving, friction continues to push against the relative motion of the two surfaces.

• This is called kinetic friction.• The magnitude kinetic friction is generally less

than that of static friction.• It’s computed the same way of static friction: .

Chapter 12 Notes

Page 32: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 32Chapter 12 Notes

Page 33: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 33

Coulomb’s Law of Friction

• The direction of the force of kinetic friction is always opposed to the relative motion of the surfaces.

• As we said earlier, the coefficient of kinetic friction is usually less than the coefficient of static friction.

• Thus, if we increase the angle of the table slowly so that static friction is just overcome, the petunias will begin to accelerate.

• Coulomb's primary contribution to the theory, sometimes called Coulomb's law of friction, was that the force of kinetic friction does not depend on the relative velocities of the surfaces.

Chapter 12 Notes

Page 34: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 34

Spring Forces

• Even if you don't see very many actual springs in a video game, there are likely very many virtual springs at work.

• Springs exhibit a general behavior that is very useful for enforcing constraints, for example, preventing objects from overlapping, cloth rendering, and rag-doll character animation.

Chapter 12 Notes

Page 35: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 35

Control Systems

• There are two types of spring motion, damped oscillation and undamped oscillation.

• A virtual spring (often in the form of a spring-damper system) is a type of control system.

• There are certain advantages to be had when the physical nature of the problem is dropped and we think of it purely in mathematical terms.

• Indeed, many times the problem was never really physical to begin with, and was only recast in physical terms so that the spring-damper apparatus could be applied.

Chapter 12 Notes

Page 36: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 36

The Rest Length

• Consider a spring with one end fixed and the other end free to move in one dimension.

• When the spring is at equilibrium with no external forces on it, it has a natural length, called the rest length.

• If we stretch the spring, then it will pull back to try to regain its rest length.

• Likewise, if we compress the spring, it will push back.

Chapter 12 Notes

Page 37: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 37Chapter 12 Notes

Rest length

Compress

Stretch

Page 38: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 38

Hooke’s Law

• Robert Hooke (1635 –1703).• (Image from Wikimedia

Commons.)• The magnitude of the

restorative force is proportional to the distance from the rest length (provided the force does not exceed the elastic limit of the material used to construct the spring).

Chapter 12 Notes

Page 39: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 39

Hooke’s Law

Where is the spring constant that describes how stiff the spring is, is the spring’s rest length, and is the length that the spring has been stretched or compressed to.

Chapter 12 Notes

𝑙

𝑙𝑟𝑒𝑠𝑡

Page 40: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 40

Rewriting Hooke’s Law

• Things get easier if we adopt a reference frame where the position x = 0 designates the rest position, in which the spring has its rest length and there are no restorative forces.

• Let Since contains both the spring constant and the mass of the particle , it measures the spring's ability to accelerate a particle at its end.

Chapter 12 Notes

Page 41: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 41

Rewriting Hooke’s Law

• With those notational changes, we can rewrite Hooke’s Law as , where is acceleration as a function of time and is position as a function of time.

• This is called a differential equation, since it is an equation in both position and its second derivative, acceleration .

Chapter 12 Notes

Page 42: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 42

Solving Differential Equations

• We don’t have the tools to solve general differential equations, but this one is not too hard.

• If we grab a spring and experimentally graph the position of its end as a function of time after compression, we get a graph like this:

Chapter 12 Notes

Page 43: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 43

Solving Our Differential Equation

• This function ought to look familiar to you: it's the graph of the cosine function.

• Let's see what happens if we just try as our position function. Differentiating twice to get the velocity and acceleration functions, we get:

which is close, but we're missing the factor of .Chapter 12 Notes

Page 44: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 44

Does Matter?

• To understand where should appear in , consider what happens to the graph of when we change the value of .

• In other words, we repeat our physical experiment and vary the stiffness of the spring.

• The result is that larger values of (stiffer springs) result in a graph that is horizontally compressed: the frequency of oscillation is increased.

• Likewise, smaller values of K cause the spring to oscillate more slowly, and the graph is expanded.

Chapter 12 Notes

Page 45: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 45

How Much Does Matter?

• Furthermore, we observe that the frequency is proportional to the square root of . For example, when we increase by a factor of four, the frequency doubles.

• This gives us a hint as to where should appear, since all we are doing is scaling the time axis.

Chapter 12 Notes

Page 46: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 46

Angular Frequency

The quantity is called the angular frequency and comes up often enough that we find it helpful to introduce the notation

= and we can write the solution as

Chapter 12 Notes

Page 47: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 47

Three More Degrees of Freedom

There are some degrees of freedom inherent in the motion of the spring that we have not accounted for.1. We are not accounting for the maximum displacement,

known as the amplitude of the oscillations and denoted . Our equation always has an amplitude of 1.

2. We are assuming that , meaning the spring was initially stretched to the maximum displacement and released with zero initial velocity. However, in general, we could have pulled it to displacement and then given it a shove so it has initial velocity .

Chapter 12 Notes

Page 48: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 48

The Three are Two

• It would appear that we have three more variables that need to be accounted for in our equation if it is going to be completely general.

• As it turns out, the three variables we have just discussed (the amplitude, initial position, and initial velocity) are interrelated.

• If we pick any two, the value for the third is fixed. • We'll keep as is, but we'll replace and with the phase

offset , which describes where in the cycle the spring is at . • Adjustments to the phase offset have the simple effect of

shifting the graph horizontally on the time axis.

Chapter 12 Notes

Page 49: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 49

Simple Harmonic Motion

Adding these two variables, we arrive at the general solution, the equations of simple harmonic oscillation:

Chapter 12 Notes

Page 50: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 50

Damping Forces

• So far, we have been studying a physically nonexistent situation in which the spring will oscillate forever.

• In reality, there are usually at least two more interesting forces, driving force and friction.

• The driving force is an external force, that acts as the input to the system and causes the motion to begin. Friction we have already met.

• The general term used to describe any effect that tends to reduce the amplitude of an oscillatory system is damping, and we call oscillation where the amplitude decays over time damped oscillation.

• Damping forces are useful in video games, so let's discuss them in more detail.

Chapter 12 Notes

Page 51: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 51

Damping Force

The damping force is simply , where indicates the instantaneous magnitude and direction of the damping force, is the instantaneous velocity, and is a constant that describes physical conditions such as the viscosity, roughness, etc.

Chapter 12 Notes

Page 52: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 52

Qualitative Observations

• The damping force has an extremely simple form, but things get interesting when we study motion over time.

• Qualitatively, we can make some basic predictions about how damped oscillation of a spring would differ from undamped oscillation of the same spring.

• The more obvious prediction is that we would expect the amplitude of oscillation to decay over time. Like the force of friction, damping removes energy from the system.

• The second observation is only slightly less obvious: Since damping in general slows the velocity of the mass on the end of the spring, we would expect the frequency of oscillation to be reduced compared to undamped oscillation.

• Those two intuitive predictions turn out to be correct, although, of course, to be more specific we will need to analyze the math.

Chapter 12 Notes

Page 53: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 53

Harmonic Motion with Damping Forces

• Combining the restorative and damping forces, the net force can be written as

.• To derive the equation of motion, we will need

accelerations, not forces. Applying Newton's Second Law and dividing both sides by the mass, we have:

Chapter 12 Notes

Page 54: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 54

Spring-Damper Systems in Video Games

Spring-damper systems are used in video games as control systems. A control system takes as input a function of time that represents some target value. For example:1. Camera code might compute a desired camera position based

on the player's position each frame; 2. AI code might determine an exact targeting angle for an enemy;3. We may have a desired player character velocity based on the

instantaneous amount of control stick deflection; 4. We might have a desired screen-space position for some

highlight effect, based on the currently selected choice in a menu.

Chapter 12 Notes

Page 55: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 55

The Set Point

• The current value of the input signal is known as the set point in control system terminology.

• The set point is essentially the rest position of the spring, and the input signal is like somebody taking the other end of the spring and yanking it around.

• It is similar to a driving force, but we are given a function describing a position rather than a force or acceleration.

Chapter 12 Notes

Page 56: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 56

What Does a Control System Do?

The job of any control system is to take this input signal and produce an output signal. Using our examples from 2 slides ago, the output signal might be (respectively):1. The camera position to use for each frame2. The animated targeting angle the enemy will use

to aim the weapon, 3. The player character velocity.4. The screen-space position of the highlight.Chapter 12 Notes

Page 57: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 57

No Jerks Allowed

• For many control systems, the actual position and set point are not used; rather, only the error is needed.

• Of course, an obvious question is, if we know the desired value, why don't we just use that directly? Because it's too jerky.

• In the same way that the shocks and springs on a car don't just pass along the elevation of the road directly to the car, a control system in a video game is often designed to smooth out the bumps caused by sudden state changes that might make the camera snap to a new position or the player jerk into motion.

Chapter 12 Notes

Page 58: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 58

PD Controllers

• The camera or screen-space highlight are nonphysical examples in which the quantity of mass is not really appropriate and is dropped.

• But the differential equations are still the same, and they have the same solution.

• Stripped of the spring metaphor, we are left with what is known as a PD controller.

• The P stands for proportional, and this is the spring part of the controller, since it is proportional to the current error.

• The damper is the D part, which stands for derivative, because the action of the damper at any given instant is proportional to the derivative (the velocity).

Chapter 12 Notes

Page 59: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 59

Don’t Reinvent the Wheel (Or the Spring)

• PD controllers (and their more robust cousin, the PID controller, where the I stands for integral and is used to remove steady-state error) are broadly applicable tools.

• They have been standard engineering tools for decades (centuries?) and are well understood.

• Nevertheless, they are one of the most frequently reinvented wheels in video game programming.

Chapter 12 Notes

Page 60: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 60Chapter 12 Notes

Page 61: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 61

Tuning

• Different cars have suspensions that are tuned differently; sports cars are tighter and the cars retirees like to drive are smoother. In the same way, we tune our control systems to get the response we like.

• Notice that the code uses the and from our earlier equations. However, most people don't find those to be the most intuitive dials to have for tweaking.

• Instead, the damping ratio and frequency of oscillation are used for the designer interface, while and are computed as derived quantities.

• To tune the frequency, we might adjust either the damped or undamped version, using either angular frequency or simply Hertz; the units and absolute value are often not important because the value that feels good will be determined experimentally anyway.

Chapter 12 Notes

Page 62: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 62

Alternatives and Generalizations

• The second-order systems we have described here are certainly not the only type of control system, nor even the simplest, but they do behave nicely under a very broad set of circumstances and are easy to implement and tune.

• Another commonly used control system is a simple first order lag, , under which the error decays exponentially.

• This is similar to a critically damped second-order system, but with a bit jerkier response to a sudden change in the set point.

• Another common technique is to chase the set point at a fixed velocity. • A filter is another broad class of control system in which the output is

computed by taking some linear combination of set points or values on previous frames.

Chapter 12 Notes

Page 63: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

Section 12.3:

Momentum

Chapter 12 Notes 3D Math Primer for Graphics & Game Dev 63

Page 64: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

3D Math Primer for Graphics & Game Dev 64

Moe’s Box

• Suppose Moe's box has mass , and at a certain instant we observe it moving with a velocity .

• Coming in late to the story, we cannot tell what magnitude of forces were used to achieve that motion, or how long the forces were applied, or what the history of the box's velocity was.

Chapter 12 Notes

Page 65: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

Section 12.4:

Impulsive Forces and Collisions

Chapter 12 Notes 3D Math Primer for Graphics & Game Dev 65

Page 66: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

Section 12.5:

Rotational Dynamics

Chapter 12 Notes 3D Math Primer for Graphics & Game Dev 66

Page 67: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

Section 12.6:

Real-Time Rigid Body Simulators

Chapter 12 Notes 3D Math Primer for Graphics & Game Dev 67

Page 68: Lecture Notes for Chapter 12: Mechanics 2 - Game Math

That concludes Chapter 12. Next, Chapter 13: Curves in 3D

Chapter 12 Notes 3D Math Primer for Graphics & Game Dev 68