Your SlideShare is downloading. ×
Simple Verlet Physics by Stuart Allen (FunkyPear)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Simple Verlet Physics by Stuart Allen (FunkyPear)

17,711
views

Published on

Stuart Allen instructs how to utilize verlet physics for more elegant motion in games.

Stuart Allen instructs how to utilize verlet physics for more elegant motion in games.


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
17,711
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
22
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Simple Verlet Physics for Games Stuart Allen (aka FunkyPear)
  • 2. Euler Integration Simplest method of moving particles and objects Need to keep track of object position and speed Each frame/time step add speed to position: X = X + speedX Y = Y + speedY
  • 3. Euler Integration
  • 4. Verlet Integration Also fairly simple, but expandable to be more accurate (outside scope of this talk) Need to keep track of object current position and previous position Each frame/time step, calculate distance travelled since last time, and add to current position: X = X + (X - oldX) Y = Y + (Y - oldY)
  • 5. Verlet Integration
  • 6. Demo 1Euler & Verlet Particle Movement Demo
  • 7. Constraints Constraints ensure two particles stay a certain distance apart by moving them towards or away from each other
  • 8. Demo 2Particle Constraint Demo
  • 9. Gravity & Other Forces Forces applied directly to particle positions  Gravity: y += 1 Verlet motion makes force persist (inertia)
  • 10. Demo 3Particle Constraint with Gravity Demo
  • 11. Simple Four Step Verlet EngineStep 1: Apply forces (gravity, wind, etc)Step 2: Verlet updateStep 3: ConstraintsStep 4: Collision Detection
  • 12. Rope Expanding from our last demo, rope can be simulated by having a chain of points connected in row with sticks
  • 13. Demo 4Multiple Constraints Rope Demo
  • 14. Cloth Cloth can be simulated by a grid of points that are connected to their neighbours
  • 15. Demo 5Rope Becomes Cloth Demo
  • 16. Relaxation Loop over constrain step multiple time to pull points together and make final result more rigid Less constrain loops means a more bendy and bouncy structure
  • 17. Engine Upgrade: Fixed Points Fixed points do not move – other end of stick does all the moving
  • 18. Structures & Towers Adding fixed points allows us to build fixed but flexible structures  Towers (fixed points on ground)  Bridges (fixed points on either edge of a gap)  Dangling ropes (fixed point above rope)
  • 19. Structures & Towers
  • 20. Demo 6Towers Editor Demo
  • 21. Demo 7Game Jam Tower Game Demo
  • 22. Similar Mechanic:World of Goo (2D Boy)
  • 23. Engine Upgrade: Stick Length Tolerance Sticks previously had set length Modify sticks to have min and max lengths. Soft body dynamics possible due to addition valid solutions
  • 24. Blobs Blobs attempt to mimic gooey / gelatinous objects Multiple different configurations:  Centre point makes blob seem more solid  Double skinning helps stop edge points glitching  More tolerance in inner sticks makes for a flatter, more dynamic blob
  • 25. Demo 8Blobs Editor Demo
  • 26. Blobs – Each Point Linked to Opposite
  • 27. Blobs – With Central Point
  • 28. Similar Mechanic:Gish (Chronic Logic)
  • 29. Thanks for listening! :) More info and source code atwww.funkypear.com/mochilondon2012

×