Skip to content
Snippets Groups Projects
Commit c7f07668 authored by BATON Theau's avatar BATON Theau
Browse files

Start event system

parent 6e6dd041
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ namespace megu::kernel { ...@@ -13,7 +13,7 @@ namespace megu::kernel {
Movable(float x, float y, float w, float h); Movable(float x, float y, float w, float h);
void update_physic(double) override; void update_physic(double) override;
void on_collide(Kernel &, const PhysicEngine &, Physical &, double) override; void on_collide(Kernel &, PhysicEngine &, Identifiable &, Physical &, double) override;
void apply(Kernel & k, PhysicEngine &) override; void apply(Kernel & k, PhysicEngine &) override;
void unapply(Kernel & k, PhysicEngine &) override; void unapply(Kernel & k, PhysicEngine &) override;
......
#include "PhysicResolver.hpp" #include "PhysicResolver.hpp"
#include <kernel/front/Kernel.hpp>
namespace megu::kernel { namespace megu::kernel {
void PhysicResolver::resolve(Kernel & kernel, PhysicEngine & engine, double time) { void PhysicResolver::resolve(Kernel & kernel, PhysicEngine & engine, double time) {
auto & collisions = engine.get().collision(); auto & collisions = engine.get().collision();
...@@ -9,7 +11,7 @@ namespace megu::kernel { ...@@ -9,7 +11,7 @@ namespace megu::kernel {
auto target_comp = this->get(collision.target()); auto target_comp = this->get(collision.target());
if(source_comp.has_value() && target_comp.has_value()) { if(source_comp.has_value() && target_comp.has_value()) {
source_comp.value().get().on_collide(kernel, engine, target_comp.value().get(), time); source_comp.value().get().on_collide(kernel, engine, *kernel.get(target_comp.value()), target_comp.value(), time);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment