diff options
author | Stijn Buys <ingar@osirion.org> | 2013-10-16 20:59:08 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-10-16 20:59:08 +0000 |
commit | 71b517e154e4644fcf0f8bb3b8b40b7898ecdd9d (patch) | |
tree | 71fe2b8e08e25425893fd363e9e82730e86add83 /src/game/base/ship.h | |
parent | ce62661012a167d48bd6117940a551355eb6773b (diff) |
Added support for autopilot formation flight and docking.
Diffstat (limited to 'src/game/base/ship.h')
-rw-r--r-- | src/game/base/ship.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/game/base/ship.h b/src/game/base/ship.h index 7b25f18..61ff1c7 100644 --- a/src/game/base/ship.h +++ b/src/game/base/ship.h @@ -18,6 +18,10 @@ namespace game const float MIN_DELTA = 0.000001f; +// planet docking distance +const float PLANET_SAFE_DISTANCE = 50.0f; + + /** * @brief A ship in the game, controled by a player * */ @@ -85,7 +89,7 @@ public: return ship_autopilot_target; } - inline bool has_autopilot_flag(const AutoPilotFlags flag) { + inline bool has_autopilot_flag(const AutoPilotFlags flag) const { return ( (ship_autopilot_flags & flag) == flag); } @@ -207,16 +211,25 @@ public: void set_spawn(core::Entity *spawn); protected: + /** + * @brief autopilot frame + * */ + void frame_autopilot(const unsigned long elapsed); + + /** + * @brief autopilot goto target + * */ + void frame_autopilot_goto(const unsigned long elapsed, core::Entity *target); /** * @brief autopilot goto target * */ - void frame_autopilot_goto(const unsigned long elapsed, const core::Entity *target); + void frame_autopilot_dock(const unsigned long elapsed, core::Entity *target); /** * @brief autopilot formation flying * */ - void frame_autopilot_formation(const unsigned long elapsed, const core::Entity *target); + void frame_autopilot_formation(const unsigned long elapsed, core::Entity *target); private: JumpPoint *find_closest_jumppoint(); |