Ultimate A* Pathfinding Solution
aoiti
$0.0
(no ratings)
Date |
Price |
---|---|
日期和时间 |
价钱($) |
06/09(2022) |
0.0 |
11/17(2024) |
0.0 |
Jump AssetStore
Ultimate A* Pathfinding Solution contains the necessary algorithm to apply A* pathfinding to any situation, whether the scene is made of tiles, colliders, nodes. 2D or 3D!This A* pathfinding solution contains Pathfinder class designed to fit any situations as long as the class is supplied with a method that calculates a heuristic approximation of distance between two nodes/points or any other objects, and a method that returns connected nodes/points or objects of same type and their distances as floats.Usage:Pathfinder() mypathfinder= new Pathfinder(HeuristicDistance, ConnectedNodesAndStepCosts,calculatorPatience);mypathfinder.GenerateAstarPath( A, B, out path);T: Any class or struct that has a way to measure distance between its instances. Examples are; Vector3, Vector2, Vector3Int etc. It can even be a custom class as long as there is a measurable distance between its instances.HeuristicDistance: any method name that takes two T instances and returns an aproximate distanceConnectedNodesAndStepCosts: any method name that takes a T instance and returns a dictionary of its neighbours as the keys and distances to the neighbours as the values.calculatorPatience: the number of steps that the algorithm calculate before giving up. It is a safety precaution for testing. I advise starting with 100 or less and increasing to 9999 or more after testing.GenerateAstarPath: returns true if exists a path from starting instance to ending instance, and outputs a list of adjacently connected T instances that lead to the target (path).