2023-01-05 13:25:55 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/**************************************************************************/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*  nav_region.cpp                                                        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/**************************************************************************/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                         This file is part of:                          */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                             GODOT ENGINE                               */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                        https://godotengine.org                         */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/**************************************************************************/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                                                                        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Permission is hereby granted, free of charge, to any person obtaining  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* a copy of this software and associated documentation files (the        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* "Software"), to deal in the Software without restriction, including    */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* without limitation the rights to use, copy, modify, merge, publish,    */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* distribute, sublicense, and/or sell copies of the Software, and to     */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* permit persons to whom the Software is furnished to do so, subject to  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* the following conditions:                                              */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                                                                        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* The above copyright notice and this permission notice shall be         */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* included in all copies or substantial portions of the Software.        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                                                                        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/**************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "nav_region.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "nav_map.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "3d/nav_map_builder_3d.h" 
  
						 
					
						
							
								
									
										
										
										
											2024-08-30 15:52:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "3d/nav_mesh_queries_3d.h" 
  
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "3d/nav_region_iteration_3d.h" 
  
						 
					
						
							
								
									
										
										
										
											2024-08-30 15:52:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								void  NavRegion : : set_map ( NavMap  * p_map )  {  
						 
					
						
							
								
									
										
										
										
											2023-04-05 02:15:25 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( map  = =  p_map )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-25 05:28:21 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-11-24 18:30:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									cancel_sync_request ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-06-25 05:28:21 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( map )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										map - > remove_region ( this ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									map  =  p_map ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									polygons_dirty  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-25 05:28:21 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( map )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										map - > add_region ( this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-11-24 18:30:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										request_sync ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-15 12:45:28 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-07-06 23:01:19 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								void  NavRegion : : set_enabled ( bool  p_enabled )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( enabled  = =  p_enabled )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									enabled  =  p_enabled ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// TODO: This should not require a full rebuild as the region has not really changed.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									polygons_dirty  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-11-24 18:30:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									request_sync ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-10-07 10:57:21 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2023-07-06 23:01:19 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-04-01 01:49:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								void  NavRegion : : set_use_edge_connections ( bool  p_enabled )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( use_edge_connections  ! =  p_enabled )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										use_edge_connections  =  p_enabled ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										polygons_dirty  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2024-11-24 18:30:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									request_sync ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-04-01 01:49:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 01:08:21 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								void  NavRegion : : set_transform ( Transform3D  p_transform )  {  
						 
					
						
							
								
									
										
										
										
											2023-04-05 02:15:25 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( transform  = =  p_transform )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									transform  =  p_transform ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									polygons_dirty  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-06-20 15:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-11-24 18:30:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									request_sync ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-20 15:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# ifdef DEBUG_ENABLED 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( map  & &  Math : : rad_to_deg ( map - > get_up ( ) . angle_to ( transform . basis . get_column ( 1 ) ) )  > =  90.0f )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										ERR_PRINT_ONCE ( " Attempted to update a navigation region transform rotated 90 degrees or more away from the current navigation map UP orientation. " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# endif  // DEBUG_ENABLED
  
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-20 15:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								void  NavRegion : : set_navigation_mesh ( Ref < NavigationMesh >  p_navigation_mesh )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# ifdef DEBUG_ENABLED 
  
						 
					
						
							
								
									
										
										
										
											2024-06-21 11:15:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( map  & &  p_navigation_mesh . is_valid ( )  & &  ! Math : : is_equal_approx ( double ( map - > get_cell_size ( ) ) ,  double ( p_navigation_mesh - > get_cell_size ( ) ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-06-20 15:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ERR_PRINT_ONCE ( vformat ( " Attempted to update a navigation region with a navigation mesh that uses a `cell_size` of %s while assigned to a navigation map set to a `cell_size` of %s. The cell size for navigation maps can be changed by using the NavigationServer map_set_cell_size() function. The cell size for default navigation maps can also be changed in the ProjectSettings. " ,  double ( p_navigation_mesh - > get_cell_size ( ) ) ,  double ( map - > get_cell_size ( ) ) ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-21 11:15:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( map  & &  p_navigation_mesh . is_valid ( )  & &  ! Math : : is_equal_approx ( double ( map - > get_cell_height ( ) ) ,  double ( p_navigation_mesh - > get_cell_height ( ) ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-06-20 15:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ERR_PRINT_ONCE ( vformat ( " Attempted to update a navigation region with a navigation mesh that uses a `cell_height` of %s while assigned to a navigation map set to a `cell_height` of %s. The cell height for navigation maps can be changed by using the NavigationServer map_set_cell_height() function. The cell height for default navigation maps can also be changed in the ProjectSettings. " ,  double ( p_navigation_mesh - > get_cell_height ( ) ) ,  double ( map - > get_cell_height ( ) ) ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# endif  // DEBUG_ENABLED
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									RWLockWrite  write_lock ( navmesh_rwlock ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									pending_navmesh_vertices . clear ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									pending_navmesh_polygons . clear ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( p_navigation_mesh . is_valid ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										p_navigation_mesh - > get_data ( pending_navmesh_vertices ,  pending_navmesh_polygons ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									polygons_dirty  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-11-24 18:30:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									request_sync ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-08-25 22:59:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Vector3  NavRegion : : get_closest_point_to_segment ( const  Vector3  & p_from ,  const  Vector3  & p_to ,  bool  p_use_collision )  const  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									RWLockRead  read_lock ( region_rwlock ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  NavMeshQueries3D : : polygons_get_closest_point_to_segment ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											get_polygons ( ) ,  p_from ,  p_to ,  p_use_collision ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								gd : : ClosestPointQueryResult  NavRegion : : get_closest_point_info ( const  Vector3  & p_point )  const  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									RWLockRead  read_lock ( region_rwlock ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  NavMeshQueries3D : : polygons_get_closest_point_info ( get_polygons ( ) ,  p_point ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-23 18:16:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Vector3  NavRegion : : get_random_point ( uint32_t  p_navigation_layers ,  bool  p_uniformly )  const  {  
						 
					
						
							
								
									
										
										
										
											2024-08-25 22:59:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									RWLockRead  read_lock ( region_rwlock ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-23 18:16:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( ! get_enabled ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  Vector3 ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-08-30 15:52:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  NavMeshQueries3D : : polygons_get_random_point ( get_polygons ( ) ,  p_navigation_layers ,  p_uniformly ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-23 18:16:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-02-12 10:03:26 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								void  NavRegion : : set_navigation_layers ( uint32_t  p_navigation_layers )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( navigation_layers  = =  p_navigation_layers )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									navigation_layers  =  p_navigation_layers ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									region_dirty  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									request_sync ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  NavRegion : : set_enter_cost ( real_t  p_enter_cost )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									real_t  new_enter_cost  =  MAX ( p_enter_cost ,  0.0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( enter_cost  = =  new_enter_cost )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									enter_cost  =  new_enter_cost ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									region_dirty  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									request_sync ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  NavRegion : : set_travel_cost ( real_t  p_travel_cost )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									real_t  new_travel_cost  =  MAX ( p_travel_cost ,  0.0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( travel_cost  = =  new_travel_cost )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									travel_cost  =  new_travel_cost ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									region_dirty  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									request_sync ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  NavRegion : : set_owner_id ( ObjectID  p_owner_id )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( owner_id  = =  p_owner_id )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									owner_id  =  p_owner_id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									region_dirty  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									request_sync ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								bool  NavRegion : : sync ( )  {  
						 
					
						
							
								
									
										
										
										
											2024-08-25 22:59:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									RWLockWrite  write_lock ( region_rwlock ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-02-12 10:03:26 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  something_changed  =  region_dirty  | |  polygons_dirty ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									region_dirty  =  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									update_polygons ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  something_changed ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  NavRegion : : update_polygons ( )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ! polygons_dirty )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									navmesh_polygons . clear ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-23 18:16:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									surface_area  =  0.0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bounds  =  AABB ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									polygons_dirty  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-02 01:20:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( map  = =  nullptr )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-20 15:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									RWLockRead  read_lock ( navmesh_rwlock ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-13 13:36:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-20 15:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( pending_navmesh_vertices . is_empty ( )  | |  pending_navmesh_polygons . is_empty ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-13 10:14:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-20 15:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  len  =  pending_navmesh_vertices . size ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( len  = =  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-20 15:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									const  Vector3  * vertices_r  =  pending_navmesh_vertices . ptr ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									navmesh_polygons . resize ( pending_navmesh_polygons . size ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-23 18:16:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									real_t  _new_region_surface_area  =  0.0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									AABB  _new_bounds ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-23 18:16:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  first_vertex  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-23 18:16:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  navigation_mesh_polygon_index  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for  ( gd : : Polygon  & polygon  :  navmesh_polygons )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-23 18:16:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										polygon . surface_area  =  0.0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-20 15:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Vector < int >  navigation_mesh_polygon  =  pending_navmesh_polygons [ navigation_mesh_polygon_index ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-23 18:16:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										navigation_mesh_polygon_index  + =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  navigation_mesh_polygon_size  =  navigation_mesh_polygon . size ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( navigation_mesh_polygon_size  <  3 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											continue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										const  int  * indices  =  navigation_mesh_polygon . ptr ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										bool  valid ( true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-23 18:16:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										polygon . points . resize ( navigation_mesh_polygon_size ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										polygon . edges . resize ( navigation_mesh_polygon_size ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										real_t  _new_polygon_surface_area  =  0.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										for  ( int  j ( 2 ) ;  j  <  navigation_mesh_polygon_size ;  j + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											const  Face3  face  =  Face3 ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													transform . xform ( vertices_r [ indices [ 0 ] ] ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													transform . xform ( vertices_r [ indices [ j  -  1 ] ] ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													transform . xform ( vertices_r [ indices [ j ] ] ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											_new_polygon_surface_area  + =  face . get_area ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										polygon . surface_area  =  _new_polygon_surface_area ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										_new_region_surface_area  + =  _new_polygon_surface_area ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										for  ( int  j ( 0 ) ;  j  <  navigation_mesh_polygon_size ;  j + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											int  idx  =  indices [ j ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( idx  <  0  | |  idx  > =  len )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												valid  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Vector3  point_position  =  transform . xform ( vertices_r [ idx ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-23 18:16:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											polygon . points [ j ] . pos  =  point_position ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											polygon . points [ j ] . key  =  NavMapBuilder3D : : get_point_key ( point_position ,  map - > get_merge_rasterizer_cell_size ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( first_vertex )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												first_vertex  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												_new_bounds . position  =  point_position ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												_new_bounds . expand_to ( point_position ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( ! valid )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											ERR_BREAK_MSG ( ! valid ,  " The navigation mesh set in this region is not valid! " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-23 18:16:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									surface_area  =  _new_region_surface_area ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bounds  =  _new_bounds ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  NavRegion : : get_iteration_update ( NavRegionIteration  & r_iteration )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									r_iteration . navigation_layers  =  get_navigation_layers ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									r_iteration . enter_cost  =  get_enter_cost ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									r_iteration . travel_cost  =  get_travel_cost ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									r_iteration . owner_object_id  =  get_owner_id ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									r_iteration . owner_type  =  get_type ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-26 04:50:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									r_iteration . owner_rid  =  get_self ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-12-26 04:50:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									r_iteration . enabled  =  get_enabled ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									r_iteration . transform  =  get_transform ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									r_iteration . owner_use_edge_connections  =  get_use_edge_connections ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									r_iteration . bounds  =  get_bounds ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-26 04:50:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									r_iteration . surface_area  =  get_surface_area ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-12-26 04:50:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									r_iteration . navmesh_polygons . clear ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									r_iteration . navmesh_polygons . resize ( navmesh_polygons . size ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for  ( uint32_t  i  =  0 ;  i  <  navmesh_polygons . size ( ) ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-26 04:50:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										gd : : Polygon  & navmesh_polygon  =  navmesh_polygons [ i ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										navmesh_polygon . owner  =  & r_iteration ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										r_iteration . navmesh_polygons [ i ]  =  navmesh_polygon ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-12-15 20:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-10 12:22:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2024-11-24 18:30:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  NavRegion : : request_sync ( )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( map  & &  ! sync_dirty_request_list_element . in_list ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										map - > add_region_sync_dirty_request ( & sync_dirty_request_list_element ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  NavRegion : : cancel_sync_request ( )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( map  & &  sync_dirty_request_list_element . in_list ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										map - > remove_region_sync_dirty_request ( & sync_dirty_request_list_element ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								NavRegion : : NavRegion ( )  :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										sync_dirty_request_list_element ( this )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									type  =  NavigationUtilities : : PathSegmentType : : PATH_SEGMENT_TYPE_REGION ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								NavRegion : : ~ NavRegion ( )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									cancel_sync_request ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}