dynamics part 2 how does it work?? by willis louie jianfei liao

24
DYNAMICS DYNAMICS Part 2 Part 2 HOW DOES IT WORK?? HOW DOES IT WORK?? by by Willis Louie Willis Louie Jianfei Liao Jianfei Liao

Upload: mary-gardner

Post on 06-Jan-2018

215 views

Category:

Documents


1 download

DESCRIPTION

Presentation Milestone Presentation 1 What is a Physics Engine? Presentation 1 What is a Physics Engine? Presentation 2 How Does It Work? Presentation 2 How Does It Work? Presentation 3 Integration Presentation 3 Integration Presentation 4 Testing and Documentation Presentation 4 Testing and Documentation

TRANSCRIPT

Page 1: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

DYNAMICSDYNAMICSPart 2Part 2

HOW DOES IT WORK??HOW DOES IT WORK??byby

Willis LouieWillis LouieJianfei LiaoJianfei Liao

Page 2: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

Arcade Game - 1942Arcade Game - 1942

Page 3: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

Presentation MilestonePresentation Milestone Presentation 1 What is a Physics Presentation 1 What is a Physics

Engine?Engine? Presentation 2 How Does It Presentation 2 How Does It

Work?Work? Presentation 3 IntegrationPresentation 3 Integration Presentation 4 Testing and Presentation 4 Testing and

DocumentationDocumentation

Page 4: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

TABLE OF CONTENTTABLE OF CONTENT 1) Implementation1) Implementation 2) Timeline / Current Status2) Timeline / Current Status 3) Concepts3) Concepts

ObjectsObjects JointsJoints CollisionCollision

Page 5: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

TABLE OF CONTENTTABLE OF CONTENT 1) 1) ImplementationImplementation 2) Timeline / Current Status2) Timeline / Current Status 3) Concepts3) Concepts

ObjectsObjects JointsJoints CollisionCollision

Page 6: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

Question:Question: How to implement the How to implement the physics?physics?

Answer: Answer: Physics simulationPhysics simulation

Page 7: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

Simulation ProcessSimulation Process 1) Create a dynamic world1) Create a dynamic world

2) Create dynamics bodies2) Create dynamics bodies

3) Initializations3) Initializations

4) Step forward in the world4) Step forward in the world

Page 8: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

TABLE OF CONTENTTABLE OF CONTENT 1) Implementation1) Implementation 2) 2) Timeline / Current StatusTimeline / Current Status 3) Concepts3) Concepts

ObjectsObjects JointsJoints CollisionCollision

Page 9: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

Our TimelineOur Timeline

Page 10: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

TABLE OF CONTENTTABLE OF CONTENT 1) Implementation1) Implementation 2) Timeline / Current Status2) Timeline / Current Status 3) 3) ConceptsConcepts

ObjectsObjects JointsJoints CollisionCollision

Page 11: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

Applying PhysicsApplying Physics In order to apply physics we need to In order to apply physics we need to

know the object properties and know the object properties and attributesattributes

ObjectsObjects JointsJoints Collision Collision

Page 12: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

TABLE OF CONTENTTABLE OF CONTENT 1) Implementation1) Implementation 2) Timeline / Current Status2) Timeline / Current Status 3) 3) ConceptsConcepts

ObjectsObjects JointsJoints CollisionCollision

Page 13: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

Object PropertiesObject Properties position vector(x,y,z) – shape,sizeposition vector(x,y,z) – shape,size linear velocity(vx,vy,vz) – movementlinear velocity(vx,vy,vz) – movement Orientation – rotation,directionOrientation – rotation,direction Total body massTotal body mass Center of mass(and inertia matrix)Center of mass(and inertia matrix)

Page 14: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

Object PropertiesObject Properties

Geometry objects + Rigid body = simulated Geometry objects + Rigid body = simulated objectobjectShape, etc Shape, etc Mass, etc Mass, etc

Page 15: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

TABLE OF CONTENTTABLE OF CONTENT 1) Implementation1) Implementation 2) Timeline / Current Status2) Timeline / Current Status 3) 3) ConceptsConcepts

ObjectsObjects JointsJoints CollisionCollision

Page 16: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

Joints, Joints, Joints!!!Joints, Joints, Joints!!! Joints (relationship between bodies) Joints (relationship between bodies)

Can move or turn a certain way onlyCan move or turn a certain way only Different joints (human vs. robot) Different joints (human vs. robot)

Ball, socket, universal joints, etcBall, socket, universal joints, etc Joints must connect, if not they fly offJoints must connect, if not they fly off Constraint force mixing for soft Constraint force mixing for soft

materialmaterial

Page 17: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

TABLE OF CONTENTTABLE OF CONTENT 1) Implementation1) Implementation 2) Timeline / Current Status2) Timeline / Current Status 3) 3) ConceptsConcepts

ObjectsObjects JointsJoints CollisionCollision

Page 18: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

CollisionCollision

Page 19: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

CollisionCollision

Why must we have it?Why must we have it?

Page 20: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

PING’S LAWPING’S LAW

Object A crashing into object B = Object A crashing into object B = EXPLOSIONEXPLOSION

EXPLOSION = EXCITEMENTEXPLOSION = EXCITEMENT

Page 21: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

Collision DetectionCollision Detection collision detection enginecollision detection engine collision detection function – collision detection function –

touching or not?touching or not? Checks for contact points Checks for contact points Each contact point creates a contact Each contact point creates a contact

jointjoint To see what reaction should occur, To see what reaction should occur, Hard or soft, explode or bounce offHard or soft, explode or bounce off

Page 22: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

Collision DetectionCollision Detection Each contact point creates a contact Each contact point creates a contact

jointjoint To see what reaction should occur, To see what reaction should occur, Hard or soft, explode or bounce offHard or soft, explode or bounce off

Page 23: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

Collision DetectionCollision Detection LoopLoop

Apply forcesApply forces Adjust jointsAdjust joints Collision detectionCollision detection Create contact jointsCreate contact joints Carry out actionCarry out action Remove all contact jointsRemove all contact joints

Page 24: DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao

So…How does it work?So…How does it work? Create the worldCreate the world Using attributes to simulate objectsUsing attributes to simulate objects Using joints to built complex objectsUsing joints to built complex objects Check the collision detectionCheck the collision detection Check the contact jointsCheck the contact joints If hit blow it upIf hit blow it up