DEV Community

teeqly
teeqly

Posted on

It looks like I've developed a realistic physics engine in C++.

One evening, I started writing my own sandbox/laboratory-style game with realistic physics — things like electrical conductivity through water, soft bodies, and so on. I wrote it in C++, building my own engine from scratch. I wasn't happy with existing ones, and honestly, I just wanted to have full control over the physics.

I ended up spending a very long time developing a physics engine that, in some benchmarks, actually outperformed engines like Box2D or Chipmunk (if I'm not mistaken). My engine supports soft bodies, fluids, friction, wind (strong enough to deform or blow away fragile objects), micro-cracks, full environmental interaction, and more.

At first it was built on GDI, but I later switched to Direct3D 9 — which was a huge step up in performance and smoothness. I wrote several demo scenes, designed a fairly comprehensive (but still clean) API, and polished everything as much as I could.

Somewhere along the way, I became so absorbed in the engine itself that I forgot my original goal. Instead of making a game, I decided to focus on building a solid physics engine that others could use. There’s even an installer now for people who want to try it without diving into the code.

This engine can save you a ton of time and give you powerful functionality out of the box — much more than starting from scratch.

If you're curious or want to use it, here's the link:

https://github.com/teeqly1/Phys2D

This engine is in beta, so please don't be negative if you don't mention something in the note, I'll try to fix it.

Good luck with your game dev adventures!

Top comments (0)