1) It does! Heavy thanks to Mr. Erin Catto's paper Iterative Dynamics with Temporal Coherence, I finally got it to work. I'm able to plop boxes on the ground and there is minimal jiggle which is quite impressive to me given that I'm getting one closest point per frame from GJK and building a manifold that sometimes is only 2 or 3 points (where as box clipping would give you the expected 4). The key seems to be something I learned from Bullet called penetration velocity. Basically the penetration distance divided by frame time. It helps you build a manifold. Really neat stuff.
2) Yeah I threw it away. I took it out. It was never getting hit anyway, hahaha.
3) Yeah I figured as much. I have the following code for soft constraints:
Code:
if (m_constraints[i].NeedsDampingCalculation())
{
scalar w = m_constraints[i].GetDampingFrequency();
scalar w2 = w*w;
scalar k = totalEffectiveMass * w2;
scalar c = (scalar)2.0 * totalEffectiveMass * m_constraints[i].GetDampingRatio() * w;
scalar gamma = (scalar)1.0 / (c + elapsedSecs * k);
scalar beta0 = k / (c + elapsedSecs * k);
C = beta0 * m_constraints[i].GetConstraintValue() + gamma * m_lastImpulses[i];
}
else
{
C = m_constraints[i].GetERP() * oneOverDT * m_constraints[i].GetConstraintValue() +
m_constraints[i].GetCFM() * m_lastImpulses[i];
}
which kind of gives you an option to use a designer-fill-in-the-values approach or go with your own ERP/CFM values.
Anyway, I am now working on friction constraints and after that I will be doing rag doll stuff (with polygonal boxes as the limbs). I am cutting bodies in half with a samurai sword in this game and they are to separate and fall realistically on the ground. I have the cutting code working and it creates stubs and everything--it's just incredibly slow. I'm going to put it into its own thread and have the bodies freeze after you slice them and then slowly fall apart. Wish me luck!!
I'll post a demo of the game when it gets closer to something I want to be associated with hahahaha. Thanks for all your help Dirk.
Mike