5-physics in game (game development - umt spring 2017)
TRANSCRIPT
PhysicsinGame
FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY
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
KinematicsandKinetics
FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY
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
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
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
RigidBodyandSoftBody
FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY
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
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
CollisionDetectionandCollisionResponse
FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY
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
CollisionDetection
FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY
Nocollisionatcurrenttime
Collisionatcurrenttime
NocollisionatcurrenttimeUpcomingcollisioninfuture
Collisionatcurrenttime
DiscreteCollisionDetection Continuous CollisionDetection
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
Reference• PhysicsforGameDevelopers- DavidMBourg,BryanBywalec
FROM:HAFIZAMMARSIDDIQUI– COURSE:GAMEDEVELOPMENT– INSTITUTE:UNIVERSITYOFMANAGEMENTANDTECHNOLOGY