@@ -1138,8 +1138,6 @@ Vector<Vector2> GodotNavigationServer2D::obstacle_get_vertices(RID p_obstacle) c
11381138}
11391139
11401140void GodotNavigationServer2D::flush_queries () {
1141- // In c++ we can't be sure that this is performed in the main thread
1142- // even with mutable functions.
11431141 MutexLock lock (commands_mutex);
11441142 MutexLock lock2 (operations_mutex);
11451143
@@ -1259,7 +1257,21 @@ void GodotNavigationServer2D::internal_free_obstacle(RID p_object) {
12591257 }
12601258}
12611259
1262- void GodotNavigationServer2D::process (real_t p_delta_time) {
1260+ void GodotNavigationServer2D::process (double p_delta_time) {
1261+ // Called for each main loop iteration AFTER node and user script process() and BEFORE RenderingServer sync.
1262+ // Will run reliably every rendered frame independent of the physics tick rate.
1263+ // Use for things that (only) need to update once per main loop iteration and rendered frame or is visible to the user.
1264+ // E.g. (final) sync of objects for this main loop iteration, updating rendered debug visuals, updating debug statistics, ...
1265+ }
1266+
1267+ void GodotNavigationServer2D::physics_process (double p_delta_time) {
1268+ // Called for each physics process step AFTER node and user script physics_process() and BEFORE PhysicsServer sync.
1269+ // Will NOT run reliably every rendered frame. If there is no physics step this function will not run.
1270+ // Use for physics or step depending calculations and updates where the result affects the next step calculation.
1271+ // E.g. anything physics sync related, avoidance simulations, physics space state queries, ...
1272+ // If physics process needs to play catchup this function will be called multiple times per frame so it should not hold
1273+ // costly updates that are not important outside the stepped calculations to avoid causing a physics performance death spiral.
1274+
12631275 flush_queries ();
12641276
12651277 if (!active) {
0 commit comments