summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/navigation_region_2d.cpp8
-rw-r--r--scene/2d/navigation_region_2d.h4
-rw-r--r--scene/2d/ray_cast_2d.cpp7
3 files changed, 13 insertions, 6 deletions
diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp
index 4bead978f1..e685ad8f67 100644
--- a/scene/2d/navigation_region_2d.cpp
+++ b/scene/2d/navigation_region_2d.cpp
@@ -104,8 +104,8 @@ void NavigationPolygon::_set_polygons(const TypedArray<Vector<int32_t>> &p_array
}
}
-Array NavigationPolygon::_get_polygons() const {
- Array ret;
+TypedArray<Vector<int32_t>> NavigationPolygon::_get_polygons() const {
+ TypedArray<Vector<int32_t>> ret;
ret.resize(polygons.size());
for (int i = 0; i < ret.size(); i++) {
ret[i] = polygons[i].indices;
@@ -122,8 +122,8 @@ void NavigationPolygon::_set_outlines(const TypedArray<Vector<Vector2>> &p_array
rect_cache_dirty = true;
}
-Array NavigationPolygon::_get_outlines() const {
- Array ret;
+TypedArray<Vector<Vector2>> NavigationPolygon::_get_outlines() const {
+ TypedArray<Vector<Vector2>> ret;
ret.resize(outlines.size());
for (int i = 0; i < ret.size(); i++) {
ret[i] = outlines[i];
diff --git a/scene/2d/navigation_region_2d.h b/scene/2d/navigation_region_2d.h
index 012debb584..487a578401 100644
--- a/scene/2d/navigation_region_2d.h
+++ b/scene/2d/navigation_region_2d.h
@@ -55,10 +55,10 @@ protected:
static void _bind_methods();
void _set_polygons(const TypedArray<Vector<int32_t>> &p_array);
- Array _get_polygons() const;
+ TypedArray<Vector<int32_t>> _get_polygons() const;
void _set_outlines(const TypedArray<Vector<Vector2>> &p_array);
- Array _get_outlines() const;
+ TypedArray<Vector<Vector2>> _get_outlines() const;
public:
#ifdef TOOLS_ENABLED
diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp
index 9521667854..51b3e676f9 100644
--- a/scene/2d/ray_cast_2d.cpp
+++ b/scene/2d/ray_cast_2d.cpp
@@ -279,6 +279,13 @@ void RayCast2D::remove_exception(const CollisionObject2D *p_node) {
void RayCast2D::clear_exceptions() {
exclude.clear();
+
+ if (exclude_parent_body && is_inside_tree()) {
+ CollisionObject2D *parent = Object::cast_to<CollisionObject2D>(get_parent());
+ if (parent) {
+ exclude.insert(parent->get_rid());
+ }
+ }
}
void RayCast2D::set_collide_with_areas(bool p_enabled) {