normal.normalize(); final float normalx = normal.x; final float normaly = normal.y;
normal.x = pointBx - pointAx; normal.y = pointBy - pointAy; normal.normalize();
output.normal.x = rx * a + sx; output.normal.y = ry * a + sy; output.normal.normalize(); return true;
normalOut.x = xfqc * minDistanceX - xfqs * minDistanceY; normalOut.y = xfqs * minDistanceX + xfqc * minDistanceY; normalOut.normalize(); } else { distance = maxDistance;
r.y = p2y - p1y; assert ((r.x * r.x + r.y * r.y) > 0f); r.normalize(); rx = r.x; ry = r.y;
r.y = p2y - p1y; assert ((r.x * r.x + r.y * r.y) > 0f); r.normalize(); rx = r.x; ry = r.y;
protected PrismaticJoint(IWorldPool argWorld, PrismaticJointDef def) { super(argWorld, def); m_localAnchorA = new Vec2(def.localAnchorA); m_localAnchorB = new Vec2(def.localAnchorB); m_localXAxisA = new Vec2(def.localAxisA); m_localXAxisA.normalize(); m_localYAxisA = new Vec2(); Vec2.crossToOutUnsafe(1f, m_localXAxisA, m_localYAxisA); m_referenceAngle = def.referenceAngle; m_impulse = new Vec3(); m_motorMass = 0.0f; m_motorImpulse = 0.0f; m_lowerTranslation = def.lowerTranslation; m_upperTranslation = def.upperTranslation; m_maxMotorForce = def.maxMotorForce; m_motorSpeed = def.motorSpeed; m_enableLimit = def.enableLimit; m_enableMotor = def.enableMotor; m_limitState = LimitState.INACTIVE; m_K = new Mat33(); m_axis = new Vec2(); m_perp = new Vec2(); }
normal.x = pointB.x - pointA.x; normal.y = pointB.y - pointA.y; normal.normalize();
m_linearImpulse.normalize(); m_linearImpulse.mulLocal(maxImpulse);
tempVec.x = px + t * vx; tempVec.y = py + t * vy; n.normalize(); final Vec2 point = tempVec2; point.x = point1.x + t * vx;
localTangent.x = v12.x - v11.x; localTangent.y = v12.y - v11.y; localTangent.normalize();
u.set(cB).addLocal(rB).subLocal(cA).subLocal(rA); float length = u.normalize(); float C = length - m_maxLength;
float length = u.normalize(); float C = length - m_length; C = MathUtils.clamp(C, -Settings.maxLinearCorrection, Settings.maxLinearCorrection);
m_normals[i].normalize();
m_linearImpulse.normalize(); m_linearImpulse.mulLocal(maxImpulse);
edge1.normalize(); m_normal1.set(edge1.y, -edge1.x); float offset1 = Vec2.dot(m_normal1, temp.set(m_centroidB).subLocal(m_v1)); edge0.normalize(); m_normal0.set(edge0.y, -edge0.x); convex1 = Vec2.cross(edge0, edge1) >= 0.0f; edge2.normalize(); m_normal2.set(edge2.y, -edge2.x); convex2 = Vec2.cross(edge1, edge2) > 0.0f;
normal.normalize(); temp.set(normal).mulLocal(rA); output.pointA.addLocal(temp);
n.set(-n.x, -n.y); n.normalize();