From c6d17ef545978bec555c8af8ef5eaef82c44e5f1 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 12 Nov 2022 14:28:39 +0100 Subject: Implemented very basic linear move-to-dest component --- battles/include/kurator/battles/Point.h | 7 +++++++ battles/include/kurator/battles/components.h | 13 +++++++++++++ 2 files changed, 20 insertions(+) (limited to 'battles/include') diff --git a/battles/include/kurator/battles/Point.h b/battles/include/kurator/battles/Point.h index 71a6993..b6be651 100644 --- a/battles/include/kurator/battles/Point.h +++ b/battles/include/kurator/battles/Point.h @@ -11,6 +11,13 @@ struct Point { double x; double y; + double magnitude() const; + double distance(const Point& other) 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; }; diff --git a/battles/include/kurator/battles/components.h b/battles/include/kurator/battles/components.h index 307acc3..0c1e280 100644 --- a/battles/include/kurator/battles/components.h +++ b/battles/include/kurator/battles/components.h @@ -25,5 +25,18 @@ struct Team }; +struct AIState +{ + Point destination; + entt::entity target = entt::null; +}; + + +struct FloatingMovement +{ + double speed; // linear and instant angular for now +}; + + } // namespace battles } // namespace kurator -- cgit v1.1