|
@@ -111,7 +111,7 @@ void Area2D::_body_enter_tree(ObjectID p_id) {
|
|
E->get().in_tree = true;
|
|
E->get().in_tree = true;
|
|
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
|
|
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
|
|
for (int i = 0; i < E->get().shapes.size(); i++) {
|
|
for (int i = 0; i < E->get().shapes.size(); i++) {
|
|
- emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_id, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape);
|
|
|
|
|
|
+ emit_signal(SceneStringNames::get_singleton()->body_shape_entered, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -125,7 +125,7 @@ void Area2D::_body_exit_tree(ObjectID p_id) {
|
|
E->get().in_tree = false;
|
|
E->get().in_tree = false;
|
|
emit_signal(SceneStringNames::get_singleton()->body_exited, node);
|
|
emit_signal(SceneStringNames::get_singleton()->body_exited, node);
|
|
for (int i = 0; i < E->get().shapes.size(); i++) {
|
|
for (int i = 0; i < E->get().shapes.size(); i++) {
|
|
- emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_id, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape);
|
|
|
|
|
|
+ emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -147,6 +147,7 @@ void Area2D::_body_inout(int p_status, const RID &p_body, int p_instance, int p_
|
|
if (body_in) {
|
|
if (body_in) {
|
|
if (!E) {
|
|
if (!E) {
|
|
E = body_map.insert(objid, BodyState());
|
|
E = body_map.insert(objid, BodyState());
|
|
|
|
+ E->get().rid = p_body;
|
|
E->get().rc = 0;
|
|
E->get().rc = 0;
|
|
E->get().in_tree = node && node->is_inside_tree();
|
|
E->get().in_tree = node && node->is_inside_tree();
|
|
if (node) {
|
|
if (node) {
|
|
@@ -163,7 +164,7 @@ void Area2D::_body_inout(int p_status, const RID &p_body, int p_instance, int p_
|
|
}
|
|
}
|
|
|
|
|
|
if (!node || E->get().in_tree) {
|
|
if (!node || E->get().in_tree) {
|
|
- emit_signal(SceneStringNames::get_singleton()->body_shape_entered, objid, node, p_body_shape, p_area_shape);
|
|
|
|
|
|
+ emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, node, p_body_shape, p_area_shape);
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
@@ -185,7 +186,7 @@ void Area2D::_body_inout(int p_status, const RID &p_body, int p_instance, int p_
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!node || in_tree) {
|
|
if (!node || in_tree) {
|
|
- emit_signal(SceneStringNames::get_singleton()->body_shape_exited, objid, obj, p_body_shape, p_area_shape);
|
|
|
|
|
|
+ emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_body, obj, p_body_shape, p_area_shape);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -204,7 +205,7 @@ void Area2D::_area_enter_tree(ObjectID p_id) {
|
|
E->get().in_tree = true;
|
|
E->get().in_tree = true;
|
|
emit_signal(SceneStringNames::get_singleton()->area_entered, node);
|
|
emit_signal(SceneStringNames::get_singleton()->area_entered, node);
|
|
for (int i = 0; i < E->get().shapes.size(); i++) {
|
|
for (int i = 0; i < E->get().shapes.size(); i++) {
|
|
- emit_signal(SceneStringNames::get_singleton()->area_shape_entered, p_id, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape);
|
|
|
|
|
|
+ emit_signal(SceneStringNames::get_singleton()->area_shape_entered, E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -218,7 +219,7 @@ void Area2D::_area_exit_tree(ObjectID p_id) {
|
|
E->get().in_tree = false;
|
|
E->get().in_tree = false;
|
|
emit_signal(SceneStringNames::get_singleton()->area_exited, node);
|
|
emit_signal(SceneStringNames::get_singleton()->area_exited, node);
|
|
for (int i = 0; i < E->get().shapes.size(); i++) {
|
|
for (int i = 0; i < E->get().shapes.size(); i++) {
|
|
- emit_signal(SceneStringNames::get_singleton()->area_shape_exited, p_id, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape);
|
|
|
|
|
|
+ emit_signal(SceneStringNames::get_singleton()->area_shape_exited, E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -239,6 +240,7 @@ void Area2D::_area_inout(int p_status, const RID &p_area, int p_instance, int p_
|
|
if (area_in) {
|
|
if (area_in) {
|
|
if (!E) {
|
|
if (!E) {
|
|
E = area_map.insert(objid, AreaState());
|
|
E = area_map.insert(objid, AreaState());
|
|
|
|
+ E->get().rid = p_area;
|
|
E->get().rc = 0;
|
|
E->get().rc = 0;
|
|
E->get().in_tree = node && node->is_inside_tree();
|
|
E->get().in_tree = node && node->is_inside_tree();
|
|
if (node) {
|
|
if (node) {
|
|
@@ -255,7 +257,7 @@ void Area2D::_area_inout(int p_status, const RID &p_area, int p_instance, int p_
|
|
}
|
|
}
|
|
|
|
|
|
if (!node || E->get().in_tree) {
|
|
if (!node || E->get().in_tree) {
|
|
- emit_signal(SceneStringNames::get_singleton()->area_shape_entered, objid, node, p_area_shape, p_self_shape);
|
|
|
|
|
|
+ emit_signal(SceneStringNames::get_singleton()->area_shape_entered, p_area, node, p_area_shape, p_self_shape);
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
@@ -277,7 +279,7 @@ void Area2D::_area_inout(int p_status, const RID &p_area, int p_instance, int p_
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!node || in_tree) {
|
|
if (!node || in_tree) {
|
|
- emit_signal(SceneStringNames::get_singleton()->area_shape_exited, objid, obj, p_area_shape, p_self_shape);
|
|
|
|
|
|
+ emit_signal(SceneStringNames::get_singleton()->area_shape_exited, p_area, obj, p_area_shape, p_self_shape);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -309,7 +311,7 @@ void Area2D::_clear_monitoring() {
|
|
}
|
|
}
|
|
|
|
|
|
for (int i = 0; i < E->get().shapes.size(); i++) {
|
|
for (int i = 0; i < E->get().shapes.size(); i++) {
|
|
- emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->key(), node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape);
|
|
|
|
|
|
+ emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape);
|
|
}
|
|
}
|
|
|
|
|
|
emit_signal(SceneStringNames::get_singleton()->body_exited, obj);
|
|
emit_signal(SceneStringNames::get_singleton()->body_exited, obj);
|
|
@@ -338,7 +340,7 @@ void Area2D::_clear_monitoring() {
|
|
}
|
|
}
|
|
|
|
|
|
for (int i = 0; i < E->get().shapes.size(); i++) {
|
|
for (int i = 0; i < E->get().shapes.size(); i++) {
|
|
- emit_signal(SceneStringNames::get_singleton()->area_shape_exited, E->key(), node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape);
|
|
|
|
|
|
+ emit_signal(SceneStringNames::get_singleton()->area_shape_exited, E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape);
|
|
}
|
|
}
|
|
|
|
|
|
emit_signal(SceneStringNames::get_singleton()->area_exited, obj);
|
|
emit_signal(SceneStringNames::get_singleton()->area_exited, obj);
|
|
@@ -533,13 +535,13 @@ void Area2D::_bind_methods() {
|
|
ClassDB::bind_method(D_METHOD("_body_inout"), &Area2D::_body_inout);
|
|
ClassDB::bind_method(D_METHOD("_body_inout"), &Area2D::_body_inout);
|
|
ClassDB::bind_method(D_METHOD("_area_inout"), &Area2D::_area_inout);
|
|
ClassDB::bind_method(D_METHOD("_area_inout"), &Area2D::_area_inout);
|
|
|
|
|
|
- ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "local_shape")));
|
|
|
|
- ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "local_shape")));
|
|
|
|
|
|
+ ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::_RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "local_shape")));
|
|
|
|
+ ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::_RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "local_shape")));
|
|
ADD_SIGNAL(MethodInfo("body_entered", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
|
|
ADD_SIGNAL(MethodInfo("body_entered", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
|
|
ADD_SIGNAL(MethodInfo("body_exited", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
|
|
ADD_SIGNAL(MethodInfo("body_exited", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
|
|
|
|
|
|
- ADD_SIGNAL(MethodInfo("area_shape_entered", PropertyInfo(Variant::INT, "area_id"), PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D"), PropertyInfo(Variant::INT, "area_shape"), PropertyInfo(Variant::INT, "local_shape")));
|
|
|
|
- ADD_SIGNAL(MethodInfo("area_shape_exited", PropertyInfo(Variant::INT, "area_id"), PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D"), PropertyInfo(Variant::INT, "area_shape"), PropertyInfo(Variant::INT, "local_shape")));
|
|
|
|
|
|
+ ADD_SIGNAL(MethodInfo("area_shape_entered", PropertyInfo(Variant::_RID, "area_rid"), PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D"), PropertyInfo(Variant::INT, "area_shape"), PropertyInfo(Variant::INT, "local_shape")));
|
|
|
|
+ ADD_SIGNAL(MethodInfo("area_shape_exited", PropertyInfo(Variant::_RID, "area_rid"), PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D"), PropertyInfo(Variant::INT, "area_shape"), PropertyInfo(Variant::INT, "local_shape")));
|
|
ADD_SIGNAL(MethodInfo("area_entered", PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D")));
|
|
ADD_SIGNAL(MethodInfo("area_entered", PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D")));
|
|
ADD_SIGNAL(MethodInfo("area_exited", PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D")));
|
|
ADD_SIGNAL(MethodInfo("area_exited", PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D")));
|
|
|
|
|