Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions scene/2d/navigation/navigation_link_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ void NavigationLink2D::_update_debug_mesh() {
return;
}

_prepare_debug_canvas_item();
if (!Engine::get_singleton()->is_editor_hint() && !NavigationServer2D::get_singleton()->get_debug_enabled()) {
return;
}
Expand All @@ -387,9 +388,10 @@ void NavigationLink2D::_update_debug_mesh() {

real_t radius = NavigationServer2D::get_singleton()->map_get_link_connection_radius(get_world_2d()->get_navigation_map());

draw_line(get_start_position(), get_end_position(), color);
draw_arc(get_start_position(), radius, 0, Math::TAU, 10, color);
draw_arc(get_end_position(), radius, 0, Math::TAU, 10, color);
RenderingServer *rs = RenderingServer::get_singleton();
rs->canvas_item_add_line(_get_debug_canvas_item(), get_start_position(), get_end_position(), color);
_draw_arc_debug(get_start_position(), radius, 0, Math::TAU, 10, color);
_draw_arc_debug(get_end_position(), radius, 0, Math::TAU, 10, color);

const Vector2 link_segment = end_position - start_position;
const float arror_len = 5.0;
Expand All @@ -398,20 +400,20 @@ void NavigationLink2D::_update_debug_mesh() {
Vector2 anchor = start_position + (link_segment * 0.75);
Vector2 direction = start_position.direction_to(end_position);
Vector2 arrow_dir = -direction.orthogonal();
draw_line(anchor, anchor + (arrow_dir - direction) * arror_len, color);
rs->canvas_item_add_line(_get_debug_canvas_item(), anchor, anchor + (arrow_dir - direction) * arror_len, color);

arrow_dir = direction.orthogonal();
draw_line(anchor, anchor + (arrow_dir - direction) * arror_len, color);
rs->canvas_item_add_line(_get_debug_canvas_item(), anchor, anchor + (arrow_dir - direction) * arror_len, color);
}

if (is_bidirectional()) {
Vector2 anchor = start_position + (link_segment * 0.25);
Vector2 direction = end_position.direction_to(start_position);
Vector2 arrow_dir = -direction.orthogonal();
draw_line(anchor, anchor + (arrow_dir - direction) * arror_len, color);
rs->canvas_item_add_line(_get_debug_canvas_item(), anchor, anchor + (arrow_dir - direction) * arror_len, color);

arrow_dir = direction.orthogonal();
draw_line(anchor, anchor + (arrow_dir - direction) * arror_len, color);
rs->canvas_item_add_line(_get_debug_canvas_item(), anchor, anchor + (arrow_dir - direction) * arror_len, color);
}
}
#endif // DEBUG_ENABLED
Expand Down
47 changes: 13 additions & 34 deletions scene/2d/navigation/navigation_obstacle_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,11 @@ void NavigationObstacle2D::_notification(int p_what) {
NavigationServer2D::get_singleton()->obstacle_set_avoidance_enabled(obstacle, avoidance_enabled);
_update_transform();
set_physics_process_internal(true);
#ifdef DEBUG_ENABLED
RS::get_singleton()->canvas_item_set_parent(debug_canvas_item, get_world_2d()->get_canvas());
#endif // DEBUG_ENABLED
} break;

case NOTIFICATION_EXIT_TREE: {
set_physics_process_internal(false);
_update_map(RID());
#ifdef DEBUG_ENABLED
RS::get_singleton()->canvas_item_set_parent(debug_canvas_item, RID());
#endif // DEBUG_ENABLED
} break;

case NOTIFICATION_SUSPENDED:
Expand Down Expand Up @@ -143,12 +137,6 @@ void NavigationObstacle2D::_notification(int p_what) {
NavigationServer2D::get_singleton()->obstacle_set_paused(obstacle, !can_process());
} break;

case NOTIFICATION_VISIBILITY_CHANGED: {
#ifdef DEBUG_ENABLED
RS::get_singleton()->canvas_item_set_visible(debug_canvas_item, is_visible_in_tree());
#endif // DEBUG_ENABLED
} break;

