Packageorg.ffilmation.engine.core
Classpublic class fAiContainer

This object provides access to the AI methods of the engine.



Public Methods
 MethodDefined by
  
findPath(origin:fPoint3d, destiny:fPoint3d, withDiagonals:Boolean = true):Array

Finds a path between 2 points, using an AStar search algorythm.

fAiContainer
Public Constants
 ConstantDefined by
  MAXSEARCHDEPTH : Number = 200
[static] This is the maximum depth pathfinding will reach before failing.
fAiContainer
Method detail
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:

Parameters
origin:fPoint3d — Origin point
 
destiny:fPoint3d — Destination point
 
withDiagonals:Boolean (default = true) — Is diagonal movement allowed for this calculation ?

Returns
Array — An array of 3dPoints describing the resulting path. Null if it fails
Constant detail
MAXSEARCHDEPTHconstant
public static const MAXSEARCHDEPTH:Number = 200

This is the maximum depth pathfinding will reach before failing. You may need to adjust this depending on your cell size