aboutsummaryrefslogtreecommitdiff
path: root/src/test/CollisionTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/CollisionTest.cpp')
-rw-r--r--src/test/CollisionTest.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/test/CollisionTest.cpp b/src/test/CollisionTest.cpp
index ff9e7cc..65d592d 100644
--- a/src/test/CollisionTest.cpp
+++ b/src/test/CollisionTest.cpp
@@ -107,7 +107,7 @@ public:
ASSERT_NE(script_object2_ref, nullptr);
// Ensure Script::init() is called on all BehaviorScript instances
- script_sys.update();
+ script_sys.fixed_update();
}
};
@@ -122,7 +122,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);
}
@@ -145,7 +145,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);
}
@@ -170,7 +170,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);
}
@@ -195,7 +195,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);
}
@@ -222,7 +222,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);
}
@@ -251,7 +251,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);
}
@@ -280,7 +280,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);
}
@@ -302,7 +302,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);
}
@@ -327,7 +327,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);
}
@@ -352,7 +352,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);
}
@@ -382,10 +382,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);
}