Removed debug output in tests.

master
Martin Felis 2020-11-20 10:48:56 +01:00
parent 67cc892f14
commit 159400b722
1 changed files with 5 additions and 27 deletions

View File

@ -321,21 +321,10 @@ TEST_CASE("CalcConstraintImpulse", "[Collision]") {
}
SECTION("CalculateImpulse") {
for (int i = 0; i < 1; i++) {
cout << "Iter " << i << endl;
CalcConstraintImpulse(&sphere_a_body, &sphere_b_body, cinfo, 0);
// REQUIRE((cinfo.accumImpulse - Vector3d(0., 0., 0.)).norm() < 1.0e-12);
// REQUIRE((cinfo.accumImpulse - Vector3d(0., -sphere_mass * sphere_a_body.qdot[1], 0.)).norm() < 1.0e-12);
cout << "pre impulse: " << sphere_a_body.qdot.transpose() << endl;
cout << "pre impulse2: " << sphere_b_body.qdot.transpose() << endl;
cout << "impulse: " << cinfo.deltaImpulse << endl;
ApplyConstraintImpulse(&sphere_a_body, &sphere_b_body, cinfo);
cout << "pst impulse: " << sphere_a_body.qdot.transpose() << endl;
cout << "pst impulse2: " << sphere_b_body.qdot.transpose() << endl;
}
CalcConstraintImpulse(&sphere_a_body, &sphere_b_body, cinfo, 0);
ApplyConstraintImpulse(&sphere_a_body, &sphere_b_body, cinfo);
REQUIRE(sphere_a_body.qdot[1] > -0.1);
REQUIRE(sphere_b_body.qdot[1] < 0.1);
REQUIRE(sphere_b_body.qdot[1] < 0.1);
}
SECTION("CheckBounce") {
@ -386,19 +375,8 @@ TEST_CASE("CalcConstraintImpulse", "[Collision]") {
}
SECTION("CalculateImpulse") {
for (int i = 0; i < 1; i++) {
cout << "Iter " << i << endl;
CalcConstraintImpulse(&sphere_a_body, &sphere_b_body, cinfo, 0);
// REQUIRE((cinfo.accumImpulse - Vector3d(0., 0., 0.)).norm() < 1.0e-12);
// REQUIRE((cinfo.accumImpulse - Vector3d(0., -sphere_mass * sphere_a_body.qdot[1], 0.)).norm() < 1.0e-12);
cout << "pre impulse: " << sphere_a_body.qdot.transpose() << endl;
cout << "pre impulse2: " << sphere_b_body.qdot.transpose() << endl;
cout << "impulse: " << cinfo.deltaImpulse << endl;
ApplyConstraintImpulse(&sphere_a_body, &sphere_b_body, cinfo);
cout << "pst impulse: " << sphere_a_body.qdot.transpose() << endl;
cout << "pst impulse2: " << sphere_b_body.qdot.transpose() << endl;
}
CalcConstraintImpulse(&sphere_a_body, &sphere_b_body, cinfo, 0);
ApplyConstraintImpulse(&sphere_a_body, &sphere_b_body, cinfo);
REQUIRE(sphere_a_body.qdot[1] < 0.1);
REQUIRE(sphere_b_body.qdot[1] > -0.1);
}