Antkeeper  0.0.1
nest-selection-state.hpp
Go to the documentation of this file.
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 
20 #ifndef ANTKEEPER_NEST_SELECTION_STATE_HPP
21 #define ANTKEEPER_NEST_SELECTION_STATE_HPP
22 
24 #include <engine/entity/id.hpp>
25 #include <engine/math/vector.hpp>
26 #include <engine/render/model.hpp>
29 
31 {
32 public:
33  explicit nest_selection_state(::game& ctx);
34  virtual ~nest_selection_state();
35 
36 private:
37  void create_first_person_camera_rig();
38  void destroy_first_person_camera_rig();
39  void set_first_person_camera_rig_pedestal(float pedestal);
40  void move_first_person_camera_rig(const math::fvec2& direction, float factor);
41  void satisfy_first_person_camera_rig_constraints();
42 
43  void setup_controls();
44  void enable_controls();
45  void disable_controls();
46 
47  std::vector<std::shared_ptr<::event::subscription>> action_subscriptions;
48  std::shared_ptr<::event::subscription> mouse_motion_subscription;
49  std::shared_ptr<render::model> worker_model;
50 
51  bool mouse_look{false};
52  bool mouse_drag{false};
53  bool adjust_exposure{false};
54  bool adjust_time{false};
55 
56  bool moving{false};
57  math::fvec2 movement_direction{0.0f, 0.0f};
58  float movement_speed{0.0f};
59 
60  entity::id worker_ant_eid;
61 
62  entity::id larva_eid;
63 
64  entity::id first_person_camera_rig_eid;
65  float first_person_camera_rig_translation_spring_angular_frequency;
66  float first_person_camera_rig_rotation_spring_angular_frequency;
67  float first_person_camera_rig_fov_spring_angular_frequency;
68  float first_person_camera_rig_min_elevation;
69  float first_person_camera_rig_max_elevation;
70  float first_person_camera_near_fov;
71  float first_person_camera_far_fov;
72  float first_person_camera_near_speed;
73  float first_person_camera_far_speed;
74  float first_person_camera_rig_pedestal_speed;
75  float first_person_camera_rig_pedestal;
76 
77  double first_person_camera_yaw{0.0};
78  double first_person_camera_pitch{0.0};
79 
80  std::shared_ptr<ccd_ik_solver> larva_ik_solver;
81 
82  std::shared_ptr<scene::light_probe> sky_probe;
83 };
84 
85 #endif // ANTKEEPER_NEST_SELECTION_STATE_HPP
Abstract base class for game states.
Definition: game-state.hpp:29
::game & ctx
Definition: game-state.hpp:44
Definition: game.hpp:121
entt::entity id
Entity ID type.
Definition: id.hpp:28
n-dimensional vector.
Definition: vector.hpp:44