Add navigation obstacles to performance monitor stats

Adds navigation obstacle count to navigation performance monitor.
This commit is contained in:
smix8 2024-06-25 04:50:43 +02:00
parent 25ff1306d6
commit f9876d3a88
10 changed files with 26 additions and 1 deletions

View file

@ -91,6 +91,7 @@ void Performance::_bind_methods() {
BIND_ENUM_CONSTANT(NAVIGATION_EDGE_MERGE_COUNT);
BIND_ENUM_CONSTANT(NAVIGATION_EDGE_CONNECTION_COUNT);
BIND_ENUM_CONSTANT(NAVIGATION_EDGE_FREE_COUNT);
BIND_ENUM_CONSTANT(NAVIGATION_OBSTACLE_COUNT);
BIND_ENUM_CONSTANT(MONITOR_MAX);
}
@ -141,6 +142,7 @@ String Performance::get_monitor_name(Monitor p_monitor) const {
PNAME("navigation/edges_merged"),
PNAME("navigation/edges_connected"),
PNAME("navigation/edges_free"),
PNAME("navigation/obstacles"),
};
@ -225,6 +227,8 @@ double Performance::get_monitor(Monitor p_monitor) const {
return NavigationServer3D::get_singleton()->get_process_info(NavigationServer3D::INFO_EDGE_CONNECTION_COUNT);
case NAVIGATION_EDGE_FREE_COUNT:
return NavigationServer3D::get_singleton()->get_process_info(NavigationServer3D::INFO_EDGE_FREE_COUNT);
case NAVIGATION_OBSTACLE_COUNT:
return NavigationServer3D::get_singleton()->get_process_info(NavigationServer3D::INFO_OBSTACLE_COUNT);
default: {
}
@ -272,6 +276,7 @@ Performance::MonitorType Performance::get_monitor_type(Monitor p_monitor) const
MONITOR_TYPE_QUANTITY,
MONITOR_TYPE_QUANTITY,
MONITOR_TYPE_QUANTITY,
MONITOR_TYPE_QUANTITY,
};

View file

@ -100,6 +100,7 @@ public:
NAVIGATION_EDGE_MERGE_COUNT,
NAVIGATION_EDGE_CONNECTION_COUNT,
NAVIGATION_EDGE_FREE_COUNT,
NAVIGATION_OBSTACLE_COUNT,
MONITOR_MAX
};