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

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