2D physics simulator Tech Demo

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
2,957
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 14, 2010

Download simulator:
http://robinerd.com/?page_id=105

Source Code:
https://github.com/robinerd/World-of-Aircraft

Download background music from my album on iTunes:
http://itunes.apple.com/se/album/chip-ahoy/id406154281

This is my physics simulator or engine, made for simulating 2D physics. I made it with Java. The simulator includes the physical concepts of gravity, friction, rigid body collision, spring forces, torques and rotations, moment of inertia, momentum and more. The video pretty much shows what it is about, the user draws the rigid body objects with his mouse, similar to drawing in paint, places connections by right clicking, and then starts the simulation.

There are two materials, "wings" and "structure" which come from the fact that this engine will be the base for a new game I'm working on. The game will be a 2D flight simulator, with lots of physics. Anyway, the two materials are for painting objects that overlap. If you paint several shapes in one material, they have to be separated by transparent space to be interpreted as different objects. But if you use different materials you can have overlapping objects, and then connect them together.

I hope you liked this little demo, if you have any questions about the simulator, just ask :)

The background music is "Victory!" composed by me, also available at http://www.youtube.com/watch?v=6Zit9qhm5Wc

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (Robinerd)

  • i really felt like killing myself after watching that...

  • @Eliminator3030 now now, I'm sure you'd be able to make something like this if you just had enough time and interest ;)

  • I liked the demo a lot. Not an open source type, though, are you? 

  • @w104bgs 8 months later.. the source code is now public! Check the description ;)

  • hey this is realy good engine but how do you get that center of mass? and how do u calc inertia and other stuff...

  • @deluksic first of all I loop through the drawing area to find objects. Each time a colored pixel is found, I iterate through all adjacent pixels recursively and also mark them as visited. Since all pixels of an object have equal density, the center of mass is found by averaging the coordinates of all pixels in the object. Similarily you can get inertia by averaging the distance to center of mass for each pixel. To support non-homogenous objects, you just have to multiply with each pixel's mass

Video Responses

This video is a response to Phun - 2D physics sandbox
see all

All Comments (25)

Sign In or Sign Up now to post a comment!
  • @Robinerd Thanks, man. I have all the time in world!

  • @Robinerd good luck then!

  • @ferminho thank you! I'm participating in the swedish game awards contest, so the deadline is in May next year I think, but I will probably have some demo available this year :)

  • Interesting that you'd do this engine instead of using any of them available... this surely has a lot of work underneath. Congratulations, looking very nice so far!

    When will we see something of the game? ;)

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more