PathEngine home previous: 'loadpathengine'next: 'swarm'
Contents, Programmers Guide, Example Projects, 'testapplication'

'testapplication'

Description

Mixing control methods.
This project combines the user control mechanism from tutorial 2 with code to advance along a path that was introduced in tutorial 3.
The findClosestUnobstructedPoint() query is introduced.

The release build of this project can be run by double-clicking 'run testapplication.bat', in the 'bin' subdirectory of the SDK.
A prebuilt release dll for this project is included with the SDK archive.

Code from tutorial 2 and tutorial 3 is combined, as follows:
If there is a path then the agent advances automatically along that path.
If one of the direct control keys is pressed then any current path is deleted and control reverts back to the keys.

The findClosestUnobstructedPoint() query is used so that the agent will move close to the selected target position when possible even if the target position itself is obstructed.

Controls:

'4' - Place or move agent
'5' - Set a target for pathfinding
'6' to '9' - Place or move an obstacle
'W' - Move forwards
'S' - Move backwards
'A' - Move left
'D' - Move right

Notice that no matter where we move the agent under direct control, PathEngine will always understand how to pathfind from the agents current position.


Documentation for PathEngine release 5.29 - Copyright © 2002-2012 PathEnginenext: 'swarm'