case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
if (is_inside_tree()) {
_update_transform();
Expand All @@ -164,25 +152,21 @@ void NavigationObstacle2D::_notification(int p_what) {
}
} break;

case NOTIFICATION_DRAW: {
#ifdef DEBUG_ENABLED
if (is_inside_tree()) {
bool is_debug_enabled = false;
if (Engine::get_singleton()->is_editor_hint()) {
is_debug_enabled = true;
} else if (NavigationServer2D::get_singleton()->get_debug_enabled() && NavigationServer2D::get_singleton()->get_debug_avoidance_enabled()) {
is_debug_enabled = true;
}
case NOTIFICATION_DRAW: {
if (!is_inside_tree() || !Engine::get_singleton()->is_editor_hint()) {
return;
}

if (is_debug_enabled) {
RS::get_singleton()->canvas_item_clear(debug_canvas_item);
RS::get_singleton()->canvas_item_set_transform(debug_canvas_item, Transform2D());
_update_fake_agent_radius_debug();
_update_static_obstacle_debug();
}
_prepare_debug_canvas_item();
if (!NavigationServer2D::get_singleton()->get_debug_enabled() || !NavigationServer2D::get_singleton()->get_debug_avoidance_enabled()) {
return;
}
#endif // DEBUG_ENABLED

_update_fake_agent_radius_debug();
_update_static_obstacle_debug();
} break;
#endif // DEBUG_ENABLED
}
}

Expand All @@ -195,7 +179,6 @@ NavigationObstacle2D::NavigationObstacle2D() {
NavigationServer2D::get_singleton()->obstacle_set_avoidance_enabled(obstacle, avoidance_enabled);

#ifdef DEBUG_ENABLED
debug_canvas_item = RenderingServer::get_singleton()->canvas_item_create();
debug_mesh_rid = RenderingServer::get_singleton()->mesh_create();
#endif // DEBUG_ENABLED
}
Expand All @@ -211,10 +194,6 @@ NavigationObstacle2D::~NavigationObstacle2D() {
RenderingServer::get_singleton()->free_rid(debug_mesh_rid);
debug_mesh_rid = RID();
}
if (debug_canvas_item.is_valid()) {
RenderingServer::get_singleton()->free_rid(debug_canvas_item);
debug_canvas_item = RID();
}
#endif // DEBUG_ENABLED
}

