private Fix64 KScalar( VoltBody bodyA, VoltBody bodyB, VoltVector2 normal) { Fix64 massSum = bodyA.InvMass + bodyB.InvMass; Fix64 r1cnSqr = VoltMath.Square(VoltMath.Cross(this.toA, normal)); Fix64 r2cnSqr = VoltMath.Square(VoltMath.Cross(this.toB, normal)); return (massSum + bodyA.InvInertia * r1cnSqr + bodyB.InvInertia * r2cnSqr); }
private float KScalar( VoltBody bodyA, VoltBody bodyB, Vector2 normal) { float massSum = bodyA.InvMass + bodyB.InvMass; float r1cnSqr = VoltMath.Square(VoltMath.Cross(this.toA, normal)); float r2cnSqr = VoltMath.Square(VoltMath.Cross(this.toB, normal)); return (massSum + bodyA.InvInertia * r1cnSqr + bodyB.InvInertia * r2cnSqr); }