navigation_server_2d_dummy.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /**************************************************************************/
  2. /* navigation_server_2d_dummy.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_SERVER_2D_DUMMY_H
  31. #define NAVIGATION_SERVER_2D_DUMMY_H
  32. #include "servers/navigation_server_2d.h"
  33. class NavigationServer2DDummy : public NavigationServer2D {
  34. GDCLASS(NavigationServer2DDummy, NavigationServer2D);
  35. public:
  36. TypedArray<RID> get_maps() const override { return TypedArray<RID>(); }
  37. RID map_create() override { return RID(); }
  38. void map_set_active(RID p_map, bool p_active) override {}
  39. bool map_is_active(RID p_map) const override { return false; }
  40. void map_set_cell_size(RID p_map, real_t p_cell_size) override {}
  41. real_t map_get_cell_size(RID p_map) const override { return 0; }
  42. void map_set_use_edge_connections(RID p_map, bool p_enabled) override {}
  43. bool map_get_use_edge_connections(RID p_map) const override { return false; }
  44. void map_set_edge_connection_margin(RID p_map, real_t p_connection_margin) override {}
  45. real_t map_get_edge_connection_margin(RID p_map) const override { return 0; }
  46. void map_set_link_connection_radius(RID p_map, real_t p_connection_radius) override {}
  47. real_t map_get_link_connection_radius(RID p_map) const override { return 0; }
  48. Vector<Vector2> map_get_path(RID p_map, Vector2 p_origin, Vector2 p_destination, bool p_optimize, uint32_t p_navigation_layers = 1) const override { return Vector<Vector2>(); }
  49. Vector2 map_get_closest_point(RID p_map, const Vector2 &p_point) const override { return Vector2(); }
  50. RID map_get_closest_point_owner(RID p_map, const Vector2 &p_point) const override { return RID(); }
  51. TypedArray<RID> map_get_links(RID p_map) const override { return TypedArray<RID>(); }
  52. TypedArray<RID> map_get_regions(RID p_map) const override { return TypedArray<RID>(); }
  53. TypedArray<RID> map_get_agents(RID p_map) const override { return TypedArray<RID>(); }
  54. TypedArray<RID> map_get_obstacles(RID p_map) const override { return TypedArray<RID>(); }
  55. void map_force_update(RID p_map) override {}
  56. Vector2 map_get_random_point(RID p_map, uint32_t p_naviation_layers, bool p_uniformly) const override { return Vector2(); };
  57. uint32_t map_get_iteration_id(RID p_map) const override { return 0; }
  58. RID region_create() override { return RID(); }
  59. void region_set_enabled(RID p_region, bool p_enabled) override {}
  60. bool region_get_enabled(RID p_region) const override { return false; }
  61. void region_set_use_edge_connections(RID p_region, bool p_enabled) override {}
  62. bool region_get_use_edge_connections(RID p_region) const override { return false; }
  63. void region_set_enter_cost(RID p_region, real_t p_enter_cost) override {}
  64. real_t region_get_enter_cost(RID p_region) const override { return 0; }
  65. void region_set_travel_cost(RID p_region, real_t p_travel_cost) override {}
  66. real_t region_get_travel_cost(RID p_region) const override { return 0; }
  67. void region_set_owner_id(RID p_region, ObjectID p_owner_id) override {}
  68. ObjectID region_get_owner_id(RID p_region) const override { return ObjectID(); }
  69. bool region_owns_point(RID p_region, const Vector2 &p_point) const override { return false; }
  70. void region_set_map(RID p_region, RID p_map) override {}
  71. RID region_get_map(RID p_region) const override { return RID(); }
  72. void region_set_navigation_layers(RID p_region, uint32_t p_navigation_layers) override {}
  73. uint32_t region_get_navigation_layers(RID p_region) const override { return 0; }
  74. void region_set_transform(RID p_region, Transform2D p_transform) override {}
  75. Transform2D region_get_transform(RID p_region) const override { return Transform2D(); }
  76. void region_set_navigation_polygon(RID p_region, Ref<NavigationPolygon> p_navigation_polygon) override {}
  77. int region_get_connections_count(RID p_region) const override { return 0; }
  78. Vector2 region_get_connection_pathway_start(RID p_region, int p_connection_id) const override { return Vector2(); }
  79. Vector2 region_get_connection_pathway_end(RID p_region, int p_connection_id) const override { return Vector2(); }
  80. Vector2 region_get_random_point(RID p_region, uint32_t p_navigation_layers, bool p_uniformly) const override { return Vector2(); };
  81. RID link_create() override { return RID(); }
  82. void link_set_map(RID p_link, RID p_map) override {}
  83. RID link_get_map(RID p_link) const override { return RID(); }
  84. void link_set_enabled(RID p_link, bool p_enabled) override {}
  85. bool link_get_enabled(RID p_link) const override { return false; }
  86. void link_set_bidirectional(RID p_link, bool p_bidirectional) override {}
  87. bool link_is_bidirectional(RID p_link) const override { return false; }
  88. void link_set_navigation_layers(RID p_link, uint32_t p_navigation_layers) override {}
  89. uint32_t link_get_navigation_layers(RID p_link) const override { return 0; }
  90. void link_set_start_position(RID p_link, Vector2 p_position) override {}
  91. Vector2 link_get_start_position(RID p_link) const override { return Vector2(); }
  92. void link_set_end_position(RID p_link, Vector2 p_position) override {}
  93. Vector2 link_get_end_position(RID p_link) const override { return Vector2(); }
  94. void link_set_enter_cost(RID p_link, real_t p_enter_cost) override {}
  95. real_t link_get_enter_cost(RID p_link) const override { return 0; }
  96. void link_set_travel_cost(RID p_link, real_t p_travel_cost) override {}
  97. real_t link_get_travel_cost(RID p_link) const override { return 0; }
  98. void link_set_owner_id(RID p_link, ObjectID p_owner_id) override {}
  99. ObjectID link_get_owner_id(RID p_link) const override { return ObjectID(); }
  100. RID agent_create() override { return RID(); }
  101. void agent_set_map(RID p_agent, RID p_map) override {}
  102. RID agent_get_map(RID p_agent) const override { return RID(); }
  103. void agent_set_paused(RID p_agent, bool p_paused) override {}
  104. bool agent_get_paused(RID p_agent) const override { return false; }
  105. void agent_set_avoidance_enabled(RID p_agent, bool p_enabled) override {}
  106. bool agent_get_avoidance_enabled(RID p_agent) const override { return false; }
  107. void agent_set_neighbor_distance(RID p_agent, real_t p_distance) override {}
  108. real_t agent_get_neighbor_distance(RID p_agent) const override { return 0; }
  109. void agent_set_max_neighbors(RID p_agent, int p_count) override {}
  110. int agent_get_max_neighbors(RID p_agent) const override { return 0; }
  111. void agent_set_time_horizon_agents(RID p_agent, real_t p_time_horizon) override {}
  112. real_t agent_get_time_horizon_agents(RID p_agent) const override { return 0; }
  113. void agent_set_time_horizon_obstacles(RID p_agent, real_t p_time_horizon) override {}
  114. real_t agent_get_time_horizon_obstacles(RID p_agent) const override { return 0; }
  115. void agent_set_radius(RID p_agent, real_t p_radius) override {}
  116. real_t agent_get_radius(RID p_agent) const override { return 0; }
  117. void agent_set_max_speed(RID p_agent, real_t p_max_speed) override {}
  118. real_t agent_get_max_speed(RID p_agent) const override { return 0; }
  119. void agent_set_velocity_forced(RID p_agent, Vector2 p_velocity) override {}
  120. void agent_set_velocity(RID p_agent, Vector2 p_velocity) override {}
  121. Vector2 agent_get_velocity(RID p_agent) const override { return Vector2(); }
  122. void agent_set_position(RID p_agent, Vector2 p_position) override {}
  123. Vector2 agent_get_position(RID p_agent) const override { return Vector2(); }
  124. bool agent_is_map_changed(RID p_agent) const override { return false; }
  125. void agent_set_avoidance_callback(RID p_agent, Callable p_callback) override {}
  126. bool agent_has_avoidance_callback(RID p_agent) const override { return false; }
  127. void agent_set_avoidance_layers(RID p_agent, uint32_t p_layers) override {}
  128. uint32_t agent_get_avoidance_layers(RID p_agent) const override { return 0; }
  129. void agent_set_avoidance_mask(RID p_agent, uint32_t p_mask) override {}
  130. uint32_t agent_get_avoidance_mask(RID p_agent) const override { return 0; }
  131. void agent_set_avoidance_priority(RID p_agent, real_t p_priority) override {}
  132. real_t agent_get_avoidance_priority(RID p_agent) const override { return 0; }
  133. RID obstacle_create() override { return RID(); }
  134. void obstacle_set_avoidance_enabled(RID p_obstacle, bool p_enabled) override {}
  135. bool obstacle_get_avoidance_enabled(RID p_obstacle) const override { return false; }
  136. void obstacle_set_map(RID p_obstacle, RID p_map) override {}
  137. RID obstacle_get_map(RID p_obstacle) const override { return RID(); }
  138. void obstacle_set_paused(RID p_obstacle, bool p_paused) override {}
  139. bool obstacle_get_paused(RID p_obstacle) const override { return false; }
  140. void obstacle_set_radius(RID p_obstacle, real_t p_radius) override {}
  141. real_t obstacle_get_radius(RID p_agent) const override { return 0; }
  142. void obstacle_set_velocity(RID p_obstacle, Vector2 p_velocity) override {}
  143. Vector2 obstacle_get_velocity(RID p_agent) const override { return Vector2(); }
  144. void obstacle_set_position(RID p_obstacle, Vector2 p_position) override {}
  145. Vector2 obstacle_get_position(RID p_agent) const override { return Vector2(); }
  146. void obstacle_set_vertices(RID p_obstacle, const Vector<Vector2> &p_vertices) override {}
  147. Vector<Vector2> obstacle_get_vertices(RID p_agent) const override { return Vector<Vector2>(); }
  148. void obstacle_set_avoidance_layers(RID p_obstacle, uint32_t p_layers) override {}
  149. uint32_t obstacle_get_avoidance_layers(RID p_agent) const override { return 0; }
  150. void query_path(const Ref<NavigationPathQueryParameters2D> &p_query_parameters, Ref<NavigationPathQueryResult2D> p_query_result) const override {}
  151. void init() override {}
  152. void sync() override {}
  153. void finish() override {}
  154. void free(RID p_object) override {}
  155. void parse_source_geometry_data(const Ref<NavigationPolygon> &p_navigation_mesh, const Ref<NavigationMeshSourceGeometryData2D> &p_source_geometry_data, Node *p_root_node, const Callable &p_callback = Callable()) override {}
  156. void bake_from_source_geometry_data(const Ref<NavigationPolygon> &p_navigation_mesh, const Ref<NavigationMeshSourceGeometryData2D> &p_source_geometry_data, const Callable &p_callback = Callable()) override {}
  157. void bake_from_source_geometry_data_async(const Ref<NavigationPolygon> &p_navigation_mesh, const Ref<NavigationMeshSourceGeometryData2D> &p_source_geometry_data, const Callable &p_callback = Callable()) override {}
  158. bool is_baking_navigation_polygon(Ref<NavigationPolygon> p_navigation_polygon) const override { return false; }
  159. RID source_geometry_parser_create() override { return RID(); }
  160. void source_geometry_parser_set_callback(RID p_parser, const Callable &p_callback) override {}
  161. Vector<Vector2> simplify_path(const Vector<Vector2> &p_path, real_t p_epsilon) override { return Vector<Vector2>(); }
  162. void set_debug_enabled(bool p_enabled) {}
  163. bool get_debug_enabled() const { return false; }
  164. };
  165. #endif // NAVIGATION_SERVER_2D_DUMMY_H