aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/example/game.cpp14
-rw-r--r--src/test/CollisionTest.cpp2
2 files changed, 10 insertions, 6 deletions
diff --git a/src/example/game.cpp b/src/example/game.cpp
index 70c562e..a8d6d1b 100644
--- a/src/example/game.cpp
+++ b/src/example/game.cpp
@@ -44,12 +44,13 @@ public:
//define playable world
GameObject world = mgr.new_object(
"Name", "Tag", vec2{screen_size_width / 2, screen_size_height / 2}, 0, 1);
- world.add_component<Rigidbody>(
- Rigidbody::Data{.mass = 0,
- .gravity_scale = 0,
- .body_type = Rigidbody::BodyType::STATIC,
- .constraints = {0, 0, 0},
- .offset = {0, 0}});
+ world.add_component<Rigidbody>(Rigidbody::Data{
+ .mass = 0,
+ .gravity_scale = 0,
+ .body_type = Rigidbody::BodyType::STATIC,
+ .offset = {0, 0},
+ .collision_layers = {0},
+ });
world.add_component<BoxCollider>(
vec2{0, 0 - (screen_size_height / 2 + world_collider / 2)},
vec2{world_collider, world_collider});
@@ -73,6 +74,7 @@ public:
.constraints = {0, 0, 0},
.elastisity_coefficient = 1,
.offset = {0, 0},
+ .collision_layers = {0},
});
game_object1.add_component<BoxCollider>(vec2{0, 0}, vec2{20, 20});
game_object1.add_component<BehaviorScript>().set_script<MyScript>();
diff --git a/src/test/CollisionTest.cpp b/src/test/CollisionTest.cpp
index 74edaf7..3da04b5 100644
--- a/src/test/CollisionTest.cpp
+++ b/src/test/CollisionTest.cpp
@@ -78,6 +78,7 @@ public:
.constraints = {0, 0, 0},
.elastisity_coefficient = 1,
.offset = {0, 0},
+ .collision_layers = {0},
});
game_object1.add_component<BoxCollider>(vec2{0, 0}, vec2{10, 10});
BehaviorScript & script_object1
@@ -93,6 +94,7 @@ public:
.constraints = {0, 0, 0},
.elastisity_coefficient = 1,
.offset = {0, 0},
+ .collision_layers = {0},
});
game_object2.add_component<BoxCollider>(vec2{0, 0}, vec2{10, 10});
BehaviorScript & script_object2