| Package | org.ffilmation.engine.core |
| Class | public class fAiContainer |
This object provides access to the AI methods of the engine.
| Method | Defined by | ||
|---|---|---|---|
|
Finds a path between 2 points, using an AStar search algorythm. | fAiContainer | ||
| Constant | Defined by | ||
|---|---|---|---|
| MAXSEARCHDEPTH : Number = 200 [static]
This is the maximum depth pathfinding will reach before failing.
| fAiContainer | ||
| findPath | () | method |
public function findPath(origin:fPoint3d, destiny:fPoint3d, withDiagonals:Boolean = true):Array
Finds a path between 2 points, using an AStar search algorythm. It works in 3d. This is a CPU-intensive calculation: If you have several elements trying to find its way around at the same time, it will impact your performance: try to use it sparingly. If you want an example of how to make a character walk around your scene using this, download the mynameisponcho sources from the download area.
I took it from here. Thank you!
TODO:
origin:fPoint3d — Origin point
|
|
destiny:fPoint3d — Destination point
|
|
withDiagonals:Boolean (default = true) — Is diagonal movement allowed for this calculation ?
|
Array — An array of 3dPoints describing the resulting path. Null if it fails
|
| MAXSEARCHDEPTH | constant |
public static const MAXSEARCHDEPTH:Number = 200This is the maximum depth pathfinding will reach before failing. You may need to adjust this depending on your cell size