32 #include "scene/2d/collision_object_2d.h" 41 SPACE_OVERRIDE_DISABLED,
42 SPACE_OVERRIDE_COMBINE,
43 SPACE_OVERRIDE_COMBINE_REPLACE,
44 SPACE_OVERRIDE_REPLACE,
45 SPACE_OVERRIDE_REPLACE_COMBINE
50 SpaceOverride space_override;
53 bool gravity_is_point;
54 real_t gravity_distance_scale;
57 uint32_t collision_mask;
64 void _body_inout(
int p_status,
const RID& p_body,
int p_instance,
int p_body_shape,
int p_area_shape);
66 void _body_enter_tree(ObjectID p_id);
67 void _body_exit_tree(ObjectID p_id);
73 bool operator<(
const ShapePair& p_sp)
const {
74 if (body_shape==p_sp.body_shape)
75 return area_shape < p_sp.area_shape;
77 return body_shape < p_sp.body_shape;
81 ShapePair(
int p_bs,
int p_as) { body_shape=p_bs; area_shape=p_as; }
95 void _area_inout(
int p_status,
const RID& p_area,
int p_instance,
int p_area_shape,
int p_self_shape);
97 void _area_enter_tree(ObjectID p_id);
98 void _area_exit_tree(ObjectID p_id);
100 struct AreaShapePair {
104 bool operator<(
const AreaShapePair& p_sp)
const {
105 if (area_shape==p_sp.area_shape)
106 return self_shape < p_sp.self_shape;
108 return area_shape < p_sp.area_shape;
112 AreaShapePair(
int p_bs,
int p_as) { area_shape=p_bs; self_shape=p_as; }
123 void _clear_monitoring();
128 void _notification(
int p_what);
129 static void _bind_methods();
132 void set_space_override_mode(SpaceOverride p_mode);
133 SpaceOverride get_space_override_mode()
const;
135 void set_gravity_is_point(
bool p_enabled);
136 bool is_gravity_a_point()
const;
138 void set_gravity_distance_scale(real_t p_scale);
139 real_t get_gravity_distance_scale()
const;
141 void set_gravity_vector(
const Vector2& p_vec);
142 Vector2 get_gravity_vector()
const;
144 void set_gravity(real_t p_gravity);
145 real_t get_gravity()
const;
147 void set_linear_damp(real_t p_linear_damp);
148 real_t get_linear_damp()
const;
150 void set_angular_damp(real_t p_angular_damp);
151 real_t get_angular_damp()
const;
153 void set_priority(real_t p_priority);
154 real_t get_priority()
const;
156 void set_enable_monitoring(
bool p_enable);
157 bool is_monitoring_enabled()
const;
159 void set_monitorable(
bool p_enable);
160 bool is_monitorable()
const;
162 void set_collision_mask(uint32_t p_mask);
163 uint32_t get_collision_mask()
const;
165 void set_layer_mask(uint32_t p_mask);
166 uint32_t get_layer_mask()
const;
168 void set_collision_mask_bit(
int p_bit,
bool p_value);
169 bool get_collision_mask_bit(
int p_bit)
const;
171 void set_layer_mask_bit(
int p_bit,
bool p_value);
172 bool get_layer_mask_bit(
int p_bit)
const;
174 Array get_overlapping_bodies()
const;
175 Array get_overlapping_areas()
const;
177 bool overlaps_area(
Node* p_area)
const;
178 bool overlaps_body(
Node* p_body)
const;
184 VARIANT_ENUM_CAST(Area2D::SpaceOverride);
Definition: collision_object_2d.h:35