navigation_server_2d_dummy.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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_closest_point(RID p_region, const Vector2 &p_point) const override { return Vector2(); }
  81. Vector2 region_get_random_point(RID p_region, uint32_t p_navigation_layers, bool p_uniformly) const override { return Vector2(); }
  82. RID link_create() override { return RID(); }
  83. void link_set_map(RID p_link, RID p_map) override {}
  84. RID link_get_map(RID p_link) const override { return RID(); }
  85. void link_set_enabled(RID p_link, bool p_enabled) override {}
  86. bool link_get_enabled(RID p_link) const override { return false; }
  87. void link_set_bidirectional(RID p_link, bool p_bidirectional) override {}
  88. bool link_is_bidirectional(RID p_link) const override { return false; }
  89. void link_set_navigation_layers(RID p_link, uint32_t p_navigation_layers) override {}
  90. uint32_t link_get_navigation_layers(RID p_link) const override { return 0; }
  91. void link_set_start_position(RID p_link, Vector2 p_position) override {}
  92. Vector2 link_get_start_position(RID p_link) const override { return Vector2(); }
  93. void link_set_end_position(RID p_link, Vector2 p_position) override {}
  94. Vector2 link_get_end_position(RID p_link) const override { return Vector2(); }
  95. void link_set_enter_cost(RID p_link, real_t p_enter_cost) override {}
  96. real_t link_get_enter_cost(RID p_link) const override { return 0; }
  97. void link_set_travel_cost(RID p_link, real_t p_travel_cost) override {}
  98. real_t link_get_travel_cost(RID p_link) const override { return 0; }
  99. void link_set_owner_id(RID p_link, ObjectID p_owner_id) override {}
  100. ObjectID link_get_owner_id(RID p_link) const override { return ObjectID(); }
  101. RID agent_create() override { return RID(); }
  102. void agent_set_map(RID p_agent, RID p_map) override {}
  103. RID agent_get_map(RID p_agent) const override { return RID(); }
  104. void agent_set_paused(RID p_agent, bool p_paused) override {}
  105. bool agent_get_paused(RID p_agent) const override { return false; }
  106. void agent_set_avoidance_enabled(RID p_agent, bool p_enabled) override {}
  107. bool agent_get_avoidance_enabled(RID p_agent) const override { return false; }
  108. void agent_set_neighbor_distance(RID p_agent, real_t p_distance) override {}
  109. real_t agent_get_neighbor_distance(RID p_agent) const override { return 0; }
  110. void agent_set_max_neighbors(RID p_agent, int p_count) override {}
  111. int agent_get_max_neighbors(RID p_agent) const override { return 0; }
  112. void agent_set_time_horizon_agents(RID p_agent, real_t p_time_horizon) override {}
  113. real_t agent_get_time_horizon_agents(RID p_agent) const override { return 0; }
  114. void agent_set_time_horizon_obstacles(RID p_agent, real_t p_time_horizon) override {}
  115. real_t agent_get_time_horizon_obstacles(RID p_agent) const override { return 0; }
  116. void agent_set_radius(RID p_agent, real_t p_radius) override {}
  117. real_t agent_get_radius(RID p_agent) const override { return 0; }
  118. void agent_set_max_speed(RID p_agent, real_t p_max_speed) override {}
  119. real_t agent_get_max_speed(RID p_agent) const override { return 0; }
  120. void agent_set_velocity_forced(RID p_agent, Vector2 p_velocity) override {}
  121. void agent_set_velocity(RID p_agent, Vector2 p_velocity) override {}
  122. Vector2 agent_get_velocity(RID p_agent) const override { return Vector2(); }
  123. void agent_set_position(RID p_agent, Vector2 p_position) override {}
  124. Vector2 agent_get_position(RID p_agent) const override { return Vector2(); }
  125. bool agent_is_map_changed(RID p_agent) const override { return false; }
  126. void agent_set_avoidance_callback(RID p_agent, Callable p_callback) override {}
  127. bool agent_has_avoidance_callback(RID p_agent) const override { return false; }
  128. void agent_set_avoidance_layers(RID p_agent, uint32_t p_layers) override {}
  129. uint32_t agent_get_avoidance_layers(RID p_agent) const override { return 0; }
  130. void agent_set_avoidance_mask(RID p_agent, uint32_t p_mask) override {}
  131. uint32_t agent_get_avoidance_mask(RID p_agent) const override { return 0; }
  132. void agent_set_avoidance_priority(RID p_agent, real_t p_priority) override {}
  133. real_t agent_get_avoidance_priority(RID p_agent) const override { return 0; }
  134. RID obstacle_create() override { return RID(); }
  135. void obstacle_set_avoidance_enabled(RID p_obstacle, bool p_enabled) override {}
  136. bool obstacle_get_avoidance_enabled(RID p_obstacle) const override { return false; }
  137. void obstacle_set_map(RID p_obstacle, RID p_map) override {}
  138. RID obstacle_get_map(RID p_obstacle) const override { return RID(); }
  139. void obstacle_set_paused(RID p_obstacle, bool p_paused) override {}
  140. bool obstacle_get_paused(RID p_obstacle) const override { return false; }
  141. void obstacle_set_radius(RID p_obstacle, real_t p_radius) override {}
  142. real_t obstacle_get_radius(RID p_agent) const override { return 0; }
  143. void obstacle_set_velocity(RID p_obstacle, Vector2 p_velocity) override {}
  144. Vector2 obstacle_get_velocity(RID p_agent) const override { return Vector2(); }
  145. void obstacle_set_position(RID p_obstacle, Vector2 p_position) override {}
  146. Vector2 obstacle_get_position(RID p_agent) const override { return Vector2(); }
  147. void obstacle_set_vertices(RID p_obstacle, const Vector<Vector2> &p_vertices) override {}
  148. Vector<Vector2> obstacle_get_vertices(RID p_agent) const override { return Vector<Vector2>(); }
  149. void obstacle_set_avoidance_layers(RID p_obstacle, uint32_t p_layers) override {}
  150. uint32_t obstacle_get_avoidance_layers(RID p_agent) const override { return 0; }
  151. void query_path(const Ref<NavigationPathQueryParameters2D> &p_query_parameters, Ref<NavigationPathQueryResult2D> p_query_result) const override {}
  152. void init() override {}
  153. void sync() override {}
  154. void finish() override {}
  155. void free(RID p_object) override {}
  156. 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 {}
  157. 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 {}
  158. 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 {}
  159. bool is_baking_navigation_polygon(Ref<NavigationPolygon> p_navigation_polygon) const override { return false; }
  160. RID source_geometry_parser_create() override { return RID(); }
  161. void source_geometry_parser_set_callback(RID p_parser, const Callable &p_callback) override {}
  162. Vector<Vector2> simplify_path(const Vector<Vector2> &p_path, real_t p_epsilon) override { return Vector<Vector2>(); }
  163. void set_debug_enabled(bool p_enabled) {}
  164. bool get_debug_enabled() const { return false; }
  165. };
  166. #endif // NAVIGATION_SERVER_2D_DUMMY_H