Engine Prototype 05

This is my fifth prototype of the Dejeweled physics engine. The engine now supports collisions between circles and capsules. This version is simple, with an inefficient method of finding colliding pairs. And objects can pass through each other if they are traveling too fast. But that will all change soon.

This ragdoll is just like the one from Engine Prototype 01, but with a ball to play with. Objects can actually collide now! :D Nifty, eh?

Click the window to start. Then use the arrow keys to move the stick figure around. You can also click and drag the mouse to move the ball, too.

left - rotate left
right - rotate right
up - raise arms
down - spread legs

For slow motion, hold down the space bar. Click the meters to adjust the physics settings.

Let me know if you find anything interesting. ;)


Engine Screen 05

Finally, some real progress! :)

I've started adding collision detection to the engine. Collision detection is harder than I expected, but not too hard.

So far I've implemented simple circle collisions and capsule collisions, which you can see in the screen shot above. But there's still a long way to go. I still have to take into account the effect of friction and restitution forces. I also have to make sure objects don't pass through each other when they are going really fast, which is probably the biggest problem at this point.

And then of course there's the issue of efficiency. Right now the engine is using a simple brute-force approach to find colliding objects, but that's going to be really slow with a hundred objects on the screen at once. I'm planning on using the Sweep and Prune algorithm to speed that up.

I'll post the next prototype soon. It's already fun to play with. :)