Expand Down Expand Up @@ -450,7 +429,7 @@ void NavigationObstacle2D::_update_fake_agent_radius_debug() {
const Vector2 safe_scale = get_global_scale().abs().maxf(0.001);
// Agent radius is a scalar value and does not support non-uniform scaling, choose the largest axis.
const float scaling_max_value = safe_scale[safe_scale.max_axis_index()];
RS::get_singleton()->canvas_item_add_circle(debug_canvas_item, get_global_position(), scaling_max_value * radius, debug_radius_color);
RS::get_singleton()->canvas_item_add_circle(_get_debug_canvas_item(), get_global_position(), scaling_max_value * radius, debug_radius_color);
}
}
#endif // DEBUG_ENABLED
Expand Down Expand Up @@ -512,6 +491,6 @@ void NavigationObstacle2D::_update_static_obstacle_debug() {

rs->mesh_add_surface_from_arrays(debug_mesh_rid, RSE::PRIMITIVE_LINES, edge_mesh_array, Array(), Dictionary(), RSE::ARRAY_FLAG_USE_2D_VERTICES);

rs->canvas_item_add_mesh(debug_canvas_item, debug_mesh_rid, get_global_transform());
rs->canvas_item_add_mesh(_get_debug_canvas_item(), debug_mesh_rid, Transform2D());
}
#endif // DEBUG_ENABLED
1 change: 0 additions & 1 deletion scene/2d/navigation/navigation_obstacle_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class NavigationObstacle2D : public Node2D {

#ifdef DEBUG_ENABLED
private:
RID debug_canvas_item;
RID debug_mesh_rid;

void _update_fake_agent_radius_debug();
Expand Down
66 changes: 22 additions & 44 deletions scene/2d/navigation/navigation_region_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,26 +168,29 @@ void NavigationRegion2D::_notification(int p_what) {
_region_update_transform();
} break;

case NOTIFICATION_VISIBILITY_CHANGED: {
#ifdef DEBUG_ENABLED
_set_debug_visible(is_visible_in_tree());
#endif // DEBUG_ENABLED
} break;

case NOTIFICATION_EXIT_TREE: {
_region_exit_navigation_map();
#ifdef DEBUG_ENABLED
_set_debug_visible(false);
#endif // DEBUG_ENABLED
} break;

case NOTIFICATION_DRAW: {
#ifdef DEBUG_ENABLED
if (is_inside_tree() && (Engine::get_singleton()->is_editor_hint() || (NavigationServer2D::get_singleton()->get_debug_enabled() && NavigationServer2D::get_singleton()->get_debug_navigation_enabled())) && navigation_polygon.is_valid()) {
_update_debug_mesh();
_update_debug_edge_connections_mesh();
_update_debug_baking_rect();
if (!is_inside_tree() || !(Engine::get_singleton()->is_editor_hint() || (NavigationServer2D::get_singleton()->get_debug_enabled() && NavigationServer2D::get_singleton()->get_debug_navigation_enabled()))) {
return;
}

if (navigation_polygon.is_null()) {
_prepare_debug_canvas_item();
return;
}

if (!debug_mesh_dirty) {
return;
}

_prepare_debug_canvas_item();
_update_debug_mesh();
_update_debug_edge_connections_mesh();
_update_debug_baking_rect();
#endif // DEBUG_ENABLED
} break;
}
Expand Down Expand Up @@ -267,10 +270,6 @@ void NavigationRegion2D::_navigation_polygon_changed() {
#ifdef DEBUG_ENABLED
debug_mesh_dirty = true;

if (navigation_polygon.is_null()) {
_set_debug_visible(false);
}

if (is_inside_tree() && (Engine::get_singleton()->is_editor_hint() || get_tree()->is_debugging_navigation_hint())) {
queue_redraw();
}
Expand Down Expand Up @@ -400,9 +399,6 @@ NavigationRegion2D::~NavigationRegion2D() {
#ifdef DEBUG_ENABLED
NavigationServer2D::get_singleton()->disconnect(SNAME("map_changed"), callable_mp(this, &NavigationRegion2D::_navigation_map_changed));
NavigationServer2D::get_singleton()->disconnect(SNAME("navigation_debug_changed"), callable_mp(this, &NavigationRegion2D::_navigation_debug_changed));
if (debug_instance_rid.is_valid()) {
RS::get_singleton()->free_rid(debug_instance_rid);
}
if (debug_mesh_rid.is_valid()) {
RS::get_singleton()->free_rid(debug_mesh_rid);
}
Expand Down Expand Up @@ -442,17 +438,9 @@ void NavigationRegion2D::_region_update_transform() {

#ifdef DEBUG_ENABLED
void NavigationRegion2D::_update_debug_mesh() {
if (!is_inside_tree()) {
_set_debug_visible(false);
return;
}

const NavigationServer2D *ns2d = NavigationServer2D::get_singleton();
RenderingServer *rs = RenderingServer::get_singleton();

if (!debug_instance_rid.is_valid()) {
debug_instance_rid = rs->canvas_item_create();
}
if (!debug_mesh_rid.is_valid()) {
debug_mesh_rid = rs->mesh_create();
}
Expand Down Expand Up @@ -593,8 +581,7 @@ void NavigationRegion2D::_update_debug_mesh() {
rs->mesh_add_surface_from_arrays(debug_mesh_rid, RSE::PRIMITIVE_LINES, line_mesh_array, Array(), Dictionary(), RSE::ARRAY_FLAG_USE_2D_VERTICES);
}

rs->canvas_item_add_mesh(debug_instance_rid, debug_mesh_rid, Transform2D());
rs->canvas_item_set_visible(debug_instance_rid, is_visible_in_tree());
rs->canvas_item_add_mesh(_get_debug_canvas_item(), debug_mesh_rid, Transform2D());
}
#endif // DEBUG_ENABLED

Expand All @@ -608,18 +595,19 @@ void NavigationRegion2D::_update_debug_edge_connections_mesh() {
// Draw the region edge connections.
Transform2D xform = get_global_transform();
real_t radius = ns2d->map_get_edge_connection_margin(get_world_2d()->get_navigation_map()) / 2.0;
RenderingServer *rs = RenderingServer::get_singleton();
for (int i = 0; i < ns2d->region_get_connections_count(region); i++) {
// Two main points
Vector2 a = ns2d->region_get_connection_pathway_start(region, i);
a = xform.affine_inverse().xform(a);
Vector2 b = ns2d->region_get_connection_pathway_end(region, i);
b = xform.affine_inverse().xform(b);
draw_line(a, b, debug_edge_connection_color);
rs->canvas_item_add_line(_get_debug_canvas_item(), a, b, debug_edge_connection_color);

// Draw a circle to illustrate the margins.
real_t angle = a.angle_to_point(b);
draw_arc(a, radius, angle + Math::PI / 2.0, angle - Math::PI / 2.0 + Math::TAU, 10, debug_edge_connection_color);
draw_arc(b, radius, angle - Math::PI / 2.0, angle + Math::PI / 2.0, 10, debug_edge_connection_color);
_draw_arc_debug(a, radius, angle + Math::PI / 2.0, angle - Math::PI / 2.0 + Math::TAU, 10, debug_edge_connection_color);
_draw_arc_debug(b, radius, angle - Math::PI / 2.0, angle + Math::PI / 2.0, 10, debug_edge_connection_color);
}
}
}
Expand All @@ -632,17 +620,7 @@ void NavigationRegion2D::_update_debug_baking_rect() {
Vector2 baking_rect_offset = get_navigation_polygon()->get_baking_rect_offset();
Rect2 debug_baking_rect = Rect2(baking_rect.position.x + baking_rect_offset.x, baking_rect.position.y + baking_rect_offset.y, baking_rect.size.x, baking_rect.size.y);
Color debug_baking_rect_color = Color(0.8, 0.5, 0.7, 0.1);
draw_rect(debug_baking_rect, debug_baking_rect_color);
}
}
#endif // DEBUG_ENABLED

#ifdef DEBUG_ENABLED
void NavigationRegion2D::_set_debug_visible(bool p_visible) {
RenderingServer *rs = RenderingServer::get_singleton();
ERR_FAIL_NULL(rs);
if (debug_instance_rid.is_valid()) {
RS::get_singleton()->canvas_item_set_visible(debug_instance_rid, p_visible);
RenderingServer::get_singleton()->canvas_item_add_rect(_get_debug_canvas_item(), debug_baking_rect, debug_baking_rect_color);
}
}
#endif // DEBUG_ENABLED
Expand Down
2 changes: 0 additions & 2 deletions scene/2d/navigation/navigation_region_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ class NavigationRegion2D : public Node2D {
#ifdef DEBUG_ENABLED
private:
RID debug_mesh_rid;
RID debug_instance_rid;

bool debug_mesh_dirty = true;

void _set_debug_visible(bool p_visible);
void _update_debug_mesh();
void _update_debug_edge_connections_mesh();
void _update_debug_baking_rect();
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/path_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ void Path2D::_debug_update() {
rs->mesh_add_surface_from_arrays(debug_mesh_rid, RSE::PRIMITIVE_LINES, bone_array, Array(), Dictionary(), RSE::ARRAY_FLAG_USE_2D_VERTICES);
}

rs->canvas_item_clear(get_canvas_item());
rs->canvas_item_add_mesh(get_canvas_item(), debug_mesh_rid, Transform2D());
_prepare_debug_canvas_item();
rs->canvas_item_add_mesh(_get_debug_canvas_item(), debug_mesh_rid, Transform2D());
}
#endif // DEBUG_ENABLED

Expand Down
16 changes: 10 additions & 6 deletions scene/2d/physics/collision_polygon_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,15 @@
collision_object = nullptr;
} break;

#ifdef DEBUG_ENABLED
case NOTIFICATION_DRAW: {
ERR_FAIL_COND(!is_inside_tree());
if (!Engine::get_singleton()->is_editor_hint() && !PhysicsServer2D::get_singleton()->debug_is_enabled()) {
break;
}

RenderingServer *rs = RenderingServer::get_singleton();

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm32 (target=template_debug, arch=arm32)

no member named 'get_singleton' in namespace 'RenderingServerEnums'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm32 (target=template_debug, arch=arm32)

use of undeclared identifier 'rs'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm32 (target=template_debug, arch=arm32)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm32 (target=template_debug, arch=arm32)

unexpected namespace name 'RenderingServerEnums': expected expression

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm32 (target=template_debug, arch=arm32)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm64 (target=template_debug, arch=arm64)

no member named 'get_singleton' in namespace 'RenderingServerEnums'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm64 (target=template_debug, arch=arm64)

use of undeclared identifier 'rs'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm64 (target=template_debug, arch=arm64)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm64 (target=template_debug, arch=arm64)

unexpected namespace name 'RenderingServerEnums': expected expression

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm64 (target=template_debug, arch=arm64)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor w/ clang-cl (target=editor, use_llvm=yes)

use of undeclared identifier 'RenderingServer'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor w/ clang-cl (target=editor, use_llvm=yes)

use of undeclared identifier 'rs'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor w/ clang-cl (target=editor, use_llvm=yes)

unexpected namespace name 'RenderingServerEnums': expected expression

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor w/ clang-cl (target=editor, use_llvm=yes)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Editor (target=editor)

no member named 'get_singleton' in namespace 'RenderingServerEnums'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Editor (target=editor)

use of undeclared identifier 'rs'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Editor (target=editor)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Editor (target=editor)

unexpected namespace name 'RenderingServerEnums': expected expression

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Editor (target=editor)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

no member named 'get_singleton' in namespace 'RenderingServerEnums'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'rs'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

unexpected namespace name 'RenderingServerEnums': expected expression

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

no member named 'get_singleton' in namespace 'RenderingServerEnums'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'rs'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

unexpected namespace name 'RenderingServerEnums': expected expression

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🍎 macOS / Editor (target=editor)

no member named 'get_singleton' in namespace 'RenderingServerEnums'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🍎 macOS / Editor (target=editor)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🍎 macOS / Editor (target=editor)

use of undeclared identifier 'rs'

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🍎 macOS / Editor (target=editor)

unexpected namespace name 'RenderingServerEnums': expected expression

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🍎 macOS / Editor (target=editor)

use of undeclared identifier 'RenderingServer'; did you mean 'RenderingServerEnums'?

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'get_singleton': identifier not found

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'RenderingServer': is not a class or namespace name

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'rs': undeclared identifier

Check failure on line 139 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'RenderingServer': undeclared identifier
_prepare_debug_canvas_item();
if (polygon.size() > 2) {
#ifdef TOOLS_ENABLED
if (build_mode == BUILD_SOLIDS) {
Expand All @@ -143,22 +146,22 @@
Color c(0.4, 0.9, 0.1);
for (int i = 0; i < decomp.size(); i++) {
c.set_hsv(Math::fmod(c.get_h() + 0.738, 1), c.get_s(), c.get_v(), 0.5);
draw_colored_polygon(decomp[i], c);
rs->canvas_item_add_polygon(_get_debug_canvas_item(), decomp[i], Vector<Color>{ c });

Check failure on line 149 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor w/ clang-cl (target=editor, use_llvm=yes)

use of undeclared identifier 'rs'

Check failure on line 149 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Editor (target=editor)

use of undeclared identifier 'rs'

Check failure on line 149 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'rs'

Check failure on line 149 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'rs'

Check failure on line 149 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🍎 macOS / Editor (target=editor)

use of undeclared identifier 'rs'

Check failure on line 149 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'rs': undeclared identifier
}
}
#endif
#endif // TOOLS_ENABLED

const Color stroke_color = get_tree()->get_debug_collisions_color();
draw_polyline(polygon, stroke_color);
rs->canvas_item_add_polyline(_get_debug_canvas_item(), polygon, Vector<Color>{ stroke_color });

Check failure on line 155 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm32 (target=template_debug, arch=arm32)

use of undeclared identifier 'rs'

Check failure on line 155 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm64 (target=template_debug, arch=arm64)

use of undeclared identifier 'rs'

Check failure on line 155 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor w/ clang-cl (target=editor, use_llvm=yes)

use of undeclared identifier 'rs'

Check failure on line 155 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Editor (target=editor)

use of undeclared identifier 'rs'

Check failure on line 155 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'rs'

Check failure on line 155 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'rs'

Check failure on line 155 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🍎 macOS / Editor (target=editor)

use of undeclared identifier 'rs'

Check failure on line 155 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'rs': undeclared identifier
// Draw the last segment.
draw_line(polygon[polygon.size() - 1], polygon[0], stroke_color);
rs->canvas_item_add_line(_get_debug_canvas_item(), polygon[polygon.size() - 1], polygon[0], stroke_color);

Check failure on line 157 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm32 (target=template_debug, arch=arm32)

use of undeclared identifier 'rs'

Check failure on line 157 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm64 (target=template_debug, arch=arm64)

use of undeclared identifier 'rs'

Check failure on line 157 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor w/ clang-cl (target=editor, use_llvm=yes)

use of undeclared identifier 'rs'

Check failure on line 157 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Editor (target=editor)

use of undeclared identifier 'rs'

Check failure on line 157 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'rs'

Check failure on line 157 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'rs'

Check failure on line 157 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🍎 macOS / Editor (target=editor)

use of undeclared identifier 'rs'

Check failure on line 157 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'rs': undeclared identifier
}

if (one_way_collision) {
Color dcol = get_tree()->get_debug_collisions_color(); //0.9,0.2,0.2,0.4);
dcol.a = 1.0;
Vector2 line_to = 20.0 * one_way_collision_direction;
draw_line(Vector2(), line_to, dcol, 3);
rs->canvas_item_add_line(_get_debug_canvas_item(), Vector2(), line_to, dcol, 3);

Check failure on line 164 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm32 (target=template_debug, arch=arm32)

use of undeclared identifier 'rs'

Check failure on line 164 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm64 (target=template_debug, arch=arm64)

use of undeclared identifier 'rs'

Check failure on line 164 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor w/ clang-cl (target=editor, use_llvm=yes)

use of undeclared identifier 'rs'

Check failure on line 164 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Editor (target=editor)

use of undeclared identifier 'rs'

Check failure on line 164 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'rs'

Check failure on line 164 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'rs'

Check failure on line 164 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🍎 macOS / Editor (target=editor)

use of undeclared identifier 'rs'

Check failure on line 164 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'rs': undeclared identifier
real_t tsize = 8;

Vector<Vector2> pts = {
Expand All @@ -169,9 +172,10 @@

Vector<Color> cols{ dcol, dcol, dcol };

draw_primitive(pts, cols, Vector<Vector2>()); //small arrow
rs->canvas_item_add_primitive(_get_debug_canvas_item(), pts, cols, Vector<Vector2>(), RID()); //small arrow

Check failure on line 175 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm32 (target=template_debug, arch=arm32)

use of undeclared identifier 'rs'

Check failure on line 175 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Template arm64 (target=template_debug, arch=arm64)

use of undeclared identifier 'rs'

Check failure on line 175 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor w/ clang-cl (target=editor, use_llvm=yes)

use of undeclared identifier 'rs'

Check failure on line 175 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🤖 Android / Editor (target=editor)

use of undeclared identifier 'rs'

Check failure on line 175 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'rs'

Check failure on line 175 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'rs'

Check failure on line 175 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🍎 macOS / Editor (target=editor)

use of undeclared identifier 'rs'

Check failure on line 175 in scene/2d/physics/collision_polygon_2d.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'rs': undeclared identifier
}
} break;
#endif // DEBUG_ENABLED
}
}

Expand Down
Loading
Loading