RecastNavigation是一个导航寻路工具集,使用邻接的凸多边形集合描述一个3D场景,A*寻路算法使3D场景的可达性得到保证。
RecastNavigation编译流程
安装SDL环境
1
2
3
4yum install SDL2_gfx-devel.x86_64
yum install SDL2_image-devel.x86_64
yum install SDL2_ttf-devel.x86_64
yum install SDL2.x86_64安装opengl环境
1
2
3yum install mesa*
yum install freeglut*
yum install *GLEW*下载编译代码
1
2
3
4
5
6
7
8git clone git@github.com:recastnavigation/recastnavigation.git
cd recastnavigation
mkdir build
cd build
cmake -DBUILD_RECAST_DEMO=OFF ..
make
g++版本7.3.1, 低版本可能会有问题
编译后的库文件在recastnavigation/build/Detour/和recastnavigation/build/Recast目录下使用
将
recastnavigation/build/Detour
和recastnavigation/build/Recast
目录下的libDetour.a
和libRecast.a
文件复制到你的项目中, 然后引用头文件Recast/Include
和Detour/Include
即可, 具体示例可参考RecastDemo