b2WheelJoint uninitialized variable

I found a case where two member variables of b2WheelJoint remain uninitialized.

In the case of m_frequencyHz = 0.0f the members m_sAx and m_sBx are not set in InitVelocityConstraints() but are used in SolveVelocityConstraints() which leads to undefined behavior usually resulting in NANs in the system.

Setting m_sAx and m_sBx to 0.0f in the constructor resolves the problem.
Nice find!

What about m_ax? Looks like that could be used uninitialized too in the 0 frequency case.

Also, what if the user creates the joint with a frequency and then later changes that frequency to zero? I don't think setting m_sAx and m_sBx to 0.0f in the constructor will work in that case. They may not be NaN then but they might also not be 0 then. I suspect m_sAx and m_sBx need to be set to 0 in the InitVelocityConstraints() method in this case, or in the SetSpringFrequencyHz() method. Same with the m_ax variable.
m_ax is already set to zero in the constructor, but you are right, all three should be set to zero in the else-branch of "if (m_frequencyHz > 0.0f)" so that no random values remain when resetting m_frequencyHz to zero without recreating the object.

Original thread: https://box2d.org/forum/viewtopic.php?t=10243