
寻路
文章平均质量分 52
只要你在
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
bvTree 碰撞检测
是一棵二叉树, 包围层次盒BVH是一种场景管理技术,广泛应用于碰撞检测、射线相交测试之类的应用场合中。 bvTree有两种节点(Node)类型:Interior Node 和 Leaf Node。 LeafNode 是最终存放tile的地方 划分策略可以选择比较高端的表面积启发式算法(SurfaceArea Heuristic) SAH基于的思想:如果某物的表面积越大,那么它被射线击中的...原创 2018-05-15 19:39:47 · 3198 阅读 · 0 评论 -
detour TopologyOptimization
dtCrowd::update在updateMoveRequest后会执行updateTopologyOptimization ---------- dtCrowd::updateTopologyOptimization(dtCrowdAgent**agents,constintnagents,constfloatdt): 强制位移可能导致agent position不在corrido...原创 2019-03-11 14:51:13 · 588 阅读 · 1 评论 -
detour seperation 根据弹力散开
for (intj= 0; j < ag->nneis;++j) { 对于所有的neighbour dtVsub(diff,ag->npos,nei->npos); 算出我到neighbour的向量,是二维平面的 如果其长度小于separationDist 说明进入了Separation的范围 算出weight=...原创 2019-03-11 01:32:19 · 350 阅读 · 0 评论 -
detour getDistanceToGoal(constdtCrowdAgent*ag,constfloatrange)
getDistanceToGoal(constdtCrowdAgent*ag,constfloatrange): 如果ag->cornerFlags[ag->ncorners-1]& DT_STRAIGHTPATH_END 说明这个点是path的终点,是在findStraightPath中设置的 这个时候就是endOfPath,可以计...原创 2019-03-11 01:30:04 · 331 阅读 · 0 评论 -
detour 寻路核心逻辑 CrowdToolState::updateTick dtCrowd::update
CrowdToolState::updateTick(constfloatdt) 作为寻路模拟过程的主要函数主要就是干3件事: 1 crowd->update(dt, &m_agentDebug); 2 Update agent trails表示agent的足迹,不是寻路的必要部分,可以不用 3 m_agentDebug.vod->normalizeSamples();...原创 2018-05-20 12:37:56 · 3032 阅读 · 2 评论 -
navmesh 生成网格信息 三角化切分多边形中检测有效分割的算法
Detecting Valid Partitions Two algorithms are used to determine whether a group of three vertices can form a valid internal triangle. The first algorithm is fast and can quickly cull partitions that ...原创 2019-02-26 18:05:51 · 1232 阅读 · 0 评论 -
NMGen中存在的一些问题
Setting Smoothing Threshold Too High smootingThreshold设置的太高会导致生成的regions畸形,进而导致三角化和轮廓匹配失败。 在生成region的时候如果没有border,平滑的border区域会被生成为一个畸形的region。 但是,我们没有必要设置这个值大于2 Triangulation Fail...原创 2019-03-01 16:09:45 · 482 阅读 · 0 评论 -
navmesh 生成网格信息 总 (更新中 )
The general process is as follows: Voxelization- Create a solidheightfieldfrom the source geometry. 体素化,根据几何体创建solid heightfield(recast里面的rcHeightField) Generate Regions - Detect the top surf...原创 2019-02-24 13:48:28 · 1437 阅读 · 0 评论 -
detour Filter的设定和判定过程
Filter的设定和判定过程: m_filters[ag->params.queryFilterType]表示一个具体的agent所使用的filter m_navquery->initSlicedFindPath的时候 令m_query.filter= filter; 表示这一次使用m_navquery来查询的时候用到的filter,这个是作为客...原创 2018-05-27 13:30:41 · 375 阅读 · 0 评论 -
TOGGLE_POLYS flags
handleClick TOOLMODE_TOGGLE_POLYS 以点击的点为中心用navquery->findNearestPoly(p, halfExtents,&filter, &ref, tgt); 找到最近的poly和poly上面距离p最近的点tgt 如果找到了 flags ^= SAMPLE_POLYFLAGS_DISA...原创 2018-05-16 12:08:02 · 316 阅读 · 0 评论 -
dtNavMesh::addTile connectIntLinks baseOffMeshLinks connectExtOffMeshLinks connectExtLinks ...
函数: dtNavMesh::addTile connectIntLinks baseOffMeshLinks connectExtOffMeshLinks connectExtLinks connectExtOffMeshLinks ============================= 首先关于poly dtpoly是寻路的基本单元 包含信...原创 2018-05-15 18:30:23 · 887 阅读 · 0 评论 -
checkPathValidity 检查所有agent的corridor的m_path是否有效
如果是无效的要进行重新设置并且设置replan 首先获得第一个polygon,m_path[0] 这里,因为addagent的时候,ag->corridor.reset(ref, nearest); m_path[0] = ref; 所以就算是没有设定目标,const int npath = ag->corridor.getPathCount();也是1 然后根据...原创 2018-05-15 14:19:36 · 250 阅读 · 0 评论 -
raycast 一小段距离碰撞到的poly recast_navigation
dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, const float* endPos, const dtQueryFilter* filter, const unsigned int options, dtRaycastHi...原创 2018-05-15 14:22:19 · 830 阅读 · 0 评论 -
recast_navigation dtIntersectSegmentPoly2D 2D上的线段与多边形相交计算 产生结果:是否相交,线段跨越的开始和结束百分比,相交的边
dtIntersectSegmentPoly2D(startPos, endPos, verts, nv, tmin, tmax, segMin, segMax): 参看: http://geomalgorithms.com/vector_products.html 首先: 2D perp Operator 表示一个向量(v1,v2)的逆时针法线 然后,在2D...原创 2018-05-15 14:21:25 · 745 阅读 · 0 评论 -
寻路 pathfinder 狂乱画
原创 2018-05-23 19:47:52 · 796 阅读 · 0 评论