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

68 lines
1.6 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. #ifndef ANTKEEPER_AI_STEERING_AGENT_HPP
  20. #define ANTKEEPER_AI_STEERING_AGENT_HPP
  21. #include "utility/fundamental-types.hpp"
  22. #include "math/quaternion-type.hpp"
  23. namespace ai {
  24. namespace steering {
  25. /**
  26. * Autonomous agent governed by steering behaviors.
  27. */
  28. struct agent
  29. {
  30. /// Mass of the agent.
  31. float mass;
  32. /// Cartesian position vector.
  33. float3 position;
  34. /// Velocity vector.
  35. float3 velocity;
  36. /// Acceleration vector.
  37. float3 acceleration;
  38. /// Maximum force.
  39. float max_force;
  40. /// Maximum speed.
  41. float max_speed;
  42. /// Maximum speed squared.
  43. float max_speed_squared;
  44. /// Orientation quaternion.
  45. math::quaternion<float> orientation;
  46. /// Orthonormal basis forward direction vector.
  47. float3 forward;
  48. /// Orthonormal basis up direction vector.
  49. float3 up;
  50. };
  51. } // namespace steering
  52. } // namespace ai
  53. #endif // ANTKEEPER_AI_STEERING_AGENT_HPP