roll and fall playing with the laws of motion games fundamentals © by jarek francik kingston...

30
Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Upload: regina-hicks

Post on 12-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Roll and FallPlaying with the Laws of Motion

Games Fundamentals© by Jarek Francik

Kingston University, London

2007 - 2013

Page 2: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Agenda

• Laws of Motion• Inclined Plane• Friction• Falling and Throwing• Demo

Page 3: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Newton’s Laws of Motion

Page 4: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

1. If no external force acts on a particle,or all the forces are balanced, then the particle moves without any change in velocity

if it was in rest if it was in motionit stays at rest it stays in motion

NEWTON’S LAWS OF MOTION

Page 5: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Notice that the behaviour of objects around usis usually affected by air resistance and friction

NEWTON’S LAWS OF MOTION

Page 6: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

2. If unbalanced external net force acts upon an object then the object moves with the acceleration directly proportional to the magnitude of this force and in the same directionand inversely proportional to the massof that object

NEWTON’S LAWS OF MOTION

maFmF

a

Page 7: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

The phenomenon of falling is ruled by the Newton’s second law.

The force acting is the gravitational force

The acceration is on the surface of Earthalways the same:

g = 9.81 m/s2

Fg = mg

NEWTON’S LAWS OF MOTION

Page 8: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Notice that the behaviour of objects around usis usually affected by air resistance and friction

NEWTON’S LAWS OF MOTION

Page 9: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

3. Whenever A exerts a force on B,B simultaneously exerts a force on Awith the same magnitude and opposite direction

NEWTON’S LAWS OF MOTION

Page 10: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Friction Force

Page 11: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

INCLINED PLANE

aFg = mg

Page 12: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

INCLINED PLANE

aFg = mg

mg sina

mg cosa

Page 13: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

INCLINED PLANE

aFg = mg

mg sina

mg cosa

FN = mg cosa

Page 14: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

INCLINED PLANE

aFg = mg

F = mg sina

FN = mg cosa

F = Fg + FN

Page 15: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

INCLINED PLANE

a

FN = mg cosa

Page 16: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

INCLINED PLANE

aFg = mg

F = mg sina

FN = mg cosa

FF = fmg cosa

Page 17: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

INCLINED PLANE

a

Page 18: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

a

INCLINED PLANE

V

Vh

Vv

Page 19: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

a

INCLINED PLANE

Vh = V cosa

Vv = 0

Page 20: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

a

INCLINED PLANE

Vh V cosa

Vv = 0

Page 21: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Friction Force

Page 22: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

FRICTION FORCE

FF = f1mg

FF

V

FF

FF = f2mg

V

FF = 0

V = 0

Page 23: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Falling & Throwing

Page 24: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

FALL & THROWV

mg

V uniform velocity

F = mg gravitational force

2

02

00

0

0

atatdtVdtS

atVV

atVV

gmF

a

tt

PARABOLIC TRAJECTORY

Page 25: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

FALL & THROW

V

Vh

VV

Vh = V cosa

VV = V sina + at

Page 26: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

FALL & THROW• If there is no initial horizontal componentVh = 0trajectory is linear

• Non-zero horizontal componentVh ≠ 0trajectory is parabolic

• Both horizontal and vertical components are non zeroVh ≠ 0VV ≠ 0 trajectory is also parabolic

• What if VV < 0 yes, trajectory is also parabolic

Page 27: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Demo

Page 28: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Accelerated Motion

double v = m_sprite.GetSpeed(); v += 10; m_sprite.SetSpeed(v); ... // code above – before Update!m_sprite.Update(GetTime());

or:

m_sprite.SetSpeed(m_sprite.GetSpeed() + 10);

DEMO

Page 29: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Free Fall

double vx = m_sprite.GetXVelocity(); double vy = m_sprite.GetYVelocity(); vy -= 10; m_sprite.SetVelocity(vx, vy);

or:

m_sprite.SetVelocity(m_sprite.GetXVelocity(), m_sprite.GetYVelocity()-10);

DEMO

Page 30: Roll and Fall Playing with the Laws of Motion Games Fundamentals © by Jarek Francik Kingston University, London 2007 - 2013

Bounce

if (m_ball.GetBottom() >= 600 && m_ball.GetYVelocity() < 0)

m_ball.SetVelocity(m_ball.GetXVelocity(), -0.8 * m_ball.GetYVelocity());

DEMO