Posts Tagged ‘rigid body dynamics’


other physics videos

November 17, 2008

For those too lazy to get the engine from the repository and build it, here are more videos of it in action.  Seriously though, I can understand if you aren’t a programmer.  But for those who are, I have a link on my site, accessible from here, that goes to a publicly checkout-able repository and a jillion ways to build it.  It builds on Visual Studio 2008 (VC9) with a project file, it builds in C::B 8.02 or higher on the MinGW toolset, it has a raw makefile MinGW build, it has a GNU/Linux make GCC build, a C::B 8.02 or highter Ubuntu Linux build, I MEAN HAVE I NOT GIVEN YOU ENOUGH OPTIONS!?  JESUS GOD OMFGROFLMAO NARNIA PANTALOON SCALLYWAG! SLDKJFKLSDJSOIEOWEJOOJ!!!1!1!!1!!11!!!1!  😮 😮 😮 😀 😡  I’ll do 64-bit build when my laptop gets here as it’s 64-bit, that should make it friendlier to 64-bit types.

yay, its crazy time forever lawlz XD.

Now that we’re done with me becoming mildly volatile for a brief period, let’s get back to the videos.

wooooooooo, happy town.


pivot constraints == awesome chain physics!

November 17, 2008

In the past, I have had two different kinds of inelastic distance constraints: single distance constraints (rat_constraint_bar) and min/max distance constraints (rat_constraint_slider).  I add a new one called the pivot (rat_constraint_pivot).  Why, you ask?

Well, you might think a distance constraint with a length of zero is sufficient, but it isn’t.  Here’s why: a distance constraint uses the normal of the distance “bar” to decide how to pull or push the anchor points.  If you are a point, this value cannot exist unless the objects are separated, which means the constraint will never keep the anchors at zero distance from each other.  Furthermore, this means the pivot will never react like a revolute joint, because this behavior relies on a shared point.  So, the key is to compromise.  We use our old friend bias velocity (pseudo velocity) to keep the points together, regular distance constraint style.  But in order to get the correct pivot behavior out of it we have to calculate the impulse as if, like I said before, the anchors share a point even if they don’t.  This means instead of normals, we must create a mass matrix to get the correct torque, then apply the equal offset impulse to the anchors.  Think of it as unbreakable sticky friction.

The really cool looking result can be seen in the following video.  I can now have real segmented chains; solid segments, not distance constraints between particles!  🙂