コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }