navigation_path_query_parameters_3d.h 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /**************************************************************************/
  2. /* navigation_path_query_parameters_3d.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #ifndef NAVIGATION_PATH_QUERY_PARAMETERS_3D_H
  31. #define NAVIGATION_PATH_QUERY_PARAMETERS_3D_H
  32. #include "core/object/ref_counted.h"
  33. #include "servers/navigation/navigation_utilities.h"
  34. class NavigationPathQueryParameters3D : public RefCounted {
  35. GDCLASS(NavigationPathQueryParameters3D, RefCounted);
  36. NavigationUtilities::PathQueryParameters parameters;
  37. protected:
  38. static void _bind_methods();
  39. public:
  40. enum PathfindingAlgorithm {
  41. PATHFINDING_ALGORITHM_ASTAR = 0,
  42. };
  43. enum PathPostProcessing {
  44. PATH_POSTPROCESSING_CORRIDORFUNNEL = 0,
  45. PATH_POSTPROCESSING_EDGECENTERED,
  46. };
  47. enum PathMetadataFlags {
  48. PATH_METADATA_INCLUDE_NONE = NavigationUtilities::PathMetadataFlags::PATH_INCLUDE_NONE,
  49. PATH_METADATA_INCLUDE_TYPES = NavigationUtilities::PathMetadataFlags::PATH_INCLUDE_TYPES,
  50. PATH_METADATA_INCLUDE_RIDS = NavigationUtilities::PathMetadataFlags::PATH_INCLUDE_RIDS,
  51. PATH_METADATA_INCLUDE_OWNERS = NavigationUtilities::PathMetadataFlags::PATH_INCLUDE_OWNERS,
  52. PATH_METADATA_INCLUDE_ALL = NavigationUtilities::PathMetadataFlags::PATH_INCLUDE_ALL
  53. };
  54. const NavigationUtilities::PathQueryParameters &get_parameters() const { return parameters; }
  55. void set_pathfinding_algorithm(const PathfindingAlgorithm p_pathfinding_algorithm);
  56. PathfindingAlgorithm get_pathfinding_algorithm() const;
  57. void set_path_postprocessing(const PathPostProcessing p_path_postprocessing);
  58. PathPostProcessing get_path_postprocessing() const;
  59. void set_map(const RID &p_map);
  60. const RID &get_map() const;
  61. void set_start_position(const Vector3 &p_start_position);
  62. const Vector3 &get_start_position() const;
  63. void set_target_position(const Vector3 &p_target_position);
  64. const Vector3 &get_target_position() const;
  65. void set_navigation_layers(uint32_t p_navigation_layers);
  66. uint32_t get_navigation_layers() const;
  67. void set_metadata_flags(BitField<NavigationPathQueryParameters3D::PathMetadataFlags> p_flags);
  68. BitField<NavigationPathQueryParameters3D::PathMetadataFlags> get_metadata_flags() const;
  69. void set_simplify_path(bool p_enabled);
  70. bool get_simplify_path() const;
  71. void set_simplify_epsilon(real_t p_epsilon);
  72. real_t get_simplify_epsilon() const;
  73. };
  74. VARIANT_ENUM_CAST(NavigationPathQueryParameters3D::PathfindingAlgorithm);
  75. VARIANT_ENUM_CAST(NavigationPathQueryParameters3D::PathPostProcessing);
  76. VARIANT_BITFIELD_CAST(NavigationPathQueryParameters3D::PathMetadataFlags);
  77. #endif // NAVIGATION_PATH_QUERY_PARAMETERS_3D_H