aboutsummaryrefslogtreecommitdiff
path: root/src/test/CollisionTest.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-10 19:50:26 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-10 19:50:26 +0100
commit770496ee9d0e45480c0e0f8951adb8eee247bfe1 (patch)
tree98c68b0d37d8a1c0c8b8013ea7884d56f04aaa28 /src/test/CollisionTest.cpp
parent0cb7f2f82ca167656b3c5cb9f0cc3b44c59cb0eb (diff)
big WIP
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 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);
}