<< Towards better employment contracts, pt. 1 Back to index... A simple VN engine >>

Minor Gripe

2019-07-15 -- ERP Update: new ui, refactors, helpers, capsule-capsule work

Chris Ertel

Current State of the Elixir Rigid Physics Library

Since last update

I fixed a bunch of little annoying things that made working with (and debugging) the engine unpleasant.

Intersection primitives and ERP

Taking a page from the Valve Rubikon writeup, there are only a few intersection types I’m doing:

I’ve finished all the non hull-related pairings, though the capsule stuff was a near-failure. Capsule-capsule intersection, at its core, is about finding the distance between two line segments. That in turn is a constrained minimization problem, and without the code and explanations of David Eberly I probably would’ve spent all of July figuyring it out.

Since I only have four week left at Recurse center (including this week), I’m going to go ahead and timebox this to about a week. I need to implement GJK and SAT for the hull bits, and if I hit wall-time I’ll just need to live in a world of spheres and capsules and move on to dynamics.

The basic idea behind the hull stuff is that you’re taking a perfectly good set of two potentitally colliding polyhedra and performing a Minkowski Difference on them, and seeing if the resulting poylhedra in Minkowski space contains the origin or not..or at least, that is how I’d summarize some much better presentations of the topic.

Next steps

Once the hull stuff is done, I want to try and implement aggregate bodies. The idea is that a body should be able to be made of multiple shapes, so we can build things like tables or what have you out of simpler shapes. I’m not sure if this is a “nice-to-have” or a disaster in the making.

The math behind it is sound–you just use the parallel-axis theorom, I think, to add up the different shapes moments of inertia and then you can figure out a reasonable inertia tensor for the aggregate. Then, during collision detection, you just loop over the shapes instead of just the bodies.

My expected changes for such a thing would be:

That feels like about a few days of work, but could go faster or slower–let’s see how hulls go first.

Addendum: Paintballing

I went paintballing this weekend. That’s probably a whole ‘nother post into itself, but all-in-all it was a wonderful experience and I failed to injure myself (I think, I hope!).

Tags: update

Other Elixir Rigid Physics Engine posts:

<< Towards better employment contracts, pt. 1 Back to index... A simple VN engine >>