From be36b204c6dc597f74541e926f2f2821ab553228 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Wed, 18 Dec 2024 23:54:29 +0100 Subject: testing dynamic --- src/crepe/system/CollisionSystem.cpp | 6 +----- src/example/game.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/crepe/system/CollisionSystem.cpp b/src/crepe/system/CollisionSystem.cpp index a9a0523..75e914d 100644 --- a/src/crepe/system/CollisionSystem.cpp +++ b/src/crepe/system/CollisionSystem.cpp @@ -72,12 +72,8 @@ void CollisionSystem::update() { std::vector> collided = this->gather_collisions(all_colliders); - // For both objects call the collision handler + // For the object convert the info and call the collision handler if needed for (auto & collision_pair : collided) { - // Determine type - //CollisionInternalType type = this->get_collider_type(collision_pair.first.collider, collision_pair.second.collider); - // Determine resolution - //std::pair resolution_data = this->get_collision_resolution(collision_pair.first, collision_pair.second, type); // Convert internal struct to external struct CollisionInfo info = this->get_collision_info(collision_pair.first, collision_pair.second); // Determine if and/or what collison handler is needed. diff --git a/src/example/game.cpp b/src/example/game.cpp index 69bfae2..01e55d5 100644 --- a/src/example/game.cpp +++ b/src/example/game.cpp @@ -206,7 +206,7 @@ public: vec2{world_collider, world_collider}, vec2{0, screen_size_height / 2 + world_collider / 2}); // Bottom world.add_component( - vec2{world_collider, world_collider}, + vec2{world_collider, world_collider},git stauts vec2{0 - (screen_size_width / 2 + world_collider / 2), 0}); // Left world.add_component( vec2{world_collider, world_collider}, @@ -220,12 +220,12 @@ public: }); GameObject game_object1 = new_object( - "Name", "Tag", vec2{screen_size_width / 2, screen_size_height / 2+30}, 0, 1); + "Name", "Tag", vec2{screen_size_width / 2, screen_size_height / 2+60}, 0, 1); game_object1.add_component(Rigidbody::Data{ .mass = 1, .gravity_scale = 0, .body_type = Rigidbody::BodyType::DYNAMIC, - .linear_velocity = {0, 1}, + .linear_velocity = {0, 0}, .constraints = {0, 0, 0}, .elastisity_coefficient = 1, }); @@ -257,7 +257,7 @@ public: game_object2.add_component(Rigidbody::Data{ .mass = 1, .gravity_scale = 1, - .body_type = Rigidbody::BodyType::KINEMATIC, + .body_type = Rigidbody::BodyType::DYNAMIC, .linear_velocity = {0, 0}, .constraints = {0, 0, 0}, .elastisity_coefficient = 1, -- cgit v1.2.3