From bcf1672f0171a3ce0ef27f23c99b09c741168cba Mon Sep 17 00:00:00 2001 From: Sara Date: Wed, 19 Jun 2024 12:56:02 +0200 Subject: [PATCH] feat: added get_eye_transform to unit --- src/unit.cpp | 4 ++++ src/unit.hpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/unit.cpp b/src/unit.cpp index 1b841e6..e4b3872 100644 --- a/src/unit.cpp +++ b/src/unit.cpp @@ -43,6 +43,10 @@ UnitWorldState *Unit::get_world_state() const { return this->world_state; } +gd::Transform3D Unit::get_eye_transform() const { + return this->eyes->get_global_transform(); +} + void Unit::destroy_state() { if(this->state == nullptr || this->state->is_queued_for_deletion() || !this->state->is_inside_tree()) return; diff --git a/src/unit.hpp b/src/unit.hpp index 9d17a3d..9d43017 100644 --- a/src/unit.hpp +++ b/src/unit.hpp @@ -23,7 +23,9 @@ public: void stop_plan(); void plan_for_marker(GoalMarker *marker); void plan_for_goal(gd::Ref goal); + UnitWorldState *get_world_state() const; + gd::Transform3D get_eye_transform() const; private: void destroy_state(); void state_finished();