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

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