Impulse Engine

Impulse Engine is a small 2D physics engine written in C++ created by Randy Gaul. The engine is intended to be used in an educational manner by allowing others to learn the inner workings of physics engines. The source code of Impulse Engine is filled with comments and is written in as straight-forward a manner as possible.

Capture

Features:

  • Generalized convex polygons
  • Real-time hull creation from any set of points
  • Circle and Polygon collision routines using Separating Axis Theorem
  • Impulse based collision resolution
  • Cross-platform support thanks to whackashoe

If you have any questions feel free to contact Randy at: r dot gaul at digipen dot edu.

Here is a link to the github repository.

10 thoughts on “Impulse Engine

    1. Randy Gaul Post author

      Wow that looks great! It’s very cool that you ported a Java version of Impulse Engine. It would be great if you could consider using the same license on your port as the Impulse Engine has.

      Reply
  1. CHAOS-THEORY

    that’s quiet an honnor, except that i actually wish that you made up all this hard work in AS3; cause am having hard days trying to follow/recreate your work.
    also, may i just have a quick way of instant messaging to communicate with you; i would really appreciate that… fb or skype
    thanks for your time kind sir

    Reply
  2. Joseph

    First, Thank you immensely for crating this project, and to wackashoe for proving the Java version. Now, on the subject of code there is a slight bug/glitch when calculating the penetration of circles to the edges of polygons. I know this is in both versions of code because in your video at around 0:40 the polygon jitters when it contacts the circle on its vertex. A simple fix for this is to recalculate the penetration as the circle’s radius minus the distance from the closest vertex and the center of the transposed bodies:

    C++

    Java

    Obviously this is for the second vertex and two version of this code need to be implemented one for the closest v1 and the other for the closest v2;

    This code just needs to be inserted within the code that finds the closest vertex and then calculates the normals.

    Thanks again!

    Reply
  3. john

    Well done!
    By the way, why don’t you make the tutorial at tut+ about the core engine e.g the Body etc. It would be great . . .

    Reply
    1. Randy Gaul Post author

      Thanks! Usually it takes a lot of time to write a tuts+ article. How about I just write a new blog post here? :) It would be a big help if you name some more you’d like to hear about, besides just the implementation of Body.

      Reply
  4. john

    Thats positive news for me if you mind to write the whole(at least uncovered stuff on tut+) tutorial about your concise and eye-candy implementation.
    And how do we integrate all this things to our game system, to sprite(or simple graphics in general), world(at least rectangular platformer world), tile etc(thats maybe and i’m sure time consuming, and can lead to half deadly dizzi-ness syndrome or simply head ache in medical therm).
    I dont know, just the idea that insanely hitting my head.
    Actually, i have came across to your tutorials at tut+ just about last years.
    But, surprisingly i can to figure out how ‘beautifull’ this stuff by now.
    I understand why every experienced programmer said that i need to practice and practice again to be good.
    And i think he/she’s right, just like physic if Expertise=Knowledge/effort;
    since knowledge is infinite, no instant route to master everything but there’s an Expert path as a formula.
    Btw, thanks for response and sorry about wasting alot of your time to reply this stupid metaphor suggestion from random amateur folk.

    Reply
  5. john

    Edit:
    The point is simple game implementation tutorial that using the most feature in your physic engine.
    And i think its better than boring API such as javadoc that everybody may get lazy to read(including me at some point). Altought sometimes API documentation its important too. . .
    . .but still, BOOKMARKED. .

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">