💿🐜 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.

572 lines
20 KiB

  1. /*
  2. * Copyright (C) 2021 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. #include "game/state/nuptial-flight.hpp"
  20. #include "game/state/pause-menu.hpp"
  21. #include "entity/archetype.hpp"
  22. #include "entity/systems/astronomy.hpp"
  23. #include "entity/systems/orbit.hpp"
  24. #include "entity/systems/camera.hpp"
  25. #include "entity/components/observer.hpp"
  26. #include "entity/components/transform.hpp"
  27. #include "entity/components/terrain.hpp"
  28. #include "entity/components/camera.hpp"
  29. #include "entity/components/constraints/spring-to.hpp"
  30. #include "entity/components/constraints/three-dof.hpp"
  31. #include "entity/components/constraint-stack.hpp"
  32. #include "entity/commands.hpp"
  33. #include "animation/screen-transition.hpp"
  34. #include "animation/ease.hpp"
  35. #include "resources/resource-manager.hpp"
  36. #include "game/world.hpp"
  37. #include "application.hpp"
  38. #include "render/passes/clear-pass.hpp"
  39. #include <memory>
  40. #include <iostream>
  41. #include "state-machine.hpp"
  42. namespace game {
  43. namespace state {
  44. nuptial_flight::nuptial_flight(game::context& ctx):
  45. game::state::base(ctx)
  46. {
  47. ctx.logger->push_task("Entering nuptial flight state");
  48. // Disable UI color clear
  49. ctx.ui_clear_pass->set_cleared_buffers(false, true, false);
  50. // Create world
  51. game::world::create_stars(ctx);
  52. game::world::create_sun(ctx);
  53. game::world::create_planet(ctx);
  54. game::world::create_moon(ctx);
  55. // Set time to solar noon
  56. game::world::set_time(ctx, 0.0);
  57. // Freeze time
  58. game::world::set_time_scale(ctx, 0.0);
  59. // Switch to surface camera
  60. ctx.underground_camera->set_active(false);
  61. ctx.surface_camera->set_active(true);
  62. // Find planet EID by name
  63. entity::id planet_eid = ctx.entities["planet"];
  64. // Remove terrain component from planet (if any)
  65. //if (ctx.entity_registry->has<entity::component::terrain>(planet_eid))
  66. // ctx.entity_registry->remove<entity::component::terrain>(planet_eid);
  67. // Enable clouds in sky pass
  68. //ctx.surface_sky_pass->set_clouds_model(ctx.resource_manager->load<render::model>("cloud-plane.mdl"));
  69. // Create biome terrain component
  70. entity::component::terrain biome_terrain;
  71. biome_terrain.max_lod = 18;
  72. biome_terrain.patch_material = ctx.resource_manager->load<render::material>("desert-terrain.mtl");
  73. biome_terrain.elevation = [](double, double) -> double
  74. {
  75. return 0.0;
  76. };
  77. // Replace planet terrain component with biome terrain component
  78. ctx.entity_registry->replace<entity::component::terrain>(planet_eid, biome_terrain);
  79. // Create observer
  80. entity::id observer_eid = ctx.entity_registry->create();
  81. {
  82. entity::component::observer observer;
  83. observer.reference_body_eid = planet_eid;
  84. observer.elevation = 2000.0;
  85. observer.latitude = 0.0;
  86. observer.longitude = 0.0;
  87. observer.camera = ctx.surface_camera;
  88. ctx.entity_registry->assign<entity::component::observer>(observer_eid, observer);
  89. // Set reference location of astronomy system
  90. ctx.astronomy_system->set_reference_body(planet_eid);
  91. ctx.astronomy_system->set_observer_location(double3{observer.elevation, observer.latitude, observer.longitude});
  92. }
  93. // Setup camera
  94. setup_camera();
  95. /*
  96. ctx.surface_camera->look_at({0, 0, 1}, {0, 0, 0}, {0, 1, 0});
  97. ctx.surface_camera->set_exposure(-14.5f);
  98. ctx.surface_scene->update_tweens();
  99. */
  100. // Queue fade in
  101. ctx.fade_transition_color->set_value({1, 1, 1});
  102. ctx.function_queue.push(std::bind(&screen_transition::transition, ctx.fade_transition, 5.0f, true, ease<float>::out_sine, true, nullptr));
  103. // Queue control setup
  104. ctx.function_queue.push(std::bind(&nuptial_flight::enable_controls, this));
  105. ctx.logger->pop_task(EXIT_SUCCESS);
  106. }
  107. nuptial_flight::~nuptial_flight()
  108. {
  109. ctx.logger->push_task("Exiting nuptial flight state");
  110. // Resume time
  111. //const double time_scale = (*ctx.config)["time_scale"].get<double>();
  112. //game::world::set_time_scale(ctx, time_scale);
  113. ctx.logger->pop_task(EXIT_SUCCESS);
  114. }
  115. void nuptial_flight::setup_camera()
  116. {
  117. // Switch to surface camera
  118. ctx.underground_camera->set_active(false);
  119. ctx.surface_camera->set_active(true);
  120. // Create surface camera entity
  121. if (!ctx.entities.count("surface_cam"))
  122. {
  123. // Create camera target entity
  124. entity::id target_eid = ctx.entity_registry->create();
  125. ctx.entities["surface_cam_target"] = target_eid;
  126. {
  127. // Transform
  128. entity::component::transform target_transform;
  129. target_transform.local = math::identity_transform<float>;
  130. target_transform.world = target_transform.local;
  131. target_transform.warp = true;
  132. ctx.entity_registry->assign<entity::component::transform>(target_eid, target_transform);
  133. }
  134. // Create camera entity
  135. entity::id camera_eid = ctx.entity_registry->create();
  136. ctx.entities["surface_cam"] = camera_eid;
  137. // Create camera transform component
  138. entity::component::transform transform;
  139. transform.local = math::identity_transform<float>;
  140. transform.world = transform.local;
  141. transform.warp = true;
  142. ctx.entity_registry->assign<entity::component::transform>(camera_eid, transform);
  143. // Create camera camera component
  144. entity::component::camera camera;
  145. camera.object = ctx.surface_camera;
  146. ctx.entity_registry->assign<entity::component::camera>(camera_eid, camera);
  147. // Create camera 3DOF constraint entity
  148. entity::id three_dof_constraint_eid = ctx.entity_registry->create();
  149. ctx.entities["surface_cam_3dof"] = three_dof_constraint_eid;
  150. {
  151. // Create 3DOF to constraint
  152. entity::component::constraint::three_dof three_dof;
  153. three_dof.yaw = 0.0f;
  154. three_dof.pitch = 0.0f;
  155. three_dof.roll = 0.0f;
  156. ctx.entity_registry->assign<entity::component::constraint::three_dof>(three_dof_constraint_eid, three_dof);
  157. // Create constraint stack node component
  158. entity::component::constraint_stack_node node;
  159. node.active = true;
  160. node.weight = 1.0f;
  161. node.next = entt::null;
  162. ctx.entity_registry->assign<entity::component::constraint_stack_node>(three_dof_constraint_eid, node);
  163. }
  164. // Create camera spring to constraint entity
  165. entity::id spring_constraint_eid = ctx.entity_registry->create();
  166. {
  167. // Create spring to constraint
  168. entity::component::constraint::spring_to spring;
  169. spring.target = target_eid;
  170. spring.translation = {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, 1.0f, math::two_pi<float>};
  171. spring.translation.w = hz_to_rads(8.0f);
  172. spring.spring_translation = true;
  173. spring.spring_rotation = false;
  174. ctx.entity_registry->assign<entity::component::constraint::spring_to>(spring_constraint_eid, spring);
  175. // Create constraint stack node component
  176. entity::component::constraint_stack_node node;
  177. node.active = true;
  178. node.weight = 1.0f;
  179. node.next = three_dof_constraint_eid;
  180. ctx.entity_registry->assign<entity::component::constraint_stack_node>(spring_constraint_eid, node);
  181. }
  182. // Create camera constraint stack component
  183. entity::component::constraint_stack constraint_stack;
  184. constraint_stack.head = spring_constraint_eid;
  185. ctx.entity_registry->assign<entity::component::constraint_stack>(camera_eid, constraint_stack);
  186. }
  187. float ev100 = 14.5f;
  188. ctx.surface_camera->set_exposure(ev100);
  189. }
  190. void nuptial_flight::enable_controls()
  191. {
  192. // Get camera entities
  193. entity::id camera_eid = ctx.entities["surface_cam"];
  194. entity::id target_eid = ctx.entities["surface_cam_target"];
  195. entity::id three_dof_eid = ctx.entities["surface_cam_3dof"];
  196. const float slow_modifier = 0.25f;
  197. const float fast_modifier = 4.0f;
  198. const float dolly_speed = 20.0f;
  199. const float truck_speed = dolly_speed;
  200. const float pedestal_speed = 30.0f;
  201. float mouse_tilt_sensitivity = 1.0f;
  202. float mouse_pan_sensitivity = 1.0f;
  203. bool mouse_invert_tilt = false;
  204. bool mouse_invert_pan = false;
  205. float gamepad_tilt_sensitivity = 1.0f;
  206. float gamepad_pan_sensitivity = 1.0f;
  207. bool gamepad_invert_tilt = false;
  208. bool gamepad_invert_pan = false;
  209. bool mouse_look_toggle = false;
  210. ctx.mouse_look = false;
  211. if (ctx.config->contains("mouse_tilt_sensitivity"))
  212. mouse_tilt_sensitivity = math::radians((*ctx.config)["mouse_tilt_sensitivity"].get<float>());
  213. if (ctx.config->contains("mouse_pan_sensitivity"))
  214. mouse_pan_sensitivity = math::radians((*ctx.config)["mouse_pan_sensitivity"].get<float>());
  215. if (ctx.config->contains("mouse_invert_tilt"))
  216. mouse_invert_tilt = math::radians((*ctx.config)["mouse_invert_tilt"].get<bool>());
  217. if (ctx.config->contains("mouse_invert_pan"))
  218. mouse_invert_pan = math::radians((*ctx.config)["mouse_invert_pan"].get<bool>());
  219. if (ctx.config->contains("mouse_look_toggle"))
  220. mouse_look_toggle = math::radians((*ctx.config)["mouse_look_toggle"].get<bool>());
  221. if (ctx.config->contains("gamepad_tilt_sensitivity"))
  222. gamepad_tilt_sensitivity = math::radians((*ctx.config)["gamepad_tilt_sensitivity"].get<float>());
  223. if (ctx.config->contains("gamepad_pan_sensitivity"))
  224. gamepad_pan_sensitivity = math::radians((*ctx.config)["gamepad_pan_sensitivity"].get<float>());
  225. if (ctx.config->contains("gamepad_invert_tilt"))
  226. gamepad_invert_tilt = math::radians((*ctx.config)["gamepad_invert_tilt"].get<bool>());
  227. if (ctx.config->contains("gamepad_invert_pan"))
  228. gamepad_invert_pan = math::radians((*ctx.config)["gamepad_invert_pan"].get<bool>());
  229. const input::control* move_slow = ctx.controls["move_slow"];
  230. const input::control* move_fast = ctx.controls["move_fast"];
  231. const input::control* mouse_look = ctx.controls["mouse_look"];
  232. float mouse_tilt_factor = mouse_tilt_sensitivity * (mouse_invert_tilt ? -1.0f : 1.0f);
  233. float mouse_pan_factor = mouse_pan_sensitivity * (mouse_invert_pan ? -1.0f : 1.0f);
  234. float gamepad_tilt_factor = gamepad_tilt_sensitivity * (gamepad_invert_tilt ? -1.0f : 1.0f);
  235. float gamepad_pan_factor = gamepad_pan_sensitivity * (gamepad_invert_pan ? -1.0f : 1.0f);
  236. ctx.controls["move_forward"]->set_active_callback
  237. (
  238. [&ctx = this->ctx, target_eid, three_dof_eid, truck_speed, move_slow, move_fast, slow_modifier, fast_modifier](float value)
  239. {
  240. if (move_slow->is_active())
  241. value *= slow_modifier;
  242. if (move_fast->is_active())
  243. value *= fast_modifier;
  244. auto& three_dof = ctx.entity_registry->get<entity::component::constraint::three_dof>(three_dof_eid);
  245. const math::quaternion<float> yaw = math::angle_axis(three_dof.yaw, {0.0f, 1.0f, 0.0f});
  246. const float3 movement = {0.0f, 0.0f, -truck_speed * value * (1.0f / 60.0f)};
  247. entity::command::translate(*ctx.entity_registry, target_eid, yaw * movement);
  248. }
  249. );
  250. // Dolly backward
  251. ctx.controls["move_back"]->set_active_callback
  252. (
  253. [&ctx = this->ctx, target_eid, three_dof_eid, truck_speed, move_slow, move_fast, slow_modifier, fast_modifier](float value)
  254. {
  255. if (move_slow->is_active())
  256. value *= slow_modifier;
  257. if (move_fast->is_active())
  258. value *= fast_modifier;
  259. auto& three_dof = ctx.entity_registry->get<entity::component::constraint::three_dof>(three_dof_eid);
  260. const math::quaternion<float> yaw = math::angle_axis(three_dof.yaw, {0.0f, 1.0f, 0.0f});
  261. const float3 movement = {0.0f, 0.0f, truck_speed * value * (1.0f / 60.0f)};
  262. entity::command::translate(*ctx.entity_registry, target_eid, yaw * movement);
  263. }
  264. );
  265. // Truck right
  266. ctx.controls["move_right"]->set_active_callback
  267. (
  268. [&ctx = this->ctx, target_eid, three_dof_eid, truck_speed, move_slow, move_fast, slow_modifier, fast_modifier](float value)
  269. {
  270. if (move_slow->is_active())
  271. value *= slow_modifier;
  272. if (move_fast->is_active())
  273. value *= fast_modifier;
  274. auto& three_dof = ctx.entity_registry->get<entity::component::constraint::three_dof>(three_dof_eid);
  275. const math::quaternion<float> yaw = math::angle_axis(three_dof.yaw, {0.0f, 1.0f, 0.0f});
  276. const float3 movement = {truck_speed * value * (1.0f / 60.0f), 0.0f, 0.0f};
  277. entity::command::translate(*ctx.entity_registry, target_eid, yaw * movement);
  278. }
  279. );
  280. // Truck left
  281. ctx.controls["move_left"]->set_active_callback
  282. (
  283. [&ctx = this->ctx, target_eid, three_dof_eid, truck_speed, move_slow, move_fast, slow_modifier, fast_modifier](float value)
  284. {
  285. if (move_slow->is_active())
  286. value *= slow_modifier;
  287. if (move_fast->is_active())
  288. value *= fast_modifier;
  289. auto& three_dof = ctx.entity_registry->get<entity::component::constraint::three_dof>(three_dof_eid);
  290. const math::quaternion<float> yaw = math::angle_axis(three_dof.yaw, {0.0f, 1.0f, 0.0f});
  291. const float3 movement = {-truck_speed * value * (1.0f / 60.0f), 0.0f, 0.0f};
  292. entity::command::translate(*ctx.entity_registry, target_eid, yaw * movement);
  293. }
  294. );
  295. // Pedestal up
  296. ctx.controls["move_up"]->set_active_callback
  297. (
  298. [&ctx = this->ctx, target_eid, pedestal_speed, move_slow, move_fast, slow_modifier, fast_modifier](float value)
  299. {
  300. if (move_slow->is_active())
  301. value *= slow_modifier;
  302. if (move_fast->is_active())
  303. value *= fast_modifier;
  304. const float3 movement = {0.0f, pedestal_speed * value * (1.0f / 60.0f), 0.0f};
  305. entity::command::translate(*ctx.entity_registry, target_eid, movement);
  306. }
  307. );
  308. // Pedestal down
  309. ctx.controls["move_down"]->set_active_callback
  310. (
  311. [&ctx = this->ctx, target_eid, pedestal_speed, move_slow, move_fast, slow_modifier, fast_modifier](float value)
  312. {
  313. if (move_slow->is_active())
  314. value *= slow_modifier;
  315. if (move_fast->is_active())
  316. value *= fast_modifier;
  317. const float3 movement = {0.0f, -pedestal_speed * value * (1.0f / 60.0f), 0.0f};
  318. entity::command::translate(*ctx.entity_registry, target_eid, movement);
  319. }
  320. );
  321. // Mouse rotate
  322. ctx.controls["mouse_look"]->set_activated_callback
  323. (
  324. [&ctx = this->ctx, mouse_look_toggle]()
  325. {
  326. if (mouse_look_toggle)
  327. ctx.mouse_look = !ctx.mouse_look;
  328. else
  329. ctx.mouse_look = true;
  330. ctx.app->set_relative_mouse_mode(ctx.mouse_look);
  331. }
  332. );
  333. ctx.controls["mouse_look"]->set_deactivated_callback
  334. (
  335. [&ctx = this->ctx, mouse_look_toggle]()
  336. {
  337. if (!mouse_look_toggle)
  338. {
  339. ctx.mouse_look = false;
  340. ctx.app->set_relative_mouse_mode(false);
  341. }
  342. }
  343. );
  344. // Pan left
  345. ctx.controls["look_left_gamepad"]->set_active_callback
  346. (
  347. [&ctx = this->ctx, three_dof_eid, gamepad_pan_factor](float value)
  348. {
  349. auto& three_dof = ctx.entity_registry->get<entity::component::constraint::three_dof>(three_dof_eid);
  350. three_dof.yaw += gamepad_pan_factor * value * (1.0f / 60.0f);
  351. }
  352. );
  353. ctx.controls["look_left_mouse"]->set_active_callback
  354. (
  355. [&ctx = this->ctx, three_dof_eid, mouse_pan_factor](float value)
  356. {
  357. if (!ctx.mouse_look)
  358. return;
  359. auto& three_dof = ctx.entity_registry->get<entity::component::constraint::three_dof>(three_dof_eid);
  360. three_dof.yaw += mouse_pan_factor * value * (1.0f / 60.0f);
  361. }
  362. );
  363. // Pan right
  364. ctx.controls["look_right_gamepad"]->set_active_callback
  365. (
  366. [&ctx = this->ctx, three_dof_eid, gamepad_pan_factor](float value)
  367. {
  368. auto& three_dof = ctx.entity_registry->get<entity::component::constraint::three_dof>(three_dof_eid);
  369. three_dof.yaw -= gamepad_pan_factor * value * (1.0f / 60.0f);
  370. }
  371. );
  372. ctx.controls["look_right_mouse"]->set_active_callback
  373. (
  374. [&ctx = this->ctx, three_dof_eid, mouse_pan_factor](float value)
  375. {
  376. if (!ctx.mouse_look)
  377. return;
  378. auto& three_dof = ctx.entity_registry->get<entity::component::constraint::three_dof>(three_dof_eid);
  379. three_dof.yaw -= mouse_pan_factor * value * (1.0f / 60.0f);
  380. }
  381. );
  382. // Tilt up
  383. ctx.controls["look_up_gamepad"]->set_active_callback
  384. (
  385. [&ctx = this->ctx, three_dof_eid, gamepad_tilt_factor](float value)
  386. {
  387. auto& three_dof = ctx.entity_registry->get<entity::component::constraint::three_dof>(three_dof_eid);
  388. three_dof.pitch -= gamepad_tilt_factor * value * (1.0f / 60.0f);
  389. three_dof.pitch = std::max<float>(math::radians(-90.0f), three_dof.pitch);
  390. }
  391. );
  392. ctx.controls["look_up_mouse"]->set_active_callback
  393. (
  394. [&ctx = this->ctx, three_dof_eid, mouse_tilt_factor](float value)
  395. {
  396. if (!ctx.mouse_look)
  397. return;
  398. auto& three_dof = ctx.entity_registry->get<entity::component::constraint::three_dof>(three_dof_eid);
  399. three_dof.pitch -= mouse_tilt_factor * value * (1.0f / 60.0f);
  400. three_dof.pitch = std::max<float>(math::radians(-90.0f), three_dof.pitch);
  401. }
  402. );
  403. // Tilt down
  404. ctx.controls["look_down_gamepad"]->set_active_callback
  405. (
  406. [&ctx = this->ctx, three_dof_eid, gamepad_tilt_factor](float value)
  407. {
  408. auto& three_dof = ctx.entity_registry->get<entity::component::constraint::three_dof>(three_dof_eid);
  409. three_dof.pitch += gamepad_tilt_factor * value * (1.0f / 60.0f);
  410. three_dof.pitch = std::min<float>(math::radians(90.0f), three_dof.pitch);
  411. }
  412. );
  413. ctx.controls["look_down_mouse"]->set_active_callback
  414. (
  415. [&ctx = this->ctx, three_dof_eid, mouse_tilt_factor](float value)
  416. {
  417. if (!ctx.mouse_look)
  418. return;
  419. auto& three_dof = ctx.entity_registry->get<entity::component::constraint::three_dof>(three_dof_eid);
  420. three_dof.pitch += mouse_tilt_factor * value * (1.0f / 60.0f);
  421. three_dof.pitch = std::min<float>(math::radians(90.0f), three_dof.pitch);
  422. }
  423. );
  424. /*
  425. // Use tool
  426. ctx.controls["use_tool"]->set_activated_callback
  427. (
  428. [&ctx]()
  429. {
  430. if (ctx.entities.count("active_tool"))
  431. {
  432. entity::id tool_eid = ctx.entities["active_tool"];
  433. const auto& tool = ctx.entity_registry->get<entity::component::tool>(tool_eid);
  434. if (tool.activated)
  435. tool.activated();
  436. }
  437. }
  438. );
  439. ctx.controls["use_tool"]->set_deactivated_callback
  440. (
  441. [&ctx]()
  442. {
  443. if (ctx.entities.count("active_tool"))
  444. {
  445. entity::id tool_eid = ctx.entities["active_tool"];
  446. const auto& tool = ctx.entity_registry->get<entity::component::tool>(tool_eid);
  447. if (tool.deactivated)
  448. tool.deactivated();
  449. }
  450. }
  451. );
  452. ctx.controls["use_tool"]->set_active_callback
  453. (
  454. [&ctx](float value)
  455. {
  456. if (ctx.entities.count("active_tool"))
  457. {
  458. entity::id tool_eid = ctx.entities["active_tool"];
  459. const auto& tool = ctx.entity_registry->get<entity::component::tool>(tool_eid);
  460. if (tool.active)
  461. tool.active();
  462. }
  463. }
  464. );
  465. */
  466. // Setup pause control
  467. ctx.controls["pause"]->set_activated_callback
  468. (
  469. [this, &ctx = this->ctx]()
  470. {
  471. // Disable controls
  472. this->disable_controls();
  473. // Set resume callback
  474. ctx.resume_callback = [this, &ctx]()
  475. {
  476. this->enable_controls();
  477. ctx.resume_callback = nullptr;
  478. };
  479. // Push pause menu state
  480. ctx.state_machine.emplace(new game::state::pause_menu(ctx));
  481. }
  482. );
  483. }
  484. void nuptial_flight::disable_controls()
  485. {
  486. ctx.controls["move_forward"]->set_active_callback(nullptr);
  487. ctx.controls["move_back"]->set_active_callback(nullptr);
  488. ctx.controls["move_right"]->set_active_callback(nullptr);
  489. ctx.controls["move_left"]->set_active_callback(nullptr);
  490. ctx.controls["move_up"]->set_active_callback(nullptr);
  491. ctx.controls["move_down"]->set_active_callback(nullptr);
  492. ctx.controls["mouse_look"]->set_activated_callback(nullptr);
  493. ctx.controls["mouse_look"]->set_deactivated_callback(nullptr);
  494. ctx.controls["look_left_gamepad"]->set_active_callback(nullptr);
  495. ctx.controls["look_left_mouse"]->set_active_callback(nullptr);
  496. ctx.controls["look_right_gamepad"]->set_active_callback(nullptr);
  497. ctx.controls["look_right_mouse"]->set_active_callback(nullptr);
  498. ctx.controls["look_up_gamepad"]->set_active_callback(nullptr);
  499. ctx.controls["look_up_mouse"]->set_active_callback(nullptr);
  500. ctx.controls["look_down_gamepad"]->set_active_callback(nullptr);
  501. ctx.controls["look_down_mouse"]->set_active_callback(nullptr);
  502. ctx.controls["pause"]->set_activated_callback(nullptr);
  503. }
  504. } // namespace state
  505. } // namespace game