| Package | org.ffilmation.engine.core |
| Class | public class fAiContainer |
This object provides access to the AI methods of the engine.
| Method | Defined by | ||
|---|---|---|---|
|
calculateLineOfSight(fromx:Number, fromy:Number, fromz:Number, tox:Number, toy:Number, toz:Number):Array
This methods returns an array of all the elements that cross an imaginary line between two points, sorted by distance to origin. | fAiContainer | ||
|
Finds a path between 2 points, using an AStar search algorythm. | fAiContainer | ||
|
findPathCustomCriteria(criteria:fEnginePathfindCriteria):Array
Finds a path between 2 points, using an AStar search algorythm and a custom find criteria. | fAiContainer | ||
| Constant | Defined by | ||
|---|---|---|---|
| MAXSEARCHDEPTH : Number = 200 [static]
This is the maximum depth pathfinding will reach before failing.
| fAiContainer | ||
| calculateLineOfSight | () | method |
public function calculateLineOfSight(fromx:Number, fromy:Number, fromz:Number, tox:Number, toy:Number, toz:Number):Array
This methods returns an array of all the elements that cross an imaginary line between two points, sorted by distance to origin. This is a CPU-intensive calculation: Try to use it sparingly.
Parametersfromx:Number — X coordinate for the origin
|
|
fromy:Number — Y coordinate for the origin
|
|
fromz:Number — Z coordinate for the origin
|
|
tox:Number — X coordinate for the destiny
|
|
toy:Number — Y coordinate for the destiny
|
|
toz:Number — Z coordinate for the destiny
|
Array — An array of fCoordinateOccupant elements. If the array is null or empty there's nothing between the origin point and the end point.
If the origin point is outside the scene's limits, the method will return null.
|
| 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
|
| findPathCustomCriteria | () | method |
public function findPathCustomCriteria(criteria:fEnginePathfindCriteria):Array
Finds a path between 2 points, using an AStar search algorythm and a custom find criteria. 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.
Parameterscriteria:fEnginePathfindCriteria — An object implementing the fEnginePathfindCriteria interface that contains the find criteria.
|
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.