Hello again! Smile

Building up on previous ideas, I came across the concept of position based dynamics. To put it succinctly, this type of system models bodies as groups of particles and restraints instead of treating each object as a traditional rigid body with explicit velocity,angle,shape, etc.

This demo is largely based upon that concept, and loosely follows the algorithm described by this paper.

You can find the source for this project here: https://github.com/Zaalan3/RigidBody

Pressing 1 shows the individual vertices, and pressing 2 shows the bounding boxes used for collision.

Advanced Character Physics by Thomas Jakobsen is another paper that helped me quite a bit in understanding this concept.Razz
That is quite impressive! Nice work!
Made a few key optimizations, which greatly improved the speed Very Happy

Right now the collision is a very general version of Separating Axis Theorem.Writing specific routines for collision between different 'types' of objects would make for a faster, more game-usable engine.
So,for the foreseeable future I'm going to be reworking the object system so there are a few defined types:
-Fixed 'Terrain'
-Rotatable 'Boxes'
-and 'Boxes' with no rotational component(basically an object made up of a single particle w/ x,y distance restrains).
These seem like the easiest to work with imo, but I'm always open to suggestions!

Looks very cool! I'll definitely be checking out how you do concave colissions!

You may also want to install a git client, that's much easier than uploading and deleting files manually, I'd recommend Github desktop
Thanks, I'll definitely check it out! Very Happy

For the moment, I imagine concave bodies would be two concave bodies would end up being two groups connected via constraints but lacking collision.

Still need to properly separate the terrain from moving bodies.

I'd imagine a sort of interacting particle system / cellular automata would also be fun Smile
Wanted to show how the current build is looking.

Currently does two constraint passes, a pre and post collision pass. Ideally I'd only need one, but I'm not sure how to get away with that Razz

I love the work Smile.
Does this only work with boxes or it can work with other shapes?
The shapes aren't set in stone so they should yes ( though be warned I haven't tested anything other than triangles ). I've just been using these rectangles because they're easy to texture later on. ;P

The shapes are specified as a set of distance constraints rather than hard shape definitions, so you could build any shape if you took the time to define the distance relations between it's points.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum