Moai SDK
1.5 revision 1 (MoaiEdition)
|
Inherits MOAILuaObject.
Function List | |
findPath | |
getGraph | |
getPathEntry | |
getPathSize | |
init | |
reserveTerrainWeights | |
setFlags | |
setGraph | |
setHeuristic | |
setTerrainMask | |
setTerrainDeck | |
setTerrainWeight | |
setWeight |
Attempts to find an efficient path from the start node to the finish node. May be called incrementally.
function findPath ( MOAIPathFinder self [, number iterations ] )
self | ( MOAIPathFinder ) |
iterations | ( number ) Optional. |
Returns the attached graph (if any).
function getGraph ( MOAIPathFinder self )
self | ( MOAIPathFinder ) |
Returns a path entry. This is a node ID that may be passed back to the graph to get a location.
function getPathEntry ( MOAIPathFinder self, number index )
self | ( MOAIPathFinder ) |
index | ( number ) |
Returns the size of the path (in nodes).
function getPathSize ( MOAIPathFinder self )
self | ( MOAIPathFinder ) |
Specify the ID of the start and target node.
function init ( MOAIPathFinder self, number startNodeID, number targetNodeID )
self | ( MOAIPathFinder ) |
startNodeID | ( number ) |
targetNodeID | ( number ) |
Specify the size of the terrain weight vector.
function reserveTerrainWeights ( MOAIPathFinder self [, number size ] )
self | ( MOAIPathFinder ) |
size | ( number ) Optional. Default value is 0. |
Set flags to use for pathfinding. These are graph specific flags provided by the graph implementation.
function setFlags ( MOAIPathFinder self [, number heuristic ] )
self | ( MOAIPathFinder ) |
heuristic | ( number ) Optional. |
Set graph data to use for pathfinding.
function setGraph ( MOAIPathFinder self [, MOAIGrid grid ] )
self | ( MOAIPathFinder ) |
grid | ( MOAIGrid ) Optional. Default value is nil. |
function setGraph ( MOAIPathFinder self [, MOAIGridPathGraph gridPathGraph ] )
self | ( MOAIPathFinder ) |
gridPathGraph | ( MOAIGridPathGraph ) Optional. Default value is nil. |
Set heuristic to use for pathfinding. This is a const provided by the graph implementation being used.
function setHeuristic ( MOAIPathFinder self [, number heuristic ] )
self | ( MOAIPathFinder ) |
heuristic | ( number ) Optional. |
Set terrain deck to use with graph.
function setTerrainDeck ( MOAIPathFinder self [, MOAIPathTerrainDeck terrainDeck ] )
self | ( MOAIPathFinder ) |
terrainDeck | ( MOAIPathTerrainDeck ) Optional. Default value is nil. |
Set 32-bit mask to apply to terrain samples.
function setTerrainMask ( MOAIPathFinder self [, number mask ] )
self | ( MOAIPathFinder ) |
mask | ( number ) Optional. Default value is 0xffffffff. |
Set a component of the terrain weight vector.
function setTerrainWeight ( MOAIPathFinder self, number index [, number deltaScale, number penaltyScale ] )
self | ( MOAIPathFinder ) |
index | ( number ) |
deltaScale | ( number ) Optional. Default value is 0. |
penaltyScale | ( number ) Optional. Default value is 0. |
Sets weights to be applied to G and H.
function setWeight ( MOAIPathFinder self [, number gWeight, number hWeight ] )
self | ( MOAIPathFinder ) |
gWeight | ( number ) Optional. Default value is 1.0. |
hWeight | ( number ) Optional. Default value is 1.0. |