From 9b453277059fd015703873172d0dc87b4a29cb55 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 3 Feb 2023 22:00:28 +0100 Subject: Created engine module right now containing only Point This might be a bit too generic of a name, but the intent is to get the main shared abstracts for gameplay loop and/or simulation outside of the game executable implementation to redirect dependencies. --- sim/include/kurator/sim/FloatingMovement.h | 4 ++-- sim/include/kurator/sim/Point.h | 26 -------------------------- sim/include/kurator/sim/components.h | 6 +++--- 3 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 sim/include/kurator/sim/Point.h (limited to 'sim/include') diff --git a/sim/include/kurator/sim/FloatingMovement.h b/sim/include/kurator/sim/FloatingMovement.h index 352377d..d7e8479 100644 --- a/sim/include/kurator/sim/FloatingMovement.h +++ b/sim/include/kurator/sim/FloatingMovement.h @@ -3,7 +3,7 @@ #include #include -#include "Point.h" +#include namespace kurator @@ -18,7 +18,7 @@ struct FloatingMovement double acceleration; double deceleration; double destination_boundary = 100.0; - Point speed = {0.0, 0.0}; + engine::Point speed = {0.0, 0.0}; static void update(entt::registry& registry, entt::dispatcher& dispatcher, float dt); }; diff --git a/sim/include/kurator/sim/Point.h b/sim/include/kurator/sim/Point.h deleted file mode 100644 index afd30ba..0000000 --- a/sim/include/kurator/sim/Point.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - - -namespace kurator -{ -namespace sim -{ - - -struct Point -{ - double x; - double y; - double magnitude() const; - double distance(const Point& other) const; - double angle() const; - Point rotate(double angle) const; - Point scale(double _scale) const; - Point normalized() const; - Point operator-(const Point& other) const; - Point operator+(const Point& other) const; -}; - - -} // namespace sim -} // namespace kurator diff --git a/sim/include/kurator/sim/components.h b/sim/include/kurator/sim/components.h index f4f1799..e8b2591 100644 --- a/sim/include/kurator/sim/components.h +++ b/sim/include/kurator/sim/components.h @@ -2,7 +2,7 @@ #include -#include "Point.h" +#include namespace kurator @@ -13,7 +13,7 @@ namespace sim struct Transform { - Point position; + engine::Point position; double angle; entt::entity reference_frame = entt::null; }; @@ -28,7 +28,7 @@ struct Team struct AIState { double keep_at_range; - Point destination; + engine::Point destination; entt::entity target = entt::null; }; -- cgit v1.1