R-D NevMash

A couple of things. First, it sounds like you might be confusing Recast with Detour. Basically, Recast builds the meshes and Detour uses them. Recast takes the input geometry (provided by your parser) and creates a mesh file. I have previously been reluctant to get specific because a) I don't use Recast+Detour anymore and b) the API is in a rather constant state of flux, so what I say now may already be out of date, since I'm drawing on my experience from approximately two years ago. And if it isn't out of date yet, it undoubtedly will be in the future.

Nevertheless, the basic process in Recast for generating a mesh is as follows:
  1. Get geometry for the area you want to mesh from your parser
  2. Create rcConfig structure with your config values
  3. Determine bounding box for the tile you want to create
  4. Call rcCreateHeightField, passing in the geometry from the parser
  5. Call rcMarkWalkableTriangles
  6. Call rcRasterizeTriangles
  7. Call rcFilterLowHangingWalkableObstacles
  8. Call rcFilterLedgeSpans
  9. Call rcFilterWalkableLowHeightSpans
  10. Call rcBuildCompactHeightField
  11. Call rcErodeArea
  12. Call rcBuildDistanceField
  13. Call rcBuildRegions
  14. Call rcBuildContours
  15. Call rcBuildPolyMesh
  16. Call rcBuildPolyMeshDetail
  17. Call dtCreateNavMeshData. This will give you the structure to save to the disk. This will be the mesh for the tile you've just created. Later you can load these files and use dtAddTile (or something similarly named) to load the tiles for use in pathfinding.

The parameters for these functions are well documented both by comments in Recast.h and example in the samples.

There are some restrictions on the config values you pass. I have already posted details on that somewhere in this forum, but I will leave it to you to find the post.

Edit: As for dynamic objects, take a look at the DetourCrowd folder. He has added some local navigation code since I've stopped using R+D.



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值