tile_map_layer.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. /**************************************************************************/
  2. /* tile_map_layer.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 TILE_MAP_LAYER_H
  31. #define TILE_MAP_LAYER_H
  32. #include "scene/resources/2d/tile_set.h"
  33. class TileSetAtlasSource;
  34. class TileMap;
  35. enum TileMapLayerDataFormat {
  36. TILE_MAP_LAYER_DATA_FORMAT_0 = 0,
  37. TILE_MAP_LAYER_DATA_FORMAT_MAX,
  38. };
  39. class TerrainConstraint {
  40. private:
  41. Ref<TileSet> tile_set;
  42. Vector2i base_cell_coords;
  43. int bit = -1;
  44. int terrain = -1;
  45. int priority = 1;
  46. public:
  47. bool operator<(const TerrainConstraint &p_other) const {
  48. if (base_cell_coords == p_other.base_cell_coords) {
  49. return bit < p_other.bit;
  50. }
  51. return base_cell_coords < p_other.base_cell_coords;
  52. }
  53. String to_string() const {
  54. return vformat("Constraint {pos:%s, bit:%d, terrain:%d, priority:%d}", base_cell_coords, bit, terrain, priority);
  55. }
  56. Vector2i get_base_cell_coords() const {
  57. return base_cell_coords;
  58. }
  59. bool is_center_bit() const {
  60. return bit == 0;
  61. }
  62. HashMap<Vector2i, TileSet::CellNeighbor> get_overlapping_coords_and_peering_bits() const;
  63. void set_terrain(int p_terrain) {
  64. terrain = p_terrain;
  65. }
  66. int get_terrain() const {
  67. return terrain;
  68. }
  69. void set_priority(int p_priority) {
  70. priority = p_priority;
  71. }
  72. int get_priority() const {
  73. return priority;
  74. }
  75. TerrainConstraint(Ref<TileSet> p_tile_set, const Vector2i &p_position, int p_terrain); // For the center terrain bit
  76. TerrainConstraint(Ref<TileSet> p_tile_set, const Vector2i &p_position, const TileSet::CellNeighbor &p_bit, int p_terrain); // For peering bits
  77. TerrainConstraint() {}
  78. };
  79. #ifdef DEBUG_ENABLED
  80. class DebugQuadrant;
  81. #endif // DEBUG_ENABLED
  82. class RenderingQuadrant;
  83. struct CellData {
  84. Vector2i coords;
  85. TileMapCell cell;
  86. // Debug.
  87. SelfList<CellData> debug_quadrant_list_element;
  88. // Rendering.
  89. Ref<RenderingQuadrant> rendering_quadrant;
  90. SelfList<CellData> rendering_quadrant_list_element;
  91. LocalVector<LocalVector<RID>> occluders;
  92. // Physics.
  93. LocalVector<RID> bodies;
  94. // Navigation.
  95. LocalVector<RID> navigation_regions;
  96. // Scenes.
  97. String scene;
  98. // Runtime TileData cache.
  99. TileData *runtime_tile_data_cache = nullptr;
  100. // List elements.
  101. SelfList<CellData> dirty_list_element;
  102. bool operator<(const CellData &p_other) const {
  103. return coords < p_other.coords;
  104. }
  105. // For those, copy everything but SelfList elements.
  106. void operator=(const CellData &p_other) {
  107. coords = p_other.coords;
  108. cell = p_other.cell;
  109. occluders = p_other.occluders;
  110. bodies = p_other.bodies;
  111. navigation_regions = p_other.navigation_regions;
  112. scene = p_other.scene;
  113. runtime_tile_data_cache = p_other.runtime_tile_data_cache;
  114. }
  115. CellData(const CellData &p_other) :
  116. debug_quadrant_list_element(this),
  117. rendering_quadrant_list_element(this),
  118. dirty_list_element(this) {
  119. coords = p_other.coords;
  120. cell = p_other.cell;
  121. occluders = p_other.occluders;
  122. bodies = p_other.bodies;
  123. navigation_regions = p_other.navigation_regions;
  124. scene = p_other.scene;
  125. runtime_tile_data_cache = p_other.runtime_tile_data_cache;
  126. }
  127. CellData() :
  128. debug_quadrant_list_element(this),
  129. rendering_quadrant_list_element(this),
  130. dirty_list_element(this) {
  131. }
  132. };
  133. // We use another comparator for Y-sorted layers with reversed X drawing order.
  134. struct CellDataYSortedXReversedComparator {
  135. _FORCE_INLINE_ bool operator()(const CellData &p_a, const CellData &p_b) const {
  136. return p_a.coords.x == p_b.coords.x ? (p_a.coords.y < p_b.coords.y) : (p_a.coords.x > p_b.coords.x);
  137. }
  138. };
  139. #ifdef DEBUG_ENABLED
  140. class DebugQuadrant : public RefCounted {
  141. GDCLASS(DebugQuadrant, RefCounted);
  142. public:
  143. Vector2i quadrant_coords;
  144. SelfList<CellData>::List cells;
  145. RID canvas_item;
  146. SelfList<DebugQuadrant> dirty_quadrant_list_element;
  147. DebugQuadrant() :
  148. dirty_quadrant_list_element(this) {
  149. }
  150. ~DebugQuadrant() {
  151. cells.clear();
  152. }
  153. };
  154. #endif // DEBUG_ENABLED
  155. class RenderingQuadrant : public RefCounted {
  156. GDCLASS(RenderingQuadrant, RefCounted);
  157. public:
  158. struct CoordsWorldComparator {
  159. _ALWAYS_INLINE_ bool operator()(const Vector2 &p_a, const Vector2 &p_b) const {
  160. // We sort the cells by their local coords, as it is needed by rendering.
  161. if (p_a.y == p_b.y) {
  162. return p_a.x > p_b.x;
  163. } else {
  164. return p_a.y < p_b.y;
  165. }
  166. }
  167. };
  168. Vector2i quadrant_coords;
  169. SelfList<CellData>::List cells;
  170. List<RID> canvas_items;
  171. Vector2 canvas_items_position;
  172. SelfList<RenderingQuadrant> dirty_quadrant_list_element;
  173. RenderingQuadrant() :
  174. dirty_quadrant_list_element(this) {
  175. }
  176. ~RenderingQuadrant() {
  177. cells.clear();
  178. }
  179. };
  180. class TileMapLayer : public Node2D {
  181. GDCLASS(TileMapLayer, Node2D);
  182. public:
  183. enum HighlightMode {
  184. HIGHLIGHT_MODE_DEFAULT,
  185. HIGHLIGHT_MODE_ABOVE,
  186. HIGHLIGHT_MODE_BELOW,
  187. };
  188. enum DebugVisibilityMode {
  189. DEBUG_VISIBILITY_MODE_DEFAULT,
  190. DEBUG_VISIBILITY_MODE_FORCE_SHOW,
  191. DEBUG_VISIBILITY_MODE_FORCE_HIDE,
  192. };
  193. enum DirtyFlags {
  194. DIRTY_FLAGS_LAYER_ENABLED = 0,
  195. DIRTY_FLAGS_LAYER_IN_TREE,
  196. DIRTY_FLAGS_LAYER_IN_CANVAS,
  197. DIRTY_FLAGS_LAYER_LOCAL_TRANSFORM,
  198. DIRTY_FLAGS_LAYER_VISIBILITY,
  199. DIRTY_FLAGS_LAYER_SELF_MODULATE,
  200. DIRTY_FLAGS_LAYER_Y_SORT_ENABLED,
  201. DIRTY_FLAGS_LAYER_Y_SORT_ORIGIN,
  202. DIRTY_FLAGS_LAYER_X_DRAW_ORDER_REVERSED,
  203. DIRTY_FLAGS_LAYER_Z_INDEX,
  204. DIRTY_FLAGS_LAYER_LIGHT_MASK,
  205. DIRTY_FLAGS_LAYER_TEXTURE_FILTER,
  206. DIRTY_FLAGS_LAYER_TEXTURE_REPEAT,
  207. DIRTY_FLAGS_LAYER_RENDERING_QUADRANT_SIZE,
  208. DIRTY_FLAGS_LAYER_COLLISION_ENABLED,
  209. DIRTY_FLAGS_LAYER_USE_KINEMATIC_BODIES,
  210. DIRTY_FLAGS_LAYER_COLLISION_VISIBILITY_MODE,
  211. DIRTY_FLAGS_LAYER_OCCLUSION_ENABLED,
  212. DIRTY_FLAGS_LAYER_NAVIGATION_ENABLED,
  213. DIRTY_FLAGS_LAYER_NAVIGATION_MAP,
  214. DIRTY_FLAGS_LAYER_NAVIGATION_VISIBILITY_MODE,
  215. DIRTY_FLAGS_LAYER_RUNTIME_UPDATE,
  216. DIRTY_FLAGS_LAYER_INDEX_IN_TILE_MAP_NODE, // For compatibility.
  217. DIRTY_FLAGS_LAYER_GROUP_SELECTED_LAYERS,
  218. DIRTY_FLAGS_LAYER_GROUP_HIGHLIGHT_SELECTED,
  219. DIRTY_FLAGS_TILE_SET,
  220. DIRTY_FLAGS_MAX,
  221. };
  222. private:
  223. static constexpr float FP_ADJUST = 0.00001;
  224. // Properties.
  225. HashMap<Vector2i, CellData> tile_map_layer_data;
  226. bool enabled = true;
  227. Ref<TileSet> tile_set;
  228. HighlightMode highlight_mode = HIGHLIGHT_MODE_DEFAULT;
  229. int y_sort_origin = 0;
  230. bool x_draw_order_reversed = false;
  231. int rendering_quadrant_size = 16;
  232. bool collision_enabled = true;
  233. bool use_kinematic_bodies = false;
  234. DebugVisibilityMode collision_visibility_mode = DEBUG_VISIBILITY_MODE_DEFAULT;
  235. bool occlusion_enabled = true;
  236. bool navigation_enabled = true;
  237. RID navigation_map_override;
  238. DebugVisibilityMode navigation_visibility_mode = DEBUG_VISIBILITY_MODE_DEFAULT;
  239. // Internal.
  240. bool pending_update = false;
  241. // For keeping compatibility with TileMap.
  242. TileMap *tile_map_node = nullptr;
  243. int layer_index_in_tile_map_node = -1;
  244. // Dirty flag. Allows knowing what was modified since the last update.
  245. struct {
  246. bool flags[DIRTY_FLAGS_MAX] = { false };
  247. SelfList<CellData>::List cell_list;
  248. } dirty;
  249. // Rect cache.
  250. mutable Rect2 rect_cache;
  251. mutable bool rect_cache_dirty = true;
  252. mutable Rect2i used_rect_cache;
  253. mutable bool used_rect_cache_dirty = true;
  254. // Runtime tile data.
  255. bool _runtime_update_tile_data_was_cleaned_up = false;
  256. void _build_runtime_update_tile_data(bool p_force_cleanup);
  257. void _build_runtime_update_tile_data_for_cell(CellData &r_cell_data, bool p_use_tilemap_for_runtime, bool p_auto_add_to_dirty_list = false);
  258. bool _runtime_update_needs_all_cells_cleaned_up = false;
  259. void _clear_runtime_update_tile_data();
  260. void _clear_runtime_update_tile_data_for_cell(CellData &r_cell_data);
  261. void _update_cells_callback(bool p_force_cleanup);
  262. // Per-system methods.
  263. #ifdef DEBUG_ENABLED
  264. HashMap<Vector2i, Ref<DebugQuadrant>> debug_quadrant_map;
  265. Vector2i _coords_to_debug_quadrant_coords(const Vector2i &p_coords) const;
  266. bool _debug_was_cleaned_up = false;
  267. void _debug_update(bool p_force_cleanup);
  268. void _debug_quadrants_update_cell(CellData &r_cell_data, SelfList<DebugQuadrant>::List &r_dirty_debug_quadrant_list);
  269. #endif // DEBUG_ENABLED
  270. HashMap<Vector2i, Ref<RenderingQuadrant>> rendering_quadrant_map;
  271. bool _rendering_was_cleaned_up = false;
  272. void _rendering_update(bool p_force_cleanup);
  273. void _rendering_notification(int p_what);
  274. void _rendering_quadrants_update_cell(CellData &r_cell_data, SelfList<RenderingQuadrant>::List &r_dirty_rendering_quadrant_list);
  275. void _rendering_occluders_clear_cell(CellData &r_cell_data);
  276. void _rendering_occluders_update_cell(CellData &r_cell_data);
  277. #ifdef DEBUG_ENABLED
  278. void _rendering_draw_cell_debug(const RID &p_canvas_item, const Vector2 &p_quadrant_pos, const CellData &r_cell_data);
  279. #endif // DEBUG_ENABLED
  280. HashMap<RID, Vector2i> bodies_coords; // Mapping for RID to coords.
  281. bool _physics_was_cleaned_up = false;
  282. void _physics_update(bool p_force_cleanup);
  283. void _physics_notification(int p_what);
  284. void _physics_clear_cell(CellData &r_cell_data);
  285. void _physics_update_cell(CellData &r_cell_data);
  286. #ifdef DEBUG_ENABLED
  287. void _physics_draw_cell_debug(const RID &p_canvas_item, const Vector2 &p_quadrant_pos, const CellData &r_cell_data);
  288. #endif // DEBUG_ENABLED
  289. bool _navigation_was_cleaned_up = false;
  290. void _navigation_update(bool p_force_cleanup);
  291. void _navigation_notification(int p_what);
  292. void _navigation_clear_cell(CellData &r_cell_data);
  293. void _navigation_update_cell(CellData &r_cell_data);
  294. #ifdef DEBUG_ENABLED
  295. void _navigation_draw_cell_debug(const RID &p_canvas_item, const Vector2 &p_quadrant_pos, const CellData &r_cell_data);
  296. #endif // DEBUG_ENABLED
  297. bool _scenes_was_cleaned_up = false;
  298. void _scenes_update(bool p_force_cleanup);
  299. void _scenes_clear_cell(CellData &r_cell_data);
  300. void _scenes_update_cell(CellData &r_cell_data);
  301. #ifdef DEBUG_ENABLED
  302. void _scenes_draw_cell_debug(const RID &p_canvas_item, const Vector2 &p_quadrant_pos, const CellData &r_cell_data);
  303. #endif // DEBUG_ENABLED
  304. // Terrains.
  305. TileSet::TerrainsPattern _get_best_terrain_pattern_for_constraints(int p_terrain_set, const Vector2i &p_position, const RBSet<TerrainConstraint> &p_constraints, TileSet::TerrainsPattern p_current_pattern) const;
  306. RBSet<TerrainConstraint> _get_terrain_constraints_from_added_pattern(const Vector2i &p_position, int p_terrain_set, TileSet::TerrainsPattern p_terrains_pattern) const;
  307. RBSet<TerrainConstraint> _get_terrain_constraints_from_painted_cells_list(const RBSet<Vector2i> &p_painted, int p_terrain_set, bool p_ignore_empty_terrains) const;
  308. void _tile_set_changed();
  309. void _renamed();
  310. void _update_notify_local_transform();
  311. // Internal updates.
  312. void _queue_internal_update();
  313. void _deferred_internal_update();
  314. void _internal_update(bool p_force_cleanup);
  315. virtual void _physics_interpolated_changed() override;
  316. protected:
  317. void _notification(int p_what);
  318. static void _bind_methods();
  319. void _validate_property(PropertyInfo &p_property) const;
  320. virtual void _update_self_texture_filter(RS::CanvasItemTextureFilter p_texture_filter) override;
  321. virtual void _update_self_texture_repeat(RS::CanvasItemTextureRepeat p_texture_repeat) override;
  322. public:
  323. #ifdef TOOLS_ENABLED
  324. virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const override;
  325. #endif
  326. // TileMap node.
  327. void set_as_tile_map_internal_node(int p_index);
  328. int get_index_in_tile_map() const {
  329. return layer_index_in_tile_map_node;
  330. }
  331. const HashMap<Vector2i, CellData> &get_tile_map_layer_data() const {
  332. return tile_map_layer_data;
  333. }
  334. // Rect caching.
  335. Rect2 get_rect(bool &r_changed) const;
  336. // Terrains.
  337. HashMap<Vector2i, TileSet::TerrainsPattern> terrain_fill_constraints(const Vector<Vector2i> &p_to_replace, int p_terrain_set, const RBSet<TerrainConstraint> &p_constraints) const; // Not exposed.
  338. HashMap<Vector2i, TileSet::TerrainsPattern> terrain_fill_connect(const Vector<Vector2i> &p_coords_array, int p_terrain_set, int p_terrain, bool p_ignore_empty_terrains = true) const; // Not exposed.
  339. HashMap<Vector2i, TileSet::TerrainsPattern> terrain_fill_path(const Vector<Vector2i> &p_coords_array, int p_terrain_set, int p_terrain, bool p_ignore_empty_terrains = true) const; // Not exposed.
  340. HashMap<Vector2i, TileSet::TerrainsPattern> terrain_fill_pattern(const Vector<Vector2i> &p_coords_array, int p_terrain_set, TileSet::TerrainsPattern p_terrains_pattern, bool p_ignore_empty_terrains = true) const; // Not exposed.
  341. // Not exposed to users.
  342. TileMapCell get_cell(const Vector2i &p_coords) const;
  343. static void draw_tile(RID p_canvas_item, const Vector2 &p_position, const Ref<TileSet> p_tile_set, int p_atlas_source_id, const Vector2i &p_atlas_coords, int p_alternative_tile, int p_frame = -1, Color p_modulation = Color(1.0, 1.0, 1.0, 1.0), const TileData *p_tile_data_override = nullptr, real_t p_normalized_animation_offset = 0.0);
  344. ////////////// Exposed functions //////////////
  345. // --- Cells manipulation ---
  346. // Generic cells manipulations and data access.
  347. void set_cell(const Vector2i &p_coords, int p_source_id = TileSet::INVALID_SOURCE, const Vector2i &p_atlas_coords = TileSetSource::INVALID_ATLAS_COORDS, int p_alternative_tile = 0);
  348. void erase_cell(const Vector2i &p_coords);
  349. void fix_invalid_tiles();
  350. void clear();
  351. int get_cell_source_id(const Vector2i &p_coords) const;
  352. Vector2i get_cell_atlas_coords(const Vector2i &p_coords) const;
  353. int get_cell_alternative_tile(const Vector2i &p_coords) const;
  354. TileData *get_cell_tile_data(const Vector2i &p_coords) const; // Helper method to make accessing the data easier.
  355. TypedArray<Vector2i> get_used_cells() const;
  356. TypedArray<Vector2i> get_used_cells_by_id(int p_source_id = TileSet::INVALID_SOURCE, const Vector2i &p_atlas_coords = TileSetSource::INVALID_ATLAS_COORDS, int p_alternative_tile = TileSetSource::INVALID_TILE_ALTERNATIVE) const;
  357. Rect2i get_used_rect() const;
  358. bool is_cell_flipped_h(const Vector2i &p_coords) const;
  359. bool is_cell_flipped_v(const Vector2i &p_coords) const;
  360. bool is_cell_transposed(const Vector2i &p_coords) const;
  361. // Patterns.
  362. Ref<TileMapPattern> get_pattern(TypedArray<Vector2i> p_coords_array);
  363. void set_pattern(const Vector2i &p_position, const Ref<TileMapPattern> p_pattern);
  364. // Terrains.
  365. void set_cells_terrain_connect(TypedArray<Vector2i> p_cells, int p_terrain_set, int p_terrain, bool p_ignore_empty_terrains = true);
  366. void set_cells_terrain_path(TypedArray<Vector2i> p_path, int p_terrain_set, int p_terrain, bool p_ignore_empty_terrains = true);
  367. // --- Physics helpers ---
  368. bool has_body_rid(RID p_physics_body) const;
  369. Vector2i get_coords_for_body_rid(RID p_physics_body) const; // For finding tiles from collision.
  370. // --- Runtime ---
  371. void update_internals();
  372. void notify_runtime_tile_data_update();
  373. GDVIRTUAL1R(bool, _use_tile_data_runtime_update, Vector2i);
  374. GDVIRTUAL2(_tile_data_runtime_update, Vector2i, TileData *);
  375. GDVIRTUAL2(_update_cells, TypedArray<Vector2i>, bool);
  376. // --- Shortcuts to methods defined in TileSet ---
  377. Vector2i map_pattern(const Vector2i &p_position_in_tilemap, const Vector2i &p_coords_in_pattern, Ref<TileMapPattern> p_pattern);
  378. TypedArray<Vector2i> get_surrounding_cells(const Vector2i &p_coords);
  379. Vector2i get_neighbor_cell(const Vector2i &p_coords, TileSet::CellNeighbor p_cell_neighbor) const;
  380. Vector2 map_to_local(const Vector2i &p_pos) const;
  381. Vector2i local_to_map(const Vector2 &p_pos) const;
  382. // --- Accessors ---
  383. void set_tile_map_data_from_array(const Vector<uint8_t> &p_data);
  384. Vector<uint8_t> get_tile_map_data_as_array() const;
  385. void set_enabled(bool p_enabled);
  386. bool is_enabled() const;
  387. void set_tile_set(const Ref<TileSet> &p_tile_set);
  388. Ref<TileSet> get_tile_set() const;
  389. void set_highlight_mode(HighlightMode p_highlight_mode);
  390. HighlightMode get_highlight_mode() const;
  391. virtual void set_self_modulate(const Color &p_self_modulate) override;
  392. virtual void set_y_sort_enabled(bool p_y_sort_enabled) override;
  393. void set_y_sort_origin(int p_y_sort_origin);
  394. int get_y_sort_origin() const;
  395. void set_x_draw_order_reversed(bool p_x_draw_order_reversed);
  396. bool is_x_draw_order_reversed() const;
  397. virtual void set_z_index(int p_z_index) override;
  398. virtual void set_light_mask(int p_light_mask) override;
  399. void set_rendering_quadrant_size(int p_size);
  400. int get_rendering_quadrant_size() const;
  401. void set_collision_enabled(bool p_enabled);
  402. bool is_collision_enabled() const;
  403. void set_use_kinematic_bodies(bool p_use_kinematic_bodies);
  404. bool is_using_kinematic_bodies() const;
  405. void set_collision_visibility_mode(DebugVisibilityMode p_show_collision);
  406. DebugVisibilityMode get_collision_visibility_mode() const;
  407. void set_occlusion_enabled(bool p_enabled);
  408. bool is_occlusion_enabled() const;
  409. void set_navigation_enabled(bool p_enabled);
  410. bool is_navigation_enabled() const;
  411. void set_navigation_map(RID p_map);
  412. RID get_navigation_map() const;
  413. void set_navigation_visibility_mode(DebugVisibilityMode p_show_navigation);
  414. DebugVisibilityMode get_navigation_visibility_mode() const;
  415. TileMapLayer();
  416. ~TileMapLayer();
  417. };
  418. VARIANT_ENUM_CAST(TileMapLayer::DebugVisibilityMode);
  419. #endif // TILE_MAP_LAYER_H