new Finder(gv, config)
寻路算法
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
gv |
ht.graph.GraphView | ht.graph3d.Graph3dView | 视图 |
|
config |
object |
<optional> |
Requires:
- module:ht-astar.js
Requires
- module:ht-astar.js
Methods
-
debugOff() → {void}
-
关闭调试
Returns:
void -
debugOn() → {void}
-
开启调试
Returns:
void -
findPath(begin, end) → {Array.<object>}
-
找到两点之间的路径
Parameters:
Name Type Description begin
object 起始点,格式 {x,y}
end
object 结束点,格式 {x,y}
Returns:
Array.<object> -路径信息
-
refreshMap() → {void}
-
刷新地图
Returns:
void -
simplifyPath(path) → {Array.<object>}
-
简化路径
Parameters:
Name Type Description path
Array.<object> 路径信息
Returns:
Array.<object> -简化路径信息