* feat(pathfinding): 添加寻路系统模块 实现完整的寻路系统,支持 A* 算法、网格地图、导航网格和路径平滑: A* 寻路算法: - 高效的二叉堆优先队列 - 可配置的启发式权重 - 最大搜索节点限制 - 支持对角移动和穿角避免 网格地图 (GridMap): - 基于二维数组的网格地图 - 支持 4 方向和 8 方向移动 - 可变移动代价 - 从数组或字符串加载地图 导航网格 (NavMesh): - 凸多边形导航网格 - 自动检测相邻多边形 - 漏斗算法路径优化 - 适合复杂地形 路径平滑: - Bresenham 视线检测 - 射线投射视线检测 - 视线简化器 (移除不必要的拐点) - Catmull-Rom 曲线平滑 - 组合平滑器 启发式函数: - 曼哈顿距离 (4方向) - 欧几里得距离 (任意方向) - 切比雪夫距离 (8方向) - 八角距离 (8方向,对角线√2) 蓝图节点 (8个): - FindPath: 基础寻路 - FindPathSmooth: 平滑寻路 - IsWalkable: 检查可通行性 - GetPathLength: 获取路径点数 - GetPathDistance: 获取路径距离 - GetPathPoint: 获取路径点 - MoveAlongPath: 沿路径移动 - HasLineOfSight: 视线检测 * chore: update pnpm-lock.yaml for pathfinding package
38 lines
933 B
JSON
38 lines
933 B
JSON
{
|
|
"name": "@esengine/pathfinding",
|
|
"version": "1.0.0",
|
|
"description": "寻路系统 | Pathfinding System - A*, Grid, NavMesh",
|
|
"type": "module",
|
|
"main": "./dist/index.js",
|
|
"module": "./dist/index.js",
|
|
"types": "./dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"import": "./dist/index.js",
|
|
"types": "./dist/index.d.ts"
|
|
}
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"module.json"
|
|
],
|
|
"scripts": {
|
|
"build": "tsup",
|
|
"build:watch": "tsup --watch",
|
|
"type-check": "tsc --noEmit",
|
|
"clean": "rimraf dist"
|
|
},
|
|
"dependencies": {
|
|
"@esengine/ecs-framework": "workspace:*",
|
|
"@esengine/ecs-framework-math": "workspace:*",
|
|
"@esengine/blueprint": "workspace:*"
|
|
},
|
|
"devDependencies": {
|
|
"tsup": "^8.0.0",
|
|
"typescript": "^5.8.0"
|
|
},
|
|
"publishConfig": {
|
|
"access": "public"
|
|
}
|
|
}
|