Currently, only velocities are reset.
In my game, after set a body static, it will still be moved a bit in the next step in SolveTOI by bA.Advance(minAlpha).
In my game, after set a body static, it will still be moved a bit in the next step in SolveTOI by bA.Advance(minAlpha).
Code:
void b2Body::SetType(b2BodyType type)
{
...
if (m_type == b2_staticBody)
{
m_linearVelocity.SetZero();
m_angularVelocity = 0.0f;
}
...
}
{
...
if (m_type == b2_staticBody)
{
m_linearVelocity.SetZero();
m_angularVelocity = 0.0f;
}
...
}