💿🐜 Antkeeper source code https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.6 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. /*
  2. * Copyright (C) 2023 Christopher J. Howard
  3. *
  4. * This file is part of Antkeeper source code.
  5. *
  6. * Antkeeper source code is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Antkeeper source code is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef ANTKEEPER_NUPTIAL_FLIGHT_STATE_HPP
  20. #define ANTKEEPER_NUPTIAL_FLIGHT_STATE_HPP
  21. #include "game/states/game-state.hpp"
  22. #include <engine/entity/id.hpp>
  23. #include <engine/math/vector.hpp>
  24. #include <engine/event/subscription.hpp>
  25. #include <engine/scene/text.hpp>
  26. #include <engine/utility/text-file.hpp>
  27. #include <memory>
  28. class nuptial_flight_state: public game_state
  29. {
  30. public:
  31. explicit nuptial_flight_state(::game& ctx);
  32. virtual ~nuptial_flight_state();
  33. private:
  34. void create_camera_rig();
  35. void destroy_camera_rig();
  36. void set_camera_rig_zoom(float zoom);
  37. void satisfy_camera_rig_constraints();
  38. void setup_controls();
  39. void enable_controls();
  40. void disable_controls();
  41. void select_entity(entity::id entity_id);
  42. void select_nearest_entity(const math::fvec3& direction);
  43. // Camera
  44. entity::id camera_rig_focus_eid;
  45. entity::id camera_rig_focus_ease_to_eid;
  46. entity::id camera_rig_eid;
  47. entity::id camera_rig_spring_translation_eid;
  48. entity::id camera_rig_spring_rotation_eid;
  49. entity::id camera_rig_copy_translation_eid;
  50. entity::id camera_rig_pivot_eid;
  51. float camera_rig_near_distance;
  52. float camera_rig_far_distance;
  53. float camera_rig_near_fov;
  54. float camera_rig_far_fov;
  55. float camera_rig_zoom_speed;
  56. float camera_rig_zoom;
  57. entity::id camera_rig_fov_spring_eid;
  58. float camera_rig_translation_spring_angular_frequency;
  59. float camera_rig_rotation_spring_angular_frequency;
  60. float camera_rig_fov_spring_angular_frequency;
  61. float camera_rig_focus_ease_to_duration;
  62. // Ants
  63. entity::id swarm_eid;
  64. // Name generation
  65. std::shared_ptr<text_file> name_pool;
  66. // Picking
  67. std::uint32_t selected_picking_flag;
  68. entity::id selected_eid;
  69. // UI
  70. scene::text selection_text;
  71. // Controls
  72. bool mouse_look{false};
  73. std::vector<std::shared_ptr<::event::subscription>> action_subscriptions;
  74. std::shared_ptr<::event::subscription> mouse_motion_subscription;
  75. };
  76. #endif // ANTKEEPER_NUPTIAL_FLIGHT_STATE_HPP