diff options
Diffstat (limited to 'src/test/CollisionTest.cpp')
-rw-r--r-- | src/test/CollisionTest.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/test/CollisionTest.cpp b/src/test/CollisionTest.cpp index dd45eb6..0607128 100644 --- a/src/test/CollisionTest.cpp +++ b/src/test/CollisionTest.cpp @@ -106,7 +106,7 @@ public: ASSERT_NE(script_object2_ref, nullptr); // Ensure Script::init() is called on all BehaviorScript instances - script_sys.update(); + script_sys.fixed_update(); } }; @@ -121,7 +121,7 @@ TEST_F(CollisionTest, collision_example) { EXPECT_EQ(ev.info.this_collider.game_object_id, 2); }; EXPECT_FALSE(collision_happend); - collision_sys.update(); + collision_sys.fixed_update(); EXPECT_FALSE(collision_happend); } @@ -144,7 +144,7 @@ TEST_F(CollisionTest, collision_box_box_dynamic_both_no_velocity) { EXPECT_FALSE(collision_happend); Transform & tf = this->mgr.get_components_by_id<Transform>(1).front().get(); tf.position = {50, 30}; - collision_sys.update(); + collision_sys.fixed_update(); EXPECT_TRUE(collision_happend); } @@ -169,7 +169,7 @@ TEST_F(CollisionTest, collision_box_box_dynamic_x_direction_no_velocity) { EXPECT_FALSE(collision_happend); Transform & tf = this->mgr.get_components_by_id<Transform>(1).front().get(); tf.position = {45, 30}; - collision_sys.update(); + collision_sys.fixed_update(); EXPECT_TRUE(collision_happend); } @@ -194,7 +194,7 @@ TEST_F(CollisionTest, collision_box_box_dynamic_y_direction_no_velocity) { EXPECT_FALSE(collision_happend); Transform & tf = this->mgr.get_components_by_id<Transform>(1).front().get(); tf.position = {50, 25}; - collision_sys.update(); + collision_sys.fixed_update(); EXPECT_TRUE(collision_happend); } @@ -221,7 +221,7 @@ TEST_F(CollisionTest, collision_box_box_dynamic_both) { rg1.data.linear_velocity = {10, 10}; Rigidbody & rg2 = this->mgr.get_components_by_id<Rigidbody>(2).front().get(); rg2.data.linear_velocity = {10, 10}; - collision_sys.update(); + collision_sys.fixed_update(); EXPECT_TRUE(collision_happend); } @@ -250,7 +250,7 @@ TEST_F(CollisionTest, collision_box_box_dynamic_x_direction) { rg1.data.linear_velocity = {10, 10}; Rigidbody & rg2 = this->mgr.get_components_by_id<Rigidbody>(2).front().get(); rg2.data.linear_velocity = {10, 10}; - collision_sys.update(); + collision_sys.fixed_update(); EXPECT_TRUE(collision_happend); } @@ -279,7 +279,7 @@ TEST_F(CollisionTest, collision_box_box_dynamic_y_direction) { rg1.data.linear_velocity = {10, 10}; Rigidbody & rg2 = this->mgr.get_components_by_id<Rigidbody>(2).front().get(); rg2.data.linear_velocity = {10, 10}; - collision_sys.update(); + collision_sys.fixed_update(); EXPECT_TRUE(collision_happend); } @@ -301,7 +301,7 @@ TEST_F(CollisionTest, collision_box_box_static_both) { tf.position = {50, 30}; Rigidbody & rg2 = this->mgr.get_components_by_id<Rigidbody>(2).front().get(); rg2.data.body_type = crepe::Rigidbody::BodyType::STATIC; - collision_sys.update(); + collision_sys.fixed_update(); EXPECT_TRUE(collision_happend); } @@ -326,7 +326,7 @@ TEST_F(CollisionTest, collision_box_box_static_x_direction) { rg1.data.linear_velocity = {10, 10}; Rigidbody & rg2 = this->mgr.get_components_by_id<Rigidbody>(2).front().get(); rg2.data.body_type = crepe::Rigidbody::BodyType::STATIC; - collision_sys.update(); + collision_sys.fixed_update(); EXPECT_TRUE(collision_happend); } @@ -351,7 +351,7 @@ TEST_F(CollisionTest, collision_box_box_static_y_direction) { rg1.data.linear_velocity = {10, 10}; Rigidbody & rg2 = this->mgr.get_components_by_id<Rigidbody>(2).front().get(); rg2.data.body_type = crepe::Rigidbody::BodyType::STATIC; - collision_sys.update(); + collision_sys.fixed_update(); EXPECT_TRUE(collision_happend); } @@ -381,10 +381,10 @@ TEST_F(CollisionTest, collision_box_box_static_multiple) { //todo check visually this->game_object1.add_component<BoxCollider>(vec2{-5, 0}, vec2{10, 10}); offset_value = 5; resolution = 10; - collision_sys.update(); + collision_sys.fixed_update(); offset_value = -5; resolution = 10; tf.position = {55, 30}; - collision_sys.update(); + collision_sys.fixed_update(); EXPECT_TRUE(collision_happend); } |