diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-12-12 18:24:26 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-12-12 18:24:26 +0100 |
commit | 962c987adff029dc2cbc60b0f1bb9b21b1d416f7 (patch) | |
tree | 2738ca92360631efadd99259200feb6577cdfe9c /src/test/PhysicsTest.cpp | |
parent | 1e42d6669b462a3d1490788d3b20141d15c881db (diff) | |
parent | 15bb400deafa1ea4fea1ff11e835f103fa82090f (diff) |
Merge branch 'jaro/physics-system-improvement' of github.com:lonkaars/crepe into jaro/particle-system-improvement
Diffstat (limited to 'src/test/PhysicsTest.cpp')
-rw-r--r-- | src/test/PhysicsTest.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/PhysicsTest.cpp b/src/test/PhysicsTest.cpp index c04e3ff..3afb3c7 100644 --- a/src/test/PhysicsTest.cpp +++ b/src/test/PhysicsTest.cpp @@ -108,7 +108,7 @@ TEST_F(PhysicsTest, movement) { EXPECT_NEAR(transform.position.x, 0.02, 0.001); EXPECT_NEAR(transform.position.y, 0.02, 0.001); EXPECT_NEAR(transform.rotation, 0.02, 0.001); - + rigidbody.data.constraints = {0, 0, 0}; rigidbody.data.linear_velocity_coefficient.x = 0.5; rigidbody.data.linear_velocity_coefficient.y = 0.5; rigidbody.data.angular_velocity_coefficient = 0.5; @@ -122,9 +122,11 @@ TEST_F(PhysicsTest, movement) { rigidbody.data.max_angular_velocity = 1000; rigidbody.data.angular_velocity = 360; system.update(); - EXPECT_NEAR(transform.rotation, 7.22, 0.0001); + EXPECT_NEAR(transform.rotation, 7.24, 0.01); rigidbody.data.angular_velocity = -360; system.update(); - EXPECT_NEAR(transform.rotation, 0.02, 0.001); + EXPECT_NEAR(transform.rotation, 0.04, 0.001); + system.update(); + EXPECT_NEAR(transform.rotation, 352.84, 0.01); } |