5-physics in game (game development - umt spring 2017)

14
Physics in Game FROM: HAFIZ AMMAR SIDDIQUI – COURSE: GAME DEVELOPMENT – INSTITUTE: UNIVERSITY OF MANAGEMENT AND TECHNOLOGY

Upload: hafiz-ammar-siddiqui

Post on 11-Apr-2017

170 views

Category:

Education


1 download

TRANSCRIPT

Page 1: 5-Physics in Game (Game Development - UMT Spring 2017)

PhysicsinGame

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Page 2: 5-Physics in Game (Game Development - UMT Spring 2017)

GamePhysics• Game physics adds laws of physics into a game

• Close approximation of real physicswhich is implementedwith discrete values

• Update the state of objects based on physical calculations

• Computemotion of objects in a scene

• Computemechanical interactions between objects in a scene

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Page 3: 5-Physics in Game (Game Development - UMT Spring 2017)

KinematicsandKinetics

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Page 4: 5-Physics in Game (Game Development - UMT Spring 2017)

Kinematics• Study of the motion of bodies without considering the mass and forces acting on them

(ignoring the forces that cause the motion)

• Focuses on position,speed, velocity and acceleration of bodies

• Speed: Rate of change of positionwith time (scalar)

• Velocity: Rate of change of positionwith time (vector)

• Acceleration: Rate of change of velocity with time (vector)

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Page 5: 5-Physics in Game (Game Development - UMT Spring 2017)

Kinetics• Study of the motion of bodies with regard to the mass and forces acting on them

(considering the forces that cause the motion)

• Focuses on mass and forces acting on bodies

•Mass: Amountof matter contained in a body (scalar)

• Force: Thatchanges or tends to change the state of rest or motion of a body (vector)

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Page 6: 5-Physics in Game (Game Development - UMT Spring 2017)

Kinetics(NewtonLaws)• A body will remain at rest or continue to move in a straight line at a constant speed

unless acted uponby a force

• The acceleration of a body is proportional to the resultant force acting on the body and

is in the same direction as the resultant force

• For every action, there is an equal and opposite reaction

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Page 7: 5-Physics in Game (Game Development - UMT Spring 2017)

RigidBodyandSoftBody

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Page 8: 5-Physics in Game (Game Development - UMT Spring 2017)

RigidBody• A systemof particles that remain at fixed distances fromone another

• Distance between any two points of a rigid body remains constant in time regardless of

external forces exerted on it

• Rigid body translates or rotates as a whole, no relative translation or rotation among

the particles of a rigid body

• It does not change its shapeduring its motion or when it encounters any collision

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Page 9: 5-Physics in Game (Game Development - UMT Spring 2017)

SoftBody• A systemof particles that can change their distances fromone another

• Distance between any two points of a soft body changes with respect to the external

forces exerted on it

• There is relative translation or rotation among the particles of a soft body

• It can change its shapeduring its motion or when it encounters any collision

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Page 10: 5-Physics in Game (Game Development - UMT Spring 2017)

CollisionDetectionandCollisionResponse

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Page 11: 5-Physics in Game (Game Development - UMT Spring 2017)

CollisionDetection• Process of determiningwhether two or morebodies have run into each other or not

• Computational geometry problem involving the calculation of whether and where two

or more bodies have collided or they are about to collide

• Discrete Collision: Determinewhether bodies are colliding at current time or not

• ContinuousCollision: Predict the exact point and time of collision between bodies

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Page 12: 5-Physics in Game (Game Development - UMT Spring 2017)

CollisionDetection

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Nocollisionatcurrenttime

Collisionatcurrenttime

NocollisionatcurrenttimeUpcomingcollisioninfuture

Collisionatcurrenttime

DiscreteCollisionDetection Continuous CollisionDetection

Page 13: 5-Physics in Game (Game Development - UMT Spring 2017)

CollisionResponse• How bodieswill react to collision

• Simulate what happenswhen a collision is detected between bodies

•Motion and shape of bodies after they have collided with respect to their properties

• Rigid Body Collision: Bodies can change their position and rotation but not shapes

• Soft Body Collision: Bodies can change their position, rotation and shapes

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY

Page 14: 5-Physics in Game (Game Development - UMT Spring 2017)

Reference• PhysicsforGameDevelopers- DavidMBourg,BryanBywalec

FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY