|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.emohawk.agent.module.sensomotoric.EmohawkNavigation
public class EmohawkNavigation
Facade for navigation in UT2004. Method navigate() can be called both synchronously and asynchronously.
Uses IUT2004PathExecutor
, FloydWarshallMap
, IUT2004RunStraight
and IUT2004GetBackToNavGraph
to handle all possible navigation cases.
Field Summary | |
---|---|
protected static int |
ARRIVED_AT_LOCATION_XY_THRESHOLD
Location threshold for checking whether we have arrived on target. |
protected static int |
ARRIVED_AT_LOCATION_Z_THRESHOLD
Location threshold for checking whether we have arrived on target. |
static double |
AT_LOCATION
We're managed to get to location |
static double |
AT_PLAYER
We're managed to get to player |
protected UT2004Bot |
bot
UT2004Bot reference. |
protected IPathFuture |
currentFuturePath
Current path stored in IPathFuture object. |
protected ILocated |
currentTarget
Current location target. |
protected Player |
currentTargetPlayer
Current target is player (if not null) |
protected IWorldEventListener<EndMessage> |
endMessageListener
|
protected NavPoint |
fromNavPoint
Navpoint we're running from (initial position when path executor has been triggered) |
protected FloydWarshallMap |
fwMap
FloydWarshallMap that is used for path planning. |
protected ILocated |
lastTarget
Last location target. |
protected Player |
lastTargetPlayer
Last location target. |
protected LogCategory |
log
Log used by this class. |
protected boolean |
navigating
Whether navigation is running. |
protected static int |
NEW_PATH_DISTANCE_THRESHOLD
Location threshold for requesting of a new path or switching a path. |
protected static double |
PLAYER_DISTANCE_TRASHOLD
When PLAYER is further from currentTarget than this location, recompute the path |
protected boolean |
runningStraightToPlayer
We're running straight to the player. |
protected Location |
runningStraightToPlayerFailedAt
Where run-straight failed. |
protected NavPoint |
toNavPoint
Navpoint we're running to, nearest navpoint to currentTarget |
Constructor Summary | |
---|---|
EmohawkNavigation(UT2004Bot bot,
Steering steering,
FloydWarshallMap fwMap)
Here you may specify any custom UT2004Navigation parts. |
Method Summary | |
---|---|
List<ILocated> |
getCurrentPathCopy()
|
List<ILocated> |
getCurrentPathDirect()
|
ILocated |
getCurrentTarget()
|
NavPoint |
getCurrentTargetNavPoint()
|
Player |
getCurrentTargetPlayer()
|
ILocated |
getLastTarget()
|
NavPoint |
getLastTargetNavPoint()
|
NavPoint |
getLastTargetPlayer()
|
NavPoint |
getNearestNavPoint(ILocated location)
|
boolean |
isNavigating()
|
protected void |
navigate()
|
void |
navigate(ILocated target)
|
void |
navigate(Player player)
|
protected void |
processPathFuture(IPathFuture futurePath)
Checks if last path element is in close distance from our desired target and if not, we will add our desired target as the last path element. |
protected void |
reset(boolean stopGetBackToNavGraph)
|
void |
setFocus(ILocated located)
|
protected void |
startNavigate()
|
void |
stopNavigation()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int NEW_PATH_DISTANCE_THRESHOLD
protected static final int ARRIVED_AT_LOCATION_XY_THRESHOLD
protected static final int ARRIVED_AT_LOCATION_Z_THRESHOLD
protected static final double PLAYER_DISTANCE_TRASHOLD
public static final double AT_PLAYER
public static final double AT_LOCATION
protected LogCategory log
protected FloydWarshallMap fwMap
protected UT2004Bot bot
protected IWorldEventListener<EndMessage> endMessageListener
protected ILocated lastTarget
protected Player lastTargetPlayer
protected ILocated currentTarget
protected Player currentTargetPlayer
protected NavPoint fromNavPoint
protected NavPoint toNavPoint
protected IPathFuture currentFuturePath
protected boolean navigating
protected boolean runningStraightToPlayer
protected Location runningStraightToPlayerFailedAt
Constructor Detail |
---|
public EmohawkNavigation(UT2004Bot bot, Steering steering, FloydWarshallMap fwMap)
bot
- ut2004PathExecutor
- fwMap
- getBackOnPath
- runStraight
- Method Detail |
---|
public boolean isNavigating()
public void setFocus(ILocated located)
public void stopNavigation()
public void navigate(ILocated target)
public void navigate(Player player)
public NavPoint getNearestNavPoint(ILocated location)
public List<ILocated> getCurrentPathCopy()
public List<ILocated> getCurrentPathDirect()
public ILocated getCurrentTarget()
public Player getCurrentTargetPlayer()
public NavPoint getCurrentTargetNavPoint()
public ILocated getLastTarget()
public NavPoint getLastTargetPlayer()
public NavPoint getLastTargetNavPoint()
protected void startNavigate()
protected void navigate()
protected void processPathFuture(IPathFuture futurePath)
futurePath
- protected void reset(boolean stopGetBackToNavGraph)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |