32 #include "scene/2d/node_2d.h" 33 #include "scene/2d/navigation2d.h" 34 #include "scene/resources/tile_set.h" 35 #include "self_list.h" 66 bool center_x,center_y;
69 HalfOffset half_offset;
83 bool operator<(
const PosKey& p_k)
const {
return (y==p_k.y) ? x < p_k.x : y < p_k.y; }
85 PosKey(int16_t p_x, int16_t p_y) { x=p_x; y=p_y; }
86 PosKey() { x=0; y=0; }
130 void operator=(
const Quadrant& q) { pos=q.pos; canvas_items=q.canvas_items; body=q.body; cells=q.cells; navpoly_ids=q.navpoly_ids; occluder_instances=q.occluder_instances; }
131 Quadrant(
const Quadrant& q) : dirty_list(
this) { pos=q.pos; canvas_items=q.canvas_items; body=q.body; cells=q.cells; occluder_instances=q.occluder_instances; navpoly_ids=q.navpoly_ids;}
132 Quadrant() : dirty_list(
this) {}
142 bool rect_cache_dirty;
143 bool quadrant_order_dirty;
148 uint32_t collision_layer;
149 uint32_t collision_mask;
151 TileOrigin tile_origin;
153 int occluder_light_mask;
155 void _fix_cell_transform(
Matrix32& xform,
const Cell& p_cell,
const Vector2 &p_offset,
const Size2 &p_sc);
160 void _recreate_quadrants();
161 void _clear_quadrants();
162 void _update_dirty_quadrants();
163 void _update_quadrant_space(
const RID& p_space);
164 void _update_quadrant_transform();
165 void _recompute_rect_cache();
167 _FORCE_INLINE_
int _get_quadrant_size()
const;
173 void _set_old_cell_size(
int p_size) { set_cell_size(
Size2(p_size,p_size)); }
174 int _get_old_cell_size()
const {
return cell_size.x; }
176 _FORCE_INLINE_
Vector2 _map_to_world(
int p_x,
int p_y,
bool p_ignore_ofs=
false)
const;
178 Array get_used_cells()
const;
183 void _notification(
int p_what);
184 static void _bind_methods();
196 void set_cell_size(
Size2 p_size);
197 Size2 get_cell_size()
const;
199 void set_quadrant_size(
int p_size);
200 int get_quadrant_size()
const;
202 void set_center_x(
bool p_enable);
203 bool get_center_x()
const;
204 void set_center_y(
bool p_enable);
205 bool get_center_y()
const;
207 void set_cell(
int p_x,
int p_y,
int p_tile,
bool p_flip_x=
false,
bool p_flip_y=
false,
bool p_transpose=
false);
208 int get_cell(
int p_x,
int p_y)
const;
209 bool is_cell_x_flipped(
int p_x,
int p_y)
const;
210 bool is_cell_y_flipped(
int p_x,
int p_y)
const;
211 bool is_cell_transposed(
int p_x,
int p_y)
const;
213 void set_cellv(
const Vector2& p_pos,
int p_tile,
bool p_flip_x=
false,
bool p_flip_y=
false,
bool p_transpose=
false);
214 int get_cellv(
const Vector2& p_pos)
const;
216 Rect2 get_item_rect()
const;
218 void set_collision_layer(uint32_t p_layer);
219 uint32_t get_collision_layer()
const;
221 void set_collision_mask(uint32_t p_mask);
222 uint32_t get_collision_mask()
const;
224 void set_collision_use_kinematic(
bool p_use_kinematic);
225 bool get_collision_use_kinematic()
const;
227 void set_collision_friction(
float p_friction);
228 float get_collision_friction()
const;
230 void set_collision_bounce(
float p_bounce);
231 float get_collision_bounce()
const;
233 void set_mode(Mode p_mode);
234 Mode get_mode()
const;
236 void set_half_offset(HalfOffset p_half_offset);
237 HalfOffset get_half_offset()
const;
239 void set_tile_origin(TileOrigin p_tile_origin);
240 TileOrigin get_tile_origin()
const;
242 void set_custom_transform(
const Matrix32& p_xform);
243 Matrix32 get_custom_transform()
const;
245 Matrix32 get_cell_transform()
const;
246 Vector2 get_cell_draw_offset()
const;
248 Vector2 map_to_world(
const Vector2& p_pos,
bool p_ignore_ofs=
false)
const;
251 void set_y_sort_mode(
bool p_enable);
252 bool is_y_sort_mode_enabled()
const;
254 void set_occluder_light_mask(
int p_mask);
255 int get_occluder_light_mask()
const;
257 virtual void set_light_mask(
int p_light_mask);
265 VARIANT_ENUM_CAST(TileMap::Mode);
266 VARIANT_ENUM_CAST(TileMap::HalfOffset);
267 VARIANT_ENUM_CAST(TileMap::TileOrigin);
Definition: tween_interpolaters.cpp:313
Definition: math_2d.h:369
Definition: math_2d.h:204
Definition: navigation2d.h:7
Definition: tile_map.h:119
Definition: tile_map.h:114
Definition: math_2d.h:554
Definition: tile_map.h:38