temp.set(d).addLocal(r1);
m_s1 = Vec2.cross(temp, m_perp);
m_s2 = Vec2.cross(r2, m_perp);
final Vec3 impulse = pool.popVec3();
final Vec2 C1 = pool.popVec2();
C1.x = Vec2.dot(m_perp, d);
C1.y = a2 - a1 - m_refAngle;
linearError = MathUtils.max(linearError, MathUtils.abs(C1.x));
angularError = MathUtils.abs(C1.y);
if (active) {
float m1 = m_invMassA, m2 = m_invMassB;
float i1 = m_invIA, i2 = m_invIB;
float k11 = m1 + m2 + i1 * m_s1 * m_s1 + i2 * m_s2 * m_s2;
float k12 = i1 * m_s1 + i2 * m_s2;
float k13 = i1 * m_s1 * m_a1 + i2 * m_s2 * m_a2;
float k22 = i1 + i2;
float k23 = i1 * m_a1 + i2 * m_a2;
float k33 = m1 + m2 + i1 * m_a1 * m_a1 + i2 * m_a2 * m_a2;
m_K.col1.set(k11, k12, k13);
m_K.col2.set(k12, k22, k23);
m_K.col3.set(k13, k23, k33);
final Vec3 C = pool.popVec3();
C.x = C1.x;
C.y = C1.y;
C.z = C2;
m_K.solve33ToOut(C.negateLocal(), impulse);
pool.pushVec3(1);
}
else {
float m1 = m_invMassA, m2 = m_invMassB;
float i1 = m_invIA, i2 = m_invIB;