summaryrefslogtreecommitdiff
path: root/sim/include
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-02-03 22:00:28 +0100
committerAki <please@ignore.pl>2023-02-03 22:00:28 +0100
commit9b453277059fd015703873172d0dc87b4a29cb55 (patch)
tree3df0415c5b8160f9d97dae12f0c7adb55c4a23db /sim/include
parentb5a71a9c776386805a12a722be23bf8d7b7e25fe (diff)
downloadkurator-9b453277059fd015703873172d0dc87b4a29cb55.zip
kurator-9b453277059fd015703873172d0dc87b4a29cb55.tar.gz
kurator-9b453277059fd015703873172d0dc87b4a29cb55.tar.bz2
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.
Diffstat (limited to 'sim/include')
-rw-r--r--sim/include/kurator/sim/FloatingMovement.h4
-rw-r--r--sim/include/kurator/sim/Point.h26
-rw-r--r--sim/include/kurator/sim/components.h6
3 files changed, 5 insertions, 31 deletions
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 <entt/entity/registry.hpp>
#include <entt/signal/dispatcher.hpp>
-#include "Point.h"
+#include <kurator/engine/Point.h>
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 <entt/entity/entity.hpp>
-#include "Point.h"
+#include <kurator/engine/Point.h>
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;
};