mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 15:56:38 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			771 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			771 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include "navmesh.hpp"
 | |
| #include "detourdebugdraw.hpp"
 | |
| 
 | |
| #include <components/detournavigator/settings.hpp>
 | |
| 
 | |
| #include <DetourDebugDraw.h>
 | |
| 
 | |
| #include <osg/Group>
 | |
| 
 | |
| namespace SceneUtil
 | |
| {
 | |
|     osg::ref_ptr<osg::Group> createNavMeshGroup(const dtNavMesh& navMesh, const DetourNavigator::Settings& settings)
 | |
|     {
 | |
|         const osg::ref_ptr<osg::Group> group(new osg::Group);
 | |
|         DebugDraw debugDraw(*group, osg::Vec3f(0, 0, 10), 1.0f / settings.mRecastScaleFactor);
 | |
|         dtNavMeshQuery navMeshQuery;
 | |
|         navMeshQuery.init(&navMesh, settings.mMaxNavMeshQueryNodes);
 | |
|         duDebugDrawNavMeshWithClosedList(&debugDraw, navMesh, navMeshQuery,
 | |
|                                          DU_DRAWNAVMESH_OFFMESHCONS | DU_DRAWNAVMESH_CLOSEDLIST);
 | |
|         return group;
 | |
|     }
 | |
| }
 |